[LFC] Bail out of subtree verification when trees are out of sync.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2018 14:28:34 +0000 (14:28 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Aug 2018 14:28:34 +0000 (14:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188633

Reviewed by Antti Koivisto.

There's no point of trying to match geometry when subtrees are out of sync.
They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).

* layout/Verification.cpp:
(WebCore::Layout::verifyAndOutputSubtree):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234922 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/layout/Verification.cpp

index bed7d52..defcaf2 100644 (file)
@@ -1,3 +1,16 @@
+2018-08-16  Zalan Bujtas  <zalan@apple.com>
+
+        [LFC] Bail out of subtree verification when trees are out of sync.
+        https://bugs.webkit.org/show_bug.cgi?id=188633
+
+        Reviewed by Antti Koivisto.
+
+        There's no point of trying to match geometry when subtrees are out of sync.
+        They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).
+
+        * layout/Verification.cpp:
+        (WebCore::Layout::verifyAndOutputSubtree):
+
 2018-08-16  Antti Koivisto  <antti@apple.com>
 
         Use OptionSet for ActivityState::Flags
index 23d60af..0b7d0ac 100644 (file)
@@ -170,6 +170,12 @@ static bool verifyAndOutputSubtree(TextStream& stream, const LayoutContext& cont
             continue;
         }
 
+        if (!childBox) {
+            stream  << "Trees are out of sync!";
+            stream.nextLine();
+            return true;
+        }
+
         if (is<RenderBlockFlow>(*childRenderer) && childBox->establishesInlineFormattingContext()) {
             ASSERT(childRenderer->childrenInline());
             auto& blockFlow = downcast<RenderBlockFlow>(*childRenderer);
@@ -183,6 +189,7 @@ static bool verifyAndOutputSubtree(TextStream& stream, const LayoutContext& cont
         childBox = childBox->nextSibling();
         childRenderer = childRenderer->nextSibling();
     }
+
     return mismtachingGeometry;
 }