Bug 1519193 part 4. Convert AssertNoFramesInSubtree to using ShadowIncludingTreeIterator. r=emilio
authorBoris Zbarsky <bzbarsky@mit.edu>
Sat, 12 Jan 2019 03:20:05 +0000
changeset 510696 a61568f1b0812ef2f353c62de6c2603a8f04e980
parent 510695 4a2c6e288944cd05bd494c9da0501488d9a68077
child 510697 47920e0b9643e317840bc88d705582ea537d8ed8
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1519193
milestone66.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 1519193 part 4. Convert AssertNoFramesInSubtree to using ShadowIncludingTreeIterator. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D16245
layout/base/PresShell.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -71,16 +71,17 @@
 #include "nsFrameManager.h"
 #include "nsXPCOM.h"
 #include "nsILayoutHistoryState.h"
 #include "nsILineIterator.h"  // for ScrollContentIntoView
 #include "PLDHashTable.h"
 #include "mozilla/dom/Touch.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "mozilla/dom/PointerEventBinding.h"
+#include "mozilla/dom/ShadowIncludingTreeIterator.h"
 #include "nsIObserverService.h"
 #include "nsDocShell.h"  // for reflow observation
 #include "nsIBaseWindow.h"
 #include "nsError.h"
 #include "nsLayoutUtils.h"
 #include "nsViewportInfo.h"
 #include "nsCSSRendering.h"
 // for |#ifdef DEBUG| code
@@ -2874,21 +2875,19 @@ void nsIPresShell::SlotAssignmentWillCha
       aNewSlot->SetHasDirtyDescendantsForServo();
       aNewSlot->NoteDirtySubtreeForServo();
     }
   }
 }
 
 #ifdef DEBUG
 static void AssertNoFramesInSubtree(nsIContent* aContent) {
-  for (nsIContent* c = aContent; c; c = c->GetNextNode(aContent)) {
+  for (nsINode* node : ShadowIncludingTreeIterator(*aContent)) {
+    nsIContent* c = nsIContent::FromNode(node);
     MOZ_ASSERT(!c->GetPrimaryFrame());
-    if (auto* shadowRoot = c->GetShadowRoot()) {
-      AssertNoFramesInSubtree(shadowRoot);
-    }
     if (auto* binding = c->GetXBLBinding()) {
       if (auto* bindingWithContent = binding->GetBindingWithContent()) {
         nsIContent* anonContent = bindingWithContent->GetAnonymousContent();
         MOZ_ASSERT(!anonContent->GetPrimaryFrame());
 
         // Need to do this instead of just AssertNoFramesInSubtree(anonContent),
         // because the parent of the children of the <content> element isn't the
         // <content> element, but the bound element, and that confuses