[Chromium] REGRESSION (r95725): Resizing a window doesn't resize the contents
authormihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Sep 2011 03:12:33 +0000 (03:12 +0000)
committermihaip@chromium.org <mihaip@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Sep 2011 03:12:33 +0000 (03:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68730

Reviewed by James Robinson.

Source/WebCore:

Adds a missing contentsResized() call in ScrollView::setFrameRect.

Test: fast/dom/Window/window-resize-contents.html

* platform/ScrollView.cpp:
(WebCore::ScrollView::setFrameRect):

LayoutTests:

Test for resizing of the window triggering resizing of contents.

* fast/dom/Window/window-resize-contents-expected.txt: Added.
* fast/dom/Window/window-resize-contents.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/dom/Window/window-resize-contents-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Window/window-resize-contents.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/ScrollView.cpp

index c73572c..787d2c9 100644 (file)
@@ -1,5 +1,17 @@
 2011-09-23  Mihai Parparita  <mihaip@chromium.org>
 
+        [Chromium] REGRESSION (r95725): Resizing a window doesn't resize the contents
+        https://bugs.webkit.org/show_bug.cgi?id=68730
+
+        Reviewed by James Robinson.
+
+        Test for resizing of the window triggering resizing of contents.
+
+        * fast/dom/Window/window-resize-contents-expected.txt: Added.
+        * fast/dom/Window/window-resize-contents.html: Added.
+
+2011-09-23  Mihai Parparita  <mihaip@chromium.org>
+
         Rebaseline fast/ruby/ruby-text-before-after-content.html for Chromium Mac.
         
         Mark media/controls-right-click-on-timebar.html as flaky.
diff --git a/LayoutTests/fast/dom/Window/window-resize-contents-expected.txt b/LayoutTests/fast/dom/Window/window-resize-contents-expected.txt
new file mode 100644 (file)
index 0000000..2db0893
--- /dev/null
@@ -0,0 +1,6 @@
+CONSOLE MESSAGE: line 18: Initial reference node dimensions 800 x 600
+CONSOLE MESSAGE: line 20: Increasing window size by 10 x 10
+CONSOLE MESSAGE: line 22: Post-resize reference node dimensions 810 x 610
+This test checks that the yellow reference DOM node (which should be as big as the window) gets resized when the window is resized.
+
+To avoid relayouts and repaints caused by DOM-based logging, it doesn't output anything. Please check the console for confirmation that the node dimensions increase by 10x10.
diff --git a/LayoutTests/fast/dom/Window/window-resize-contents.html b/LayoutTests/fast/dom/Window/window-resize-contents.html
new file mode 100644 (file)
index 0000000..b25fe84
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="reference" style="position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: yellow; z-index: 1"></div>
+
+<div style="position: absolute; z-index: 2">
+    <p>This test checks that the yellow reference DOM node (which should be as
+    big as the window) gets resized when the window is resized.</p>
+    
+    <p>To avoid relayouts and repaints caused by DOM-based logging, it doesn't
+    output anything. Please check the console for confirmation that the node
+    dimensions increase by 10x10.</p>
+</div>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+    var referenceNode = document.getElementById('reference');
+    console.log('Initial reference node dimensions ' +
+        referenceNode.offsetWidth + ' x ' + referenceNode.offsetHeight);
+    console.log('Increasing window size by 10 x 10');
+    window.resizeBy(10, 10);
+    console.log('Post-resize reference node dimensions ' +
+        referenceNode.offsetWidth + ' x ' + referenceNode.offsetHeight);
+</script>
+
+</body>
+</html>
index 1e0a31f..6273a39 100644 (file)
@@ -1,3 +1,17 @@
+2011-09-23  Mihai Parparita  <mihaip@chromium.org>
+
+        [Chromium] REGRESSION (r95725): Resizing a window doesn't resize the contents
+        https://bugs.webkit.org/show_bug.cgi?id=68730
+
+        Reviewed by James Robinson.
+
+        Adds a missing contentsResized() call in ScrollView::setFrameRect.
+
+        Test: fast/dom/Window/window-resize-contents.html
+
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::setFrameRect):
+
 2011-09-23  Adam Klein  <adamk@chromium.org>
 
         Add ENABLE_MUTATION_OBSERVERS feature flag
index e479e16..514b52a 100644 (file)
@@ -827,6 +827,9 @@ void ScrollView::setFrameRect(const IntRect& newRect)
     frameRectsChanged();
 
     updateScrollbars(scrollOffset());
+    
+    if (!m_useFixedLayout)
+        contentsResized();
 }
 
 void ScrollView::frameRectsChanged()