Bug 1462497 - Part 2: Invalidate the new caret frame in subdocuments, since it will result in a new nsDisplayWrapList being created. r=miko, r=mstange, a=RyanVM
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 23 May 2018 10:59:53 +1200
changeset 470921 cf8f2940def1269022f5b766f3d19bf2c074a658
parent 470920 352f0eb7324c06128a648ad94273ca5cb3a19332
child 470922 e33f5999721855e2552b127ab5030ddd7771dda7
push id9267
push userryanvm@gmail.com
push dateFri, 25 May 2018 16:08:23 +0000
treeherdermozilla-beta@bb4d7af3e4ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiko, mstange, RyanVM
bugs1462497
milestone61.0
Bug 1462497 - Part 2: Invalidate the new caret frame in subdocuments, since it will result in a new nsDisplayWrapList being created. r=miko, r=mstange, a=RyanVM 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);