Changeset 145034 in webkit


Ignore:
Timestamp:
Mar 6, 2013 8:54:39 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Philippe Liard <pliard@chromium.org> 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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r145032 r145034  
     12013-03-06  Philippe Liard  <pliard@chromium.org>
     2
     3        Make RuleData support up to 8191 selectors
     4        https://bugs.webkit.org/show_bug.cgi?id=111663
     5
     6        Reviewed by Andreas Kling.
     7
     8        r125294 made RuleData consume less memory by replacing a pointer with
     9        an index encoded on 12 bits.
     10        This unfortunately breaks Chrome for Android (and others) when a lot of
     11        CSS is used or more precisely when selectorIndex cannot be stored on 12
     12        bits.
     13
     14        Threfore this change decreases the number of bits used to store
     15        m_position by 1 (from 19 to 18) and adds this extra bit to
     16        m_selectorIndex so that values up to 8191 can be stored safely without
     17        overflowing.
     18
     19        * css/RuleSet.h:
     20        (RuleData):
     21
    1222013-03-06  Seokju Kwon  <seokju.kwon@gmail.com>
    223
  • trunk/Source/WebCore/css/RuleSet.h

    r140530 r145034  
    7979private:
    8080    StyleRule* m_rule;
    81     unsigned m_selectorIndex : 12;
     81    unsigned m_selectorIndex : 13;
    8282    // This number was picked fairly arbitrarily. We can probably lower it if we need to.
    8383    // Some simple testing showed <100,000 RuleData's on large sites.
    84     unsigned m_position : 19;
     84    unsigned m_position : 18;
    8585    unsigned m_hasFastCheckableSelector : 1;
    8686    unsigned m_specificity : 24;
Note: See TracChangeset for help on using the changeset viewer.