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) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004-2011, 2014 Apple Inc. All rights reserved. |
6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 6 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
7 * (http://www.torchmobile.com/) | 7 * (http://www.torchmobile.com/) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 // Returns nullptr, a child of ShadowRoot, or a legacy shadow root. | 327 // Returns nullptr, a child of ShadowRoot, or a legacy shadow root. |
328 Node* nonBoundaryShadowTreeRootNode(); | 328 Node* nonBoundaryShadowTreeRootNode(); |
329 | 329 |
330 // Node's parent, shadow tree host. | 330 // Node's parent, shadow tree host. |
331 ContainerNode* parentOrShadowHostNode() const; | 331 ContainerNode* parentOrShadowHostNode() const; |
332 Element* parentOrShadowHostElement() const; | 332 Element* parentOrShadowHostElement() const; |
333 void setParentOrShadowHostNode(ContainerNode*); | 333 void setParentOrShadowHostNode(ContainerNode*); |
334 | 334 |
335 // Knows about all kinds of hosts. | 335 // Knows about all kinds of hosts. |
336 ContainerNode* parentOrShadowHostOrTemplateHostNode() const; | 336 ContainerNode* parentOrShadowHostOrTemplateHostNode() const { |
| 337 if (UNLIKELY(isDocumentFragment() && !isShadowRoot())) |
| 338 return parentOrShadowHostOrTemplateHostNodeForDocumentFragment(); |
| 339 return parentOrShadowHostNode(); |
| 340 } |
| 341 ContainerNode* parentOrShadowHostOrTemplateHostNodeForDocumentFragment() |
| 342 const; |
337 | 343 |
338 // Returns the parent node, but nullptr if the parent node is a ShadowRoot. | 344 // Returns the parent node, but nullptr if the parent node is a ShadowRoot. |
339 ContainerNode* nonShadowBoundaryParentNode() const; | 345 ContainerNode* nonShadowBoundaryParentNode() const; |
340 | 346 |
341 // Returns the enclosing event parent Element (or self) that, when clicked, | 347 // Returns the enclosing event parent Element (or self) that, when clicked, |
342 // would trigger a navigation. | 348 // would trigger a navigation. |
343 Element* enclosingLinkEventParentOrSelf() const; | 349 Element* enclosingLinkEventParentOrSelf() const; |
344 | 350 |
345 // These low-level calls give the caller responsibility for maintaining the | 351 // These low-level calls give the caller responsibility for maintaining the |
346 // integrity of the tree. | 352 // integrity of the tree. |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 } // namespace blink | 1031 } // namespace blink |
1026 | 1032 |
1027 #ifndef NDEBUG | 1033 #ifndef NDEBUG |
1028 // Outside the WebCore namespace for ease of invocation from gdb. | 1034 // Outside the WebCore namespace for ease of invocation from gdb. |
1029 void showNode(const blink::Node*); | 1035 void showNode(const blink::Node*); |
1030 void showTree(const blink::Node*); | 1036 void showTree(const blink::Node*); |
1031 void showNodePath(const blink::Node*); | 1037 void showNodePath(const blink::Node*); |
1032 #endif | 1038 #endif |
1033 | 1039 |
1034 #endif // Node_h | 1040 #endif // Node_h |
OLD | NEW |