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

Side by Side Diff: Source/core/css/invalidation/InvalidationSet.h

Issue 1349543004: CSS: Avoid invalidating style when only descendants need updating (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: invalidatesSelf Created 5 years, 3 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
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/invalidation/InvalidationSet.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 void combine(const InvalidationSet& other); 62 void combine(const InvalidationSet& other);
63 63
64 void addClass(const AtomicString& className); 64 void addClass(const AtomicString& className);
65 void addId(const AtomicString& id); 65 void addId(const AtomicString& id);
66 void addTagName(const AtomicString& tagName); 66 void addTagName(const AtomicString& tagName);
67 void addAttribute(const AtomicString& attributeLocalName); 67 void addAttribute(const AtomicString& attributeLocalName);
68 68
69 void setWholeSubtreeInvalid(); 69 void setWholeSubtreeInvalid();
70 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } 70 bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; }
71 71
72 void setInvalidatesSelf() { m_invalidatesSelf = true; }
73 bool invalidatesSelf() const { return m_invalidatesSelf; }
74
72 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; } 75 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; }
73 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } 76 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; }
74 77
75 void setInsertionPointCrossing() { m_insertionPointCrossing = true; } 78 void setInsertionPointCrossing() { m_insertionPointCrossing = true; }
76 bool insertionPointCrossing() const { return m_insertionPointCrossing; } 79 bool insertionPointCrossing() const { return m_insertionPointCrossing; }
77 80
78 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } 81 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; }
79 bool customPseudoInvalid() const { return m_customPseudoInvalid; } 82 bool customPseudoInvalid() const { return m_customPseudoInvalid; }
80 83
81 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr ibutes && !m_customPseudoInvalid; } 84 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr ibutes && !m_customPseudoInvalid; }
(...skipping 16 matching lines...) Expand all
98 101
99 // FIXME: optimize this if it becomes a memory issue. 102 // FIXME: optimize this if it becomes a memory issue.
100 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_classes; 103 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_classes;
101 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_ids; 104 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_ids;
102 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_tagNames; 105 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_tagNames;
103 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_attributes; 106 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_attributes;
104 107
105 // If true, all descendants might be invalidated, so a full subtree recalc i s required. 108 // If true, all descendants might be invalidated, so a full subtree recalc i s required.
106 unsigned m_allDescendantsMightBeInvalid : 1; 109 unsigned m_allDescendantsMightBeInvalid : 1;
107 110
111 // If true, the element itself is invalid.
112 unsigned m_invalidatesSelf : 1;
113
108 // If true, all descendants which are custom pseudo elements must be invalid ated. 114 // If true, all descendants which are custom pseudo elements must be invalid ated.
109 unsigned m_customPseudoInvalid : 1; 115 unsigned m_customPseudoInvalid : 1;
110 116
111 // If true, the invalidation must traverse into ShadowRoots with this set. 117 // If true, the invalidation must traverse into ShadowRoots with this set.
112 unsigned m_treeBoundaryCrossing : 1; 118 unsigned m_treeBoundaryCrossing : 1;
113 119
114 // If true, insertion point descendants must be invalidated. 120 // If true, insertion point descendants must be invalidated.
115 unsigned m_insertionPointCrossing : 1; 121 unsigned m_insertionPointCrossing : 1;
116 }; 122 };
117 123
118 } // namespace blink 124 } // namespace blink
119 125
120 #endif // InvalidationSet_h 126 #endif // InvalidationSet_h
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/invalidation/InvalidationSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698