Title: [163146] trunk/Source/WebCore
- Revision
- 163146
- Author
- [email protected]
- Date
- 2014-01-30 17:47:45 -0800 (Thu, 30 Jan 2014)
Log Message
Fixed position objects are clipped in iOS WK2
https://bugs.webkit.org/show_bug.cgi?id=127974
Reviewed by Darin Adler.
We clip compositing layers for fixed position objects to the viewport
to avoid huge layers. However, because iOS changes the fixed position
rect when zooming, we need a different rect for iOS.
In WK1 (when we have a platformWidget), we can use
visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect)
which is effectively the whole document. However in WK2 this is
the real visibleContentRect(), so there we use unscaledDocumentRect().
* page/FrameView.cpp:
(WebCore::FrameView::viewportConstrainedExtentRect):
* page/FrameView.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (163145 => 163146)
--- trunk/Source/WebCore/ChangeLog 2014-01-31 01:46:00 UTC (rev 163145)
+++ trunk/Source/WebCore/ChangeLog 2014-01-31 01:47:45 UTC (rev 163146)
@@ -1,3 +1,25 @@
+2014-01-30 Simon Fraser <[email protected]>
+
+ Fixed position objects are clipped in iOS WK2
+ https://bugs.webkit.org/show_bug.cgi?id=127974
+
+ Reviewed by Darin Adler.
+
+ We clip compositing layers for fixed position objects to the viewport
+ to avoid huge layers. However, because iOS changes the fixed position
+ rect when zooming, we need a different rect for iOS.
+
+ In WK1 (when we have a platformWidget), we can use
+ visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect)
+ which is effectively the whole document. However in WK2 this is
+ the real visibleContentRect(), so there we use unscaledDocumentRect().
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::viewportConstrainedExtentRect):
+ * page/FrameView.h:
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateCompositedBounds):
+
2014-01-28 Timothy Hatcher <[email protected]>
Add column number and call timing support to LegacyProfiler.
Modified: trunk/Source/WebCore/page/FrameView.cpp (163145 => 163146)
--- trunk/Source/WebCore/page/FrameView.cpp 2014-01-31 01:46:00 UTC (rev 163145)
+++ trunk/Source/WebCore/page/FrameView.cpp 2014-01-31 01:47:45 UTC (rev 163146)
@@ -1561,6 +1561,18 @@
return viewportRect;
}
+LayoutRect FrameView::viewportConstrainedExtentRect() const
+{
+#if PLATFORM(IOS)
+ if (platformWidget())
+ return visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
+
+ return renderView()->unscaledDocumentRect();
+#else
+ return viewportConstrainedVisibleContentRect();
+#endif
+}
+
IntSize FrameView::scrollOffsetForFixedPosition(const IntRect& visibleContentRect, const IntSize& totalContentsSize, const IntPoint& scrollPosition, const IntPoint& scrollOrigin, float frameScaleFactor, bool fixedElementsLayoutRelativeToFrame, ScrollBehaviorForFixedElements behaviorForFixed, int headerHeight, int footerHeight)
{
IntPoint position;
Modified: trunk/Source/WebCore/page/FrameView.h (163145 => 163146)
--- trunk/Source/WebCore/page/FrameView.h 2014-01-31 01:46:00 UTC (rev 163145)
+++ trunk/Source/WebCore/page/FrameView.h 2014-01-31 01:47:45 UTC (rev 163146)
@@ -226,6 +226,9 @@
// offsets from rubber-banding, and it takes zooming into account.
LayoutRect viewportConstrainedVisibleContentRect() const;
+ // A rectangle in content coordinates that is used to clip layers for fixed-position objects.
+ LayoutRect viewportConstrainedExtentRect() const;
+
String mediaType() const;
void setMediaType(const String&);
void adjustMediaTypeForPrinting(bool printing);
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (163145 => 163146)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-01-31 01:46:00 UTC (rev 163145)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-01-31 01:47:45 UTC (rev 163146)
@@ -476,13 +476,9 @@
RenderLayer* rootLayer = view.layer();
LayoutRect clippingBounds;
- if (renderer().style().position() == FixedPosition && renderer().container() == &view) {
-#if PLATFORM(IOS)
- clippingBounds = view.frameView().visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
-#else
- clippingBounds = view.frameView().viewportConstrainedVisibleContentRect();
-#endif
- } else
+ if (renderer().style().position() == FixedPosition && renderer().container() == &view)
+ clippingBounds = view.frameView().viewportConstrainedExtentRect();
+ else
clippingBounds = view.unscaledDocumentRect();
if (&m_owningLayer != rootLayer)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes