Bug 108556
Summary: | Constrain layers for fixed position elements to the viewport | ||
---|---|---|---|
Product: | WebKit | Reporter: | Simon Fraser (smfr) <simon.fraser> |
Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | bdakin, simon.fraser, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://www.redfin.com/CA/Mountain-View/1075-Space-Park-Way-94043/unit-297/home/21854852 |
Simon Fraser (smfr)
Some sites (like redfin.com) have fixedpos elements which abspos children that are way outside the viewport. We currently end up making, and painting big tiled layers for this, which is crazy. We should constrain those layer sizes to the viewport size.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Simon Fraser (smfr)
Something like this (but it needs to check if the layer really is fixed):
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 75fded054ca231b778640df24bfc4eab1f8f54d3..6953fd62ec30313f1e271441ac1a036032c66614 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -407,6 +407,11 @@ void RenderLayerBacking::updateCompositedBounds()
// Start by clipping to the document's bounds.
LayoutRect clippingBounds = view->unscaledDocumentRect();
+
+ if (renderer()->style()->position() == FixedPosition) {
+ LayoutRect viewportRect = view->frameView()->viewportConstrainedVisibleContentRect();
+ clippingBounds.intersect(viewportRect);
+ }
if (m_owningLayer != rootLayer)
clippingBounds.intersect(m_owningLayer->backgroundClipRect(RenderLayer::ClipRectsContext(rootLayer, 0, AbsoluteClipRects)).rect()); // FIXME: Incorrect for CSS regions.
Radar WebKit Bug Importer
<rdar://problem/13130376>
Simon Fraser (smfr)
*** This bug has been marked as a duplicate of bug 109646 ***