| Index: third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| diff --git a/third_party/WebKit/Source/core/html/HTMLElement.cpp b/third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| index 97f7595717213225f3016ec684e83d20fafde47f..9ad44bc51ab4e5e494a0f973a5e9836cd8eac6d6 100644
|
| --- a/third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| +++ b/third_party/WebKit/Source/core/html/HTMLElement.cpp
|
| @@ -54,6 +54,7 @@
|
| #include "core/html/HTMLTemplateElement.h"
|
| #include "core/html/HTMLTextFormControlElement.h"
|
| #include "core/html/parser/HTMLParserIdioms.h"
|
| +#include "core/layout/LayoutBoxModelObject.h"
|
| #include "core/layout/LayoutObject.h"
|
| #include "core/page/SpatialNavigation.h"
|
| #include "platform/Language.h"
|
| @@ -1051,6 +1052,49 @@ const AtomicString& HTMLElement::eventParameterName()
|
| return eventString;
|
| }
|
|
|
| +int HTMLElement::offsetLeftForBinding()
|
| +{
|
| + document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| + if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft(unclosedOffsetParent())), layoutObject->styleRef()).round();
|
| + return 0;
|
| +}
|
| +
|
| +int HTMLElement::offsetTopForBinding()
|
| +{
|
| + document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| + if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetTop(unclosedOffsetParent())), layoutObject->styleRef()).round();
|
| + return 0;
|
| +}
|
| +
|
| +int HTMLElement::offsetWidthForBinding()
|
| +{
|
| + document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| + if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetWidth(unclosedOffsetParent())), layoutObject->styleRef()).round();
|
| + return 0;
|
| +}
|
| +
|
| +int HTMLElement::offsetHeightForBinding()
|
| +{
|
| + document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| + if (LayoutBoxModelObject* layoutObject = layoutBoxModelObject())
|
| + return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetHeight(unclosedOffsetParent())), layoutObject->styleRef()).round();
|
| + return 0;
|
| +}
|
| +
|
| +Element* HTMLElement::unclosedOffsetParent()
|
| +{
|
| + document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this);
|
| +
|
| + LayoutObject* layoutObject = this->layoutObject();
|
| + if (!layoutObject)
|
| + return nullptr;
|
| +
|
| + return layoutObject->offsetParent(this);
|
| +}
|
| +
|
| } // namespace blink
|
|
|
| #ifndef NDEBUG
|
|
|