OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2009 Google Inc. All rights reserved. | 8 * Copyright (C) 2009 Google Inc. All rights reserved. |
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
10 * (http://www.torchmobile.com/) | 10 * (http://www.torchmobile.com/) |
(...skipping 3199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3210 return nullptr; | 3210 return nullptr; |
3211 | 3211 |
3212 float effectiveZoom = style()->effectiveZoom(); | 3212 float effectiveZoom = style()->effectiveZoom(); |
3213 Node* node = nullptr; | 3213 Node* node = nullptr; |
3214 for (LayoutObject* ancestor = parent(); ancestor; | 3214 for (LayoutObject* ancestor = parent(); ancestor; |
3215 ancestor = ancestor->parent()) { | 3215 ancestor = ancestor->parent()) { |
3216 // Spec: http://www.w3.org/TR/cssom-view/#offset-attributes | 3216 // Spec: http://www.w3.org/TR/cssom-view/#offset-attributes |
3217 | 3217 |
3218 node = ancestor->node(); | 3218 node = ancestor->node(); |
3219 | 3219 |
3220 if (!node) | 3220 if (!node) { |
3221 continue; | 3221 if (!ancestor->virtualContinuation()) |
| 3222 continue; |
| 3223 |
| 3224 // This is an anonymous continuation; ie. our ancestor is really the split |
| 3225 // inline. Find it by spooling to the end of the continuation chain. |
| 3226 |
| 3227 while (LayoutBoxModelObject* cont = ancestor->virtualContinuation()) |
| 3228 ancestor = cont; |
| 3229 |
| 3230 node = ancestor->node(); |
| 3231 |
| 3232 DCHECK(node); |
| 3233 } |
3222 | 3234 |
3223 // TODO(kochi): If |base| or |node| is nested deep in shadow roots, this | 3235 // TODO(kochi): If |base| or |node| is nested deep in shadow roots, this |
3224 // loop may get expensive, as isUnclosedNodeOf() can take up to O(N+M) time | 3236 // loop may get expensive, as isUnclosedNodeOf() can take up to O(N+M) time |
3225 // (N and M are depths). | 3237 // (N and M are depths). |
3226 if (base && | 3238 if (base && |
3227 (node->isClosedShadowHiddenFrom(*base) || | 3239 (node->isClosedShadowHiddenFrom(*base) || |
3228 (node->isInShadowTree() && | 3240 (node->isInShadowTree() && |
3229 node->containingShadowRoot()->type() == ShadowRootType::UserAgent))) { | 3241 node->containingShadowRoot()->type() == ShadowRootType::UserAgent))) { |
3230 // If 'position: fixed' node is found while traversing up, terminate the | 3242 // If 'position: fixed' node is found while traversing up, terminate the |
3231 // loop and return null. | 3243 // loop and return null. |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3557 const blink::LayoutObject* root = object1; | 3569 const blink::LayoutObject* root = object1; |
3558 while (root->parent()) | 3570 while (root->parent()) |
3559 root = root->parent(); | 3571 root = root->parent(); |
3560 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); | 3572 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); |
3561 } else { | 3573 } else { |
3562 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); | 3574 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); |
3563 } | 3575 } |
3564 } | 3576 } |
3565 | 3577 |
3566 #endif | 3578 #endif |
OLD | NEW |