Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5a811b2ddd4d14c8c46e4e5adbfe5ca99e2fa5c9..5ea727f5df69ca5361909e190350e36f86832b3d 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -602,13 +602,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()), layoutObject->styleRef()).round();
+ return adjustLayoutUnitForAbsoluteZoom(LayoutUnit(layoutObject->pixelSnappedOffsetLeft(offsetParent())), layoutObject->styleRef()).round();
return 0;
}
@@ -616,7 +616,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;
}
@@ -624,7 +624,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;
}
@@ -632,7 +632,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;
}
@@ -641,17 +641,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->offsetParent() : nullptr;
}
int Element::clientLeft()

Powered by Google App Engine
This is Rietveld 408576698