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

Unified Diff: third_party/WebKit/Source/core/css/RuleSet.h

Issue 2785103004: Added available bit to m_selectorIndex. (Closed)
Patch Set: Prefer unit test. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/RuleSet.h
diff --git a/third_party/WebKit/Source/core/css/RuleSet.h b/third_party/WebKit/Source/core/css/RuleSet.h
index d8ad82f5ffeee46b824cabbe4bc426fdbc347b18..d6530ff771d2831e3fcdde1a5f064d171da59ed6 100644
--- a/third_party/WebKit/Source/core/css/RuleSet.h
+++ b/third_party/WebKit/Source/core/css/RuleSet.h
@@ -111,17 +111,23 @@ class CORE_EXPORT RuleData {
private:
Member<StyleRule> m_rule;
- unsigned m_selectorIndex : 13;
- // We store an array of RuleData objects in a primitive array.
- unsigned m_isLastInArray : 1;
+ // This number is picked fairly arbitrary. If lowered, be aware that there
+ // might be sites and extensions using style rules with selector lists
+ // exceeding the number of simple selectors to fit in this bitfield.
+ // See https://crbug.com/312913 and https://crbug.com/704562
+ unsigned m_selectorIndex : 14;
// This number was picked fairly arbitrarily. We can probably lower it if we
// need to. Some simple testing showed <100,000 RuleData's on large sites.
unsigned m_position : 18;
+ // 32 bits above
unsigned m_specificity : 24;
unsigned m_containsUncommonAttributeSelector : 1;
unsigned m_linkMatchType : 2; // CSSSelector::LinkMatchMask
unsigned m_hasDocumentSecurityOrigin : 1;
unsigned m_propertyWhitelist : 2;
+ // We store an array of RuleData objects in a primitive array.
+ unsigned m_isLastInArray : 1;
+ // 31 bits above
// Use plain array instead of a Vector to minimize memory overhead.
unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount];
};
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/selector-list-limits.html ('k') | third_party/WebKit/Source/core/css/RuleSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698