OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 using TreeScope::getElementById; | 71 using TreeScope::getElementById; |
72 | 72 |
73 // TODO(kochi): crbug.com/507413 In non-Oilpan, host() may return null durin
g queued | 73 // TODO(kochi): crbug.com/507413 In non-Oilpan, host() may return null durin
g queued |
74 // event handling (e.g. during execCommand()). | 74 // event handling (e.g. during execCommand()). |
75 Element* host() const { return toElement(parentOrShadowHostNode()); } | 75 Element* host() const { return toElement(parentOrShadowHostNode()); } |
76 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } | 76 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } |
77 | 77 |
78 ShadowRoot* youngerShadowRoot() const { return prev(); } | 78 ShadowRoot* youngerShadowRoot() const { return prev(); } |
79 | 79 |
80 ShadowRoot* olderShadowRootForBindings() const; | 80 ShadowRoot* olderShadowRootForBindings() const; |
| 81 // TODO(hayato): Rename this to more less-confusing name. This is likely to
be misued because isOpen() includes V0 too. |
81 bool isOpen() const { return type() == ShadowRootType::V0 || type() == Shado
wRootType::Open; } | 82 bool isOpen() const { return type() == ShadowRootType::V0 || type() == Shado
wRootType::Open; } |
82 bool isV1() const { return type() == ShadowRootType::Open || type() == Shado
wRootType::Closed; } | 83 bool isV1() const { return type() == ShadowRootType::Open || type() == Shado
wRootType::Closed; } |
83 | 84 |
84 bool isYoungest() const { return !youngerShadowRoot(); } | 85 bool isYoungest() const { return !youngerShadowRoot(); } |
85 bool isOldest() const { return !olderShadowRoot(); } | 86 bool isOldest() const { return !olderShadowRoot(); } |
86 | 87 |
87 void attach(const AttachContext& = AttachContext()) override; | 88 void attach(const AttachContext& = AttachContext()) override; |
88 | 89 |
89 InsertionNotificationRequest insertedInto(ContainerNode*) override; | 90 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
90 void removedFrom(ContainerNode*) override; | 91 void removedFrom(ContainerNode*) override; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 return adjustedFocusedElement(); | 171 return adjustedFocusedElement(); |
171 } | 172 } |
172 | 173 |
173 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); | 174 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); |
174 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); | 175 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); |
175 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); | 176 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); |
176 | 177 |
177 } // namespace blink | 178 } // namespace blink |
178 | 179 |
179 #endif // ShadowRoot_h | 180 #endif // ShadowRoot_h |
OLD | NEW |