Bug 1462497 - Part 2: Invalidate the new caret frame in subdocuments, since it will result in a new nsDisplayWrapList being created. r?miko draft
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 23 May 2018 10:59:53 +1200
changeset 798505 cdf1414bc42159f134b9d38b84fbf1830b5d0bb0
parent 798504 b591665eecfed05ccd77e731ec5e156a8cb9a2ea
child 798506 7a87b6abea456fbe857c9ca32079738e7497eb47
push id110767
push usermwoodrow@mozilla.com
push dateTue, 22 May 2018 23:04:45 +0000
reviewersmiko
bugs1462497
milestone62.0a1
Bug 1462497 - Part 2: Invalidate the new caret frame in subdocuments, since it will result in a new nsDisplayWrapList being created. r?miko nsDisplayListBuilder::DisplayCaret returning true means that we set canSkipWrapList to true, and then we build an nsDisplayWrapList. We need to make sure we're invalidated for this changing in nesting level to be handled. MozReview-Commit-ID: 4j3WIJDcHtI
layout/generic/nsSubDocumentFrame.cpp
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -457,16 +457,19 @@ nsSubDocumentFrame::BuildDisplayList(nsD
       aBuilder->RebuildAllItemsInCurrentSubtree();
       // Mark the old caret frame as invalid so that we remove the
       // old nsDisplayCaret. We don't mark the current frame as invalid
       // since we want the nsDisplaySubdocument to retain it's place
       // in the retained display list.
       if (mPreviousCaret) {
         aBuilder->MarkFrameModifiedDuringBuilding(mPreviousCaret);
       }
+      if (aBuilder->GetCaretFrame()) {
+        aBuilder->MarkFrameModifiedDuringBuilding(aBuilder->GetCaretFrame());
+      }
     }
     mPreviousCaret = aBuilder->GetCaretFrame();
   }
 
   nsDisplayList childItems;
 
   {
     DisplayListClipState::AutoSaveRestore nestedClipState(aBuilder);