Title: [106232] trunk
Revision
106232
Author
[email protected]
Date
2012-01-30 04:36:41 -0800 (Mon, 30 Jan 2012)

Log Message

.: Manual test of number of resize events emitted during page generation.
https://bugs.webkit.org/show_bug.cgi?id=77212

Is needed to test if too many resize events are send when using fixed
layout, and needs to be a manual test because the test framework does
not currently support testing fixed layout.

Patch by Allan Sandfeld Jensen <[email protected]> on 2012-01-30
Reviewed by Kenneth Rohde Christiansen.

* ManualTests/resize-events.html: Added.

Source/WebCore: Only send resize events when layout size changes.
https://bugs.webkit.org/show_bug.cgi?id=77212

When using fixed layout the widget size is the size of content, therefore
resize checks must check against layoutsize and not widget size.

Patch by Allan Sandfeld Jensen <[email protected]> on 2012-01-30
Reviewed by Kenneth Rohde Christiansen.

Needs to be manual tests because the test framework does not currently
support testing fixed layout.

Tests: ManualTests/resize-events.html

* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::performPostLayoutTasks):

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (106231 => 106232)


--- trunk/ChangeLog	2012-01-30 12:10:14 UTC (rev 106231)
+++ trunk/ChangeLog	2012-01-30 12:36:41 UTC (rev 106232)
@@ -1,3 +1,16 @@
+2012-01-30  Allan Sandfeld Jensen  <[email protected]>
+
+        Manual test of number of resize events emitted during page generation.
+        https://bugs.webkit.org/show_bug.cgi?id=77212
+
+        Is needed to test if too many resize events are send when using fixed
+        layout, and needs to be a manual test because the test framework does
+        not currently support testing fixed layout.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * ManualTests/resize-events.html: Added.
+
 2012-01-29  Zoltan Herczeg  <[email protected]>
 
         Custom written CSS lexer

Added: trunk/ManualTests/resize-events.html (0 => 106232)


--- trunk/ManualTests/resize-events.html	                        (rev 0)
+++ trunk/ManualTests/resize-events.html	2012-01-30 12:36:41 UTC (rev 106232)
@@ -0,0 +1,48 @@
+<html>
+<head>
+    <style>
+        div.block { height: 100px; border: 1px solid black; margin:10px; }
+    </style>
+    <script>
+        var resizecount = 0;
+        var loaded = false;
+        window._onresize_ = function() {
+            resizecount++;
+            document.getElementById('count1').innerHTML = resizecount;
+        }
+    </script>
+</head>
+<body>
+    <div>
+        Test how many resize events are emitted during page load and dynamic content generation.
+
+        Do not resize the page. It invalidates the test.
+        <p style="text-indent: 10px" id=result1>
+        Resize events (should be 0 or 1): <span id=count1>0</span>
+    </div>
+    <div id=expandingblock>
+    </div>
+    <script>
+        var blockcount = 0;
+        function addBlock() {
+            var el = document.createElement('div');
+            el.setAttribute('class','block');
+            document.getElementById('expandingblock').appendChild(el);
+            if (++blockcount < 30)
+                setTimeout(addBlock, 20);
+            else
+                finish();
+        }
+        function finish() {
+            var result;
+            // 0 or 1 resize events are acceptable.
+            if (resizecount < 2)
+                result = '<p style="color: green">PASS';
+            else
+                result = '<p style="color: red">FAIL';
+            var resultElement = document.getElementById('result1')
+            resultElement.innerHTML += result;
+        }
+        _onload_ = addBlock;
+    </script>
+</body>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (106231 => 106232)


--- trunk/Source/WebCore/ChangeLog	2012-01-30 12:10:14 UTC (rev 106231)
+++ trunk/Source/WebCore/ChangeLog	2012-01-30 12:36:41 UTC (rev 106232)
@@ -1,3 +1,22 @@
+2012-01-30  Allan Sandfeld Jensen  <[email protected]>
+
+        Only send resize events when layout size changes.
+        https://bugs.webkit.org/show_bug.cgi?id=77212
+
+        When using fixed layout the widget size is the size of content, therefore
+        resize checks must check against layoutsize and not widget size.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Needs to be manual tests because the test framework does not currently
+        support testing fixed layout.
+
+        Tests: ManualTests/resize-events.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::performPostLayoutTasks):
+
 2012-01-30  Pavel Feldman  <[email protected]>
 
         Web Inspector: TimelinePanel does not respect InspectorFrontendHost.canSaveAs

Modified: trunk/Source/WebCore/page/FrameView.cpp (106231 => 106232)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-01-30 12:10:14 UTC (rev 106231)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-01-30 12:36:41 UTC (rev 106232)
@@ -1059,7 +1059,7 @@
 
                     m_firstLayout = false;
                     m_firstLayoutCallbackPending = true;
-                    m_lastLayoutSize = LayoutSize(width(), height());
+                    m_lastLayoutSize = LayoutSize(layoutWidth(), layoutHeight());
                     m_lastZoomFactor = root->style()->zoom();
 
                     // Set the initial vMode to AlwaysOn if we're auto.
@@ -2308,7 +2308,7 @@
     m_actionScheduler->resume();
 
     if (!root->printing()) {
-        LayoutSize currentSize = LayoutSize(width(), height());
+        LayoutSize currentSize = LayoutSize(layoutWidth(), layoutHeight());
         float currentZoomFactor = root->style()->zoom();
         bool resized = !m_firstLayout && (currentSize != m_lastLayoutSize || currentZoomFactor != m_lastZoomFactor);
         m_lastLayoutSize = currentSize;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to