| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Disambiguate between Node and TreeScope hierarchies; TreeScope's implemen
tation is simpler. | 55 // Disambiguate between Node and TreeScope hierarchies; TreeScope's implemen
tation is simpler. |
| 56 using TreeScope::document; | 56 using TreeScope::document; |
| 57 using TreeScope::getElementById; | 57 using TreeScope::getElementById; |
| 58 | 58 |
| 59 Element* host() const { return toElement(parentOrShadowHostNode()); } | 59 Element* host() const { return toElement(parentOrShadowHostNode()); } |
| 60 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } | 60 ElementShadow* owner() const { return host() ? host()->shadow() : 0; } |
| 61 | 61 |
| 62 virtual void insertedInto(ContainerNode*) override; | 62 virtual void insertedInto(ContainerNode*) override; |
| 63 virtual void removedFrom(ContainerNode*) override; | 63 virtual void removedFrom(ContainerNode*) override; |
| 64 | 64 |
| 65 void registerScopedHTMLStyleChild(); | |
| 66 void unregisterScopedHTMLStyleChild(); | |
| 67 | |
| 68 bool containsContentElements() const; | 65 bool containsContentElements() const; |
| 69 bool containsInsertionPoints() const { return containsContentElements(); } | 66 bool containsInsertionPoints() const { return containsContentElements(); } |
| 70 bool containsShadowRoots() const; | 67 bool containsShadowRoots() const; |
| 71 | 68 |
| 72 // For Internals, don't use this. | 69 // For Internals, don't use this. |
| 73 unsigned childShadowRootCount() const; | 70 unsigned childShadowRootCount() const; |
| 74 unsigned numberOfStyles() const { return m_numberOfStyles; } | |
| 75 | 71 |
| 76 void didAddInsertionPoint(InsertionPoint*); | 72 void didAddInsertionPoint(InsertionPoint*); |
| 77 void didRemoveInsertionPoint(InsertionPoint*); | 73 void didRemoveInsertionPoint(InsertionPoint*); |
| 78 const Vector<RefPtr<InsertionPoint> >& descendantInsertionPoints(); | 74 const Vector<RefPtr<InsertionPoint> >& descendantInsertionPoints(); |
| 79 | 75 |
| 80 // Make protected methods from base class public here. | 76 // Make protected methods from base class public here. |
| 81 using TreeScope::setDocument; | 77 using TreeScope::setDocument; |
| 82 using TreeScope::setParentTreeScope; | 78 using TreeScope::setParentTreeScope; |
| 83 | 79 |
| 84 public: | 80 public: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 98 ShadowRootRareData* ensureShadowRootRareData(); | 94 ShadowRootRareData* ensureShadowRootRareData(); |
| 99 | 95 |
| 100 void addChildShadowRoot(); | 96 void addChildShadowRoot(); |
| 101 void removeChildShadowRoot(); | 97 void removeChildShadowRoot(); |
| 102 void invalidateDescendantInsertionPoints(); | 98 void invalidateDescendantInsertionPoints(); |
| 103 | 99 |
| 104 // ShadowRoots should never be cloned. | 100 // ShadowRoots should never be cloned. |
| 105 virtual PassRefPtr<Node> cloneNode(bool) override { return nullptr; } | 101 virtual PassRefPtr<Node> cloneNode(bool) override { return nullptr; } |
| 106 | 102 |
| 107 OwnPtr<ShadowRootRareData> m_shadowRootRareData; | 103 OwnPtr<ShadowRootRareData> m_shadowRootRareData; |
| 108 unsigned m_numberOfStyles : 27; | |
| 109 unsigned m_registeredWithParentShadowRoot : 1; | 104 unsigned m_registeredWithParentShadowRoot : 1; |
| 110 unsigned m_descendantInsertionPointsIsValid : 1; | 105 unsigned m_descendantInsertionPointsIsValid : 1; |
| 111 }; | 106 }; |
| 112 | 107 |
| 113 inline Element* ShadowRoot::activeElement() const | 108 inline Element* ShadowRoot::activeElement() const |
| 114 { | 109 { |
| 115 return adjustedFocusedElement(); | 110 return adjustedFocusedElement(); |
| 116 } | 111 } |
| 117 | 112 |
| 118 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); | 113 DEFINE_NODE_TYPE_CASTS(ShadowRoot, isShadowRoot()); |
| 119 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); | 114 DEFINE_TYPE_CASTS(ShadowRoot, TreeScope, treeScope, treeScope->rootNode().isShad
owRoot(), treeScope.rootNode().isShadowRoot()); |
| 120 | 115 |
| 121 } // namespace blink | 116 } // namespace blink |
| 122 | 117 |
| 123 #endif // SKY_ENGINE_CORE_DOM_SHADOW_SHADOWROOT_H_ | 118 #endif // SKY_ENGINE_CORE_DOM_SHADOW_SHADOWROOT_H_ |
| OLD | NEW |