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 fae72842b367f9582de641faae9588229239546c..d2a15b0e3c817932c5aa918a06ee8d41870f30bc 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -613,10 +613,10 @@ PaintLayer* LayoutObject::enclosingLayer() const { |
PaintLayer* LayoutObject::paintingLayer() const { |
for (const LayoutObject* current = this; current; |
- // Use containingBlock instead of paintInvalidationParent for floating |
- // object to omit any self-painting layers of inline objects that don't |
- // paint the floating object. |
- current = current->isFloating() ? current->containingBlock() |
+ // Use container instead of paintInvalidationParent for floating object |
+ // to omit any self-painting layers of inline objects that don't paint |
+ // the floating object. |
+ current = current->isFloating() ? current->container() |
: current->paintInvalidationParent()) { |
if (current->hasLayer() && |
toLayoutBoxModelObject(current)->layer()->isSelfPaintingLayer()) { |
@@ -2468,9 +2468,8 @@ LayoutObject* LayoutObject::container(AncestorSkipInfo* skipInfo) const { |
if (pos == FixedPosition) |
return containerForFixedPosition(skipInfo); |
- if (pos == AbsolutePosition) { |
+ if (pos == AbsolutePosition) |
return containerForAbsolutePosition(skipInfo); |
- } |
if (isColumnSpanAll()) { |
LayoutObject* multicolContainer = spannerPlaceholder()->container(); |
@@ -2484,8 +2483,14 @@ LayoutObject* LayoutObject::container(AncestorSkipInfo* skipInfo) const { |
return multicolContainer; |
} |
- if (isFloating()) |
- return containingBlock(skipInfo); |
+ if (isFloating()) { |
+ for (LayoutObject* object = parent(); object; object = object->parent()) { |
+ if (object->canContainFloatingObject(*this)) |
+ return object; |
+ if (skipInfo) |
+ skipInfo->update(*object); |
+ } |
+ } |
chrishtr
2017/01/21 02:14:59
ASSERT_NOT_REACHED()
|
return parent(); |
} |