Title: [111965] releases/WebKitGTK/webkit-1.8

Diff

Modified: releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog (111964 => 111965)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-03-24 01:38:25 UTC (rev 111964)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/ChangeLog	2012-03-24 01:39:18 UTC (rev 111965)
@@ -1,3 +1,16 @@
+2012-03-23  Allan Sandfeld Jensen  <[email protected]>
+
+        REGRESSION(r106232): The resize handler is always called after loading.
+        https://bugs.webkit.org/show_bug.cgi?id=80242
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Tests that no resize events are emitted during page creation,
+        even if the page overflows and adds a scrollbar.
+
+        * fast/events/resize-events-expected.txt: Added.
+        * fast/events/resize-events.html: Added.
+
 2012-03-23  Adam Klein  <[email protected]>
 
         REGRESSION(r103452): 100% CPU usage and 5s pause after clicking on a link in Yahoo Mail

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events-expected.txt (0 => 111965)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events-expected.txt	2012-03-24 01:39:18 UTC (rev 111965)
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x582
+      RenderBlock {DIV} at (0,0) size 784x79
+        RenderBlock (anonymous) at (0,0) size 784x42
+          RenderText {#text} at (0,0) size 772x42
+            text run at (0,0) width 652: "Test how many resize events are emitted during page load and dynamic content generation. "
+            text run at (652,0) width 120: "Do not resize the"
+            text run at (0,21) width 192: "page. It invalidates the test."
+        RenderBlock {P} at (0,58) size 784x21
+          RenderText {#text} at (10,0) size 206x21
+            text run at (10,0) width 206: "Resize events (should be 0): "
+          RenderInline {SPAN} at (0,0) size 9x21
+            RenderText {#text} at (216,0) size 9x21
+              text run at (216,0) width 9: "0"
+          RenderText {#text} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,95) size 784x402
+        RenderBlock {DIV} at (10,0) size 764x402 [border: (1px solid #000000)]
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events.html (0 => 111965)


--- releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events.html	2012-03-24 01:39:18 UTC (rev 111965)
@@ -0,0 +1,54 @@
+<html>
+<head>
+    <style>
+        div.block { height: 400px; 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): <span id=count1>0</span>
+    </div>
+    <div id=expandingblock>
+    </div>
+    <script>
+        if (window.layoutTestController) {
+            layoutTestController.waitUntilDone();
+        }
+
+        var blockcount = 0;
+        function addBlock() {
+            var el = document.createElement('div');
+            el.setAttribute('class','block');
+            document.getElementById('expandingblock').appendChild(el);
+            if (++blockcount < 10)
+                setTimeout(addBlock, 20);
+            else
+                finish();
+        }
+        function finish() {
+            var result;
+            // No resize events are acceptable.
+            if (resizecount < 1)
+                result = '<p style="color: green">PASS';
+            else
+                result = '<p style="color: red">FAIL';
+            var resultElement = document.getElementById('result1')
+            resultElement.innerHTML += result;
+            if (window.layoutTestController)
+                layoutTestController.notifyDone();
+        }
+        _onload_ = addBlock;
+    </script>
+</body>
\ No newline at end of file
Property changes on: releases/WebKitGTK/webkit-1.8/LayoutTests/fast/events/resize-events.html
___________________________________________________________________

Added: svn:eol-style

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog (111964 => 111965)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-03-24 01:38:25 UTC (rev 111964)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/ChangeLog	2012-03-24 01:39:18 UTC (rev 111965)
@@ -1,3 +1,24 @@
+2012-03-23  Allan Sandfeld Jensen  <[email protected]>
+
+        REGRESSION(r106232): The resize handler is always called after loading.
+        https://bugs.webkit.org/show_bug.cgi?id=80242
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Ensure resize-events are not emitted when layout-size changes due to added
+        scrollbars. For fixed layout, scrollbars are never subtracted or added, so
+        we can compare fixedLayoutSize directly. For normal layout, use the full
+        visible rect size which is the same as layout size plus scrollbars.
+
+        Test: fast/events/resize-events.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::reset):
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::performPostLayoutTasks):
+        * page/FrameView.h:
+        (FrameView):
+
 2012-03-23  Adam Klein  <[email protected]>
 
         REGRESSION(r103452): 100% CPU usage and 5s pause after clicking on a link in Yahoo Mail

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/page/FrameView.cpp (111964 => 111965)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/page/FrameView.cpp	2012-03-24 01:38:25 UTC (rev 111964)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/page/FrameView.cpp	2012-03-24 01:39:18 UTC (rev 111965)
@@ -225,7 +225,7 @@
     m_firstLayout = true;
     m_firstLayoutCallbackPending = false;
     m_wasScrolledByUser = false;
-    m_lastLayoutSize = LayoutSize();
+    m_lastViewportSize = IntSize();
     m_lastZoomFactor = 1.0f;
     m_deferringRepaints = 0;
     m_repaintCount = 0;
@@ -1043,7 +1043,10 @@
 
                     m_firstLayout = false;
                     m_firstLayoutCallbackPending = true;
-                    m_lastLayoutSize = LayoutSize(layoutWidth(), layoutHeight());
+                    if (useFixedLayout() && !fixedLayoutSize().isEmpty() && delegatesScrolling())
+                        m_lastViewportSize = fixedLayoutSize();
+                    else
+                        m_lastViewportSize = visibleContentRect(true /*includeScrollbars*/).size();
                     m_lastZoomFactor = root->style()->zoom();
 
                     // Set the initial vMode to AlwaysOn if we're auto.
@@ -2332,10 +2335,14 @@
     m_actionScheduler->resume();
 
     if (!root->printing()) {
-        LayoutSize currentSize = LayoutSize(layoutWidth(), layoutHeight());
+        IntSize currentSize;
+        if (useFixedLayout() && !fixedLayoutSize().isEmpty() && delegatesScrolling())
+            currentSize = fixedLayoutSize();
+        else
+            currentSize = visibleContentRect(true /*includeScrollbars*/).size();
         float currentZoomFactor = root->style()->zoom();
-        bool resized = !m_firstLayout && (currentSize != m_lastLayoutSize || currentZoomFactor != m_lastZoomFactor);
-        m_lastLayoutSize = currentSize;
+        bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || currentZoomFactor != m_lastZoomFactor);
+        m_lastViewportSize = currentSize;
         m_lastZoomFactor = currentZoomFactor;
         if (resized)
             m_frame->eventHandler()->sendResizeEvent();

Modified: releases/WebKitGTK/webkit-1.8/Source/WebCore/page/FrameView.h (111964 => 111965)


--- releases/WebKitGTK/webkit-1.8/Source/WebCore/page/FrameView.h	2012-03-24 01:38:25 UTC (rev 111964)
+++ releases/WebKitGTK/webkit-1.8/Source/WebCore/page/FrameView.h	2012-03-24 01:39:18 UTC (rev 111965)
@@ -442,7 +442,7 @@
     bool m_firstLayout;
     bool m_isTransparent;
     Color m_baseBackgroundColor;
-    LayoutSize m_lastLayoutSize;
+    IntSize m_lastViewportSize;
     float m_lastZoomFactor;
 
     String m_mediaType;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to