Title: [121917] trunk
Revision
121917
Author
commit-qu...@webkit.org
Date
2012-07-05 11:20:42 -0700 (Thu, 05 Jul 2012)

Log Message

Subpixel layout broken with spans with CSS position other than static
https://bugs.webkit.org/show_bug.cgi?id=90097

Patch by Behdad Esfahbod <beh...@behdad.org> on 2012-07-05
Reviewed by Eric Seidel.

In InlineBox, don't truncate size to integers when returning.

In RenderBlock, don't round-up width to next integer.  Round-up to
next LayoutUnit instead.

Test: Added fast/sub-pixel/size-of-span-with-different-positions.html
Adjust expected outputs affected by the rounding changes.

* platform/FractionalLayoutUnit.h:
(WebCore::FractionalLayoutUnit::fromFloatCeil):
(FractionalLayoutUnit):
* rendering/InlineBox.h:
(WebCore::InlineBox::size):
* rendering/RenderBlock.cpp:
(WebCore::updatePreferredWidth):

Modified Paths

Added Paths

Diff

Added: trunk/LayoutTests/fast/sub-pixel/size-of-span-with-different-positions-expected.txt (0 => 121917)


--- trunk/LayoutTests/fast/sub-pixel/size-of-span-with-different-positions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/size-of-span-with-different-positions-expected.txt	2012-07-05 18:20:42 UTC (rev 121917)
@@ -0,0 +1,9 @@
+Test case for bug 90097. This tests span sizes with different CSS position attributes.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/sub-pixel/size-of-span-with-different-positions.html (0 => 121917)


--- trunk/LayoutTests/fast/sub-pixel/size-of-span-with-different-positions.html	                        (rev 0)
+++ trunk/LayoutTests/fast/sub-pixel/size-of-span-with-different-positions.html	2012-07-05 18:20:42 UTC (rev 121917)
@@ -0,0 +1,31 @@
+<html>
+<head>
+<style>
+    .testContent {
+        font-face: Arial; font-size: 16px;
+    }
+</style>
+</head>
+<body>
+<div id="testContent">
+    <span id="span-position-static"   style="position:static">T</span>
+    <span id="span-position-fixed"    style="position:fixed">T</span>
+    <span id="span-position-absolute" style="position:absolute">T</span>
+    <span id="span-position-relative" style="position:relative">T</span>
+</div>
+<script src=""
+<script>
+    description("Test case for bug 90097. This tests span sizes with different CSS position attributes.");
+    var spans = testContent.querySelectorAll('span');
+    var expected_width = document.getElementById('span-position-static').getBoundingClientRect().width;
+    // if expected_width is integral, all should match, otherwise should be close
+    var tolerance = expected_width % 1.0 == 0.0 ? 0.0 : 1.0 / 60;
+
+    shouldBeCloseTo('document.getElementById("span-position-fixed").getBoundingClientRect().width', expected_width, tolerance, true);
+    shouldBeCloseTo('document.getElementById("span-position-absolute").getBoundingClientRect().width', expected_width, tolerance, true);
+    shouldBeCloseTo('document.getElementById("span-position-relative").getBoundingClientRect().width', expected_width, tolerance, true);
+    document.getElementById("testContent").style.display = 'none';
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/chromium-linux/fast/html/details-marker-style-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/fast/html/details-marker-style-expected.txt (121916 => 121917)


