Title: [140758] trunk
Revision
140758
Author
[email protected]
Date
2013-01-24 17:31:55 -0800 (Thu, 24 Jan 2013)

Log Message

Fixed elements sometimes marked out-of-view if you have rubber-banded too far, 
affects flickr.com
https://bugs.webkit.org/show_bug.cgi?id=107882
-and corresponding-
<rdar://problem/13065897>

Reviewed by Simon Fraser.

Source/WebCore: 

It is possible to rubber band so far that our fixed object appears to be outside 
of the visibleContentArea(). We should use the 
viewportConstrainedVisibleContentRect() since that is what fixed objects are 
positioned based on anyway. 

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

LayoutTests: 

* platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt: Added.
* platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (140757 => 140758)


--- trunk/LayoutTests/ChangeLog	2013-01-25 01:28:31 UTC (rev 140757)
+++ trunk/LayoutTests/ChangeLog	2013-01-25 01:31:55 UTC (rev 140758)
@@ -1,3 +1,16 @@
+2013-01-24  Beth Dakin  <[email protected]>
+
+        Fixed elements sometimes marked out-of-view if you have rubber-banded too far, 
+        affects flickr.com
+        https://bugs.webkit.org/show_bug.cgi?id=107882
+        -and corresponding-
+        <rdar://problem/13065897>
+
+        Reviewed by Simon Fraser.
+
+        * platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt: Added.
+        * platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view.html: Added.
+
 2013-01-24  Keishi Hattori  <[email protected]>
 
         [Chromium] Rebaselining expectations for foreignObject-text-clipping-bug.html.

Added: trunk/LayoutTests/platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt (0 => 140758)


--- trunk/LayoutTests/platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view-expected.txt	2013-01-25 01:31:55 UTC (rev 140758)
@@ -0,0 +1,13 @@
+(Scrolling node
+  (viewport rect 0 0 785 600)
+  (contents size 785 2221)
+  (requested scroll position 0 -200)
+  (children 1
+    (Fixed node
+      (anchor edges: AnchorEdgeLeft AnchorEdgeBottom)
+      (viewport rect at last layout: 0.00 0.00 785.00 600.00)
+      (layer position at last layout 0.00 516.00)
+    )
+  )
+)
+

Added: trunk/LayoutTests/platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view.html (0 => 140758)


--- trunk/LayoutTests/platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/tiled-drawing/fixed/negative-scroll-offset-in-view.html	2013-01-25 01:31:55 UTC (rev 140758)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    body {
+        height: 2200px;
+    }
+
+    .fixed {
+        position: fixed;
+        left: 0;
+        margin: 10px;
+        height: 50px;
+        background-color: rgba(0, 128, 0, 0.8);
+        border: 2px solid black;
+        -webkit-box-shadow: 0 0 10px black;
+        top: auto;
+        bottom: 10px;
+        width: 96%;
+    }
+  </style>
+
+    <script type="text/_javascript_" charset="utf-8">
+      if (window.testRunner) {
+        testRunner.waitUntilDone();
+        testRunner.dumpAsText();
+      }
+
+      function doScroll()
+      {
+        window.setTimeout(function() {
+          window.scrollTo(0, -200);
+          if (window.testRunner) {
+            document.getElementById('results').innerText = window.internals.scrollingStateTreeAsText(document);
+            testRunner.notifyDone();
+          }
+        }, 10);
+      }
+      
+      window.addEventListener('load', doScroll, false);
+    </script>
+</head>
+
+<body>
+
+    <pre id="results"></pre>
+    <div class="fixed"></div>
+
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (140757 => 140758)


--- trunk/Source/WebCore/ChangeLog	2013-01-25 01:28:31 UTC (rev 140757)
+++ trunk/Source/WebCore/ChangeLog	2013-01-25 01:31:55 UTC (rev 140758)
@@ -1,3 +1,21 @@
+2013-01-24  Beth Dakin  <[email protected]>
+
+        Fixed elements sometimes marked out-of-view if you have rubber-banded too far, 
+        affects flickr.com
+        https://bugs.webkit.org/show_bug.cgi?id=107882
+        -and corresponding-
+        <rdar://problem/13065897>
+
+        Reviewed by Simon Fraser.
+
+        It is possible to rubber band so far that our fixed object appears to be outside 
+        of the visibleContentArea(). We should use the 
+        viewportConstrainedVisibleContentRect() since that is what fixed objects are 
+        positioned based on anyway. 
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
+
 2013-01-24  Kentaro Hara  <[email protected]>
 
         Unreviewed build fix.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (140757 => 140758)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-01-25 01:28:31 UTC (rev 140757)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2013-01-25 01:31:55 UTC (rev 140758)
@@ -2065,7 +2065,7 @@
 
     // Fixed position elements that are invisible in the current view don't get their own layer.
     if (FrameView* frameView = m_renderView->frameView()) {
-        IntRect viewBounds = frameView->visibleContentRect();
+        LayoutRect viewBounds = frameView->viewportConstrainedVisibleContentRect();
         LayoutRect layerBounds = layer->calculateLayerBounds(rootRenderLayer(), 0, RenderLayer::DefaultCalculateLayerBoundsFlags
             | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
         layerBounds.scale(frameView->frame()->frameScaleFactor());
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to