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..87b382affe98ab14745f1b1f9efa12af937baefd 100644 |
--- a/third_party/WebKit/Source/core/dom/Element.cpp |
+++ b/third_party/WebKit/Source/core/dom/Element.cpp |
@@ -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() |