Title: [241295] trunk/Source/WebCore
Revision
241295
Author
za...@apple.com
Date
2019-02-12 07:59:16 -0800 (Tue, 12 Feb 2019)

Log Message

[LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
https://bugs.webkit.org/show_bug.cgi?id=194540

Reviewed by Antti Koivisto.

Use FormattingContext::computeBorderAndPadding instead.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (241294 => 241295)


--- trunk/Source/WebCore/ChangeLog	2019-02-12 15:34:36 UTC (rev 241294)
+++ trunk/Source/WebCore/ChangeLog	2019-02-12 15:59:16 UTC (rev 241295)
@@ -1,5 +1,21 @@
 2019-02-12  Zalan Bujtas  <za...@apple.com>
 
+        [LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
+        https://bugs.webkit.org/show_bug.cgi?id=194540
+
+        Reviewed by Antti Koivisto.
+
+        Use FormattingContext::computeBorderAndPadding instead.
+
+        * layout/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
+        * layout/FormattingContext.h:
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
+        * layout/inlineformatting/InlineFormattingContext.h:
+
+2019-02-12  Zalan Bujtas  <za...@apple.com>
+
         [LFC][IFC] Add intrinsic width support for float boxes.
         https://bugs.webkit.org/show_bug.cgi?id=194528
 

Modified: trunk/Source/WebCore/layout/FormattingContext.cpp (241294 => 241295)


--- trunk/Source/WebCore/layout/FormattingContext.cpp	2019-02-12 15:34:36 UTC (rev 241294)
+++ trunk/Source/WebCore/layout/FormattingContext.cpp	2019-02-12 15:59:16 UTC (rev 241295)
@@ -123,13 +123,14 @@
     displayBox.setVerticalMargin({ nonCollapsedVerticalMargin, { } });
 }
 
-void FormattingContext::computeBorderAndPadding(const Box& layoutBox) const
+void FormattingContext::computeBorderAndPadding(const Box& layoutBox, Optional<UsedHorizontalValues> usedValues) const
 {
     auto& layoutState = this->layoutState();
+    if (!usedValues)
+        usedValues = UsedHorizontalValues { layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth() };
     auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox);
-    auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth();
     displayBox.setBorder(Geometry::computedBorder(layoutBox));
-    displayBox.setPadding(Geometry::computedPadding(layoutBox, UsedHorizontalValues { containingBlockWidth }));
+    displayBox.setPadding(Geometry::computedPadding(layoutBox, *usedValues));
 }
 
 void FormattingContext::layoutOutOfFlowDescendants(const Box& layoutBox) const

Modified: trunk/Source/WebCore/layout/FormattingContext.h (241294 => 241295)


--- trunk/Source/WebCore/layout/FormattingContext.h	2019-02-12 15:34:36 UTC (rev 241294)
+++ trunk/Source/WebCore/layout/FormattingContext.h	2019-02-12 15:59:16 UTC (rev 241295)
@@ -69,7 +69,7 @@
     FormattingState& formattingState() const { return m_formattingState; }
     const Box& root() const { return *m_root; }
 
-    void computeBorderAndPadding(const Box&) const;
+    void computeBorderAndPadding(const Box&, Optional<UsedHorizontalValues> = WTF::nullopt) const;
 
 #ifndef NDEBUG
     virtual void validateGeometryConstraintsAfterLayout() const;

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp (241294 => 241295)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2019-02-12 15:34:36 UTC (rev 241294)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp	2019-02-12 15:59:16 UTC (rev 241295)
@@ -190,13 +190,6 @@
     displayBox.setHorizontalMargin({ computedHorizontalMargin.start.valueOr(0), computedHorizontalMargin.end.valueOr(0) });
 }
 
-void InlineFormattingContext::computeBorderAndPadding(const Box& layoutBox, UsedHorizontalValues usedValues) const
-{
-    auto& displayBox = layoutState().displayBoxForLayoutBox(layoutBox);
-    displayBox.setBorder(Geometry::computedBorder(layoutBox));
-    displayBox.setPadding(Geometry::computedPadding(layoutBox, usedValues));
-}
-
 void InlineFormattingContext::computeWidthAndMargin(const Box& layoutBox, UsedHorizontalValues usedValues) const
 {
     auto& layoutState = this->layoutState();

Modified: trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h (241294 => 241295)


--- trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h	2019-02-12 15:34:36 UTC (rev 241294)
+++ trunk/Source/WebCore/layout/inlineformatting/InlineFormattingContext.h	2019-02-12 15:59:16 UTC (rev 241295)
@@ -92,7 +92,6 @@
     void computeIntrinsicWidthForInlineBlock(const Box&) const;
     void computeWidthAndHeightForReplacedInlineBox(const Box&, UsedHorizontalValues) const;
     void computeMargin(const Box&, UsedHorizontalValues) const;
-    void computeBorderAndPadding(const Box&, UsedHorizontalValues) const;
     void computeHeightAndMargin(const Box&) const;
     void computeWidthAndMargin(const Box&, UsedHorizontalValues) const;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to