Title: [105515] trunk
Revision
105515
Author
[email protected]
Date
2012-01-20 07:51:53 -0800 (Fri, 20 Jan 2012)

Log Message

REGRESSION (r98852): apple.com navigation bar is broken under full-page zoom
https://bugs.webkit.org/show_bug.cgi?id=76249

Reviewed by Andreas Kling.

Source/WebCore:

Fix regression with full-page zoom & border-image. paintNinePieceImage() expects local, unzoomed coordinates.
Restore the behaviour as it was before r98852, fixing the regression.

Test: fast/borders/scaled-border-image.html

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

LayoutTests:

Add new test covering zooming + border-image, which regressed.

* fast/borders/scaled-border-image.html: Added.
* platform/mac/fast/borders/scaled-border-image-expected.png: Added.
* platform/mac/fast/borders/scaled-border-image-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105514 => 105515)


--- trunk/LayoutTests/ChangeLog	2012-01-20 15:33:21 UTC (rev 105514)
+++ trunk/LayoutTests/ChangeLog	2012-01-20 15:51:53 UTC (rev 105515)
@@ -1,3 +1,16 @@
+2012-01-20  Nikolas Zimmermann  <[email protected]>
+
+        REGRESSION (r98852): apple.com navigation bar is broken under full-page zoom
+        https://bugs.webkit.org/show_bug.cgi?id=76249
+
+        Reviewed by Andreas Kling.
+
+        Add new test covering zooming + border-image, which regressed.
+
+        * fast/borders/scaled-border-image.html: Added.
+        * platform/mac/fast/borders/scaled-border-image-expected.png: Added.
+        * platform/mac/fast/borders/scaled-border-image-expected.txt: Added.
+
 2012-01-20  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegion]Expose DOM interface for WebKitCSSRegionRule

Added: trunk/LayoutTests/fast/borders/scaled-border-image.html (0 => 105515)


--- trunk/LayoutTests/fast/borders/scaled-border-image.html	                        (rev 0)
+++ trunk/LayoutTests/fast/borders/scaled-border-image.html	2012-01-20 15:51:53 UTC (rev 105515)
@@ -0,0 +1,15 @@
+<style>
+    div {
+        border-width: 21px 30px 30px 21px;
+        width: 75px;
+        height: 75px;
+        margin: 10px;
+        border-image-source: url(resources/border-image.png);
+        border-image-slice: 21 30 30 21 fill;
+        border-image-width: 1;
+        border-image-repeat: repeat;
+    }
+</style>
+<div></div>
+This should look like the above, only scaled up by a factor of 2:
+<div style="zoom: 2;"></div>

Added: trunk/LayoutTests/platform/mac/fast/borders/scaled-border-image-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/borders/scaled-border-image-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/borders/scaled-border-image-expected.txt (0 => 105515)


--- trunk/LayoutTests/platform/mac/fast/borders/scaled-border-image-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/borders/scaled-border-image-expected.txt	2012-01-20 15:51:53 UTC (rev 105515)
@@ -0,0 +1,10 @@
+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,10) size 784x570
+      RenderBlock {DIV} at (10,0) size 126x126 [border: (21px none #000000) (30px none #000000) (21px none #000000)]
+      RenderBlock (anonymous) at (0,136) size 784x18
+        RenderText {#text} at (0,0) size 401x18
+          text run at (0,0) width 401: "This should look like the above, only scaled up by a factor of 2:"
+      RenderBlock {DIV} at (20,174) size 252x252 [border: (42px none #000000) (60px none #000000) (42px none #000000)]

Modified: trunk/Source/WebCore/ChangeLog (105514 => 105515)


--- trunk/Source/WebCore/ChangeLog	2012-01-20 15:33:21 UTC (rev 105514)
+++ trunk/Source/WebCore/ChangeLog	2012-01-20 15:51:53 UTC (rev 105515)
@@ -1,3 +1,18 @@
+2012-01-20  Nikolas Zimmermann  <[email protected]>
+
+        REGRESSION (r98852): apple.com navigation bar is broken under full-page zoom
+        https://bugs.webkit.org/show_bug.cgi?id=76249
+
+        Reviewed by Andreas Kling.
+
+        Fix regression with full-page zoom & border-image. paintNinePieceImage() expects local, unzoomed coordinates.
+        Restore the behaviour as it was before r98852, fixing the regression.
+
+        Test: fast/borders/scaled-border-image.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paintNinePieceImage):
+
 2012-01-20  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegion]Expose DOM interface for WebKitCSSRegionRule

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (105514 => 105515)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-01-20 15:33:21 UTC (rev 105514)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2012-01-20 15:51:53 UTC (rev 105515)
@@ -1123,11 +1123,10 @@
     IntSize imageSize = calculateImageIntrinsicDimensions(styleImage, borderImageRect.size());
 
     // If both values are ‘auto’ then the intrinsic width and/or height of the image should be used, if any.
-    IntSize containerSize = imageSize.isEmpty() ? borderImageRect.size() : imageSize;
-    styleImage->setContainerSizeForRenderer(this, containerSize, style->effectiveZoom());
+    styleImage->setContainerSizeForRenderer(this, imageSize, style->effectiveZoom());
 
-    int imageWidth = imageSize.width();
-    int imageHeight = imageSize.height();
+    int imageWidth = imageSize.width() / style->effectiveZoom();
+    int imageHeight = imageSize.height() / style->effectiveZoom();
 
     int topSlice = min<int>(imageHeight, ninePieceImage.imageSlices().top().calcValue(imageHeight));
     int rightSlice = min<int>(imageWidth, ninePieceImage.imageSlices().right().calcValue(imageWidth));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to