Title: [232532] trunk/Source/WebCore
Revision
232532
Author
[email protected]
Date
2018-06-05 20:10:45 -0700 (Tue, 05 Jun 2018)

Log Message

[LFC] Add missing margins for inflow, non replaced block and replaced inline elements
https://bugs.webkit.org/show_bug.cgi?id=186332

Reviewed by Darin Adler.

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (232531 => 232532)


--- trunk/Source/WebCore/ChangeLog	2018-06-06 01:46:17 UTC (rev 232531)
+++ trunk/Source/WebCore/ChangeLog	2018-06-06 03:10:45 UTC (rev 232532)
@@ -1,3 +1,15 @@
+2018-06-05  Zalan Bujtas  <[email protected]>
+
+        [LFC] Add missing margins for inflow, non replaced block and replaced inline elements
+        https://bugs.webkit.org/show_bug.cgi?id=186332
+
+        Reviewed by Darin Adler.
+
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
+        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
+        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
+
 2018-06-05  Wenson Hsieh  <[email protected]>
 
         [macOS] Spelling errors in the middle of an inserted paragraph are not displayed

Modified: trunk/Source/WebCore/layout/FormattingContextGeometry.cpp (232531 => 232532)


--- trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2018-06-06 01:46:17 UTC (rev 232531)
+++ trunk/Source/WebCore/layout/FormattingContextGeometry.cpp	2018-06-06 03:10:45 UTC (rev 232532)
@@ -542,8 +542,8 @@
     //    If 300px is too wide to fit the device, UAs should use the width of the largest rectangle that has a 2:1 ratio and fits the device instead.
     auto& style = layoutBox.style();
     LayoutUnit computedWidthValue;
-    LayoutUnit computedMarginLeft;
-    LayoutUnit computedMarginRight;
+    LayoutUnit computedMarginLeftValue;
+    LayoutUnit computedMarginRightValue;
 
     {
         auto marginLeft = style.marginLeft();
@@ -550,8 +550,8 @@
         auto marginRight = style.marginRight();
         auto containingBlockWidth = layoutContext.displayBoxForLayoutBox(*layoutBox.containingBlock())->width();
 
-        computedMarginLeft = marginLeft.isAuto() ? LayoutUnit(0) : valueForLength(marginLeft, containingBlockWidth);
-        computedMarginRight = marginRight.isAuto() ? LayoutUnit(0) : valueForLength(marginRight, containingBlockWidth);
+        computedMarginLeftValue = marginLeft.isAuto() ? LayoutUnit(0) : valueForLength(marginLeft, containingBlockWidth);
+        computedMarginRightValue = marginRight.isAuto() ? LayoutUnit(0) : valueForLength(marginRight, containingBlockWidth);
     }
 
     auto width = style.logicalWidth();
@@ -578,7 +578,7 @@
         computedWidthValue = 300;
     }
 
-    return WidthAndMargin { computedWidthValue, { } };
+    return WidthAndMargin { computedWidthValue, { computedMarginLeftValue, computedMarginRightValue } };
 }
 
 Display::Box::Edges FormattingContext::Geometry::computedBorder(LayoutContext&, const Box& layoutBox)

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp (232531 => 232532)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp	2018-06-06 01:46:17 UTC (rev 232531)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp	2018-06-06 03:10:45 UTC (rev 232532)
@@ -216,7 +216,7 @@
     if (!isStretchedToViewport(layoutContext, layoutBox))
         return computedWidthAndMarginValue;
     auto initialContainingBlockWidth = layoutContext.displayBoxForLayoutBox(initialContainingBlock(layoutBox))->contentBox().width();
-    return FormattingContext::Geometry::WidthAndMargin { std::max(computedWidthAndMarginValue.width, initialContainingBlockWidth), { } };
+    return FormattingContext::Geometry::WidthAndMargin { std::max(computedWidthAndMarginValue.width, initialContainingBlockWidth), { computedWidthAndMarginValue.margin } };
 }
 
 LayoutPoint BlockFormattingContext::Geometry::staticPosition(LayoutContext& layoutContext, const Box& layoutBox)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to