| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index e2ecccf61c2d5dbc2daaec54dc3e5c07ba06eee8..5c42b241f41d10083753d42dbc81e61d04bdeb01 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -544,20 +544,22 @@ int Element::offsetHeight()
|
| return 0;
|
| }
|
|
|
| -Element* Element::offsetParentForBindings()
|
| -{
|
| - Element* element = offsetParent();
|
| - if (!element || !element->isInShadowTree())
|
| - return element;
|
| - return element->containingShadowRoot()->shouldExposeToBindings() ? element : nullptr;
|
| -}
|
| -
|
| Element* Element::offsetParent()
|
| {
|
| document().updateLayoutIgnorePendingStylesheets();
|
| - if (LayoutObject* renderer = this->layoutObject())
|
| - return renderer->offsetParent();
|
| - return nullptr;
|
| +
|
| + LayoutObject* renderer = layoutObject();
|
| + if (!renderer)
|
| + return nullptr;
|
| +
|
| + Element* element = renderer->offsetParent();
|
| + if (!element)
|
| + return nullptr;
|
| +
|
| + if (element->isInShadowTree() && !element->containingShadowRoot()->shouldExposeToBindings())
|
| + return nullptr;
|
| +
|
| + return element;
|
| }
|
|
|
| int Element::clientLeft()
|
|
|