Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1934833002: Ensure filter and reflection outsets are applied on paint invalidation rect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698