Title: [118975] trunk
Revision
118975
Author
[email protected]
Date
2012-05-30 14:42:13 -0700 (Wed, 30 May 2012)

Log Message

Inline blocks with margin wrap incorrectly with subpixel layout turned on
https://bugs.webkit.org/show_bug.cgi?id=87897

Reviewed by Levi Weintraub.

Source/WebCore: 

Change WebCore::getBorderPaddingMargin and the helper function
getBPMWidth to return a LayoutUnit rather than an int as the padding and
margin values have subpixel precision. This fixes an issue where we would
incorrectly wrap inline blocks with a subpixel padding or margin. 

Test: fast/sub-pixel/inline-block-with-margin.html

* rendering/RenderBlock.cpp:
(WebCore::getBPMWidth):
(WebCore::getBorderPaddingMargin):
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):

LayoutTests: 

Add test for inline blocks with a subpixel margin. Marked as skipped on
all platforms but chromium as subpixel layout has not yet been enabled
for any other platform.

* fast/sub-pixel/inline-block-with-margin-expected.html: Added.
* fast/sub-pixel/inline-block-with-margin.html: Added.
* platform/efl/Skipped:
* platform/gtk-wk2/Skipped:
* platform/mac-lion/Skipped:
* platform/mac-snowleopard/Skipped:
* platform/mac-wk2/Skipped:
* platform/mac/Skipped:
* platform/qt-4.8/Skipped:
* platform/qt/Skipped:
* platform/win-wk2/Skipped:
* platform/win-xp/Skipped:
* platform/win/Skipped:
* platform/wincairo/Skipped:
* platform/wk2/Skipped:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (118974 => 118975)


--- trunk/LayoutTests/ChangeLog	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/ChangeLog	2012-05-30 21:42:13 UTC (rev 118975)
@@ -1,3 +1,30 @@
+2012-05-30  Emil A Eklund  <[email protected]>
+
+        Inline blocks with margin wrap incorrectly with subpixel layout turned on
+        https://bugs.webkit.org/show_bug.cgi?id=87897
+
+        Reviewed by Levi Weintraub.
+
+        Add test for inline blocks with a subpixel margin. Marked as skipped on
+        all platforms but chromium as subpixel layout has not yet been enabled
+        for any other platform.
+
+        * fast/sub-pixel/inline-block-with-margin-expected.html: Added.
+        * fast/sub-pixel/inline-block-with-margin.html: Added.
+        * platform/efl/Skipped:
+        * platform/gtk-wk2/Skipped:
+        * platform/mac-lion/Skipped:
+        * platform/mac-snowleopard/Skipped:
+        * platform/mac-wk2/Skipped:
+        * platform/mac/Skipped:
+        * platform/qt-4.8/Skipped:
+        * platform/qt/Skipped:
+        * platform/win-wk2/Skipped:
+        * platform/win-xp/Skipped:
+        * platform/win/Skipped:
+        * platform/wincairo/Skipped:
+        * platform/wk2/Skipped:
+
 2012-05-30  Jessie Berlin  <[email protected]>
 
         [Qt][GTK][Mac][Win] New plugins/npruntime/delete-plugin-within-* tests introduced in r117012

Added: trunk/LayoutTests/fast/sub-pixel/inline-block-with-margin-expected.html (0 => 118975)


--- trunk/LayoutTests/fast/sub-pixel/inline-block-with-margin-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/inline-block-with-margin-expected.html	2012-05-30 21:42:13 UTC (rev 118975)
@@ -0,0 +1,14 @@
+<!DOCTYPE>
+<html>
+    <head>
+        <style>
+            div > span { margin-left: 0.4em; }
+        </style>
+    </head>
+    <body>
+        <div>Should not <span>wrap</span></div>
+        <section>
+            Line above should not wrap.
+        </section>
+    </body>
+</html>

Added: trunk/LayoutTests/fast/sub-pixel/inline-block-with-margin.html (0 => 118975)


