[Issue#] N_SE-36822
[Problem] Display error occur when go to " http://www.samsung.com/global/ativ/ativ_s.html
[Cause] Fixed position elements are not always fixed
[Solution] Cherry picked.
[EFL][Qt][WK2] Fixed position elements are not always fixed
https://bugs.webkit.org/show_bug.cgi?id=103452
Reviewed by Simon Fraser.
The code figuring out whether fixed position layers are inside
the visible viewport, assumes that the visible viewport is always
the size of the layout viewport. This assumption doesn't hold with
how the Qt and EFL tiled backing store and coordinated graphics
works, so instead using the visibleContentsRect(), which provides
the right values in all cases.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
Use visibleContentsRect instead of scrollOffsetForFixedPosition().
scrollOffsetForFixedPosition() is needed sometimes in the Mac code
because visibleContentRect() will return negative offsets when you
are in the rubber-band phase of a scroll on the Mac.
However that is not an issue here.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136452
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
Conflicts:
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp
Change-Id: Ia2fcdcc376e3cf72edd016ae574b062c0f0e32cf
// The bounds of the GraphicsLayer created for a compositing layer is the union of the bounds of all the descendant
// RenderLayers that are rendered by the composited RenderLayer.
-IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer)
+IntRect RenderLayerCompositor::calculateCompositedBounds(const RenderLayer* layer, const RenderLayer* ancestorLayer) const
{
if (!canBeComposited(layer))
return IntRect();
return false;
// Fixed position elements that are invisible in the current view don't get their own layer.
- FrameView* frameView = m_renderView->frameView();
- if (frameView && !layer->absoluteBoundingBox().intersects(IntRect(IntPoint(frameView->scrollOffsetForFixedPosition()), frameView->layoutSize())))
- return false;
+ if (FrameView* frameView = m_renderView->frameView()) {
+ IntRect viewBounds = frameView->visibleContentRect();
+ IntRect layerBounds = calculateCompositedBounds(layer, rootRenderLayer());
+ if (!viewBounds.intersects(layerBounds))
+ return false;
+ }
return true;
}
bool needsContentsCompositingLayer(const RenderLayer*) const;
// Return the bounding box required for compositing layer and its childern, relative to ancestorLayer.
// If layerBoundingBox is not 0, on return it contains the bounding box of this layer only.
- IntRect calculateCompositedBounds(const RenderLayer*, const RenderLayer* ancestorLayer);
+ IntRect calculateCompositedBounds(const RenderLayer*, const RenderLayer* ancestorLayer) const;
// Repaint the appropriate layers when the given RenderLayer starts or stops being composited.
void repaintOnCompositingChange(RenderLayer*);