Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / rendering / RenderLayerClipper.cpp
index e228b4b..3819e51 100644 (file)
@@ -124,7 +124,7 @@ LayoutRect RenderLayerClipper::childrenClipRect() const
     RenderLayer* clippingRootLayer = clippingRootForPainting();
     LayoutRect layerBounds;
     ClipRect backgroundRect, foregroundRect, outlineRect;
-    ClipRectsContext clipRectsContext(clippingRootLayer, 0, TemporaryClipRects);
+    ClipRectsContext clipRectsContext(clippingRootLayer, TemporaryClipRects);
     // Need to use temporary clip rects, because the value of 'dontClipToOverflow' may be different from the painting path (<rdar://problem/11844909>).
     calculateRects(clipRectsContext, renderView->unscaledDocumentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
     return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(foregroundRect.rect())).enclosingBoundingBox();
@@ -133,12 +133,11 @@ LayoutRect RenderLayerClipper::childrenClipRect() const
 LayoutRect RenderLayerClipper::selfClipRect() const
 {
     // FIXME: border-radius not accounted for.
-    // FIXME: Regions not accounted for.
     RenderView* renderView = m_renderer->view();
     RenderLayer* clippingRootLayer = clippingRootForPainting();
     LayoutRect layerBounds;
     ClipRect backgroundRect, foregroundRect, outlineRect;
-    ClipRectsContext clipRectsContext(clippingRootLayer, 0, PaintingClipRects);
+    ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects);
     calculateRects(clipRectsContext, renderView->documentRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
     return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(backgroundRect.rect())).enclosingBoundingBox();
 }
@@ -146,11 +145,10 @@ LayoutRect RenderLayerClipper::selfClipRect() const
 LayoutRect RenderLayerClipper::localClipRect() const
 {
     // FIXME: border-radius not accounted for.
-    // FIXME: Regions not accounted for.
     RenderLayer* clippingRootLayer = clippingRootForPainting();
     LayoutRect layerBounds;
     ClipRect backgroundRect, foregroundRect, outlineRect;
-    ClipRectsContext clipRectsContext(clippingRootLayer, 0, PaintingClipRects);
+    ClipRectsContext clipRectsContext(clippingRootLayer, PaintingClipRects);
     calculateRects(clipRectsContext, PaintInfo::infiniteRect(), layerBounds, backgroundRect, foregroundRect, outlineRect);
 
     LayoutRect clipRect = backgroundRect.rect();
@@ -169,6 +167,7 @@ void RenderLayerClipper::calculateRects(const ClipRectsContext& clipRectsContext
 {
     if (clipRectsContext.rootLayer != m_renderer->layer() && m_renderer->layer()->parent()) {
         backgroundRect = backgroundClipRect(clipRectsContext);
+        backgroundRect.move(roundedIntSize(clipRectsContext.subPixelAccumulation));
         backgroundRect.intersect(paintDirtyRect);
     } else {
         backgroundRect = paintDirtyRect;
@@ -188,7 +187,7 @@ void RenderLayerClipper::calculateRects(const ClipRectsContext& clipRectsContext
     if (m_renderer->hasOverflowClip()) {
         // This layer establishes a clip of some kind.
         if (m_renderer->layer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip) {
-            foregroundRect.intersect(toRenderBox(m_renderer)->overflowClipRect(offset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy));
+            foregroundRect.intersect(toRenderBox(m_renderer)->overflowClipRect(offset, clipRectsContext.overlayScrollbarSizeRelevancy));
             if (m_renderer->style()->hasBorderRadius())
                 foregroundRect.setHasRadius(true);
         }
@@ -207,8 +206,7 @@ void RenderLayerClipper::calculateRects(const ClipRectsContext& clipRectsContext
             if (m_renderer->layer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)
                 backgroundRect.intersect(layerBoundsWithVisualOverflow);
         } else {
-            // Shift the bounds to be for our region only.
-            LayoutRect bounds = toRenderBox(m_renderer)->borderBoxRectInRegion(clipRectsContext.region);
+            LayoutRect bounds = toRenderBox(m_renderer)->borderBoxRect();
             bounds.moveBy(offset);
             if (m_renderer->layer() != clipRectsContext.rootLayer || clipRectsContext.respectOverflowClip == RespectOverflowClip)
                 backgroundRect.intersect(bounds);
@@ -218,7 +216,7 @@ void RenderLayerClipper::calculateRects(const ClipRectsContext& clipRectsContext
     // CSS clip (different than clipping due to overflow) can clip to any box, even if it falls outside of the border box.
     if (m_renderer->hasClip()) {
         // Clip applies to *us* as well, so go ahead and update the damageRect.
-        LayoutRect newPosClip = toRenderBox(m_renderer)->clipRect(offset, clipRectsContext.region);
+        LayoutRect newPosClip = toRenderBox(m_renderer)->clipRect(offset);
         backgroundRect.intersect(newPosClip);
         foregroundRect.intersect(newPosClip);
         outlineRect.intersect(newPosClip);
@@ -281,7 +279,7 @@ void RenderLayerClipper::calculateClipRects(const ClipRectsContext& clipRectsCon
         }
 
         if (m_renderer->hasOverflowClip()) {
-            ClipRect newOverflowClip = toRenderBox(m_renderer)->overflowClipRect(offset, clipRectsContext.region, clipRectsContext.overlayScrollbarSizeRelevancy);
+            ClipRect newOverflowClip = toRenderBox(m_renderer)->overflowClipRect(offset, clipRectsContext.overlayScrollbarSizeRelevancy);
             if (m_renderer->style()->hasBorderRadius())
                 newOverflowClip.setHasRadius(true);
             clipRects.setOverflowClipRect(intersection(newOverflowClip, clipRects.overflowClipRect()));
@@ -289,7 +287,7 @@ void RenderLayerClipper::calculateClipRects(const ClipRectsContext& clipRectsCon
                 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.posClipRect()));
         }
         if (m_renderer->hasClip()) {
-            LayoutRect newPosClip = toRenderBox(m_renderer)->clipRect(offset, clipRectsContext.region);
+            LayoutRect newPosClip = toRenderBox(m_renderer)->clipRect(offset);
             clipRects.setPosClipRect(intersection(newPosClip, clipRects.posClipRect()));
             clipRects.setOverflowClipRect(intersection(newPosClip, clipRects.overflowClipRect()));
             clipRects.setFixedClipRect(intersection(newPosClip, clipRects.fixedClipRect()));