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

Side by Side Diff: Source/WebCore/css/RuleSet.h

Issue 12755018: Merge 145034 "Make RuleData support up to 8191 selectors" (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | no next file » | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool hasDocumentSecurityOrigin() const { return m_hasDocumentSecurityOrigin; } 71 bool hasDocumentSecurityOrigin() const { return m_hasDocumentSecurityOrigin; }
72 PropertyWhitelistType propertyWhitelistType() const { return static_cast<Pro pertyWhitelistType>(m_propertyWhitelistType); } 72 PropertyWhitelistType propertyWhitelistType() const { return static_cast<Pro pertyWhitelistType>(m_propertyWhitelistType); }
73 // Try to balance between memory usage (there can be lots of RuleData object s) and good filtering performance. 73 // Try to balance between memory usage (there can be lots of RuleData object s) and good filtering performance.
74 static const unsigned maximumIdentifierCount = 4; 74 static const unsigned maximumIdentifierCount = 4;
75 const unsigned* descendantSelectorIdentifierHashes() const { return m_descen dantSelectorIdentifierHashes; } 75 const unsigned* descendantSelectorIdentifierHashes() const { return m_descen dantSelectorIdentifierHashes; }
76 76
77 void reportMemoryUsage(MemoryObjectInfo*) const; 77 void reportMemoryUsage(MemoryObjectInfo*) const;
78 78
79 private: 79 private:
80 StyleRule* m_rule; 80 StyleRule* m_rule;
81 unsigned m_selectorIndex : 12; 81 unsigned m_selectorIndex : 13;
82 // This number was picked fairly arbitrarily. We can probably lower it if we need to. 82 // This number was picked fairly arbitrarily. We can probably lower it if we need to.
83 // Some simple testing showed <100,000 RuleData's on large sites. 83 // Some simple testing showed <100,000 RuleData's on large sites.
84 unsigned m_position : 19; 84 unsigned m_position : 18;
85 unsigned m_hasFastCheckableSelector : 1; 85 unsigned m_hasFastCheckableSelector : 1;
86 unsigned m_specificity : 24; 86 unsigned m_specificity : 24;
87 unsigned m_hasMultipartSelector : 1; 87 unsigned m_hasMultipartSelector : 1;
88 unsigned m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1; 88 unsigned m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;
89 unsigned m_containsUncommonAttributeSelector : 1; 89 unsigned m_containsUncommonAttributeSelector : 1;
90 unsigned m_linkMatchType : 2; // SelectorChecker::LinkMatchMask 90 unsigned m_linkMatchType : 2; // SelectorChecker::LinkMatchMask
91 unsigned m_hasDocumentSecurityOrigin : 1; 91 unsigned m_hasDocumentSecurityOrigin : 1;
92 unsigned m_propertyWhitelistType : 2; 92 unsigned m_propertyWhitelistType : 2;
93 // Use plain array instead of a Vector to minimize memory overhead. 93 // Use plain array instead of a Vector to minimize memory overhead.
94 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; 94 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount];
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 inline RuleSet::RuleSet() 173 inline RuleSet::RuleSet()
174 : m_ruleCount(0) 174 : m_ruleCount(0)
175 , m_autoShrinkToFitEnabled(true) 175 , m_autoShrinkToFitEnabled(true)
176 { 176 {
177 } 177 }
178 178
179 } // namespace WebCore 179 } // namespace WebCore
180 180
181 #endif // RuleSet_h 181 #endif // RuleSet_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698