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 24 matching lines...) Expand all Loading... |
35 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
36 #include "wtf/HashSet.h" | 36 #include "wtf/HashSet.h" |
37 #include "wtf/RefCounted.h" | 37 #include "wtf/RefCounted.h" |
38 #include "wtf/RefPtr.h" | 38 #include "wtf/RefPtr.h" |
39 #include "wtf/text/AtomicStringHash.h" | 39 #include "wtf/text/AtomicStringHash.h" |
40 #include "wtf/text/StringHash.h" | 40 #include "wtf/text/StringHash.h" |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class Element; | 44 class Element; |
45 class TracedValue; | |
46 | 45 |
47 // Tracks data to determine which elements of a DOM subtree need to have style | 46 // Tracks data to determine which elements of a DOM subtree need to have style |
48 // recalculated. | 47 // recalculated. |
49 class DescendantInvalidationSet FINAL : public RefCountedWillBeGarbageCollected<
DescendantInvalidationSet> { | 48 class DescendantInvalidationSet FINAL : public RefCountedWillBeGarbageCollected<
DescendantInvalidationSet> { |
50 public: | 49 public: |
51 static PassRefPtrWillBeRawPtr<DescendantInvalidationSet> create() | 50 static PassRefPtrWillBeRawPtr<DescendantInvalidationSet> create() |
52 { | 51 { |
53 return adoptRefWillBeNoop(new DescendantInvalidationSet); | 52 return adoptRefWillBeNoop(new DescendantInvalidationSet); |
54 } | 53 } |
55 | 54 |
(...skipping 12 matching lines...) Expand all Loading... |
68 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; } | 67 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; } |
69 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } | 68 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } |
70 | 69 |
71 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } | 70 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } |
72 bool customPseudoInvalid() const { return m_customPseudoInvalid; } | 71 bool customPseudoInvalid() const { return m_customPseudoInvalid; } |
73 | 72 |
74 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; } |
75 | 74 |
76 void trace(Visitor*); | 75 void trace(Visitor*); |
77 | 76 |
78 void toTracedValue(TracedValue*) const; | |
79 | |
80 #ifndef NDEBUG | 77 #ifndef NDEBUG |
81 void show() const; | 78 void show() const; |
82 #endif | 79 #endif |
83 | 80 |
84 private: | 81 private: |
85 DescendantInvalidationSet(); | 82 DescendantInvalidationSet(); |
86 | 83 |
87 WillBeHeapHashSet<AtomicString>& ensureClassSet(); | 84 WillBeHeapHashSet<AtomicString>& ensureClassSet(); |
88 WillBeHeapHashSet<AtomicString>& ensureIdSet(); | 85 WillBeHeapHashSet<AtomicString>& ensureIdSet(); |
89 WillBeHeapHashSet<AtomicString>& ensureTagNameSet(); | 86 WillBeHeapHashSet<AtomicString>& ensureTagNameSet(); |
(...skipping 11 matching lines...) Expand all Loading... |
101 // If true, all descendants which are custom pseudo elements must be invalid
ated. | 98 // If true, all descendants which are custom pseudo elements must be invalid
ated. |
102 unsigned m_customPseudoInvalid : 1; | 99 unsigned m_customPseudoInvalid : 1; |
103 | 100 |
104 // If true, the invalidation must traverse into ShadowRoots with this set. | 101 // If true, the invalidation must traverse into ShadowRoots with this set. |
105 unsigned m_treeBoundaryCrossing : 1; | 102 unsigned m_treeBoundaryCrossing : 1; |
106 }; | 103 }; |
107 | 104 |
108 } // namespace blink | 105 } // namespace blink |
109 | 106 |
110 #endif // DescendantInvalidationSet_h | 107 #endif // DescendantInvalidationSet_h |
OLD | NEW |