Background size width specified in viewport percentage units not working
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2013 19:13:56 +0000 (19:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Feb 2013 19:13:56 +0000 (19:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109536

Patch by Uday Kiran <udaykiran@motorola.com> on 2013-02-12
Reviewed by Antti Koivisto.

Source/WebCore:

Corrected the check for viewport percentage unit while calculating
background image width.

Test: fast/backgrounds/size/backgroundSize-viewportPercentage-width.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize):

LayoutTests:

Added a test for background image width specified in viewport percentage unit.

* fast/backgrounds/size/backgroundSize-viewportPercentage-width-expected.html: Added.
* fast/backgrounds/size/backgroundSize-viewportPercentage-width.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142645 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/size/backgroundSize-viewportPercentage-width-expected.html [new file with mode: 0644]
LayoutTests/fast/backgrounds/size/backgroundSize-viewportPercentage-width.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBoxModelObject.cpp

index 8e129b16453ca095f0040dca09aab939f7654cbd..7efa997d9aeb00c93ce6dae5623af3eb59bff0f8 100644 (file)
@@ -1,3 +1,15 @@
+2013-02-12  Uday Kiran  <udaykiran@motorola.com>
+
+        Background size width specified in viewport percentage units not working
+        https://bugs.webkit.org/show_bug.cgi?id=109536
+
+        Reviewed by Antti Koivisto.
+
+        Added a test for background image width specified in viewport percentage unit.
+
+        * fast/backgrounds/size/backgroundSize-viewportPercentage-width-expected.html: Added.
+        * fast/backgrounds/size/backgroundSize-viewportPercentage-width.html: Added.
+
 2013-02-12  Pablo Flouret  <pablof@motorola.com>
 
         Handle error recovery in @supports
diff --git a/LayoutTests/fast/backgrounds/size/backgroundSize-viewportPercentage-width-expected.html b/LayoutTests/fast/backgrounds/size/backgroundSize-viewportPercentage-width-expected.html
new file mode 100644 (file)
index 0000000..6c7f06c
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div style="width: 50vw; height: 300px; background: url('resources/flower.jpg') top left / 50% 300px repeat-x"></div>
+<p><a href="https://bugs.webkit.org/show_bug.cgi?id=109536">https://bugs.webkit.org/show_bug.cgi?id=109536</a><br>
+You should see image repeated twice horizontally.</p>
+</body>
+</html>
diff --git a/LayoutTests/fast/backgrounds/size/backgroundSize-viewportPercentage-width.html b/LayoutTests/fast/backgrounds/size/backgroundSize-viewportPercentage-width.html
new file mode 100644 (file)
index 0000000..e93bd0e
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div style="width: 50vw; height: 300px; background: url('resources/flower.jpg') top left / 25vw 300px repeat-x"></div>
+<p><a href="https://bugs.webkit.org/show_bug.cgi?id=109536">https://bugs.webkit.org/show_bug.cgi?id=109536</a><br>
+You should see image repeated twice horizontally.</p>
+</body>
+</html>
index e291b420e3110c28169429f0e9a259f5618e7ca6..14a3b1bbf0b78c74747a9ca4d5235fffedbf5ed7 100644 (file)
@@ -1,3 +1,18 @@
+2013-02-12  Uday Kiran  <udaykiran@motorola.com>
+
+        Background size width specified in viewport percentage units not working
+        https://bugs.webkit.org/show_bug.cgi?id=109536
+
+        Reviewed by Antti Koivisto.
+
+        Corrected the check for viewport percentage unit while calculating
+        background image width.
+
+        Test: fast/backgrounds/size/backgroundSize-viewportPercentage-width.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::calculateFillTileSize):
+
 2013-02-12  Abhishek Arya  <inferno@chromium.org>
 
         Heap-use-after-free in WebCore::DeleteButtonController::enable
index 0b69237d1317ae37f58183be7728f151c70bad70..00886b39d77adcf054dee6ca6be7252bfb87d884 100644 (file)
@@ -1022,7 +1022,7 @@ IntSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer,
 
             if (layerWidth.isFixed())
                 tileSize.setWidth(layerWidth.value());
-            else if (layerWidth.isPercent() || layerHeight.isViewportPercentage())
+            else if (layerWidth.isPercent() || layerWidth.isViewportPercentage())
                 tileSize.setWidth(valueForLength(layerWidth, positioningAreaSize.width(), renderView));
             
             if (layerHeight.isFixed())