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

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 66cb9ed15a87486bad9237ce03a9705a17880a2f..85469ef8baeb70befcdbb797f57ebe3e3d300a91 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -854,8 +854,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.
@@ -865,19 +874,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());
@@ -2564,10 +2580,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();
@@ -2576,21 +2594,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