Round image sizes when zooming
authoreae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2012 22:07:59 +0000 (22:07 +0000)
committereae@chromium.org <eae@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2012 22:07:59 +0000 (22:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98205

Reviewed by Eric Seidel.

Source/WebCore:

We currently floor image sizes when zooming which can result in
images being rendered at one pixel less than the actual size.
This is especially likely to happen for very large images.

Test: fast/sub-pixel/zoomed-image-tiles.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::imageSizeForRenderer):

LayoutTests:

Add test for zoomed large image tiles.

* fast/images/zoomed-img-size.html:
* fast/sub-pixel/zoomed-image-tiles-expected.html: Added.
* fast/sub-pixel/zoomed-image-tiles.html: Added.
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
* platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
* platform/chromium/fast/images/zoomed-img-size-expected.txt: Added.
* platform/gtk/TestExpectations:
* platform/mac-lion/TestExpectations:
* platform/mac-snowleopard/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt-4.8/TestExpectations:
* platform/qt/TestExpectations:
* platform/win-wk2/TestExpectations:
* platform/win-xp/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:
* platform/wk2/TestExpectations:

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

23 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/images/zoomed-img-size.html
LayoutTests/fast/sub-pixel/zoomed-image-tiles-expected.html [new file with mode: 0644]
LayoutTests/fast/sub-pixel/zoomed-image-tiles.html [new file with mode: 0644]
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png
LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt
LayoutTests/platform/chromium/fast/images/zoomed-img-size-expected.txt [new file with mode: 0644]
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac-lion/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/qt-4.8/TestExpectations
LayoutTests/platform/qt/TestExpectations
LayoutTests/platform/win-wk2/TestExpectations
LayoutTests/platform/win-xp/TestExpectations
LayoutTests/platform/win/TestExpectations
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/loader/cache/CachedImage.cpp

index 0a7ec10..b1e21aa 100644 (file)
@@ -1,3 +1,35 @@
+2012-10-03  Emil A Eklund  <eae@chromium.org>
+
+        Round image sizes when zooming
+        https://bugs.webkit.org/show_bug.cgi?id=98205
+
+        Reviewed by Eric Seidel.
+
+        Add test for zoomed large image tiles.
+
+        * fast/images/zoomed-img-size.html:
+        * fast/sub-pixel/zoomed-image-tiles-expected.html: Added.
+        * fast/sub-pixel/zoomed-image-tiles.html: Added.
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.txt:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.txt:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png:
+        * platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.txt:
+        * platform/chromium/fast/images/zoomed-img-size-expected.txt: Added.
+        * platform/gtk/TestExpectations:
+        * platform/mac-lion/TestExpectations:
+        * platform/mac-snowleopard/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/qt-4.8/TestExpectations:
+        * platform/qt/TestExpectations:
+        * platform/win-wk2/TestExpectations:
+        * platform/win-xp/TestExpectations:
+        * platform/win/TestExpectations:
+        * platform/wincairo/TestExpectations:
+        * platform/wk2/TestExpectations:
+
 2012-10-03  Raphael Kubo da Costa  <raphael.kubo.da.costa@intel.com>
 
         [EFL] Pixel test rebaselines to enable pixel testing on the bots, part 5.
