Title: [168670] trunk/Source/WebCore
- Revision
- 168670
- Author
- [email protected]
- Date
- 2014-05-12 21:32:09 -0700 (Mon, 12 May 2014)
Log Message
[iOS] Fixed items are sometimes clipped after rubber-banding
https://bugs.webkit.org/show_bug.cgi?id=132851
<rdar://problem/16870790>
Reviewed by Benjamin Poulain.
On iOS fixed-position layers would get clipped to the document rect,
but with rubber-banding, we can now have a custom fixed postion rect
that extends outside the document rect.
Another issue was that we would un-composite fixed elements sometimes
when scrolling fast, again because they could fall outside of the document rect.
A final issue was that pinching could reveal parts of fixed elements that should
lie outside the viewport, rather than clipping the layers.
Fix by converting both call points to use viewportConstrainedVisibleContentRect()
rather than viewportConstrainedExtentRect(). On non-iOS platforms these are
the same, but on iOS viewportConstrainedVisibleContentRect() uses the
custom fixed position rect, which is the correct rect to intersect with.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (168669 => 168670)
--- trunk/Source/WebCore/ChangeLog 2014-05-13 03:19:29 UTC (rev 168669)
+++ trunk/Source/WebCore/ChangeLog 2014-05-13 04:32:09 UTC (rev 168670)
@@ -1,3 +1,31 @@
+2014-05-12 Simon Fraser <[email protected]>
+
+ [iOS] Fixed items are sometimes clipped after rubber-banding
+ https://bugs.webkit.org/show_bug.cgi?id=132851
+ <rdar://problem/16870790>
+
+ Reviewed by Benjamin Poulain.
+
+ On iOS fixed-position layers would get clipped to the document rect,
+ but with rubber-banding, we can now have a custom fixed postion rect
+ that extends outside the document rect.
+
+ Another issue was that we would un-composite fixed elements sometimes
+ when scrolling fast, again because they could fall outside of the document rect.
+
+ A final issue was that pinching could reveal parts of fixed elements that should
+ lie outside the viewport, rather than clipping the layers.
+
+ Fix by converting both call points to use viewportConstrainedVisibleContentRect()
+ rather than viewportConstrainedExtentRect(). On non-iOS platforms these are
+ the same, but on iOS viewportConstrainedVisibleContentRect() uses the
+ custom fixed position rect, which is the correct rect to intersect with.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateCompositedBounds):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
+
2014-05-06 Jon Honeycutt <[email protected]>
Don't dispatch 'beforeload' event inside FrameView::layout()
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (168669 => 168670)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-05-13 03:19:29 UTC (rev 168669)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-05-13 04:32:09 UTC (rev 168670)
@@ -455,7 +455,7 @@
LayoutRect clippingBounds;
if (renderer().style().position() == FixedPosition && renderer().container() == &view)
- clippingBounds = view.frameView().viewportConstrainedExtentRect();
+ clippingBounds = view.frameView().viewportConstrainedVisibleContentRect();
else
clippingBounds = view.unscaledDocumentRect();
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (168669 => 168670)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2014-05-13 03:19:29 UTC (rev 168669)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2014-05-13 04:32:09 UTC (rev 168670)
@@ -2629,7 +2629,7 @@
}
// Fixed position elements that are invisible in the current view don't get their own layer.
- LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedExtentRect();
+ LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxes
| RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
// Map to m_renderView to ignore page scale.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes