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

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

Issue 2194913002: Ensure that we consistently check contains: paint for fixed position containment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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 4a8c20e3dea1bc54408e7779dd067fe549010a9d..681374d984ae9a33d8fa017e12bdc7b534958fdf 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1728,10 +1728,10 @@ LayoutUnit LayoutBox::perpendicularContainingBlockLogicalHeight() const
void LayoutBox::mapLocalToAncestor(const LayoutBoxModelObject* ancestor, TransformState& transformState, MapCoordinatesFlags mode) const
{
bool isFixedPos = style()->position() == FixedPosition;
- bool hasTransform = hasLayer() && layer()->transform();
- // If this box has a transform, it acts as a fixed position container for fixed descendants,
+
+ // If this box has a transform or contains paint, it acts as a fixed position container for fixed descendants,
// and may itself also be fixed position. So propagate 'fixed' up only if this box is fixed position.
- if (hasTransform && !isFixedPos)
+ if (style()->canContainFixedPositionObjects() && !isFixedPos)
mode &= ~IsFixed;
else if (isFixedPos)
mode |= IsFixed;
@@ -1745,9 +1745,9 @@ void LayoutBox::mapAncestorToLocal(const LayoutBoxModelObject* ancestor, Transfo
return;
bool isFixedPos = style()->position() == FixedPosition;
- bool hasTransform = hasLayer() && layer()->transform();
- if (hasTransform && !isFixedPos) {
- // If this box has a transform, it acts as a fixed position container for fixed descendants,
+
+ if (style()->canContainFixedPositionObjects() && !isFixedPos) {
+ // If this box has a transform or contains paint, it acts as a fixed position container for fixed descendants,
// and may itself also be fixed position. So propagate 'fixed' up only if this box is fixed position.
mode &= ~IsFixed;
} else if (isFixedPos) {

Powered by Google App Engine
This is Rietveld 408576698