Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(750)

Side by Side Diff: Source/core/css/analyzer/DescendantInvalidationSet.h

Issue 208323003: Add support for attribute selectors in TargetedStyleRecalc. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tweaks. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // The argument is the localName() of the QualififedName for the attribute.
esprehn 2014/03/21 23:01:44 This comment doesn't add anything, the argument na
chrishtr 2014/03/21 23:11:21 Done.
60 void addAttribute(const AtomicString& attributeLocalName);
59 61
60 // Appends the classes in this DescendantInvalidationSet to the vector. 62 // Appends the classes in this DescendantInvalidationSet to the vector.
61 void getClasses(Vector<AtomicString>& classes) const; 63 void getClasses(Vector<AtomicString>& classes) const;
62 64
65 // Appends the attributes in this DescendantInvalidationSet to the vector.
66 void getAttributes(Vector<AtomicString>& attributes) const;
67
63 void setWholeSubtreeInvalid(); 68 void setWholeSubtreeInvalid();
64 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } 69 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; }
65 private: 70 private:
66 DescendantInvalidationSet(); 71 DescendantInvalidationSet();
67 72
68 HashSet<AtomicString>& ensureClassSet(); 73 HashSet<AtomicString>& ensureClassSet();
69 HashSet<AtomicString>& ensureIdSet(); 74 HashSet<AtomicString>& ensureIdSet();
70 HashSet<AtomicString>& ensureTagNameSet(); 75 HashSet<AtomicString>& ensureTagNameSet();
76 HashSet<AtomicString>& ensureAttributeSet();
71 77
72 // If true, all descendants might be invalidated, so a full subtree recalc i s required. 78 // If true, all descendants might be invalidated, so a full subtree recalc i s required.
73 bool m_allDescendantsMightBeInvalid; 79 bool m_allDescendantsMightBeInvalid;
74 80
75 // FIXME: optimize this if it becomes a memory issue. 81 // FIXME: optimize this if it becomes a memory issue.
76 OwnPtr<HashSet<AtomicString> > m_classes; 82 OwnPtr<HashSet<AtomicString> > m_classes;
77 OwnPtr<HashSet<AtomicString> > m_ids; 83 OwnPtr<HashSet<AtomicString> > m_ids;
78 OwnPtr<HashSet<AtomicString> > m_tagNames; 84 OwnPtr<HashSet<AtomicString> > m_tagNames;
85 OwnPtr<HashSet<AtomicString> > m_attributes;
79 }; 86 };
80 87
81 } // namespace WebCore 88 } // namespace WebCore
82 89
83 #endif // DescendantInvalidationSet_h 90 #endif // DescendantInvalidationSet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698