⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245816 in webkit


Ignore:
Timestamp:
May 28, 2019, 10:29:33 AM (7 years ago)
Author:
Alan Bujtas
Message:

[LFC][Verification] Add additional inline and block checks
​https://bugs.webkit.org/show_bug.cgi?id=198252
<rdar://problem/51140687>

Reviewed by Antti Koivisto.

Now we also test the geometry of the blocks with inline formatting contexts.

  • layout/Verification.cpp:

(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::verifyAndOutputSubtree):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245812 r245816  
     12019-05-28  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC][Verification] Add additional inline and block checks
     4        https://bugs.webkit.org/show_bug.cgi?id=198252
     5        <rdar://problem/51140687>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        Now we also test the geometry of the blocks with inline formatting contexts.
     10
     11        * layout/Verification.cpp:
     12        (WebCore::Layout::checkForMatchingTextRuns):
     13        (WebCore::Layout::verifyAndOutputSubtree):
     14
    1152019-05-28  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/layout/Verification.cpp

    r245779 r245816  
    109109    return areEssentiallyEqual(inlineBox.logicalLeft(), inlineRun.logicalLeft())
    110110        && areEssentiallyEqual(inlineBox.logicalRight(), inlineRun.logicalRight())
    111         && areEssentiallyEqual(inlineBox.logicalHeight(), inlineRun.logicalHeight());
    112 }
     111        && areEssentiallyEqual(inlineBox.logicalTop(), inlineRun.logicalTop())
     112        && areEssentiallyEqual(inlineBox.logicalBottom(), inlineRun.logicalBottom());
     113}
     114
    113115
    114116static bool checkForMatchingTextRuns(const Display::Run& inlineRun, const InlineTextBox& inlineTextBox)
    … …  
    116118    return areEssentiallyEqual(inlineTextBox.logicalLeft(), inlineRun.logicalLeft())
    117119        && areEssentiallyEqual(inlineTextBox.logicalRight(), inlineRun.logicalRight())
     120        && areEssentiallyEqual(inlineTextBox.logicalTop(), inlineRun.logicalTop())
     121        && areEssentiallyEqual(inlineTextBox.logicalBottom(), inlineRun.logicalBottom())
    118122        && inlineTextBox.start() == inlineRun.textContext()->start()
    119         && (inlineTextBox.end() + 1) == inlineRun.textContext()->end()
    120         && areEssentiallyEqual(inlineTextBox.logicalHeight(), inlineRun.logicalHeight());
     123        && (inlineTextBox.end() + 1) == inlineRun.textContext()->end();
    121124}
    122125
    … …  
    276279
    277280    auto& container = downcast<Container>(layoutBox);
    278     auto* childBox = container.firstChild();
     281    auto* childLayoutBox = container.firstChild();
    279282    auto* childRenderer = renderer.firstChild();
    280283
    … …  
    285288        }
    286289
    287         if (!childBox) {
     290        if (!childLayoutBox) {
    288291            stream  << "Trees are out of sync!";
    289292            stream.nextLine();
    … …  
    291294        }
    292295
    293         if (is<RenderBlockFlow>(*childRenderer) && childBox->establishesInlineFormattingContext()) {
     296        if (is<RenderBlockFlow>(*childRenderer) && childLayoutBox->establishesInlineFormattingContext()) {
    294297            ASSERT(childRenderer->childrenInline());
     298            auto mismtachingGeometry = outputMismatchingBlockBoxInformationIfNeeded(stream, context, downcast<RenderBox>(*childRenderer), *childLayoutBox);
     299            if (mismtachingGeometry)
     300                return true;
     301
    295302            auto& blockFlow = downcast<RenderBlockFlow>(*childRenderer);
    296             auto& formattingRoot = downcast<Container>(*childBox);
     303            auto& formattingRoot = downcast<Container>(*childLayoutBox);
    297304            mismtachingGeometry |= blockFlow.lineLayoutPath() == RenderBlockFlow::SimpleLinesPath ? outputMismatchingSimpleLineInformationIfNeeded(stream, context, blockFlow, formattingRoot) : outputMismatchingComplexLineInformationIfNeeded(stream, context, blockFlow, formattingRoot);
    298305        } else {
    299             auto mismatchingSubtreeGeometry = verifyAndOutputSubtree(stream, context, downcast<RenderBox>(*childRenderer), *childBox);
     306            auto mismatchingSubtreeGeometry = verifyAndOutputSubtree(stream, context, downcast<RenderBox>(*childRenderer), *childLayoutBox);
    300307            mismtachingGeometry |= mismatchingSubtreeGeometry;
    301308        }
    302309
    303         childBox = childBox->nextSibling();
     310        childLayoutBox = childLayoutBox->nextSibling();
    304311        childRenderer = childRenderer->nextSibling();
    305312    }
Note: See TracChangeset for help on using the changeset viewer.