| Index: third_party/WebKit/Source/core/dom/Element.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
|
| index ef260adf32dc31fb8e8c0d0dfbfbde675c104369..0bcf77243892135e22812a8b23726200945e0f96 100644
|
| --- a/third_party/WebKit/Source/core/dom/Element.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp
|
| @@ -622,13 +622,13 @@ void Element::callApplyScroll(ScrollState& scrollState)
|
| nativeApplyScroll(scrollState);
|
| if (callback->nativeScrollBehavior() == WebNativeScrollBehavior::PerformAfterNativeScroll)
|
| callback->handleEvent(&scrollState);
|
| -}
|
| +};
|
|
|
| int Element::offsetLeft()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft(offsetParent())), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft()), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -636,7 +636,7 @@ int Element::offsetTop()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop(offsetParent())), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop()), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -644,7 +644,7 @@ int Element::offsetWidth()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth(offsetParent())), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth()), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -652,7 +652,7 @@ int Element::offsetHeight()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight(offsetParent())), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight()), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -661,7 +661,17 @@ Element* Element::offsetParent()
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
|
|
| LayoutObject* layoutObject = this->layoutObject();
|
| - return layoutObject ? layoutObject->offsetParent() : nullptr;
|
| + if (!layoutObject)
|
| + return nullptr;
|
| +
|
| + Element* element = layoutObject->offsetParent();
|
| + if (!element)
|
| + return nullptr;
|
| +
|
| + if (element->isInShadowTree() && !element->containingShadowRoot()->isOpenOrV0())
|
| + return nullptr;
|
| +
|
| + return element;
|
| }
|
|
|
| int Element::clientLeft()
|
|
|