Title: [156322] trunk
Revision
156322
Author
[email protected]
Date
2013-09-24 00:47:10 -0700 (Tue, 24 Sep 2013)

Log Message

[CSS Background] repeat: round should round the number of tiles to the nearest natural number
https://bugs.webkit.org/show_bug.cgi?id=120668

Source/WebCore:

Patch by Andrei Parvu <[email protected]> on 2013-09-24
Reviewed by Darin Adler.

Tests already available in css3/masking and css3/background

* rendering/RenderBoxModelObject.cpp: Rounded the number of tiles to the nearest natural number.
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):

LayoutTests:

Changed the sizes of the images/masks in the tests to be compliant with the new behaviour.

Patch by Andrei Parvu <[email protected]> on 2013-09-24
Reviewed by Darin Adler.

* css3/background/background-repeat-round-auto1-expected.html:
* css3/background/background-repeat-round-auto2-expected.html:
* css3/background/background-repeat-round-border-expected.html:
* css3/background/background-repeat-round-content-expected.html:
* css3/background/background-repeat-round-padding-expected.html:
* css3/background/background-repeat-round-padding.html:
* css3/masking/mask-repeat-round-auto1-expected.html:
* css3/masking/mask-repeat-round-auto2-expected.html:
* css3/masking/mask-repeat-round-border-expected.html:
* css3/masking/mask-repeat-round-content-expected.html:
* css3/masking/mask-repeat-round-padding-expected.html:
* css3/masking/mask-repeat-round-padding.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (156321 => 156322)


--- trunk/LayoutTests/ChangeLog	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/ChangeLog	2013-09-24 07:47:10 UTC (rev 156322)
@@ -1,3 +1,25 @@
+2013-09-24  Andrei Parvu  <[email protected]>
+
+        [CSS Background] repeat: round should round the number of tiles to the nearest natural number
+        https://bugs.webkit.org/show_bug.cgi?id=120668
+
+        Changed the sizes of the images/masks in the tests to be compliant with the new behaviour.
+
+        Reviewed by Darin Adler.
+
+        * css3/background/background-repeat-round-auto1-expected.html:
+        * css3/background/background-repeat-round-auto2-expected.html:
+        * css3/background/background-repeat-round-border-expected.html:
+        * css3/background/background-repeat-round-content-expected.html:
+        * css3/background/background-repeat-round-padding-expected.html:
+        * css3/background/background-repeat-round-padding.html:
+        * css3/masking/mask-repeat-round-auto1-expected.html:
+        * css3/masking/mask-repeat-round-auto2-expected.html:
+        * css3/masking/mask-repeat-round-border-expected.html:
+        * css3/masking/mask-repeat-round-content-expected.html:
+        * css3/masking/mask-repeat-round-padding-expected.html:
+        * css3/masking/mask-repeat-round-padding.html:
+
 2013-09-23  Gurpreet Kaur  <[email protected]>
 
         CSS Unit vh, vw, vmin and vmax in box-shadow are not applied.

Modified: trunk/LayoutTests/css3/background/background-repeat-round-auto1-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/background/background-repeat-round-auto1-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/background/background-repeat-round-auto1-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -9,7 +9,7 @@
                 padding: 50px;
                 border: 50px solid transparent;
                 background-image: url(resources/circle.png);
-                background-size: 100px 79px;
+                background-size: 111px 88px;
                 background-repeat: repeat;
                 background-origin: border-box;
                 background-clip: border-box;

Modified: trunk/LayoutTests/css3/background/background-repeat-round-auto2-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/background/background-repeat-round-auto2-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/background/background-repeat-round-auto2-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -9,7 +9,7 @@
                 padding: 50px;
                 border: 50px solid transparent;
                 background-image: url(resources/circle.png);
-                background-size: 106px 85px;
+                background-size: 124px 100px;
                 background-repeat: repeat;
                 background-origin: border-box;
                 background-clip: border-box;

