Bug 1493317 Part 1 - Fix pending popup group assertion after enabling AccessibleCaret in unittest. r=mats
authorTing-Yu Lin <tlin@mozilla.com>
Sat, 16 Mar 2019 07:29:11 +0000
changeset 464480 afb8dc106fc6a8e534946eddf2246fbae45394d9
parent 464479 7bd5d216421291c6d53f5577357e78dc0da4392b
child 464481 e19d324e5970979c11c697c600d60fc366314ed8
push id35716
push useraciure@mozilla.com
push dateSun, 17 Mar 2019 09:42:17 +0000
treeherdermozilla-central@8ee97c045359 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1493317
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1493317 Part 1 - Fix pending popup group assertion after enabling AccessibleCaret in unittest. r=mats The assertion can be reproduced locally by running "./mach test dom/canvas/test/chrome/test_drawWindow_widget_layers.html" with layout.accessiblecaret.enabled=true. When AccessibleCaret is enabled, caret elements will be inserted into nsCanvasFrame::mCustomContentContainer, thus it recursively invokes ConstructFramesFromItemList() to construct frames for carets before it had a chance to construct popup group. I feel it's too strict to assume that ConstructFramesFromItemList() cannot be invoke recursively whenever there's a popup group item. I move the assertion to the end of ConstructDocElementFrame() to ensure the popup group is processed by then. Differential Revision: https://phabricator.services.mozilla.com/D10298
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -2510,16 +2510,19 @@ nsIFrame* nsCSSFrameConstructor::Constru
   SetInitialSingleChild(mDocElementContainingBlock, newFrame);
 
   // Create frames for anonymous contents if there is a canvas frame.
   if (mDocElementContainingBlock->IsCanvasFrame()) {
     ConstructAnonymousContentForCanvas(state, mDocElementContainingBlock,
                                        aDocElement);
   }
 
+  MOZ_ASSERT(!state.mHavePendingPopupgroup,
+             "Should have proccessed pending popup group by now");
+
   return newFrame;
 }
 
 nsIFrame* nsCSSFrameConstructor::ConstructRootFrame() {
   AUTO_PROFILER_LABEL("nsCSSFrameConstructor::ConstructRootFrame",
                       LAYOUT_FrameConstruction);
   AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
 
@@ -9531,18 +9534,16 @@ inline void nsCSSFrameConstructor::Const
 
   for (FCItemIterator iter(aItems); !iter.IsDone(); iter.Next()) {
     NS_ASSERTION(iter.item().DesiredParentType() == GetParentType(aParentFrame),
                  "Needed pseudos didn't get created; expect bad things");
     ConstructFramesFromItem(aState, iter, aParentFrame, aFrameItems);
   }
 
   VerifyGridFlexContainerChildren(aParentFrame, aFrameItems);
-  NS_ASSERTION(!aState.mHavePendingPopupgroup,
-               "Should have proccessed it by now");
 
   if (aParentIsWrapperAnonBox) {
     for (nsIFrame* f : aFrameItems) {
       f->SetParentIsWrapperAnonBox();
     }
   }
 }