| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 static PassRefPtr<ShadowRoot> create(Document& document, ShadowRootType type
) | 58 static PassRefPtr<ShadowRoot> create(Document& document, ShadowRootType type
) |
| 59 { | 59 { |
| 60 return adoptRef(new ShadowRoot(document, type)); | 60 return adoptRef(new ShadowRoot(document, type)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void recalcStyle(StyleRecalcChange); | 63 void recalcStyle(StyleRecalcChange); |
| 64 | 64 |
| 65 // Disambiguate between Node and TreeScope hierarchies; TreeScope's implemen
tation is simpler. | 65 // Disambiguate between Node and TreeScope hierarchies; TreeScope's implemen
tation is simpler. |
| 66 using TreeScope::document; | 66 using TreeScope::document; |
| 67 using TreeScope::getElementById; |
| 67 | 68 |
| 68 Element* host() const { return toElement(parentOrShadowHostNode()); } | 69 Element* host() const { return toElement(parentOrShadowHostNode()); } |
| 69 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } | 70 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } |
| 70 | 71 |
| 71 ShadowRoot* youngerShadowRoot() const { return prev(); } | 72 ShadowRoot* youngerShadowRoot() const { return prev(); } |
| 72 | 73 |
| 73 ShadowRoot* olderShadowRootForBindings() const; | 74 ShadowRoot* olderShadowRootForBindings() const; |
| 74 bool shouldExposeToBindings() const { return type() == AuthorShadowRoot; } | 75 bool shouldExposeToBindings() const { return type() == AuthorShadowRoot; } |
| 75 | 76 |
| 76 bool isYoungest() const { return !youngerShadowRoot(); } | 77 bool isYoungest() const { return !youngerShadowRoot(); } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 { | 156 { |
| 156 return adjustedFocusedElement(); | 157 return adjustedFocusedElement(); |
| 157 } | 158 } |
| 158 | 159 |
| 159 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); | 160 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); |
| 160 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); | 161 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); |
| 161 | 162 |
| 162 } // namespace | 163 } // namespace |
| 163 | 164 |
| 164 #endif | 165 #endif |
| OLD | NEW |