// Make sure the parent's clip rects have been calculated.
ClipRect clipRect = paintDirtyRect;
if (parent()) {
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ clipRect = backgroundClipRect(rootLayer, region, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects,
+ IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowClip);
+#else
clipRect = backgroundClipRect(rootLayer, region, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects);
+#endif
clipRect.intersect(paintDirtyRect);
// Push the parent coordinate space's clip.
if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars) {
calculateRects(rootLayer, region, (localPaintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ , IgnoreOverlayScrollbarSize, localPaintFlags & PaintLayerPaintingOverflowContents ? IgnoreOverflowClip : RespectOverflowClip
+#else
, IgnoreOverlayScrollbarSize, paintFlags & PaintLayerPaintingOverflowContents
#endif
+#endif
);
paintOffset = toPoint(layerBounds.location() - renderBoxLocation());
}
performOverlapTests(*overlapTestRequests, rootLayer, this);
// We want to paint our layer, but only if we intersect the damage rect.
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ if (this != rootLayer || !(localPaintFlags & PaintLayerPaintingOverflowContents))
+#endif
shouldPaintContent &= intersectsDamageRect(layerBounds, damageRect.rect(), rootLayer);
if (localPaintFlags & PaintLayerPaintingCompositingBackgroundPhase) {
return 0;
}
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+void RenderLayer::updateClipRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy relevancy, ShouldRespectOverflowClip respectOverflowClip)
+#else
void RenderLayer::updateClipRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy relevancy)
+#endif
{
ASSERT(clipRectsType < NumCachedClipRectsTypes);
if (m_clipRectsCache && m_clipRectsCache->m_clipRects[clipRectsType]) {
ASSERT(rootLayer == m_clipRectsCache->m_clipRectsRoot[clipRectsType]);
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ ASSERT(m_clipRectsCache->m_respectingOverflowClip[clipRectsType] == (respectOverflowClip == RespectOverflowClip));
+#endif
return; // We have the correct cached value.
}
// examine the parent. We want to cache clip rects with us as the root.
RenderLayer* parentLayer = rootLayer != this ? parent() : 0;
if (parentLayer)
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ parentLayer->updateClipRects(rootLayer, region, clipRectsType, relevancy, respectOverflowClip);
+#else
parentLayer->updateClipRects(rootLayer, region, clipRectsType, relevancy);
+#endif
ClipRects clipRects;
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ calculateClipRects(rootLayer, region, clipRectsType, clipRects, relevancy, respectOverflowClip);
+#else
calculateClipRects(rootLayer, region, clipRectsType, clipRects, relevancy);
+#endif
if (!m_clipRectsCache)
m_clipRectsCache = adoptPtr(new ClipRectsCache);
m_clipRectsCache->m_clipRects[clipRectsType] = ClipRects::create(clipRects);
#ifndef NDEBUG
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ m_clipRectsCache->m_respectingOverflowClip[clipRectsType] = respectOverflowClip == RespectOverflowClip;
+#else
m_clipRectsCache->m_clipRectsRoot[clipRectsType] = rootLayer;
#endif
+#endif
}
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, ClipRects& clipRects, OverlayScrollbarSizeRelevancy relevancy, ShouldRespectOverflowClip respectOverflowClip) const
+#else
void RenderLayer::calculateClipRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, ClipRects& clipRects, OverlayScrollbarSizeRelevancy relevancy) const
+#endif
{
if (!parent()) {
// The root layer's clip rect is always infinite.
if (useCached && parentLayer->clipRects(clipRectsType))
clipRects = *parentLayer->clipRects(clipRectsType);
else
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ parentLayer->calculateClipRects(rootLayer, region, clipRectsType, clipRects, IgnoreOverlayScrollbarSize, respectOverflowClip);
+#else
parentLayer->calculateClipRects(rootLayer, region, clipRectsType, clipRects);
+#endif
} else
clipRects.reset(PaintInfo::infiniteRect());
clipRects.setOverflowClipRect(clipRects.posClipRect());
// Update the clip rects that will be passed to child layers.
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ if ((renderer()->hasOverflowClip() && (respectOverflowClip == RespectOverflowClip || this != rootLayer)) || renderer()->hasClip()) {
+#else
if (renderer()->hasClipOrOverflowClip()) {
+#endif
// This layer establishes a clip of some kind.
// This offset cannot use convertToLayerCoords, because sometimes our rootLayer may be across
}
}
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+void RenderLayer::parentClipRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, ClipRects& clipRects, OverlayScrollbarSizeRelevancy relevancy, ShouldRespectOverflowClip respectOverflowClip) const
+#else
void RenderLayer::parentClipRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, ClipRects& clipRects, OverlayScrollbarSizeRelevancy relevancy) const
+#endif
{
ASSERT(parent());
if (clipRectsType == TemporaryClipRects) {
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ parent()->calculateClipRects(rootLayer, region, clipRectsType, clipRects, relevancy, respectOverflowClip);
+#else
parent()->calculateClipRects(rootLayer, region, clipRectsType, clipRects, relevancy);
+#endif
return;
}
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ parent()->updateClipRects(rootLayer, region, clipRectsType, relevancy, respectOverflowClip);
+#else
parent()->updateClipRects(rootLayer, region, clipRectsType, relevancy);
+#endif
clipRects = *parent()->clipRects(clipRectsType);
}
return parentRects.overflowClipRect();
}
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ClipRect RenderLayer::backgroundClipRect(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy relevancy, ShouldRespectOverflowClip respectOverflowClip) const
+#else
ClipRect RenderLayer::backgroundClipRect(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy relevancy) const
+#endif
{
ASSERT(parent());
ClipRects parentRects;
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ parentClipRects(rootLayer, region, clipRectsType, parentRects, relevancy, respectOverflowClip);
+#else
parentClipRects(rootLayer, region, clipRectsType, parentRects, relevancy);
+#endif
ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer()->style()->position());
RenderView* view = renderer()->view();
ASSERT(view);
void RenderLayer::calculateRects(const RenderLayer* rootLayer, RenderRegion* region, ClipRectsType clipRectsType, const LayoutRect& paintDirtyRect, LayoutRect& layerBounds,
ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect, OverlayScrollbarSizeRelevancy relevancy
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ , ShouldRespectOverflowClip respectOverflowClip
+#endif
, bool dontClipToOverflow
#endif
) const
|| hasOverflowAncestor()) { // parent with overflow set
backgroundRect = paintDirtyRect;
} else {
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ backgroundRect = backgroundClipRect(rootLayer, region, clipRectsType, relevancy, respectOverflowClip);
+#else
backgroundRect = backgroundClipRect(rootLayer, region, clipRectsType, relevancy);
+#endif
backgroundRect.intersect(paintDirtyRect);
}
#else
// This layer establishes a clip of some kind.
if (renderer()->hasOverflowClip()
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ && (this != rootLayer || respectOverflowClip == RespectOverflowClip)
+#endif
&& !dontClipToOverflow
#endif
) {
boxShadow = boxShadow->next();
} while (boxShadow);
// FIXME: fix for dontClipToOverflow
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ if (this != rootLayer || respectOverflowClip == RespectOverflowClip)
+#endif
backgroundRect.intersect(overflow);
} else
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ if (this != rootLayer || respectOverflowClip == RespectOverflowClip)
+#else
if (!dontClipToOverflow)
+#endif
backgroundRect.intersect(layerBounds);
#else
if (renderBox()->hasVisualOverflow()) {
RenderLayer* clippingRootLayer = clippingRootForPainting();
LayoutRect layerBounds;
ClipRect backgroundRect, foregroundRect, outlineRect;
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ // Need to use temporary clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>).
+ calculateRects(clippingRootLayer, 0, TemporaryClipRects, renderView->unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
+#else
calculateRects(clippingRootLayer, 0, PaintingClipRects, renderView->unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
+#endif
return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(foregroundRect.rect())).enclosingBoundingBox();
}
ClipRectsCache()
{
#ifndef NDEBUG
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ for (int i = 0; i < NumCachedClipRectsTypes; ++i) {
+#else
for (int i = 0; i < NumCachedClipRectsTypes; ++i)
+#endif
m_clipRectsRoot[i] = 0;
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ m_respectingOverflowClip[i] = false;
+ }
+#endif
#endif
}
RefPtr<ClipRects> m_clipRects[NumCachedClipRectsTypes];
#ifndef NDEBUG
const RenderLayer* m_clipRectsRoot[NumCachedClipRectsTypes];
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ bool m_respectingOverflowClip[NumCachedClipRectsTypes];
+#endif
#endif
};
bool hitTest(const HitTestRequest&, const HitTestPoint&, HitTestResult&);
void paintOverlayScrollbars(GraphicsContext*, const LayoutRect& damageRect, PaintBehavior, RenderObject* paintingRoot);
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ enum ShouldRespectOverflowClip { IgnoreOverflowClip, RespectOverflowClip };
+#endif
+
// This method figures out our layerBounds in coordinates relative to
// |rootLayer}. It also computes our background and foreground clip rects
// for painting/event handling.
ClipRect& backgroundRect, ClipRect& foregroundRect, ClipRect& outlineRect,
OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize
#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_ACCELERATION)
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ , ShouldRespectOverflowClip = RespectOverflowClip
+#endif
, bool dontClipToOverflow = false
#endif
) const;
// Compute and cache clip rects computed with the given layer as the root
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ void updateClipRects(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip = RespectOverflowClip);
+#else
void updateClipRects(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);
+#endif
// Compute and return the clip rects. If useCached is true, will used previously computed clip rects on ancestors
// (rather than computing them all from scratch up the parent chain).
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ void calculateClipRects(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, ClipRects&, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip = RespectOverflowClip) const;
+#else
void calculateClipRects(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, ClipRects&, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
+#endif
ClipRects* clipRects(ClipRectsType type) const { ASSERT(type < NumCachedClipRectsTypes); return m_clipRectsCache ? m_clipRectsCache->m_clipRects[type].get() : 0; }
void updateOrRemoveFilterEffect();
#endif
+#if ENABLE(TIZEN_CSS_OVERFLOW_SCROLL_FIX_WRONG_CLIPPING)
+ void parentClipRects(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, ClipRects&, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip = RespectOverflowClip) const;
+ ClipRect backgroundClipRect(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize, ShouldRespectOverflowClip = RespectOverflowClip) const;
+#else
void parentClipRects(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, ClipRects&, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
ClipRect backgroundClipRect(const RenderLayer* rootLayer, RenderRegion*, ClipRectsType, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize) const;
+#endif
LayoutRect paintingExtent(const RenderLayer* rootLayer, const LayoutRect& paintDirtyRect, PaintBehavior);
RenderLayer* enclosingTransformedAncestor() const;