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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2448983002: offsetParent() fails to consider continuations when searching for the parent. (Closed)
Patch Set: Added test case. Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/inline/inline-offsetParent-continuation.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/inline/inline-offsetParent-continuation.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698