Title: [240035] trunk
Revision
240035
Author
za...@apple.com
Date
2019-01-16 06:52:55 -0800 (Wed, 16 Jan 2019)

Log Message

[LFC] Adjust margin box verification.
https://bugs.webkit.org/show_bug.cgi?id=193482

Source/WebCore:

Reviewed by Antti Koivisto.

In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
so let's check the individual margin values instead (and at this point we know that all other boxes match).

Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html

* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

Tools:

Reviewed by Antti Koivisto.

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

Reviewed by Antti Koivisto.

* fast/block/block-only/non-auto-top-bottom-height-with-auto-margins-expected.txt: Added.
* fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (240034 => 240035)


--- trunk/LayoutTests/ChangeLog	2019-01-16 11:05:08 UTC (rev 240034)
+++ trunk/LayoutTests/ChangeLog	2019-01-16 14:52:55 UTC (rev 240035)
@@ -1,3 +1,13 @@
+2019-01-16  Zalan Bujtas  <za...@apple.com>
+
+        [LFC] Adjust margin box verification.
+        https://bugs.webkit.org/show_bug.cgi?id=193482
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/block-only/non-auto-top-bottom-height-with-auto-margins-expected.txt: Added.
+        * fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html: Added.
+
 2019-01-15  Ryosuke Niwa  <rn...@webkit.org>
 
         VisualViewport API should be updated upon opening of keyboard

Added: trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-auto-margins-expected.txt (0 => 240035)


--- trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-auto-margins-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-auto-margins-expected.txt	2019-01-16 14:52:55 UTC (rev 240035)
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+layer at (8,8) size 110x110
+  RenderBlock (relative positioned) {DIV} at (0,0) size 110x110 [border: (5px solid #008000)]
+layer at (13,53) size 50x50
+  RenderBlock (positioned) {DIV} at (5,45) size 50x50 [bgcolor=#0000FF]
+layer at (8,118) size 110x110
+  RenderBlock (relative positioned) {DIV} at (0,110) size 110x110 [border: (5px solid #008000)]
+layer at (13,133) size 50x50
+  RenderBlock (positioned) {DIV} at (5,15) size 50x50 [bgcolor=#0000FF]
+layer at (8,228) size 110x110
+  RenderBlock (relative positioned) {DIV} at (0,220) size 110x110 [border: (5px solid #008000)]
+layer at (13,258) size 50x50
+  RenderBlock (positioned) {DIV} at (5,30) size 50x50 [bgcolor=#0000FF]

Added: trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html (0 => 240035)


--- trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html	2019-01-16 14:52:55 UTC (rev 240035)
@@ -0,0 +1,22 @@
+<style>
+.container {
+	border: 5px solid green;
+    height: 100px;
+    width: 100px;
+    position: relative;
+}
+
+div div {
+	background: blue;
+    position: absolute;
+
+    height: 50px;
+    width: 50px;
+
+    top: 10px;
+    bottom: 10px;
+}
+</style>
+<div class=container><div style="margin-top: auto;"></div></div>
+<div class=container><div style="margin-bottom: auto;"></div></div>
+<div class=container><div style="margin-top: auto; margin-bottom: auto;"></div></div>

Modified: trunk/Source/WebCore/ChangeLog (240034 => 240035)


--- trunk/Source/WebCore/ChangeLog	2019-01-16 11:05:08 UTC (rev 240034)
+++ trunk/Source/WebCore/ChangeLog	2019-01-16 14:52:55 UTC (rev 240035)
@@ -1,3 +1,18 @@
+2019-01-16  Alan Kinsley  <za...@apple.com>
+
+        [LFC] Adjust margin box verification.
+        https://bugs.webkit.org/show_bug.cgi?id=193482
+
+        Reviewed by Antti Koivisto.
+
+        In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
+        so let's check the individual margin values instead (and at this point we know that all other boxes match).
+
+        Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
+
+        * layout/Verification.cpp:
+        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
+
 2019-01-16  Zan Dobersek  <zdober...@igalia.com>
 
         [FreeType] Cache the zero-width space glyph in GlyphPage::fill()

Modified: trunk/Source/WebCore/layout/Verification.cpp (240034 => 240035)


--- trunk/Source/WebCore/layout/Verification.cpp	2019-01-16 11:05:08 UTC (rev 240034)
+++ trunk/Source/WebCore/layout/Verification.cpp	2019-01-16 14:52:55 UTC (rev 240035)
@@ -265,11 +265,6 @@
         return true;
     }
 
-    if (renderer.marginBoxRect() != renderBoxLikeMarginBox(displayBox)) {
-        outputRect("marginBox", renderer.marginBoxRect(), renderBoxLikeMarginBox(displayBox));
-        return true;
-    }
-
     if (renderer.borderBoxRect() != displayBox.borderBox()) {
         outputRect("borderBox", renderer.borderBoxRect(), displayBox.borderBox());
         return true;
@@ -285,6 +280,20 @@
         return true;
     }
 
+    if (renderer.marginBoxRect() != renderBoxLikeMarginBox(displayBox)) {
+        // In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
+        // so let's check the individual margin values instead (and at this point we know that all other boxes match).
+        auto marginsMatch = displayBox.marginBefore() == renderer.marginBefore()
+            && displayBox.marginAfter() == renderer.marginAfter()
+            && displayBox.marginStart() == renderer.marginStart()
+            && displayBox.marginEnd() == renderer.marginEnd();
+
+        if (!marginsMatch) {
+            outputRect("marginBox", renderer.marginBoxRect(), renderBoxLikeMarginBox(displayBox));
+            return true;
+        }
+    }
+
     return false;
 }
 

Modified: trunk/Tools/ChangeLog (240034 => 240035)


--- trunk/Tools/ChangeLog	2019-01-16 11:05:08 UTC (rev 240034)
+++ trunk/Tools/ChangeLog	2019-01-16 14:52:55 UTC (rev 240035)
@@ -1,3 +1,12 @@
+2019-01-16  Zalan Bujtas  <za...@apple.com>
+
+        [LFC] Adjust margin box verification.
+        https://bugs.webkit.org/show_bug.cgi?id=193482
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
 2019-01-15  Sihui Liu  <sihui_...@apple.com>
 
         Fix API test WebKit.WebsiteDataStoreCustomPathsWithoutPrewarming after 193354

Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (240034 => 240035)


--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-01-16 11:05:08 UTC (rev 240034)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-01-16 14:52:55 UTC (rev 240035)
@@ -79,6 +79,7 @@
 fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html
 fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
 fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
+fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
 fast/block/basic/002.html
 fast/block/basic/003.html
 fast/block/basic/006.html
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to