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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.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/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 7ac36217c03aabd4d46414910e3b8dbcc33f3d81..d8ef7c3cf7e60e91ff3f909a7cc0e6e8dd15d9c4 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -853,8 +853,17 @@ inline void LayoutObject::invalidateContainerPreferredLogicalWidths()
}
}
-LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
+bool LayoutObject::hasFilterOrReflection() const
{
+ return (!RuntimeEnabledFeatures::cssBoxReflectFilterEnabled() && hasReflection())
+ || (hasLayer() && toLayoutBoxModelObject(this)->layer()->hasFilterInducingProperty());
+}
+
+LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped, bool* filterOrReflectionSkipped) const
+{
+ ASSERT(!ancestorSkipped || !*ancestorSkipped);
+ ASSERT(!filterOrReflectionSkipped || !*filterOrReflectionSkipped);
+
// We technically just want our containing block, but
// we may not have one if we're part of an uninstalled
// subtree. We'll climb as high as we can though.
@@ -864,19 +873,26 @@ LayoutObject* LayoutObject::containerForAbsolutePosition(const LayoutBoxModelObj
if (ancestorSkipped && object == ancestor)
*ancestorSkipped = true;
+
+ if (filterOrReflectionSkipped && object->hasFilterOrReflection())
+ *filterOrReflectionSkipped = true;
}
return nullptr;
}
-LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
+LayoutBlock* LayoutObject::containerForFixedPosition(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped, bool* filterOrReflectionSkipped) const
{
ASSERT(!ancestorSkipped || !*ancestorSkipped);
+ ASSERT(!filterOrReflectionSkipped || !*filterOrReflectionSkipped);
ASSERT(!isText());
LayoutObject* object = parent();
for (; object && !object->canContainFixedPositionObjects(); object = object->parent()) {
if (ancestorSkipped && object == ancestor)
*ancestorSkipped = true;
+
+ if (filterOrReflectionSkipped && object->hasFilterOrReflection())
+ *filterOrReflectionSkipped = true;
}
ASSERT(!object || !object->isAnonymousBlock());
@@ -2563,10 +2579,12 @@ RespectImageOrientationEnum LayoutObject::shouldRespectImageOrientation(const La
return DoNotRespectImageOrientation;
}
-LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped) const
+LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool* ancestorSkipped, bool* filterOrReflectionSkipped) const
{
if (ancestorSkipped)
*ancestorSkipped = false;
+ if (filterOrReflectionSkipped)
+ *filterOrReflectionSkipped = false;
LayoutObject* o = parent();
@@ -2575,21 +2593,21 @@ LayoutObject* LayoutObject::container(const LayoutBoxModelObject* ancestor, bool
EPosition pos = m_style->position();
if (pos == FixedPosition)
- return containerForFixedPosition(ancestor, ancestorSkipped);
+ return containerForFixedPosition(ancestor, ancestorSkipped, filterOrReflectionSkipped);
if (pos == AbsolutePosition)
- return containerForAbsolutePosition(ancestor, ancestorSkipped);
+ return containerForAbsolutePosition(ancestor, ancestorSkipped, filterOrReflectionSkipped);
if (isColumnSpanAll()) {
LayoutObject* multicolContainer = spannerPlaceholder()->container();
- if (ancestorSkipped && ancestor) {
+ if ((ancestorSkipped && ancestor) || filterOrReflectionSkipped) {
// We jumped directly from the spanner to the multicol container. Need to check if
- // we skipped |paintInvalidationContainer| on the way.
+ // we skipped |ancestor| or filter/reflection on the way.
for (LayoutObject* walker = parent(); walker && walker != multicolContainer; walker = walker->parent()) {
- if (walker == ancestor) {
+ if (ancestorSkipped && walker == ancestor)
*ancestorSkipped = true;
- break;
- }
+ if (filterOrReflectionSkipped && walker->hasFilterOrReflection())
+ *filterOrReflectionSkipped = true;
}
}
return multicolContainer;

Powered by Google App Engine
This is Rietveld 408576698