Bug 108556

Summary: Constrain layers for fixed position elements to the viewport
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: 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)
Reported 2013-01-31 17:33:08 PST
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
Simon Fraser (smfr)
Comment 1 2013-01-31 17:42:33 PST
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
Comment 2 2013-01-31 17:42:56 PST
Simon Fraser (smfr)
Comment 3 2013-02-15 16:43:36 PST
*** This bug has been marked as a duplicate of bug 109646 ***
Note You need to log in before you can comment on or make changes to this bug.