Title: [249357] trunk/Source/WebCore
Revision
249357
Author
za...@apple.com
Date
2019-08-30 21:03:54 -0700 (Fri, 30 Aug 2019)

Log Message

[LFC] Transition from Geometry(formattingContext()) to formattingContext().quirks()
https://bugs.webkit.org/show_bug.cgi?id=201372
<rdar://problem/54905514>

Reviewed by Antti Koivisto.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
(WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
(WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
* layout/inlineformatting/InlineLine.cpp:
(WebCore::Layout::Line::close):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (249356 => 249357)


--- trunk/Source/WebCore/ChangeLog	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/ChangeLog	2019-08-31 04:03:54 UTC (rev 249357)
@@ -1,5 +1,32 @@
 2019-08-30  Zalan Bujtas  <za...@apple.com>
 
+        [LFC] Transition from Geometry(formattingContext()) to formattingContext().quirks()
+        https://bugs.webkit.org/show_bug.cgi?id=201372
+        <rdar://problem/54905514>
+
+        Reviewed by Antti Koivisto.
+
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
+        * layout/FormattingContextQuirks.cpp:
+        (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
+        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
+        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
+        * layout/blockformatting/BlockFormattingContextQuirks.cpp:
+        (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
+        * layout/blockformatting/BlockMarginCollapse.cpp:
+        (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
+        (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
+        (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
+        * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
+        (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
+        (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
+        (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
+        * layout/inlineformatting/InlineLine.cpp:
+        (WebCore::Layout::Line::close):
+
+2019-08-30  Zalan Bujtas  <za...@apple.com>
+
         [LFC] Proxy LayoutState::displayBoxForLayoutBox() calls through FormattingContext
         https://bugs.webkit.org/show_bug.cgi?id=201365
         <rdar://problem/54900815>

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -75,7 +75,7 @@
         containingBlockHeightValue = formattingContext().displayBoxForLayoutBox(*layoutBox.containingBlock()).height();
     } else {
         if (layoutState().inQuirksMode())
-            containingBlockHeightValue = Quirks(formattingContext()).heightValueOfNearestContainingBlockWithFixedHeight(layoutBox);
+            containingBlockHeightValue = formattingContext().quirks().heightValueOfNearestContainingBlockWithFixedHeight(layoutBox);
         else {
             auto containingBlockHeight = layoutBox.containingBlock()->style().logicalHeight();
             if (containingBlockHeight.isFixed())

Modified: trunk/Source/WebCore/layout/FormattingContextQuirks.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/FormattingContextQuirks.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/FormattingContextQuirks.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -53,7 +53,7 @@
             auto& displayBox = formattingContext.displayBoxForLayoutBox(*containingBlock);
 
             auto usedValues = UsedHorizontalValues { formattingContext.displayBoxForLayoutBox(*containingBlock->containingBlock()).contentBoxWidth() };
-            auto verticalMargin = Geometry(formattingContext).computedVerticalMargin(*containingBlock, usedValues);
+            auto verticalMargin = formattingContext.geometry().computedVerticalMargin(*containingBlock, usedValues);
             auto verticalPadding = displayBox.paddingTop().valueOr(0) + displayBox.paddingBottom().valueOr(0);
             auto verticalBorder = displayBox.borderTop() + displayBox.borderBottom();
             bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before.valueOr(0) + verticalMargin.after.valueOr(0) + verticalPadding + verticalBorder;

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -274,7 +274,7 @@
         heightAndMargin = complicatedCases(layoutBox, usedValues, usedHorizontalValues);
     }
 
-    auto quirks = Quirks(formattingContext());
+    auto quirks = formattingContext().quirks();
     if (!quirks.needsStretching(layoutBox))
         return heightAndMargin;
 

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -82,7 +82,7 @@
         // Here is the quirky part for body box:
         // Stretch the body using the initial containing block's height and shrink it with document box's margin/border/padding.
         // This looks extremely odd when html has non-auto height.
-        auto documentBoxVerticalMargin = Geometry(formattingContext).computedVerticalMargin(documentBox, UsedHorizontalValues { initialContainingBlockDisplayBox.contentBoxWidth() });
+        auto documentBoxVerticalMargin = formattingContext.geometry().computedVerticalMargin(documentBox, UsedHorizontalValues { initialContainingBlockDisplayBox.contentBoxWidth() });
         strechedHeight -= (documentBoxVerticalMargin.before.valueOr(0) + documentBoxVerticalMargin.after.valueOr(0));
 
         auto& bodyBoxDisplayBox = formattingContext.displayBoxForLayoutBox(layoutBox);

Modified: trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/blockformatting/BlockMarginCollapse.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -515,7 +515,7 @@
     }
     // This is the estimate path. We don't yet have positive/negative margin computed.
     auto usedValues = UsedHorizontalValues { formattingContext().displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() };
-    auto computedVerticalMargin = Geometry(formattingContext()).computedVerticalMargin(layoutBox, usedValues);
+    auto computedVerticalMargin = formattingContext().geometry().computedVerticalMargin(layoutBox, usedValues);
     auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) }; 
 
     if (marginType == MarginType::Before)
@@ -541,7 +541,7 @@
     // 2. Gather positive and negative margin values from previous inflow sibling if margins are adjoining.
     // 3. Compute min/max positive and negative collapsed margin values using non-collpased computed margin before.
     auto collapsedMarginBefore = computedPositiveAndNegativeMargin(firstChildCollapsedMarginBefore(), previouSiblingCollapsedMarginAfter());
-    if (collapsedMarginBefore.isQuirk && Quirks(formattingContext()).shouldIgnoreCollapsedQuirkMargin(layoutBox))
+    if (collapsedMarginBefore.isQuirk && formattingContext().quirks().shouldIgnoreCollapsedQuirkMargin(layoutBox))
         collapsedMarginBefore = { };
 
     PositiveAndNegativeVerticalMargin::Values nonCollapsedBefore;
@@ -583,7 +583,7 @@
     ASSERT(!layoutBox.replaced());
 
     auto usedValues = UsedHorizontalValues { formattingContext().displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() };
-    auto computedVerticalMargin = Geometry(formattingContext()).computedVerticalMargin(layoutBox, usedValues);
+    auto computedVerticalMargin = formattingContext().geometry().computedVerticalMargin(layoutBox, usedValues);
     auto nonCollapsedMargin = UsedVerticalMargin::NonCollapsedValues { computedVerticalMargin.before.valueOr(0), computedVerticalMargin.after.valueOr(0) };
     auto marginsCollapseThrough = this->marginsCollapseThrough(layoutBox);
     auto positiveNegativeMarginBefore = this->positiveNegativeMarginBefore(layoutBox, nonCollapsedMargin);

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContextLineLayout.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -324,7 +324,7 @@
     };
 
     IndexAndRange currentInlineItem;
-    auto quirks = Quirks(formattingContext);
+    auto quirks = formattingContext.quirks();
     while (currentInlineItem.index < inlineItems.size()) {
         auto lineInput = LineInput { { { lineLogicalLeft, lineLogicalTop }, widthConstraint, quirks.lineHeightConstraints(formattingRoot) }, Line::SkipVerticalAligment::No, currentInlineItem, inlineItems };
         applyFloatConstraint(lineInput);
@@ -347,7 +347,7 @@
     auto& formattingContext = this->formattingContext();
     LayoutUnit maximumLineWidth;
     IndexAndRange currentInlineItem;
-    auto quirks = Quirks(formattingContext);
+    auto quirks = formattingContext.quirks();
     while (currentInlineItem.index < inlineItems.size()) {
         auto lineContent = LineLayout(formattingContext, { { { }, widthConstraint, quirks.lineHeightConstraints(formattingRoot()) }, Line::SkipVerticalAligment::Yes, currentInlineItem, inlineItems }).layout();
         currentInlineItem = { lineContent.lastCommitted->index + 1, WTF::nullopt };
@@ -393,7 +393,7 @@
     auto lineBoxRect = Display::Rect { lineContent.logicalTop(), lineContent.logicalLeft(), 0, lineContent.logicalHeight()};
     // Create final display runs.
     auto& lineRuns = lineContent.runs();
-    auto geometry = Geometry(formattingContext);
+    auto geometry = formattingContext.geometry();
     for (unsigned index = 0; index < lineRuns.size(); ++index) {
         auto& lineRun = lineRuns.at(index);
         auto& logicalRect = lineRun->logicalRect();

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp (249356 => 249357)


--- trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp	2019-08-31 02:37:55 UTC (rev 249356)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineLine.cpp	2019-08-31 04:03:54 UTC (rev 249357)
@@ -110,7 +110,7 @@
         }
 
         // Remove descent when all content is baseline aligned but none of them have descent.
-        if (InlineFormattingContext::Quirks(formattingContext()).lineDescentNeedsCollapsing(*m_content)) {
+        if (formattingContext().quirks().lineDescentNeedsCollapsing(*m_content)) {
             m_lineLogicalHeight -= m_baseline.descent;
             m_baseline.descent = { };
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to