| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 bool containsContentElements() const { return m_descendantContentElementCoun
t; } | 56 bool containsContentElements() const { return m_descendantContentElementCoun
t; } |
| 57 bool containsShadowRoots() const { return m_childShadowRootCount; } | 57 bool containsShadowRoots() const { return m_childShadowRootCount; } |
| 58 | 58 |
| 59 unsigned descendantShadowElementCount() const { return m_descendantShadowEle
mentCount; } | 59 unsigned descendantShadowElementCount() const { return m_descendantShadowEle
mentCount; } |
| 60 | 60 |
| 61 void didAddChildShadowRoot() { ++m_childShadowRootCount; } | 61 void didAddChildShadowRoot() { ++m_childShadowRootCount; } |
| 62 void didRemoveChildShadowRoot() { ASSERT(m_childShadowRootCount > 0); --m_ch
ildShadowRootCount; } | 62 void didRemoveChildShadowRoot() { ASSERT(m_childShadowRootCount > 0); --m_ch
ildShadowRootCount; } |
| 63 | 63 |
| 64 unsigned childShadowRootCount() const { return m_childShadowRootCount; } | 64 unsigned childShadowRootCount() const { return m_childShadowRootCount; } |
| 65 | 65 |
| 66 const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> >& descendantInser
tionPoints() { return m_descendantInsertionPoints; } | 66 const WillBeHeapVector<RefPtrWillBeMember<InsertionPoint>>& descendantInsert
ionPoints() { return m_descendantInsertionPoints; } |
| 67 void setDescendantInsertionPoints(WillBeHeapVector<RefPtrWillBeMember<Insert
ionPoint> >& list) { m_descendantInsertionPoints.swap(list); } | 67 void setDescendantInsertionPoints(WillBeHeapVector<RefPtrWillBeMember<Insert
ionPoint>>& list) { m_descendantInsertionPoints.swap(list); } |
| 68 void clearDescendantInsertionPoints() { m_descendantInsertionPoints.clear();
} | 68 void clearDescendantInsertionPoints() { m_descendantInsertionPoints.clear();
} |
| 69 | 69 |
| 70 StyleSheetList* styleSheets() { return m_styleSheetList.get(); } | 70 StyleSheetList* styleSheets() { return m_styleSheetList.get(); } |
| 71 void setStyleSheets(PassRefPtrWillBeRawPtr<StyleSheetList> styleSheetList) {
m_styleSheetList = styleSheetList; } | 71 void setStyleSheets(PassRefPtrWillBeRawPtr<StyleSheetList> styleSheetList) {
m_styleSheetList = styleSheetList; } |
| 72 | 72 |
| 73 DEFINE_INLINE_TRACE() | 73 DEFINE_INLINE_TRACE() |
| 74 { | 74 { |
| 75 visitor->trace(m_shadowInsertionPointOfYoungerShadowRoot); | 75 visitor->trace(m_shadowInsertionPointOfYoungerShadowRoot); |
| 76 visitor->trace(m_descendantInsertionPoints); | 76 visitor->trace(m_descendantInsertionPoints); |
| 77 visitor->trace(m_styleSheetList); | 77 visitor->trace(m_styleSheetList); |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 RefPtrWillBeMember<HTMLShadowElement> m_shadowInsertionPointOfYoungerShadowR
oot; | 81 RefPtrWillBeMember<HTMLShadowElement> m_shadowInsertionPointOfYoungerShadowR
oot; |
| 82 unsigned m_descendantShadowElementCount; | 82 unsigned m_descendantShadowElementCount; |
| 83 unsigned m_descendantContentElementCount; | 83 unsigned m_descendantContentElementCount; |
| 84 unsigned m_childShadowRootCount; | 84 unsigned m_childShadowRootCount; |
| 85 WillBeHeapVector<RefPtrWillBeMember<InsertionPoint> > m_descendantInsertionP
oints; | 85 WillBeHeapVector<RefPtrWillBeMember<InsertionPoint>> m_descendantInsertionPo
ints; |
| 86 RefPtrWillBeMember<StyleSheetList> m_styleSheetList; | 86 RefPtrWillBeMember<StyleSheetList> m_styleSheetList; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point) | 89 inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point) |
| 90 { | 90 { |
| 91 ASSERT(point); | 91 ASSERT(point); |
| 92 if (isHTMLShadowElement(*point)) | 92 if (isHTMLShadowElement(*point)) |
| 93 ++m_descendantShadowElementCount; | 93 ++m_descendantShadowElementCount; |
| 94 else if (isHTMLContentElement(*point)) | 94 else if (isHTMLContentElement(*point)) |
| 95 ++m_descendantContentElementCount; | 95 ++m_descendantContentElementCount; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 107 else | 107 else |
| 108 ASSERT_NOT_REACHED(); | 108 ASSERT_NOT_REACHED(); |
| 109 | 109 |
| 110 ASSERT(m_descendantContentElementCount >= 0); | 110 ASSERT(m_descendantContentElementCount >= 0); |
| 111 ASSERT(m_descendantShadowElementCount >= 0); | 111 ASSERT(m_descendantShadowElementCount >= 0); |
| 112 } | 112 } |
| 113 | 113 |
| 114 } // namespace blink | 114 } // namespace blink |
| 115 | 115 |
| 116 #endif | 116 #endif |
| OLD | NEW |