Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
index 7b7996ca542c27b32613429569ccd690bd5d2d9f..a3338a4cedc35febe6238e96a23f4964e0f4fc9e 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -3279,6 +3279,16 @@ Element* LayoutObject::offsetParent() const |
return node && node->isElementNode() ? toElement(node) : nullptr; |
} |
+Element* LayoutObject::unclosedOffsetParent() const |
+{ |
+ Element* element = offsetParent(); |
+ |
+ while (element && (!element->isUnclosedNodeOf(*node()) || (element->isInShadowTree() && element->containingShadowRoot()->type() == ShadowRootType::UserAgent))) |
+ element = element->layoutObject()->offsetParent(); |
+ |
+ return element; |
+} |
+ |
PositionWithAffinity LayoutObject::createPositionWithAffinity(int offset, TextAffinity affinity) |
{ |
// If this is a non-anonymous layoutObject in an editable area, then it's simple. |