https://bugs.webkit.org/show_bug.cgi?id=74314
Reviewed by Antti Koivisto.
Lower m_position to something more reasonable. A million
should be plenty. Current large sites (e.g. gmail) seem to use
tens of thousands.
Added a COMPILE_ASSERT to ensure this doesn't regress.
No new tests.
* css/CSSStyleSelector.cpp:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@102613
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-12-12 Ojan Vafai <ojan@chromium.org>
+
+ r102234 caused RuleData to use 33 bits in its bitmask
+ https://bugs.webkit.org/show_bug.cgi?id=74314
+
+ Reviewed by Antti Koivisto.
+
+ Lower m_position to something more reasonable. A million
+ should be plenty. Current large sites (e.g. gmail) seem to use
+ tens of thousands.
+
+ Added a COMPILE_ASSERT to ensure this doesn't regress.
+
+ No new tests.
+
+ * css/CSSStyleSelector.cpp:
+
2011-12-12 James Robinson <jamesr@chromium.org>
Rename webkitCancelRequestAnimationFrame to webkitCancelAnimationFrame to match spec change
CSSStyleRule* m_rule;
CSSSelector* m_selector;
unsigned m_specificity;
- unsigned m_position : 26;
+ // 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 : 25;
bool m_hasFastCheckableSelector : 1;
bool m_hasMultipartSelector : 1;
bool m_hasRightmostSelectorMatchingHTMLBasedOnRuleHash : 1;
// Use plain array instead of a Vector to minimize memory overhead.
unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount];
};
+
+struct SameSizeAsRuleData {
+ void* a;
+ void* b;
+ unsigned c;
+ unsigned d;
+ unsigned e[4];
+};
+
+COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_stay_small);
class RuleSet {
WTF_MAKE_NONCOPYABLE(RuleSet);