Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
index 70e2509cb39ec661154035ac38b7e44ec691b6e9..361f67c6e53caf5e67078e3b0d0dd9d89fe03ea8 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -1971,10 +1971,7 @@ LayoutRect LayoutBox::localOverflowRectForPaintInvalidation() const |
bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, VisualRectFlags visualRectFlags) const |
{ |
- // We need to inflate the paint invalidation rect before we use paintInvalidationState, |
- // else we would forget to inflate it for the current layoutObject. FIXME: If these were |
- // included into the visual overflow for paint invalidation, we wouldn't have this issue. |
- inflatePaintInvalidationRectForReflectionAndFilter(rect); |
+ inflateVisualRectForReflectionAndFilter(rect); |
if (ancestor == this) { |
// The final rect returned is always in the physical coordinate space of the ancestor. |
@@ -1983,10 +1980,24 @@ bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances |
} |
bool ancestorSkipped; |
- LayoutObject* container = this->container(ancestor, &ancestorSkipped); |
+ bool filterOrReflectionSkipped; |
+ LayoutObject* container = this->container(ancestor, &ancestorSkipped, &filterOrReflectionSkipped); |
if (!container) |
return true; |
+ if (filterOrReflectionSkipped) { |
+ // Apply filter and reflection outsets between this object and container or ancestor. |
+ for (LayoutObject* parent = this->parent(); parent && parent != container; parent = parent->parent()) { |
+ if (parent->isBox()) |
+ toLayoutBox(parent)->inflateVisualRectForReflectionAndFilter(rect); |
chrishtr
2016/05/02 22:16:30
Doesn't |rect| need to be in the space of parent|
Xianzhu
2016/05/02 22:21:48
Not necessary. The function just inflate the rect
chrishtr
2016/05/02 22:51:50
But if the rect is not originally in the space of
|
+ if (parent == ancestor) { |
+ // We meet ancestor before container. |
+ ASSERT(ancestorSkipped); |
+ break; |
+ } |
+ } |
+ } |
+ |
// The rect we compute at each step is shifted by our x/y offset in the parent container's coordinate space. |
// Only when we cross a writing mode boundary will we have to possibly flipForWritingMode (to convert into a more |
// appropriate offset corner for the enclosing container). |
@@ -2043,7 +2054,7 @@ bool LayoutBox::mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ances |
return container->mapToVisualRectInAncestorSpace(ancestor, rect, visualRectFlags); |
} |
-void LayoutBox::inflatePaintInvalidationRectForReflectionAndFilter(LayoutRect& paintInvalidationRect) const |
+void LayoutBox::inflateVisualRectForReflectionAndFilter(LayoutRect& paintInvalidationRect) const |
{ |
if (!RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && hasReflection()) |
paintInvalidationRect.unite(reflectedRect(paintInvalidationRect)); |