WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 109646
Bug 108556
Constrain layers for fixed position elements to the viewport
https://bugs.webkit.org/show_bug.cgi?id=108556
Summary
Constrain layers for fixed position elements to the viewport
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
Add attachment
proposed patch, testcase, etc.
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
<
rdar://problem/13130376
>
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.
Top of Page
Format For Printing
XML
Clone This Bug