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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98637
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-10-27 Fady Samuel <fsamuel@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 <reed@google.com>
test_rebaseline_expectations failing
--- /dev/null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<html>
+<head>
+ <style>
+ ::-webkit-scrollbar {
+ width: 0px;
+ height: 0px;
+ }
+ </style>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <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="../js/resources/js-test-pre.js"></script>
+</head>
+<body onload="test();">
+ <iframe id="frame" src="resources/iframe-content-scaling-bug-iframe.html" 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="../js/resources/js-test-post.js"></script>
+</body>
+</html>
--- /dev/null
+<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>
+2011-10-27 Fady Samuel <fsamuel@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 <nduca@chromium.org>
Unreviewed, fix CCSchedulerStateMachine build errors.
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();