Bug 1479914 - Always use the new caret display item when available as these can change without an invalidation. r?miko draft
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 03 Aug 2018 22:15:55 +1200
changeset 826210 fd9dede5258c5c2bd77551c29631cd7caf048dc4
parent 826209 f80f177061cb754fba49d78265750ea726c96fff
push id118270
push usermwoodrow@mozilla.com
push dateFri, 03 Aug 2018 10:16:18 +0000
reviewersmiko
bugs1479914
milestone63.0a1
Bug 1479914 - Always use the new caret display item when available as these can change without an invalidation. r?miko MozReview-Commit-ID: 8Le6xRfv5RL
layout/painting/RetainedDisplayListBuilder.cpp
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -361,16 +361,21 @@ public:
       // if they might have changed rendering, and it's easier to just use the new items
       // rather than computing if we actually need them.
       return true;
     } else if (type == DisplayItemType::TYPE_SUBDOCUMENT) {
       // nsDisplaySubDocument::mShouldFlatten can change without an invalidation
       // (and is the reason we unconditionally build the subdocument item), so always
       // use the new one to make sure we get the right value.
       return true;
+    } else if (type == DisplayItemType::TYPE_CARET) {
+      // The caret can change position while still being owned by the same frame
+      // and we don't invalidate in that case. Use the new version since the changed
+      // bounds are needed for DLBI.
+      return true;
     }
     return false;
   }
 
   RetainedDisplayList Finalize() {
     for (size_t i = 0; i < mOldDAG.Length(); i++) {
       if (mOldItems[i].IsUsed()) {
         continue;