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 766252d70d6bdd42ebb27ef0bbd76d8e34442683..5976f163e43cb9d98f1057fc1ca3505aad78d5d4 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp |
@@ -3217,8 +3217,20 @@ Element* LayoutObject::offsetParent(const Element* base) const { |
node = ancestor->node(); |
- if (!node) |
- continue; |
+ if (!node) { |
+ if (!ancestor->virtualContinuation()) |
+ continue; |
+ |
+ // This is an anonymous continuation; ie. our ancestor is really the split |
+ // inline. Find it by spooling to the end of the continuation chain. |
+ |
+ while (LayoutBoxModelObject* cont = ancestor->virtualContinuation()) |
+ ancestor = cont; |
+ |
+ node = ancestor->node(); |
+ |
+ DCHECK(node); |
+ } |
// TODO(kochi): If |base| or |node| is nested deep in shadow roots, this |
// loop may get expensive, as isUnclosedNodeOf() can take up to O(N+M) time |