| Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
|
| index 5c7b9b054644d678b49061e4eaa516b055152237..0334e0451cb9a8dda061ed26e77323ed82dd79f3 100644
|
| --- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
|
| @@ -177,12 +177,9 @@ void LayoutSVGRoot::layout() {
|
| addVisualEffectOverflow();
|
|
|
| if (!shouldApplyViewportClip()) {
|
| - FloatRect contentPaintInvalidationRect =
|
| - paintInvalidationRectInLocalSVGCoordinates();
|
| - contentPaintInvalidationRect =
|
| - m_localToBorderBoxTransform.mapRect(contentPaintInvalidationRect);
|
| - addContentsVisualOverflow(
|
| - enclosingLayoutRect(contentPaintInvalidationRect));
|
| + FloatRect contentVisualRect = visualRectInLocalSVGCoordinates();
|
| + contentVisualRect = m_localToBorderBoxTransform.mapRect(contentVisualRect);
|
| + addContentsVisualOverflow(enclosingLayoutRect(contentVisualRect));
|
| }
|
|
|
| updateLayerTransformAfterLayout();
|
| @@ -358,44 +355,40 @@ const AffineTransform& LayoutSVGRoot::localToSVGParentTransform() const {
|
| return m_localToParentTransform;
|
| }
|
|
|
| -LayoutRect LayoutSVGRoot::localOverflowRectForPaintInvalidation() const {
|
| - // This is an open-coded aggregate of SVGLayoutSupport::
|
| - // localOverflowRectForPaintInvalidation, and LayoutReplaced::
|
| - // localOverflowRectForPaintInvalidation.
|
| - // The reason for this is to optimize/minimize the paint invalidation rect
|
| - // when the box is not "decorated" (does not have background/border/etc., see
|
| - // LayoutSVGRootTest.OverflowRectMappingWithViewportClipWithoutBorder).
|
| +LayoutRect LayoutSVGRoot::localVisualRect() const {
|
| + // This is an open-coded aggregate of SVGLayoutSupport::localVisualRect
|
| + // and LayoutReplaced::localVisualRect. The reason for this is to optimize/
|
| + // minimize the visual rect when the box is not "decorated" (does not have
|
| + // background/border/etc., see
|
| + // LayoutSVGRootTest.VisualRectMappingWithViewportClipWithoutBorder).
|
|
|
| // Return early for any cases where we don't actually paint.
|
| if (style()->visibility() != EVisibility::Visible &&
|
| !enclosingLayer()->hasVisibleContent())
|
| return LayoutRect();
|
|
|
| - // Compute the paint invalidation rect of the content of the SVG in the
|
| - // border-box coordinate space.
|
| - FloatRect contentPaintInvalidationRect =
|
| - paintInvalidationRectInLocalSVGCoordinates();
|
| - contentPaintInvalidationRect =
|
| - m_localToBorderBoxTransform.mapRect(contentPaintInvalidationRect);
|
| + // Compute the visual rect of the content of the SVG in the border-box
|
| + // coordinate space.
|
| + FloatRect contentVisualRect = visualRectInLocalSVGCoordinates();
|
| + contentVisualRect = m_localToBorderBoxTransform.mapRect(contentVisualRect);
|
|
|
| // Apply initial viewport clip, overflow:visible content is added to
|
| // visualOverflow but the most common case is that overflow is hidden, so
|
| // always intersect.
|
| - contentPaintInvalidationRect.intersect(pixelSnappedBorderBoxRect());
|
| + contentVisualRect.intersect(pixelSnappedBorderBoxRect());
|
|
|
| - LayoutRect paintInvalidationRect =
|
| - enclosingLayoutRect(contentPaintInvalidationRect);
|
| + LayoutRect visualRect = enclosingLayoutRect(contentVisualRect);
|
| // If the box is decorated or is overflowing, extend it to include the
|
| // border-box and overflow.
|
| if (m_hasBoxDecorationBackground || hasOverflowModel()) {
|
| // The selectionRect can project outside of the overflowRect, so take their
|
| // union for paint invalidation to avoid selection painting glitches.
|
| - LayoutRect decoratedPaintInvalidationRect =
|
| + LayoutRect decoratedVisualRect =
|
| unionRect(localSelectionRect(), visualOverflowRect());
|
| - paintInvalidationRect.unite(decoratedPaintInvalidationRect);
|
| + visualRect.unite(decoratedVisualRect);
|
| }
|
|
|
| - return LayoutRect(enclosingIntRect(paintInvalidationRect));
|
| + return LayoutRect(enclosingIntRect(visualRect));
|
| }
|
|
|
| // This method expects local CSS box coordinates.
|
| @@ -418,9 +411,7 @@ const LayoutObject* LayoutSVGRoot::pushMappingToContainer(
|
| void LayoutSVGRoot::updateCachedBoundaries() {
|
| SVGLayoutSupport::computeContainerBoundingBoxes(
|
| this, m_objectBoundingBox, m_objectBoundingBoxValid, m_strokeBoundingBox,
|
| - m_paintInvalidationBoundingBox);
|
| - SVGLayoutSupport::intersectPaintInvalidationRectWithResources(
|
| - this, m_paintInvalidationBoundingBox);
|
| + m_visualRectInLocalSVGCoordinates);
|
| }
|
|
|
| bool LayoutSVGRoot::nodeAtPoint(HitTestResult& result,
|
|
|