OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void combine(const DescendantInvalidationSet& other); | 57 void combine(const DescendantInvalidationSet& other); |
58 | 58 |
59 void addClass(const AtomicString& className); | 59 void addClass(const AtomicString& className); |
60 void addId(const AtomicString& id); | 60 void addId(const AtomicString& id); |
61 void addTagName(const AtomicString& tagName); | 61 void addTagName(const AtomicString& tagName); |
62 void addAttribute(const AtomicString& attributeLocalName); | 62 void addAttribute(const AtomicString& attributeLocalName); |
63 | 63 |
64 void setWholeSubtreeInvalid(); | 64 void setWholeSubtreeInvalid(); |
65 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } | 65 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } |
66 | 66 |
| 67 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; } |
| 68 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } |
| 69 |
67 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } | 70 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } |
68 bool customPseudoInvalid() const { return m_customPseudoInvalid; } | 71 bool customPseudoInvalid() const { return m_customPseudoInvalid; } |
69 | 72 |
70 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr
ibutes; } | 73 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr
ibutes; } |
71 | 74 |
72 void trace(Visitor*); | 75 void trace(Visitor*); |
73 | 76 |
74 private: | 77 private: |
75 DescendantInvalidationSet(); | 78 DescendantInvalidationSet(); |
76 | 79 |
77 WillBeHeapHashSet<AtomicString>& ensureClassSet(); | 80 WillBeHeapHashSet<AtomicString>& ensureClassSet(); |
78 WillBeHeapHashSet<AtomicString>& ensureIdSet(); | 81 WillBeHeapHashSet<AtomicString>& ensureIdSet(); |
79 WillBeHeapHashSet<AtomicString>& ensureTagNameSet(); | 82 WillBeHeapHashSet<AtomicString>& ensureTagNameSet(); |
80 WillBeHeapHashSet<AtomicString>& ensureAttributeSet(); | 83 WillBeHeapHashSet<AtomicString>& ensureAttributeSet(); |
81 | 84 |
82 // If true, all descendants might be invalidated, so a full subtree recalc i
s required. | |
83 bool m_allDescendantsMightBeInvalid; | |
84 | |
85 // If true, all descendants which are custom pseudo elements must be invalid
ated. | |
86 bool m_customPseudoInvalid; | |
87 | |
88 // FIXME: optimize this if it becomes a memory issue. | 85 // FIXME: optimize this if it becomes a memory issue. |
89 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_classes; | 86 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_classes; |
90 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_ids; | 87 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_ids; |
91 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_tagNames; | 88 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_tagNames; |
92 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_attributes; | 89 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString> > m_attributes; |
| 90 |
| 91 // If true, all descendants might be invalidated, so a full subtree recalc i
s required. |
| 92 unsigned m_allDescendantsMightBeInvalid : 1; |
| 93 |
| 94 // If true, all descendants which are custom pseudo elements must be invalid
ated. |
| 95 unsigned m_customPseudoInvalid : 1; |
| 96 |
| 97 // If true, the invalidation must traverse into ShadowRoots with this set. |
| 98 unsigned m_treeBoundaryCrossing : 1; |
93 }; | 99 }; |
94 | 100 |
95 } // namespace WebCore | 101 } // namespace WebCore |
96 | 102 |
97 #endif // DescendantInvalidationSet_h | 103 #endif // DescendantInvalidationSet_h |
OLD | NEW |