Log Message
iframes seem to occasionally doubly scale or scale incorrectly when pageScaleFactor != 1.0 https://bugs.webkit.org/show_bug.cgi?id=70552
Reviewed by Simon Fraser. Source/WebCore: Test: fast/frames/iframe-double-scale-contents.html The iframe's document style was using the page's scale factor, rather than the frame's (1.0). If the page scale factor was set after layout was complete, then this would have no impact because the iframe's document style and layout is not recomputed, but if the page scale factor is set prior to creating and laying out the iframe, the iframe's content would be doubly scaled. * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::styleForDocument): LayoutTests: * fast/frames/iframe-double-scale-contents-expected.png: Added. * fast/frames/iframe-double-scale-contents-expected.txt: Added. * fast/frames/iframe-double-scale-contents.html: Added. * fast/frames/resources/iframe-content-scaling-bug-iframe.html: Added.
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/css/CSSStyleSelector.cpp
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (98636 => 98637)
--- trunk/LayoutTests/ChangeLog 2011-10-27 21:04:32 UTC (rev 98636)
+++ trunk/LayoutTests/ChangeLog 2011-10-27 21:09:24 UTC (rev 98637)
@@ -1,3 +1,15 @@
+2011-10-27 Fady Samuel <fsam...@chromium.org>
+
+ iframes seem to occasionally doubly scale or scale incorrectly when pageScaleFactor != 1.0
+ https://bugs.webkit.org/show_bug.cgi?id=70552
+
+ Reviewed by Simon Fraser.
+
+ * fast/frames/iframe-double-scale-contents-expected.png: Added.
+ * fast/frames/iframe-double-scale-contents-expected.txt: Added.
+ * fast/frames/iframe-double-scale-contents.html: Added.
+ * fast/frames/resources/iframe-content-scaling-bug-iframe.html: Added.
+
2011-10-27 Mike Reed <r...@google.com>
test_rebaseline_expectations failing
Added: trunk/LayoutTests/fast/frames/iframe-double-scale-contents-expected.png (0 => 98637)
--- trunk/LayoutTests/fast/frames/iframe-double-scale-contents-expected.png (rev 0)
+++ trunk/LayoutTests/fast/frames/iframe-double-scale-contents-expected.png 2011-10-27 21:09:24 UTC (rev 98637)
@@ -0,0 +1,6 @@
+\x89PNG
+
+
+IHDR X ' )tEXtchecksum 8b7e44169b5fe17cc38d4e93486078c1|T\xB5
+\xB6IDATx\x9C\xED\xD8\xD1 \x800Ac\xE3\xDA\xF9\xB3\x89\x85@\x9C\xA9\xE0>\x97[\xD7{\xC0o\xCD3\xBB'p\xA0{\xF7 \x80\xD3, \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88\xAD\x99ٽ \xE0(, \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\x98\xC0 \x88 , \x80\xD8t\xE5
+\xA9\xA9\xC1T IEND\xAEB`\x82
\ No newline at end of file
Added: trunk/LayoutTests/fast/frames/iframe-double-scale-contents-expected.txt (0 => 98637)
--- trunk/LayoutTests/fast/frames/iframe-double-scale-contents-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/frames/iframe-double-scale-contents-expected.txt 2011-10-27 21:09:24 UTC (rev 98637)
@@ -0,0 +1,4 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/frames/iframe-double-scale-contents.html (0 => 98637)
--- trunk/LayoutTests/fast/frames/iframe-double-scale-contents.html (rev 0)
+++ trunk/LayoutTests/fast/frames/iframe-double-scale-contents.html 2011-10-27 21:09:24 UTC (rev 98637)
@@ -0,0 +1,46 @@
+<html>
+<head>
+ <style>
+ ::-webkit-scrollbar {
+ width: 0px;
+ height: 0px;
+ }
+ </style>
+ <script src=""
+ <script>
+ window.enablePixelTesting = true;
+
+ if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+ // Layout for the iframe will be scaled down to a quarter.
+ // It appears this bug will only manifest itself if layout for the
+ // iframe has not yet been computed. If we've already laid out
+ // the iframe, then CSSStyleSelector::styleForDocument does not appear
+ // to get called for the iframe.
+ scalePage(0.5);
+
+ function scalePage(scaleFactor) {
+ var scaleOffset = 0;
+ if (window.eventSender) {
+ eventSender.scalePageBy(scaleFactor, scaleOffset, scaleOffset);
+ }
+ }
+
+ function test() {
+ // Curiously, the document style for the iframe does not
+ // appear to be recalculated after this
+ scalePage(1.0);
+ document.body.offsetWidth;
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ </script>
+ <script src=""
+</head>
+<body _onload_="test();">
+ <iframe id="frame" src="" style="position: absolute; left: 0px; top: 0px; border: none; width: 300px; height: 300px;"></iframe>
+ <div id="rightbox" style="position: absolute; left: 300px; top: 0px; width: 300px; height: 300px; background-color: green;"></div>
+ <script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/frames/resources/iframe-content-scaling-bug-iframe.html (0 => 98637)
--- trunk/LayoutTests/fast/frames/resources/iframe-content-scaling-bug-iframe.html (rev 0)
+++ trunk/LayoutTests/fast/frames/resources/iframe-content-scaling-bug-iframe.html 2011-10-27 21:09:24 UTC (rev 98637)
@@ -0,0 +1,12 @@
+<html>
+<head>
+<style>
+body {
+margin: 0;
+}
+</style>
+</head>
+<body>
+<div style="position: absolute; left: 0px; top: 0px; width: 300px; height: 300px; background-color: green;"></div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (98636 => 98637)
--- trunk/Source/WebCore/ChangeLog 2011-10-27 21:04:32 UTC (rev 98636)
+++ trunk/Source/WebCore/ChangeLog 2011-10-27 21:09:24 UTC (rev 98637)
@@ -1,3 +1,19 @@
+2011-10-27 Fady Samuel <fsam...@chromium.org>
+
+ iframes seem to occasionally doubly scale or scale incorrectly when pageScaleFactor != 1.0
+ https://bugs.webkit.org/show_bug.cgi?id=70552
+
+ Reviewed by Simon Fraser.
+
+ Test: fast/frames/iframe-double-scale-contents.html
+
+ The iframe's document style was using the page's scale factor, rather than the frame's (1.0).
+ If the page scale factor was set after layout was complete, then this would have no impact because the iframe's document style and layout is not recomputed,
+ but if the page scale factor is set prior to creating and laying out the iframe, the iframe's content would be doubly scaled.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForDocument):
+
2011-10-27 Nat Duca <nd...@chromium.org>
Unreviewed, fix CCSchedulerStateMachine build errors.
Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (98636 => 98637)
--- trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-10-27 21:04:32 UTC (rev 98636)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp 2011-10-27 21:09:24 UTC (rev 98637)
@@ -1134,7 +1134,7 @@
documentStyle->setDisplay(BLOCK);
documentStyle->setRTLOrdering(document->visuallyOrdered() ? VisualOrder : LogicalOrder);
documentStyle->setZoom(frame ? frame->pageZoomFactor() : 1);
- documentStyle->setPageScaleTransform(document->page() ? document->page()->pageScaleFactor() : 1);
+ documentStyle->setPageScaleTransform(frame ? frame->frameScaleFactor() : 1);
documentStyle->setUserModify(document->inDesignMode() ? READ_WRITE : READ_ONLY);
Element* docElement = document->documentElement();
_______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes