Title: [145034] trunk/Source/WebCore
Revision
145034
Author
[email protected]
Date
2013-03-06 20:54:39 -0800 (Wed, 06 Mar 2013)

Log Message

Make RuleData support up to 8191 selectors
https://bugs.webkit.org/show_bug.cgi?id=111663

Patch by Philippe Liard <[email protected]> on 2013-03-06
Reviewed by Andreas Kling.

r125294 made RuleData consume less memory by replacing a pointer with
an index encoded on 12 bits.
This unfortunately breaks Chrome for Android (and others) when a lot of
CSS is used or more precisely when selectorIndex cannot be stored on 12
bits.

Threfore this change decreases the number of bits used to store
m_position by 1 (from 19 to 18) and adds this extra bit to
m_selectorIndex so that values up to 8191 can be stored safely without
overflowing.

* css/RuleSet.h:
(RuleData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (145033 => 145034)


--- trunk/Source/WebCore/ChangeLog	2013-03-07 04:47:51 UTC (rev 145033)
+++ trunk/Source/WebCore/ChangeLog	2013-03-07 04:54:39 UTC (rev 145034)
@@ -1,3 +1,24 @@
+2013-03-06  Philippe Liard  <[email protected]>
+
+        Make RuleData support up to 8191 selectors
+        https://bugs.webkit.org/show_bug.cgi?id=111663
+
+        Reviewed by Andreas Kling.
+
+        r125294 made RuleData consume less memory by replacing a pointer with
+        an index encoded on 12 bits.
+        This unfortunately breaks Chrome for Android (and others) when a lot of
+        CSS is used or more precisely when selectorIndex cannot be stored on 12
+        bits.
+
+        Threfore this change decreases the number of bits used to store
+        m_position by 1 (from 19 to 18) and adds this extra bit to
+        m_selectorIndex so that values up to 8191 can be stored safely without
+        overflowing.
+
+        * css/RuleSet.h:
+        (RuleData):
+
 2013-03-06  Seokju Kwon  <[email protected]>
 
         Web Inspector: Remove unused code from contextmenu of element panel

Modified: trunk/Source/WebCore/css/RuleSet.h (145033 => 145034)


--- trunk/Source/WebCore/css/RuleSet.h	2013-03-07 04:47:51 UTC (rev 145033)
+++ trunk/Source/WebCore/css/RuleSet.h	2013-03-07 04:54:39 UTC (rev 145034)
@@ -78,10 +78,10 @@
 
 private:
     StyleRule* m_rule;
-    unsigned m_selectorIndex : 12;
+    unsigned m_selectorIndex : 13;
     // 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 : 19;
+    unsigned m_position : 18;
     unsigned m_hasFastCheckableSelector : 1;
     unsigned m_specificity : 24;
     unsigned m_hasMultipartSelector : 1;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to