Title: [222321] trunk
- Revision
- 222321
- Author
- [email protected]
- Date
- 2017-09-21 09:28:35 -0700 (Thu, 21 Sep 2017)
Log Message
In regular block layout, the width of a child's margin box should always be equal to that of its containing block
Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
https://bugs.webkit.org/show_bug.cgi?id=176620
Patch by Zhifei FANG <[email protected]> on 2017-09-21
Reviewed by Zalan Bujtas.
Source/WebCore:
Test: fast/block/over-constrained-auto-margin.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion const):
LayoutTests:
* fast/block/over-constrained-auto-margin-expected.txt: Added.
* fast/block/over-constrained-auto-margin.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (222320 => 222321)
--- trunk/LayoutTests/ChangeLog 2017-09-21 16:03:11 UTC (rev 222320)
+++ trunk/LayoutTests/ChangeLog 2017-09-21 16:28:35 UTC (rev 222321)
@@ -1,3 +1,14 @@
+2017-09-21 Zhifei FANG <[email protected]>
+
+ In regular block layout, the width of a child's margin box should always be equal to that of its containing block
+ Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
+ https://bugs.webkit.org/show_bug.cgi?id=176620
+
+ Reviewed by Zalan Bujtas.
+
+ * fast/block/over-constrained-auto-margin-expected.txt: Added.
+ * fast/block/over-constrained-auto-margin.html: Added.
+
2017-09-21 Ms2ger <[email protected]>
[WPE] Mark wrapKey_unwrapKey.worker.html as flaky.
Added: trunk/LayoutTests/fast/block/over-constrained-auto-margin-expected.txt (0 => 222321)
--- trunk/LayoutTests/fast/block/over-constrained-auto-margin-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/block/over-constrained-auto-margin-expected.txt 2017-09-21 16:28:35 UTC (rev 222321)
@@ -0,0 +1,3 @@
+PASS getComputedStyle(target1).marginRight is '-116px'
+PASS getComputedStyle(target2).marginLeft is '-116px'
+
Added: trunk/LayoutTests/fast/block/over-constrained-auto-margin.html (0 => 222321)
--- trunk/LayoutTests/fast/block/over-constrained-auto-margin.html (rev 0)
+++ trunk/LayoutTests/fast/block/over-constrained-auto-margin.html 2017-09-21 16:28:35 UTC (rev 222321)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src=""
+ </head>
+ <body>
+ <div id="wrapper">
+ <div style="width: 400px; border: 3px solid black;">
+ <div id="target1" style="
+ margin-left: 10px; width: 500px; border: 3px solid gray;
+ margin-right: auto;">
+ </div>
+ </div>
+ <div style="width: 400px; border: 3px solid black; direction: rtl;">
+ <div id="target2" style="
+ margin-right: 10px; width: 500px; border: 3px solid gray;
+ margin-left: auto; ">
+ </div>
+ </div>
+ </div>
+ <script>
+ shouldBe("getComputedStyle(target1).marginRight", "'-116px'");
+ shouldBe("getComputedStyle(target2).marginLeft", "'-116px'");
+ </script>
+ <div id="console"></div>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (222320 => 222321)
--- trunk/Source/WebCore/ChangeLog 2017-09-21 16:03:11 UTC (rev 222320)
+++ trunk/Source/WebCore/ChangeLog 2017-09-21 16:28:35 UTC (rev 222321)
@@ -1,3 +1,16 @@
+2017-09-21 Zhifei FANG <[email protected]>
+
+ In regular block layout, the width of a child's margin box should always be equal to that of its containing block
+ Merge from Blink https://bugs.chromium.org/p/chromium/issues/detail?id=708751
+ https://bugs.webkit.org/show_bug.cgi?id=176620
+
+ Reviewed by Zalan Bujtas.
+
+ Test: fast/block/over-constrained-auto-margin.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::computeLogicalWidthInRegion const):
+
2017-09-21 Javier Fernandez <[email protected]>
Unpredictable selection when dragging out of float elements children of in-flow block-level box
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (222320 => 222321)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2017-09-21 16:03:11 UTC (rev 222320)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2017-09-21 16:28:35 UTC (rev 222321)
@@ -2389,12 +2389,12 @@
#endif
&& !cb.isRenderGrid()
) {
- LayoutUnit newMargin = containerLogicalWidth - computedValues.m_extent - cb.marginStartForChild(*this);
+ LayoutUnit newMarginTotal = containerLogicalWidth - computedValues.m_extent;
bool hasInvertedDirection = cb.style().isLeftToRightDirection() != style().isLeftToRightDirection();
if (hasInvertedDirection)
- computedValues.m_margins.m_start = newMargin;
+ computedValues.m_margins.m_start = newMarginTotal - computedValues.m_margins.m_end;
else
- computedValues.m_margins.m_end = newMargin;
+ computedValues.m_margins.m_end = newMarginTotal - computedValues.m_margins.m_start;
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes