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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.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/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 663bafd43d606dc22b1d77cb28b354bb405d56df..24e53f6be10979f106bfa302bafaebb55304fdb0 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -846,20 +846,6 @@ FloatPoint PaintLayer::perspectiveOrigin() const
return FloatPoint(floatValueForLength(style.perspectiveOriginX(), borderBox.width().toFloat()), floatValueForLength(style.perspectiveOriginY(), borderBox.height().toFloat()));
}
-static inline bool isContainerForFixedPositioned(PaintLayer* layer)
-{
- return layer->isRootLayer() || layer->hasTransformRelatedProperty();
-}
-
-static inline bool isContainerForPositioned(PaintLayer* layer)
-{
- // FIXME: This is not in sync with containingBlock.
- // LayoutObject::canContainFixedPositionObjects() should probably be used
- // instead.
- LayoutBoxModelObject* layerlayoutObject = layer->layoutObject();
- return layer->isRootLayer() || layerlayoutObject->isPositioned() || layer->hasTransformRelatedProperty() || layerlayoutObject->style()->containsPaint();
-}
-
PaintLayer* PaintLayer::containingLayerForOutOfFlowPositioned(const PaintLayer* ancestor, bool* skippedAncestor) const
{
ASSERT(!ancestor || skippedAncestor); // If we have specified an ancestor, surely the caller needs to know whether we skipped it.
@@ -867,7 +853,7 @@ PaintLayer* PaintLayer::containingLayerForOutOfFlowPositioned(const PaintLayer*
*skippedAncestor = false;
if (layoutObject()->style()->position() == FixedPosition) {
PaintLayer* curr = parent();
- while (curr && !isContainerForFixedPositioned(curr)) {
+ while (curr && !curr->layoutObject()->canContainFixedPositionObjects()) {
if (skippedAncestor && curr == ancestor)
*skippedAncestor = true;
curr = curr->parent();
@@ -877,7 +863,7 @@ PaintLayer* PaintLayer::containingLayerForOutOfFlowPositioned(const PaintLayer*
}
PaintLayer* curr = parent();
- while (curr && !isContainerForPositioned(curr)) {
+ while (curr && !curr->layoutObject()->canContainAbsolutePositionObjects()) {
if (skippedAncestor && curr == ancestor)
*skippedAncestor = true;
curr = curr->parent();

Powered by Google App Engine
This is Rietveld 408576698