--- trunk/LayoutTests/fast/sub-pixel/inline-block-with-margin.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/inline-block-with-margin.html	2012-05-30 21:42:13 UTC (rev 118975)
@@ -0,0 +1,15 @@
+<!DOCTYPE>
+<html>
+    <head>
+        <style>
+            div { display: inline-block; }
+            div > span { margin-left: 0.4em; }
+        </style>
+    </head>
+    <body>
+        <div>Should not <span>wrap</span></div>
+        <section>
+            Line above should not wrap.
+        </section>
+    </body>
+</html>

Modified: trunk/LayoutTests/platform/efl/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/efl/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/efl/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -1228,6 +1228,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/gtk-wk2/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/gtk-wk2/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/gtk-wk2/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -342,6 +342,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/mac/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/mac/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/mac/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -803,6 +803,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/mac-lion/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/mac-lion/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/mac-lion/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -100,6 +100,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/mac-snowleopard/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/mac-snowleopard/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/mac-snowleopard/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -198,6 +198,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/mac-wk2/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/mac-wk2/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/mac-wk2/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -203,6 +203,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/qt/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/qt/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/qt/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -216,6 +216,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/qt-4.8/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/qt-4.8/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/qt-4.8/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -86,6 +86,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/win/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/win/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/win/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -1728,6 +1728,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/win-wk2/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/win-wk2/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/win-wk2/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -937,6 +937,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/win-xp/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/win-xp/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/win-xp/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -37,6 +37,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/wincairo/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/wincairo/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/wincairo/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -2086,6 +2086,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/LayoutTests/platform/wk2/Skipped (118974 => 118975)


--- trunk/LayoutTests/platform/wk2/Skipped	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/LayoutTests/platform/wk2/Skipped	2012-05-30 21:42:13 UTC (rev 118975)
@@ -87,6 +87,7 @@
 # https://bugs.webkit.org/show_bug.cgi?id=85532
 fast/sub-pixel/client-rect-has-subpixel-precision.html
 fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/inline-block-with-margin.html
 fast/sub-pixel/layout-boxes-with-zoom.html
 fast/sub-pixel/size-of-box-with-zoom.html
 

Modified: trunk/Source/WebCore/ChangeLog (118974 => 118975)


--- trunk/Source/WebCore/ChangeLog	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/Source/WebCore/ChangeLog	2012-05-30 21:42:13 UTC (rev 118975)
@@ -1,3 +1,22 @@
+2012-05-30  Emil A Eklund  <[email protected]>
+
+        Inline blocks with margin wrap incorrectly with subpixel layout turned on
+        https://bugs.webkit.org/show_bug.cgi?id=87897
+
+        Reviewed by Levi Weintraub.
+
+        Change WebCore::getBorderPaddingMargin and the helper function
+        getBPMWidth to return a LayoutUnit rather than an int as the padding and
+        margin values have subpixel precision. This fixes an issue where we would
+        incorrectly wrap inline blocks with a subpixel padding or margin. 
+
+        Test: fast/sub-pixel/inline-block-with-margin.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::getBPMWidth):
+        (WebCore::getBorderPaddingMargin):
+        (WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
+
 2012-05-30  Tony Chang  <[email protected]>
 
         rename flexbox css values from justify and distribute to space-between and space-around

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (118974 => 118975)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-05-30 21:35:48 UTC (rev 118974)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-05-30 21:42:13 UTC (rev 118975)
@@ -5393,14 +5393,14 @@
     return current;
 }
 
-static int getBPMWidth(int childValue, Length cssUnit)
+static LayoutUnit getBPMWidth(LayoutUnit childValue, Length cssUnit)
 {
     if (cssUnit.type() != Auto)
-        return (cssUnit.isFixed() ? cssUnit.value() : childValue);
+        return (cssUnit.isFixed() ? static_cast<LayoutUnit>(cssUnit.value()) : childValue);
     return 0;
 }
 
-static int getBorderPaddingMargin(const RenderBoxModelObject* child, bool endOfInline)
+static LayoutUnit getBorderPaddingMargin(const RenderBoxModelObject* child, bool endOfInline)
 {
     RenderStyle* childStyle = child->style();
     if (endOfInline)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to