--- trunk/LayoutTests/platform/chromium-linux/fast/html/details-marker-style-expected.txt	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/LayoutTests/platform/chromium-linux/fast/html/details-marker-style-expected.txt	2012-07-05 18:20:42 UTC (rev 121917)
@@ -15,13 +15,13 @@
             RenderDetailsMarker {DIV} at (9,0) size 112x80 [border: (8px solid #00FF00) (16px solid #00FF00) (24px solid #00FF00) (32px solid #00FF00)]: down
             RenderText {#text} at (100,79) size 27x92
               text run at (100,79) width 91: "Summary"
-      RenderBlock {DIV} at (0,257) size 784x47
+      RenderBlock {DIV} at (0,256) size 784x48
         RenderBlock {DETAILS} at (0,0) size 784x47
           RenderBlock {SUMMARY} at (0,0) size 784x47
             RenderDetailsMarker {DIV} at (0,0) size 64x40 [border: (8px solid #00FF00)]: right
             RenderText {#text} at (73,19) size 92x27
               text run at (73,19) width 92: "Summary"
-      RenderBlock {DIV} at (0,304) size 80x131
+      RenderBlock {DIV} at (0,303) size 80x132
         RenderBlock {DETAILS} at (0,0) size 80x131
           RenderBlock {SUMMARY} at (0,0) size 80x131
             RenderDetailsMarker {DIV} at (9,0) size 64x40 [border: (8px solid #00FF00)]: down

Modified: trunk/LayoutTests/platform/chromium-linux/media/video-zoom-controls-expected.png


(Binary files differ)

Added: trunk/LayoutTests/platform/chromium-linux/media/video-zoom-controls-expected.txt (0 => 121917)


--- trunk/LayoutTests/platform/chromium-linux/media/video-zoom-controls-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/media/video-zoom-controls-expected.txt	2012-07-05 18:20:42 UTC (rev 121917)
@@ -0,0 +1,62 @@
+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 (12,12) size 776x543
+      RenderBlock {P} at (0,0) size 776x28
+        RenderText {#text} at (0,0) size 275x27
+          text run at (0,0) width 275: "Zoomed video with controls."
+layer at (57,85) size 240x180
+  RenderVideo {VIDEO} at (45,73) size 240x180
+layer at (57,85) size 240x180
+  RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,0) size 240x180
+    RenderBlock {DIV} at (0,127) size 240x53
+layer at (65,213) size 225x45 scrollWidth 343 scrollHeight 54
+  RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (7,0) size 226x45 [bgcolor=#141414CC]
+    RenderBlock (anonymous) at (0,0) size 72x45
+      RenderButton {INPUT} at (13,0) size 46x45
+    RenderSlider {INPUT} at (72,16) size 38x13
+      RenderDeprecatedFlexibleBox {DIV} at (0,0) size 38x12 [border: (1px solid #E6E6E659)]
+        RenderBlock {DIV} at (1,1) size 9x36
+        RenderBlock {DIV} at (-1,1) size 48x36
+    RenderDeprecatedFlexibleBox {DIV} at (132,0) size 40x45 [color=#FFFFFF]
+      RenderBlock (anonymous) at (0,0) size 40x45
+        RenderText {#text} at (0,10) size 40x24
+          text run at (0,10) width 40: "0:00"
+    RenderBlock (anonymous) at (185,0) size 62x45
+      RenderButton {INPUT} at (0,0) size 53x45
+    RenderSlider {INPUT} at (247,16) size 23x13
+      RenderDeprecatedFlexibleBox {DIV} at (0,0) size 23x12 [border: (1px solid #E6E6E659)]
+        RenderBlock {DIV} at (1,1) size 6x36
+        RenderBlock {DIV} at (-4,1) size 36x36
+    RenderBlock (anonymous) at (292,0) size 51x45
+      RenderButton {INPUT} at (-8,0) size 46x45
+layer at (127,217) size 49x36
+  RenderBlock (relative positioned) {DIV} at (-11,-12) size 49x36
+layer at (57,310) size 240x180
+  RenderVideo {VIDEO} at (45,298) size 240x180
+layer at (57,310) size 240x180
+  RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (0,0) size 240x180
+    RenderBlock {DIV} at (0,127) size 240x53
+layer at (65,438) size 225x45 scrollWidth 343 scrollHeight 54
+  RenderDeprecatedFlexibleBox (relative positioned) {DIV} at (7,0) size 226x45 [bgcolor=#141414CC]
+    RenderBlock (anonymous) at (0,0) size 72x45
+      RenderButton {INPUT} at (13,0) size 46x45
+    RenderSlider {INPUT} at (72,16) size 38x13
+      RenderDeprecatedFlexibleBox {DIV} at (0,0) size 38x12 [border: (1px solid #E6E6E659)]
+        RenderBlock {DIV} at (1,1) size 9x36
+        RenderBlock {DIV} at (-1,1) size 48x36
+    RenderDeprecatedFlexibleBox {DIV} at (132,0) size 40x45 [color=#FFFFFF]
+      RenderBlock (anonymous) at (0,0) size 40x45
+        RenderText {#text} at (0,10) size 40x24
+          text run at (0,10) width 40: "0:00"
+    RenderBlock (anonymous) at (185,0) size 62x45
+      RenderButton {INPUT} at (0,0) size 53x45
+    RenderSlider {INPUT} at (247,16) size 23x13
+      RenderDeprecatedFlexibleBox {DIV} at (0,0) size 23x12 [border: (1px solid #E6E6E659)]
+        RenderBlock {DIV} at (1,1) size 6x36
+        RenderBlock {DIV} at (-4,1) size 36x36
+    RenderBlock (anonymous) at (292,0) size 51x45
+      RenderButton {INPUT} at (-8,0) size 46x45
+layer at (127,442) size 49x36 backgroundClip at (60,417) size 225x45 clip at (60,417) size 225x45 outlineClip at (60,417) size 225x45
+  RenderBlock (relative positioned) {DIV} at (-11,-12) size 49x36

Added: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt (0 => 121917)


--- trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt	2012-07-05 18:20:42 UTC (rev 121917)
@@ -0,0 +1,62 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x454
+  RenderBlock {HTML} at (0,0) size 800x454
+    RenderBody {BODY} at (4,4) size 142x442 [border: (1px dashed #C0C0C0)]
+      RenderBlock {P} at (1,10) size 139x28
+        RenderText {#text} at (0,-2) size 133x30
+          text run at (0,-2) width 130: "The following six blue boxes must"
+          text run at (0,7) width 133: "be of the same width. There must be"
+          text run at (0,16) width 26: "no red."
+      RenderBlock {P} at (10,46) size 121x20 [bgcolor=#008000] [border: (5px solid #0000FF)]
+        RenderText {#text} at (5,3) size 2x12
+          text run at (5,3) width 2: " "
+      RenderBlock {P} at (1,121) size 139x10
+        RenderText {#text} at (0,-2) size 12x12
+          text run at (0,-2) width 12: "      "
+        RenderText {#text} at (0,0) size 0x0
+        RenderEmbeddedObject {OBJECT} at (9,-1) size 121x38 [bgcolor=#FF0000] [border: (5px solid #0000FF)]
+          layer at (0,0) size 110x28
+            RenderView at (0,0) size 110x28
+          layer at (0,0) size 110x28
+            RenderSVGRoot {svg} at (0,0) size 110x28
+              RenderSVGRect {rect} at (0,0) size 110x28 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
+              RenderSVGPath {path} at (16,5) size 78x17 [fill={[type=SOLID] [color=#008000]}] [data="" 500 50 L 150 200 L 850 200 Z"]
+      RenderBlock {P} at (1,186) size 139x10
+        RenderEmbeddedObject {OBJECT} at (9,0) size 121x38 [bgcolor=#FF0000] [border: (5px solid #0000FF)]
+          layer at (0,0) size 110x28
+            RenderView at (0,0) size 110x28
+          layer at (0,0) size 110x28
+            RenderSVGRoot {svg} at (0,0) size 110x28
+              RenderSVGRect {rect} at (0,0) size 110x28 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
+              RenderSVGPath {path} at (16,5) size 78x17 [fill={[type=SOLID] [color=#008000]}] [data="" 500 50 L 150 200 L 850 200 Z"]
+      RenderTable at (1,250) size 138x40
+        RenderTableSection (anonymous) at (0,0) size 138x39
+          RenderTableRow (anonymous) at (0,0) size 138x39
+            RenderTableCell {P} at (0,0) size 138x39 [r=0 c=0 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (9,0) size 121x38 [bgcolor=#FF0000] [border: (5px solid #0000FF)]
+                layer at (0,0) size 110x28
+                  RenderView at (0,0) size 110x28
+                layer at (0,0) size 110x28
+                  RenderSVGRoot {svg} at (0,0) size 110x28
+                    RenderSVGRect {rect} at (0,0) size 110x28 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
+                    RenderSVGPath {path} at (16,5) size 78x17 [fill={[type=SOLID] [color=#008000]}] [data="" 500 50 L 150 200 L 850 200 Z"]
+      RenderTable {TABLE} at (1,345) size 138x40
+        RenderTableSection {TBODY} at (0,0) size 138x39
+          RenderTableRow {TR} at (0,0) size 138x39
+            RenderTableCell {TD} at (0,0) size 138x39 [r=0 c=0 rs=1 cs=1]
+              RenderEmbeddedObject {OBJECT} at (9,0) size 121x38 [bgcolor=#FF0000] [border: (5px solid #0000FF)]
+                layer at (0,0) size 110x28
+                  RenderView at (0,0) size 110x28
+                layer at (0,0) size 110x28
+                  RenderSVGRoot {svg} at (0,0) size 110x28
+                    RenderSVGRect {rect} at (0,0) size 110x28 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
+                    RenderSVGPath {path} at (16,5) size 78x17 [fill={[type=SOLID] [color=#008000]}] [data="" 500 50 L 150 200 L 850 200 Z"]
+      RenderBlock (floating) {P} at (1,440) size 139x10
+        RenderEmbeddedObject {OBJECT} at (9,0) size 121x38 [bgcolor=#FF0000] [border: (5px solid #0000FF)]
+          layer at (0,0) size 110x28
+            RenderView at (0,0) size 110x28
+          layer at (0,0) size 110x28
+            RenderSVGRoot {svg} at (0,0) size 110x28
+              RenderSVGRect {rect} at (0,0) size 110x28 [stroke={[type=SOLID] [color=#008000] [stroke width=12.00]}] [fill={[type=SOLID] [color=#00FF00]}] [x=0.00] [y=0.00] [width=1000.00] [height=250.00]
+              RenderSVGPath {path} at (16,5) size 78x17 [fill={[type=SOLID] [color=#008000]}] [data="" 500 50 L 150 200 L 850 200 Z"]

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt (121916 => 121917)


--- trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt	2012-07-05 18:20:42 UTC (rev 121917)
@@ -15,15 +15,15 @@
                         RenderText {#text} at (0,0) size 478x25
                           text run at (0,0) width 478: "Both sides should have identical size after zooming"
                   RenderTableRow {tr} at (0,67) size 490x24
-                    RenderTableCell {td} at (1,67) size 244x24 [r=1 c=0 rs=1 cs=1]
-                      RenderText {#text} at (97,5) size 50x14
-                        text run at (97,5) width 50: "SVG Image"
-                    RenderTableCell {td} at (246,67) size 243x24 [r=1 c=1 rs=1 cs=1]
-                      RenderText {#text} at (95,5) size 53x14
-                        text run at (95,5) width 53: "PNG Image"
+                    RenderTableCell {td} at (1,67) size 243x24 [r=1 c=0 rs=1 cs=1]
+                      RenderText {#text} at (96,5) size 51x14
+                        text run at (96,5) width 51: "SVG Image"
+                    RenderTableCell {td} at (245,67) size 244x24 [r=1 c=1 rs=1 cs=1]
+                      RenderText {#text} at (95,5) size 54x14
+                        text run at (95,5) width 54: "PNG Image"
                   RenderTableRow {tr} at (0,92) size 490x82
-                    RenderTableCell {td} at (1,92) size 244x82 [r=2 c=0 rs=1 cs=1]
-                      RenderEmbeddedObject {object} at (100,4) size 139x70
+                    RenderTableCell {td} at (1,92) size 243x82 [r=2 c=0 rs=1 cs=1]
+                      RenderEmbeddedObject {object} at (99,4) size 139x70
                         layer at (0,0) size 139x69
                           RenderView at (0,0) size 139x69
                         layer at (0,0) size 139x69
@@ -42,6 +42,6 @@
                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 269.61: "$Revision: 1.7 $"
                             RenderSVGRect {rect} at (23,0) size 93x69 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
                       RenderText {#text} at (0,0) size 0x0
-                    RenderTableCell {td} at (246,92) size 243x82 [r=2 c=1 rs=1 cs=1]
+                    RenderTableCell {td} at (245,92) size 244x82 [r=2 c=1 rs=1 cs=1]
                       RenderImage {img} at (5,5) size 138x69
                       RenderText {#text} at (0,0) size 0x0

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png


(Binary files differ)

Modified: trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt (121916 => 121917)


--- trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt	2012-07-05 18:20:42 UTC (rev 121917)
@@ -3,27 +3,27 @@
 layer at (0,0) size 800x378
   RenderBlock {html} at (0,0) size 800x379
     RenderBody {body} at (5,5) size 790x368
-      RenderTable {table} at (41,0) size 706x367
-        RenderTableSection (anonymous) at (0,0) size 705x367
-          RenderTableRow {tr} at (0,0) size 705x367
-            RenderTableCell {td} at (0,0) size 705x367 [r=0 c=0 rs=1 cs=3]
-              RenderTable {table} at (7,6) size 693x355
-                RenderTableSection (anonymous) at (0,0) size 692x355
-                  RenderTableRow {tr} at (0,1) size 692x65
-                    RenderTableCell {td} at (1,1) size 690x66 [r=0 c=0 rs=1 cs=2]
-                      RenderBlock {h1} at (5,19) size 681x27
-                        RenderText {#text} at (101,0) size 478x25
-                          text run at (101,0) width 478: "Both sides should have identical size after zooming"
-                  RenderTableRow {tr} at (0,67) size 692x24
-                    RenderTableCell {td} at (1,67) size 345x24 [r=1 c=0 rs=1 cs=1]
-                      RenderText {#text} at (147,5) size 51x14
-                        text run at (147,5) width 51: "SVG Image"
-                    RenderTableCell {td} at (347,67) size 344x24 [r=1 c=1 rs=1 cs=1]
+      RenderTable {table} at (42,0) size 705x367
+        RenderTableSection (anonymous) at (0,0) size 704x367
+          RenderTableRow {tr} at (0,0) size 704x367
+            RenderTableCell {td} at (0,0) size 704x367 [r=0 c=0 rs=1 cs=3]
+              RenderTable {table} at (7,6) size 692x355
+                RenderTableSection (anonymous) at (0,0) size 691x355
+                  RenderTableRow {tr} at (0,1) size 691x65
+                    RenderTableCell {td} at (1,1) size 689x66 [r=0 c=0 rs=1 cs=2]
+                      RenderBlock {h1} at (5,19) size 680x27
+                        RenderText {#text} at (101,0) size 477x25
+                          text run at (101,0) width 477: "Both sides should have identical size after zooming"
+                  RenderTableRow {tr} at (0,67) size 691x24
+                    RenderTableCell {td} at (1,67) size 344x24 [r=1 c=0 rs=1 cs=1]
+                      RenderText {#text} at (147,5) size 50x14
+                        text run at (147,5) width 50: "SVG Image"
+                    RenderTableCell {td} at (346,67) size 344x24 [r=1 c=1 rs=1 cs=1]
                       RenderText {#text} at (145,5) size 54x14
                         text run at (145,5) width 54: "PNG Image"
-                  RenderTableRow {tr} at (0,92) size 692x262
-                    RenderTableCell {td} at (1,92) size 345x262 [r=2 c=0 rs=1 cs=1]
-                      RenderEmbeddedObject {object} at (6,4) size 334x250
+                  RenderTableRow {tr} at (0,92) size 691x262
+                    RenderTableCell {td} at (1,92) size 344x262 [r=2 c=0 rs=1 cs=1]
+                      RenderEmbeddedObject {object} at (5,4) size 334x250
                         layer at (0,0) size 333x250
                           RenderView at (0,0) size 333x250
                         layer at (0,0) size 333x250
@@ -42,6 +42,6 @@
                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 260.66: "$Revision: 1.7 $"
                             RenderSVGRect {rect} at (0,0) size 333x250 [stroke={[type=SOLID] [color=#000000]}] [x=1.00] [y=1.00] [width=478.00] [height=358.00]
                       RenderText {#text} at (0,0) size 0x0
-                    RenderTableCell {td} at (347,92) size 344x262 [r=2 c=1 rs=1 cs=1]
+                    RenderTableCell {td} at (346,92) size 344x262 [r=2 c=1 rs=1 cs=1]
                       RenderImage {img} at (5,5) size 333x249
                       RenderText {#text} at (0,0) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (121916 => 121917)


--- trunk/Source/WebCore/ChangeLog	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/Source/WebCore/ChangeLog	2012-07-05 18:20:42 UTC (rev 121917)
@@ -1,3 +1,26 @@
+2012-07-05  Behdad Esfahbod  <beh...@behdad.org>
+
+        Subpixel layout broken with spans with CSS position other than static
+        https://bugs.webkit.org/show_bug.cgi?id=90097
+
+        Reviewed by Eric Seidel.
+
+        In InlineBox, don't truncate size to integers when returning.
+
+        In RenderBlock, don't round-up width to next integer.  Round-up to
+        next LayoutUnit instead.
+
+        Test: Added fast/sub-pixel/size-of-span-with-different-positions.html
+        Adjust expected outputs affected by the rounding changes.
+
+        * platform/FractionalLayoutUnit.h:
+        (WebCore::FractionalLayoutUnit::fromFloatCeil):
+        (FractionalLayoutUnit):
+        * rendering/InlineBox.h:
+        (WebCore::InlineBox::size):
+        * rendering/RenderBlock.cpp:
+        (WebCore::updatePreferredWidth):
+
 2012-07-05  Nate Chapin  <jap...@chromium.org>
 
         REGRESSION (r115654): Sometimes does not replace content for multipart/x-mixed-replace

Modified: trunk/Source/WebCore/platform/FractionalLayoutUnit.h (121916 => 121917)


--- trunk/Source/WebCore/platform/FractionalLayoutUnit.h	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/Source/WebCore/platform/FractionalLayoutUnit.h	2012-07-05 18:20:42 UTC (rev 121917)
@@ -86,6 +86,14 @@
 #endif
     FractionalLayoutUnit(const FractionalLayoutUnit& value) { m_value = value.rawValue(); }
 
+    static FractionalLayoutUnit fromFloatCeil(float value)
+    {
+      REPORT_OVERFLOW(isInBounds(value));
+      FractionalLayoutUnit v;
+      v.m_value = ceilf(value * kFixedPointDenominator);
+      return v;
+    }
+
 #if ENABLE(SUBPIXEL_LAYOUT)
     int toInt() const { return m_value / kFixedPointDenominator; }
     float toFloat() const { return static_cast<float>(m_value) / kFixedPointDenominator; }
@@ -168,15 +176,15 @@
     }
     
 private:
-    bool isInBounds(int value)
+    static bool isInBounds(int value)
     {
         return ::abs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator;
     }
-    bool isInBounds(unsigned value)
+    static bool isInBounds(unsigned value)
     {
         return value <= static_cast<unsigned>(std::numeric_limits<int>::max()) / kFixedPointDenominator;
     }
-    bool isInBounds(double value)
+    static bool isInBounds(double value)
     {
         return ::fabs(value) <= std::numeric_limits<int>::max() / kFixedPointDenominator;
     }

Modified: trunk/Source/WebCore/rendering/InlineBox.h (121916 => 121917)


--- trunk/Source/WebCore/rendering/InlineBox.h	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/Source/WebCore/rendering/InlineBox.h	2012-07-05 18:20:42 UTC (rev 121917)
@@ -207,7 +207,7 @@
 
     float width() const { return isHorizontal() ? logicalWidth() : logicalHeight(); }
     float height() const { return isHorizontal() ? logicalHeight() : logicalWidth(); }
-    FloatSize size() const { return IntSize(width(), height()); }
+    FloatSize size() const { return FloatSize(width(), height()); }
     float right() const { return left() + width(); }
     float bottom() const { return top() + height(); }
 

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (121916 => 121917)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-07-05 18:01:10 UTC (rev 121916)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2012-07-05 18:20:42 UTC (rev 121917)
@@ -5520,7 +5520,7 @@
 
 static inline void updatePreferredWidth(LayoutUnit& preferredWidth, float& result)
 {
-    LayoutUnit snappedResult = ceilf(result);
+    LayoutUnit snappedResult = LayoutUnit::fromFloatCeil(result);
     preferredWidth = max(snappedResult, preferredWidth);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to