index a4338d0..16e3288 100644 (file)
@@ -6,9 +6,19 @@
         testRunner.dumpAsText();
 
       function update() {
+        var el = document.getElementById('subpixel-test');
+        var hasSubpixelSupport = el.getBoundingClientRect().width == 4.5;
+        el.parentNode.removeChild(el);
+    
         // These arrays will become unnecessary if we fix the rounding issues that make us not always report "37x33".
-        var expectedWidths = [100, 50, 33, 25, 20, 36, 36, 36, 35, 37, 37, 37, 37, 37, 37];
-        var expectedHeights = [100, 50, 33, 25, 20, 30, 30, 32, 32, 33, 33, 33, 33, 33, 33];
+        var expectedWidths, expectedHeights;
+        if (hasSubpixelSupport) {
+            expectedWidths = [100, 50, 33, 25, 40, 36, 36, 38, 37, 37, 37, 38, 37, 37, 37];
+            expectedHeights = [100, 50, 33, 25, 40, 33, 33, 34, 32, 33, 34, 34, 33, 33, 33];
+        } else {
+            expectedWidths = [100, 50, 33, 25, 20, 36, 36, 36, 35, 37, 37, 37, 37, 37, 37];
+            expectedHeights = [100, 50, 33, 25, 20, 30, 30, 32, 32, 33, 33, 33, 33, 33, 33];
+        }
         for (i = 0; i < 15; ++i) {
           var oval = document.getElementById('oval' + i);
           var status = document.getElementById('status' + i);
@@ -59,5 +69,6 @@
     <p>Zoom 400% <span id="status13"></span>: <span id="sizes13"></span></p>
     <img id="oval14" src="resources/oval.png" style="zoom: 1234%">
     <p>Zoom 1234% <span id="status14"></span>: <span id="sizes14"></span></p>
+    <div id="subpixel-test" style="width: 4.5px; height: 10px;"></div>
   </body>
 </html>
diff --git a/LayoutTests/fast/sub-pixel/zoomed-image-tiles-expected.html b/LayoutTests/fast/sub-pixel/zoomed-image-tiles-expected.html
new file mode 100644 (file)
index 0000000..929738e
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body style="zoom: 1.1">
+    <div style="z-index: 1; overflow: hidden; width: 740px; height: 100px; position: relative;">
+        <div style="width: 165888px; height: 100px; position: absolute; z-index: -1; left: -69267px; top: 0px;">
+            <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC" style="opacity: 0.75; background: blue; left: 67584px; z-index: -1; position: absolute; width: 4096px; height: 100px;">
+        </div>
+    </div>
+</body>
+</html>
diff --git a/LayoutTests/fast/sub-pixel/zoomed-image-tiles.html b/LayoutTests/fast/sub-pixel/zoomed-image-tiles.html
new file mode 100644 (file)
index 0000000..dfa3465
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body style="zoom: 1.1">
+    <div style="z-index: 1; overflow: hidden; width: 740px; height: 100px; position: relative;">
+        <div style="width: 165888px; height: 100px; position: absolute; z-index: -1; left: -69267px; top: 0px;">
+            <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC" style="opacity: 0.75; background: blue; left: 67584px; z-index: -1; position: absolute; width: 2048px; height: 100px;">
+            <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVR42mP4%2F58BAAT%2FAf9jgNErAAAAAElFTkSuQmCC" style="opacity: 0.75; background: blue; left: 69632px; z-index: -1; position: absolute; width: 2048px; height: 100px;">
+        </div>
+    </div>
+</body>
+</html>
index 7fdb180..497052f 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png and b/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-2-expected.png differ
index e304f39..2fe913e 100644 (file)
@@ -15,15 +15,15 @@ layer at (0,0) size 800x198
                         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 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"
+                    RenderTableCell {td} at (1,67) size 242x24 [r=1 c=0 rs=1 cs=1]
+                      RenderText {#text} at (96,5) size 50x14
+                        text run at (96,5) width 50: "SVG Image"
+                    RenderTableCell {td} at (244,67) size 245x24 [r=1 c=1 rs=1 cs=1]
+                      RenderText {#text} at (96,5) size 53x14
+                        text run at (96,5) width 53: "PNG Image"
                   RenderTableRow {tr} at (0,92) size 490x82
-                    RenderTableCell {td} at (1,92) size 243x82 [r=2 c=0 rs=1 cs=1]
-                      RenderEmbeddedObject {object} at (100,5) size 138x69
+                    RenderTableCell {td} at (1,92) size 242x82 [r=2 c=0 rs=1 cs=1]
+                      RenderEmbeddedObject {object} at (99,5) size 138x69
                         layer at (0,0) size 139x69
                           RenderView at (0,0) size 138x69
                         layer at (0,0) size 139x69
@@ -42,6 +42,6 @@ layer at (0,0) size 800x198
                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 269.59: "$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 (245,92) size 244x82 [r=2 c=1 rs=1 cs=1]
-                      RenderImage {img} at (5,5) size 138x69
+                    RenderTableCell {td} at (244,92) size 245x82 [r=2 c=1 rs=1 cs=1]
+                      RenderImage {img} at (5,5) size 139x69
                       RenderText {#text} at (0,0) size 0x0
index 7c78a7f..2a0b955 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png and b/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-absolute-size-expected.png differ
index b742467..e19b103 100644 (file)
@@ -15,15 +15,15 @@ layer at (0,0) size 800x198
                         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 @@ layer at (0,0) size 800x198
                                 chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 269.59: "$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]
-                      RenderImage {img} at (5,5) size 138x69
+                    RenderTableCell {td} at (245,92) size 244x82 [r=2 c=1 rs=1 cs=1]
+                      RenderImage {img} at (5,5) size 139x69
                       RenderText {#text} at (0,0) size 0x0
index 6119211..d41df65 100644 (file)
Binary files a/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png and b/LayoutTests/platform/chromium-linux/svg/zoom/page/zoom-svg-through-object-with-percentage-size-expected.png differ
index cd89a6d..f8195ae 100644 (file)
@@ -1,14 +1,14 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-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
+layer at (0,0) size 800x379
+  RenderBlock {html} at (0,0) size 800x380
+    RenderBody {body} at (5,5) size 790x369
+      RenderTable {table} at (41,0) size 706x368
+        RenderTableSection (anonymous) at (0,0) size 705x368
+          RenderTableRow {tr} at (0,0) size 705x368
+            RenderTableCell {td} at (0,0) size 705x368 [r=0 c=0 rs=1 cs=3]
+              RenderTable {table} at (7,6) size 693x356
+                RenderTableSection (anonymous) at (0,0) size 692x356
                   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
@@ -21,7 +21,7 @@ layer at (0,0) size 800x378
                     RenderTableCell {td} at (347,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
+                  RenderTableRow {tr} at (0,92) size 692x263
                     RenderTableCell {td} at (1,92) size 345x262 [r=2 c=0 rs=1 cs=1]
                       RenderEmbeddedObject {object} at (6,4) size 334x250
                         layer at (0,0) size 333x250
@@ -42,6 +42,6 @@ layer at (0,0) size 800x378
                                 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]
-                      RenderImage {img} at (5,5) size 333x249
+                    RenderTableCell {td} at (347,92) size 344x263 [r=2 c=1 rs=1 cs=1]
+                      RenderImage {img} at (5,5) size 333x250
                       RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/chromium/fast/images/zoomed-img-size-expected.txt b/LayoutTests/platform/chromium/fast/images/zoomed-img-size-expected.txt
new file mode 100644 (file)
index 0000000..bf1be48
--- /dev/null
@@ -0,0 +1,46 @@
+Ideally, all ovals below should be reported as having width=37, height=33. Currently rounding prevents us from doing this.
+
+
+Zoom 1% PASS: 100x100 close enough to 37x33
+
+
+Zoom 2% PASS: 50x50 close enough to 37x33
+
+
+Zoom 3% PASS: 33x33 close enough to 37x33
+
+
+Zoom 4% PASS: 25x25 close enough to 37x33
+
+
+Zoom 5% PASS: 40x40 close enough to 37x33
+
+
+Zoom 30% PASS: 36x33 close enough to 37x33
+
+
+Zoom 33% PASS: 36x33 close enough to 37x33
+
+
+Zoom 50% PASS: 38x34 close enough to 37x33
+
+
+Zoom 70% PASS: 37x32 close enough to 37x33
+
+
+Zoom 100% PASS: 37x33
+
+
+Zoom 111% PASS: 37x34 close enough to 37x33
+
+
+Zoom 150% PASS: 38x34 close enough to 37x33
+
+
+Zoom 333% PASS: 37x33
+
+
+Zoom 400% PASS: 37x33
+
+
+Zoom 1234% PASS: 37x33
index c5974bf..af5f096 100644 (file)
@@ -384,6 +384,7 @@ webkit.org/b/85532 fast/sub-pixel/table-rows-have-stable-height.html [ Skip ]
 webkit.org/b/85532 fast/sub-pixel/table-rows-no-gaps.html [ Pass ]
 webkit.org/b/85532 fast/sub-pixel/vertical-align-middle-overflow.html [ Pass ]
 webkit.org/b/85532 fast/sub-pixel/sub-pixel-accumulates-to-layers.html [ Pass ]
+webkit.org/b/85532 fast/sub-pixel/zoomed-image-tiles.html [ Skip ]
 
 # Mediastream implementation is not complete yet.
 webkit.org/b/79203 fast/mediastream [ Skip ]
index ca54221..b889b77 100644 (file)
@@ -120,6 +120,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # This media test always failed on Lion
 # https://bugs.webkit.org/show_bug.cgi?id=86527 and <rdar://problem/11458493>
index 407b461..0421ce2 100644 (file)
@@ -192,6 +192,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # fast/events/pagehide-timeout.html, pageshow-pagehide-on-back-cached-with-frames.html, and
 # pageshow-pagehide-on-back-cached.html flakey on Lion Intel Debug WebKit testers.
index afc9a26..e324e8b 100644 (file)
@@ -700,6 +700,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # No CORS support for media elements is implemented yet.
 http/tests/security/video-cross-origin-readback.html
index bacdd8a..7814347 100644 (file)
@@ -115,6 +115,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # SVG Fonts are only supported when using QRawFont, which is not
 # supported with Qt 4.
index a6e306c..0452861 100644 (file)
@@ -323,6 +323,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # USE(V8)
 
index efb3b07..710db84 100644 (file)
@@ -954,6 +954,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # HiDPI tests require test infrastructure enhancements
 fast/hidpi
index 9c85216..d1789dc 100644 (file)
@@ -53,6 +53,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # REGRESSION (r83928 or before): Some tests failing assertions in MarkStack::internalAppend / MarkStack::drain
 # https://bugs.webkit.org/show_bug.cgi?id=58657
index 6840a3c..6774893 100644 (file)
@@ -1754,6 +1754,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # No CORS support for media elements is implemented yet.
 http/tests/security/video-cross-origin-readback.html
index 06df3e9..93afd66 100644 (file)
@@ -106,6 +106,7 @@ fast/sub-pixel/table-rows-no-gaps.html
 fast/sub-pixel/sub-pixel-accumulates-to-layers.html
 fast/sub-pixel/selection/selection-rect-in-sub-pixel-table.html
 fast/sub-pixel/snap-negative-location.html
+fast/sub-pixel/zoomed-image-tiles.html
 
 # [WK2][WTR] svg/animations/animate-text-nested-transforms.html fails
 # https://bugs.webkit.org/show_bug.cgi?id=95191
index 5b006be..5384fae 100644 (file)
@@ -1,3 +1,19 @@
+2012-10-03  Emil A Eklund  <eae@chromium.org>
+
+        Round image sizes when zooming
+        https://bugs.webkit.org/show_bug.cgi?id=98205
+
+        Reviewed by Eric Seidel.
+
+        We currently floor image sizes when zooming which can result in
+        images being rendered at one pixel less than the actual size.
+        This is especially likely to happen for very large images.
+
+        Test: fast/sub-pixel/zoomed-image-tiles.html
+
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::imageSizeForRenderer):
+
 2012-10-03  Hugo Parente Lima  <hugo.lima@openbossa.org>
 
         [WK2] PageViewportController.cpp is supposed to be a generic WebKit2 file but only works with Qt port.
index 41075a7..bee9695 100644 (file)
@@ -263,7 +263,12 @@ IntSize CachedImage::imageSizeForRenderer(const RenderObject* renderer, float mu
     float widthScale = m_image->hasRelativeWidth() ? 1.0f : multiplier;
     float heightScale = m_image->hasRelativeHeight() ? 1.0f : multiplier;
     IntSize minimumSize(imageSize.width() > 0 ? 1 : 0, imageSize.height() > 0 ? 1 : 0);
+#if ENABLE(SUBPIXEL_LAYOUT)
+    imageSize.setWidth(lroundf(imageSize.width() * widthScale));
+    imageSize.setHeight(lroundf(imageSize.height() * heightScale));
+#else
     imageSize.scale(widthScale, heightScale);
+#endif
     imageSize.clampToMinimumSize(minimumSize);
     return imageSize;
 }