Modified: trunk/LayoutTests/css3/background/background-repeat-round-border-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/background/background-repeat-round-border-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/background/background-repeat-round-border-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -9,7 +9,7 @@
                 padding: 50px;
                 border: 50px solid transparent;
                 background-image: url(resources/circle.png);
-                background-size: 100px 75px;
+                background-size: 111px 85px;
                 background-repeat: repeat;
                 background-origin: border-box;
                 background-clip: border-box;

Modified: trunk/LayoutTests/css3/background/background-repeat-round-content-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/background/background-repeat-round-content-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/background/background-repeat-round-content-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -9,7 +9,7 @@
                 padding: 50px;
                 border: 50px solid transparent;
                 background-image: url(resources/circle.png);
-                background-size: 66px 40px;
+                background-size: 72px 40px;
                 background-repeat: repeat;
                 background-origin: content-box;
                 background-clip: content-box;

Modified: trunk/LayoutTests/css3/background/background-repeat-round-padding-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/background/background-repeat-round-padding-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/background/background-repeat-round-padding-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -9,7 +9,7 @@
                 padding: 50px;
                 border: 50px solid transparent;
                 background-image: url(resources/circle.png);
-                background-size: 100px 83px;
+                background-size: 90px 83px;
                 background-repeat: repeat;
                 background-origin: padding-box;
                 background-clip: padding-box;

Modified: trunk/LayoutTests/css3/background/background-repeat-round-padding.html (156321 => 156322)


--- trunk/LayoutTests/css3/background/background-repeat-round-padding.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/background/background-repeat-round-padding.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -9,7 +9,7 @@
                 padding: 50px;
                 border: 50px solid transparent;
                 background-image: url(resources/circle.png);
-                background-size: 100px 93px;
+                background-size: 93px 87px;
                 background-repeat: round;
                 background-origin: padding-box;
                 background-clip: padding-box;

Modified: trunk/LayoutTests/css3/masking/mask-repeat-round-auto1-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/masking/mask-repeat-round-auto1-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/masking/mask-repeat-round-auto1-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -14,7 +14,7 @@
                 border: 50px solid blue;
                 padding: 50px;
                 -webkit-mask-image: url(resources/circle.png);
-                -webkit-mask-size: 100px 79px;
+                -webkit-mask-size: 111px 88px;
                 -webkit-mask-repeat: repeat;
                 -webkit-mask-origin: border-box;
                 -webkit-mask-clip: border-box;

Modified: trunk/LayoutTests/css3/masking/mask-repeat-round-auto2-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/masking/mask-repeat-round-auto2-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/masking/mask-repeat-round-auto2-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -14,7 +14,7 @@
                 border: 50px solid blue;
                 padding: 50px;
                 -webkit-mask-image: url(resources/circle.png);
-                -webkit-mask-size: 106px 85px;
+                -webkit-mask-size: 124px 100px;
                 -webkit-mask-repeat: repeat;
                 -webkit-mask-origin: border-box;
                 -webkit-mask-clip: border-box;

Modified: trunk/LayoutTests/css3/masking/mask-repeat-round-border-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/masking/mask-repeat-round-border-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/masking/mask-repeat-round-border-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -14,7 +14,7 @@
                 border: 50px solid blue;
                 padding: 50px;
                 -webkit-mask-image: url(resources/circle.png);
-                -webkit-mask-size: 100px 75px;
+                -webkit-mask-size: 111px 85px;
                 -webkit-mask-repeat: repeat;
                 -webkit-mask-origin: border-box;
                 -webkit-mask-clip: border-box;

Modified: trunk/LayoutTests/css3/masking/mask-repeat-round-content-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/masking/mask-repeat-round-content-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/masking/mask-repeat-round-content-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -14,7 +14,7 @@
                 border: 50px solid blue;
                 padding: 50px;
                 -webkit-mask-image: url(resources/circle.png);
-                -webkit-mask-size: 66px 40px;
+                -webkit-mask-size: 72px 40px;
                 -webkit-mask-repeat: repeat;
                 -webkit-mask-origin: content-box;
                 -webkit-mask-clip: content-box;

