| 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 ebaa903a39c876845428c9f71fc889bc35ced02e..dfb370b074bee4421e726b2fc1b5ef6cee70ef46 100644
|
| --- a/third_party/WebKit/Source/core/dom/Element.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp
|
| @@ -607,7 +607,7 @@ int Element::offsetLeft()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft()), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft(offsetParent())), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -615,7 +615,7 @@ int Element::offsetTop()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop()), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop(offsetParent())), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -623,7 +623,7 @@ int Element::offsetWidth()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth()), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth(offsetParent())), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -631,7 +631,7 @@ int Element::offsetHeight()
|
| {
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| - return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight()), layoutObject->styleRef()).round();
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight(offsetParent())), layoutObject->styleRef()).round();
|
| return 0;
|
| }
|
|
|
| @@ -640,17 +640,7 @@ Element* Element::offsetParent()
|
| document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
|
|
| LayoutObject* layoutObject = this->layoutObject();
|
| - if (!layoutObject)
|
| - return nullptr;
|
| -
|
| - Element* element = layoutObject->offsetParent();
|
| - if (!element)
|
| - return nullptr;
|
| -
|
| - if (element->isInShadowTree() && !element->containingShadowRoot()->isOpenOrV0())
|
| - return nullptr;
|
| -
|
| - return element;
|
| + return layoutObject ? layoutObject->unclosedOffsetParent() : nullptr;
|
| }
|
|
|
| int Element::clientLeft()
|
|
|