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

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

Issue 2173963002: Ensure that we consistently check contains: paint for fixed position containment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove trailing whitespace 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 6b443a587a2ce3eacddf7d97d75734b7ee46f0d8..2e3fc8252abf0146aa9b84aae1a373b54bc7bc1e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1722,10 +1722,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;
@@ -1739,9 +1739,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