| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class HTMLShadowElement; | 42 class HTMLShadowElement; |
| 43 class InsertionPoint; | 43 class InsertionPoint; |
| 44 class ShadowRootRareData; | 44 class ShadowRootRareData; |
| 45 class StyleSheetList; | 45 class StyleSheetList; |
| 46 | 46 |
| 47 class CORE_EXPORT ShadowRoot final : public DocumentFragment, public TreeScope,
public DoublyLinkedListNode<ShadowRoot> { | 47 class CORE_EXPORT ShadowRoot final : public DocumentFragment, public TreeScope,
public DoublyLinkedListNode<ShadowRoot> { |
| 48 DEFINE_WRAPPERTYPEINFO(); | 48 DEFINE_WRAPPERTYPEINFO(); |
| 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ShadowRoot); | 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ShadowRoot); |
| 50 friend class WTF::DoublyLinkedListNode<ShadowRoot>; | 50 friend class WTF::DoublyLinkedListNode<ShadowRoot>; |
| 51 public: | 51 public: |
| 52 // FIXME: We will support multiple shadow subtrees, however current implemen
tation does not work well | 52 // FIXME: Current implementation does not work well if a shadow root is dyna
mically created. |
| 53 // if a shadow root is dynamically created. So we prohibit multiple shadow s
ubtrees | 53 // So multiple shadow subtrees in several elements are prohibited. |
| 54 // in several elements for a while. | 54 // See https://github.com/w3c/webcomponents/issues/102 and http://crbug.com/
234020 |
| 55 // See https://bugs.webkit.org/show_bug.cgi?id=77503 and related bugs. | |
| 56 enum ShadowRootType { | 55 enum ShadowRootType { |
| 57 UserAgentShadowRoot = 0, | 56 UserAgentShadowRoot = 0, |
| 58 OpenShadowRoot | 57 OpenShadowRoot |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 static PassRefPtrWillBeRawPtr<ShadowRoot> create(Document& document, ShadowR
ootType type) | 60 static PassRefPtrWillBeRawPtr<ShadowRoot> create(Document& document, ShadowR
ootType type) |
| 62 { | 61 { |
| 63 return adoptRefWillBeNoop(new ShadowRoot(document, type)); | 62 return adoptRefWillBeNoop(new ShadowRoot(document, type)); |
| 64 } | 63 } |
| 65 | 64 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 return adjustedFocusedElement(); | 162 return adjustedFocusedElement(); |
| 164 } | 163 } |
| 165 | 164 |
| 166 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); | 165 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); |
| 167 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); | 166 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); |
| 168 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); | 167 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); |
| 169 | 168 |
| 170 } // namespace blink | 169 } // namespace blink |
| 171 | 170 |
| 172 #endif // ShadowRoot_h | 171 #endif // ShadowRoot_h |
| OLD | NEW |