| 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 e913d31e1340f849c08cc1f8b86a41dd5aee504c..1e2b3b75c8fca137cdf97d7d31b046c71c391b01 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
|
| @@ -2504,8 +2504,17 @@ LayoutObject* LayoutObject::container(AncestorSkipInfo* skipInfo) const {
|
| return multicolContainer;
|
| }
|
|
|
| - if (isFloating())
|
| - return containingBlock(skipInfo);
|
| + if (isFloating()) {
|
| + // Skip non-atomic inline ancestors, but nothing else. We want to stop at
|
| + // e.g. LayoutMedia objects, since they act as containing blocks but do not
|
| + // inherit from LayoutBlock (so we cannot just use containingBlock() here).
|
| + for (LayoutObject* walker = parent(); walker; walker = walker->parent()) {
|
| + if (!walker->isLayoutInline())
|
| + return walker;
|
| + if (skipInfo)
|
| + skipInfo->update(*walker);
|
| + }
|
| + }
|
|
|
| return parent();
|
| }
|
|
|