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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 static PassRefPtr<DescendantInvalidationSet> create() | 49 static PassRefPtr<DescendantInvalidationSet> create() |
50 { | 50 { |
51 return adoptRef(new DescendantInvalidationSet); | 51 return adoptRef(new DescendantInvalidationSet); |
52 } | 52 } |
53 | 53 |
54 void combine(const DescendantInvalidationSet& other); | 54 void combine(const DescendantInvalidationSet& other); |
55 | 55 |
56 void addClass(const AtomicString& className); | 56 void addClass(const AtomicString& className); |
57 void addId(const AtomicString& id); | 57 void addId(const AtomicString& id); |
58 void addTagName(const AtomicString& tagName); | 58 void addTagName(const AtomicString& tagName); |
| 59 void addAttribute(const AtomicString& attributeLocalName); |
59 | 60 |
60 // Appends the classes in this DescendantInvalidationSet to the vector. | 61 // Appends the classes in this DescendantInvalidationSet to the vector. |
61 void getClasses(Vector<AtomicString>& classes) const; | 62 void getClasses(Vector<AtomicString>& classes) const; |
62 | 63 |
| 64 // Appends the attributes in this DescendantInvalidationSet to the vector. |
| 65 void getAttributes(Vector<AtomicString>& attributes) const; |
| 66 |
63 void setWholeSubtreeInvalid(); | 67 void setWholeSubtreeInvalid(); |
64 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } | 68 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } |
65 private: | 69 private: |
66 DescendantInvalidationSet(); | 70 DescendantInvalidationSet(); |
67 | 71 |
68 HashSet<AtomicString>& ensureClassSet(); | 72 HashSet<AtomicString>& ensureClassSet(); |
69 HashSet<AtomicString>& ensureIdSet(); | 73 HashSet<AtomicString>& ensureIdSet(); |
70 HashSet<AtomicString>& ensureTagNameSet(); | 74 HashSet<AtomicString>& ensureTagNameSet(); |
| 75 HashSet<AtomicString>& ensureAttributeSet(); |
71 | 76 |
72 // If true, all descendants might be invalidated, so a full subtree recalc i
s required. | 77 // If true, all descendants might be invalidated, so a full subtree recalc i
s required. |
73 bool m_allDescendantsMightBeInvalid; | 78 bool m_allDescendantsMightBeInvalid; |
74 | 79 |
75 // FIXME: optimize this if it becomes a memory issue. | 80 // FIXME: optimize this if it becomes a memory issue. |
76 OwnPtr<HashSet<AtomicString> > m_classes; | 81 OwnPtr<HashSet<AtomicString> > m_classes; |
77 OwnPtr<HashSet<AtomicString> > m_ids; | 82 OwnPtr<HashSet<AtomicString> > m_ids; |
78 OwnPtr<HashSet<AtomicString> > m_tagNames; | 83 OwnPtr<HashSet<AtomicString> > m_tagNames; |
| 84 OwnPtr<HashSet<AtomicString> > m_attributes; |
79 }; | 85 }; |
80 | 86 |
81 } // namespace WebCore | 87 } // namespace WebCore |
82 | 88 |
83 #endif // DescendantInvalidationSet_h | 89 #endif // DescendantInvalidationSet_h |
OLD | NEW |