Modified: trunk/LayoutTests/css3/masking/mask-repeat-round-padding-expected.html (156321 => 156322)


--- trunk/LayoutTests/css3/masking/mask-repeat-round-padding-expected.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/masking/mask-repeat-round-padding-expected.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -14,7 +14,7 @@
                 border: 50px solid blue;
                 padding: 50px;
                 -webkit-mask-image: url(resources/circle.png);
-                -webkit-mask-size: 100px 83px;
+                -webkit-mask-size: 90px 83px;
                 -webkit-mask-repeat: repeat;
                 -webkit-mask-origin: padding-box;
                 -webkit-mask-clip: padding-box;

Modified: trunk/LayoutTests/css3/masking/mask-repeat-round-padding.html (156321 => 156322)


--- trunk/LayoutTests/css3/masking/mask-repeat-round-padding.html	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/LayoutTests/css3/masking/mask-repeat-round-padding.html	2013-09-24 07:47:10 UTC (rev 156322)
@@ -14,7 +14,7 @@
                 border: 50px solid blue;
                 padding: 50px;
                 -webkit-mask-image: url(resources/circle.png);
-                -webkit-mask-size: 100px 93px;
+                -webkit-mask-size: 93px 87px;
                 -webkit-mask-repeat: round;
                 -webkit-mask-origin: padding-box;
                 -webkit-mask-clip: padding-box;

Modified: trunk/Source/WebCore/ChangeLog (156321 => 156322)


--- trunk/Source/WebCore/ChangeLog	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/Source/WebCore/ChangeLog	2013-09-24 07:47:10 UTC (rev 156322)
@@ -1,3 +1,15 @@
+2013-09-24  Andrei Parvu  <[email protected]>
+
+        [CSS Background] repeat: round should round the number of tiles to the nearest natural number
+        https://bugs.webkit.org/show_bug.cgi?id=120668
+
+        Reviewed by Darin Adler.
+
+        Tests already available in css3/masking and css3/background
+
+        * rendering/RenderBoxModelObject.cpp: Rounded the number of tiles to the nearest natural number.
+        (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
+
 2013-09-24  Ryuan Choi  <[email protected]>
 
         Remove ScrollView::platformInit() and ScrollView::platformDestroy()

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (156321 => 156322)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2013-09-24 07:33:35 UTC (rev 156321)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2013-09-24 07:47:10 UTC (rev 156322)
@@ -1122,7 +1122,9 @@
 
     LayoutUnit computedXPosition = minimumValueForLength(fillLayer->xPosition(), availableWidth, true);
     if (backgroundRepeatX == RoundFill && positioningAreaSize.width() > 0 && fillTileSize.width() > 0) {
-        int nrTiles = ceil((double)positioningAreaSize.width() / fillTileSize.width());
+        long nrTiles = lroundf((float)positioningAreaSize.width() / fillTileSize.width());
+        if (!nrTiles)
+            nrTiles = 1;
 
         if (fillLayer->size().size.height().isAuto() && backgroundRepeatY != RoundFill)
             fillTileSize.setHeight(fillTileSize.height() * positioningAreaSize.width() / (nrTiles * fillTileSize.width()));
@@ -1135,7 +1137,9 @@
 
     LayoutUnit computedYPosition = minimumValueForLength(fillLayer->yPosition(), availableHeight, true);
     if (backgroundRepeatY == RoundFill && positioningAreaSize.height() > 0 && fillTileSize.height() > 0) {
-        int nrTiles = ceil((double)positioningAreaSize.height() / fillTileSize.height());
+        long nrTiles = lroundf((float)positioningAreaSize.height() / fillTileSize.height());
+        if (!nrTiles)
+            nrTiles = 1;
 
         if (fillLayer->size().size.width().isAuto() && backgroundRepeatX != RoundFill)
             fillTileSize.setWidth(fillTileSize.width() * positioningAreaSize.height() / (nrTiles * fillTileSize.height()));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to