Diff
Modified: trunk/LayoutTests/ChangeLog (104418 => 104419)
--- trunk/LayoutTests/ChangeLog 2012-01-09 00:27:04 UTC (rev 104418)
+++ trunk/LayoutTests/ChangeLog 2012-01-09 00:29:46 UTC (rev 104419)
@@ -1,3 +1,18 @@
+2012-01-08 David Levin <[email protected]>
+
+ [chromium] iframes in an autoresized window get sized incorrectly.
+ https://bugs.webkit.org/show_bug.cgi?id=75806
+
+ Reviewed by Adam Barth.
+
+ * fast/autoresize/autoresize-with-iframe-expected.txt: Added.
+ * fast/autoresize/autoresize-with-iframe.html: Added.
+ * fast/autoresize/basic.html: Pulled out autoresize-util.js
+ * fast/autoresize/resources/autoresize-util.js: Added.
+ (log):
+ (shouldBe):
+ * fast/autoresize/resources/iframe.html: Added.
+
2012-01-08 Benjamin Poulain <[email protected]>
Valid canonical URLs should have a lowercase hostname
Added: trunk/LayoutTests/fast/autoresize/autoresize-with-iframe-expected.txt (0 => 104419)
--- trunk/LayoutTests/fast/autoresize/autoresize-with-iframe-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/autoresize/autoresize-with-iframe-expected.txt 2012-01-09 00:29:46 UTC (rev 104419)
@@ -0,0 +1,10 @@
+
+
+--------
+Frame: 'frame'
+--------
+This test only works in DumpRenderTree since it relies on setting up autoresize from _javascript_. It verifies that iframes are sized correctly when the main window is autoresized. On success, you should see a series of PASS messages followed by a DONE.
+PASS: document.body.scrollWidth equaled 400
+PASS: document.body.scrollHeight equaled 200
+DONE
+
Added: trunk/LayoutTests/fast/autoresize/autoresize-with-iframe.html (0 => 104419)
--- trunk/LayoutTests/fast/autoresize/autoresize-with-iframe.html (rev 0)
+++ trunk/LayoutTests/fast/autoresize/autoresize-with-iframe.html 2012-01-09 00:29:46 UTC (rev 104419)
@@ -0,0 +1,25 @@
+<!doctype html>
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.enableAutoResizeMode(10, 10, 1000, 1000);
+ layoutTestController.dumpAsText();
+ layoutTestController.dumpChildFramesAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function run()
+{
+ var frameWindow = document.getElementById("frame").contentWindow;
+ frameWindow.postMessage("shouldBe('document.body.scrollWidth', 400)", "*");
+ frameWindow.postMessage("shouldBe('document.body.scrollHeight', 200)", "*");
+ frameWindow.postMessage("log('DONE'); if (window.layoutTestController) layoutTestController.notifyDone();", "*");
+}
+</script>
+</head>
+<body _onload_="run()" style="width:400px; height:200px; background-color:yellow;">
+<iframe id="frame" style="width:100%; height:100%;" src=""
+</iframe>
+</body>
+</html>
Modified: trunk/LayoutTests/fast/autoresize/basic.html (104418 => 104419)
--- trunk/LayoutTests/fast/autoresize/basic.html 2012-01-09 00:27:04 UTC (rev 104418)
+++ trunk/LayoutTests/fast/autoresize/basic.html 2012-01-09 00:29:46 UTC (rev 104419)
@@ -1,21 +1,7 @@
<!doctype html>
<html>
+<script src=''></script>
<script>
-function log(message)
-{
- document.getElementById("result").innerHTML += message + "<br>";
-}
-
-function shouldBe(a, b)
-{
- aValue = eval(a);
- bValue = eval(b);
- if (aValue == bValue)
- log('PASS: ' + a + ' equaled ' + b);
- else
- log('FAILED: ' + a + '(' + aValue + ') did not equal ' + b + '(' + bValue + ')');
-}
-
function runTest()
{
if (window.layoutTestController) {
Added: trunk/LayoutTests/fast/autoresize/resources/autoresize-util.js (0 => 104419)
--- trunk/LayoutTests/fast/autoresize/resources/autoresize-util.js (rev 0)
+++ trunk/LayoutTests/fast/autoresize/resources/autoresize-util.js 2012-01-09 00:29:46 UTC (rev 104419)
@@ -0,0 +1,14 @@
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function shouldBe(a, b)
+{
+ aValue = eval(a);
+ bValue = eval(b);
+ if (aValue == bValue)
+ log('PASS: ' + a + ' equaled ' + b);
+ else
+ log('FAILED: ' + a + '(' + aValue + ') did not equal ' + b + '(' + bValue + ')');
+}
Added: trunk/LayoutTests/fast/autoresize/resources/iframe.html (0 => 104419)
--- trunk/LayoutTests/fast/autoresize/resources/iframe.html (rev 0)
+++ trunk/LayoutTests/fast/autoresize/resources/iframe.html 2012-01-09 00:29:46 UTC (rev 104419)
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+<body style="background-color:green;">
+This test only works in DumpRenderTree since it relies on setting up autoresize from _javascript_. It verifies that iframes are sized correctly when the main window is autoresized. On success, you should see a series of PASS messages followed by a DONE.
+<div id='result'>
+</div>
+<script src=''></script>
+<script>
+window._onmessage_ = function (evt)
+{
+ eval(evt.data);
+}
+</script>
+</body>
+</html>
Modified: trunk/Source/WebKit/chromium/ChangeLog (104418 => 104419)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-01-09 00:27:04 UTC (rev 104418)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-01-09 00:29:46 UTC (rev 104419)
@@ -1,3 +1,16 @@
+2012-01-08 David Levin <[email protected]>
+
+ [chromium] iframes in an autoresized window get sized incorrectly.
+ https://bugs.webkit.org/show_bug.cgi?id=75806
+
+ Reviewed by Adam Barth.
+
+ TEST: fast/autoresize/autoresize-with-iframe.html
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::createFrameView): Only do autoresizing
+ for the main frame not child frames.
+
2012-01-08 Adam Barth <[email protected]>
[Chromium] Remove use_skia option from GYP
Modified: trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp (104418 => 104419)
--- trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2012-01-09 00:27:04 UTC (rev 104418)
+++ trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp 2012-01-09 00:29:46 UTC (rev 104419)
@@ -2093,7 +2093,7 @@
WebViewImpl* webView = viewImpl();
bool isMainFrame = webView->mainFrameImpl()->frame() == m_frame;
m_frame->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0);
- if (webView->shouldAutoResize())
+ if (webView->shouldAutoResize() && isMainFrame)
m_frame->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize());
#if ENABLE(GESTURE_RECOGNIZER)