Bug 55573 - Selector usage flags should not be set by the CSS parser
Summary: Selector usage flags should not be set by the CSS parser
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 05:42 PST by Antti Koivisto
Modified: 2011-03-02 11:09 PST (History)
0 users

See Also:


Attachments
move figuring out the selector flags to CSSStyleSelector (25.13 KB, patch)
2011-03-02 05:56 PST, Antti Koivisto
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2011-03-02 05:42:06 PST
Currently flags like Document::usesSiblingRules() are set directly by the CSS parser. This is wrong as we may parse stylesheets that are not actually used for document rendering. This is especially bad when the page uses querySelectorAll(). As a result we may end up in various performance penalty boxes triggered by complex selectors for no good reason.
Comment 1 Antti Koivisto 2011-03-02 05:56:36 PST
Created attachment 84410 [details]
move figuring out the selector flags to CSSStyleSelector

- Use the selector traversal in style selector constructor to figure out which flags actually are needed for the currently active style sheets.
- Remove the flag related code from the CSS parser/grammar.
- Remove the usesDescendantRules flag completely. We have descendant rules in the default style sheet, so every document uses them.
Comment 2 Dave Hyatt 2011-03-02 09:48:36 PST
Comment on attachment 84410 [details]
move figuring out the selector flags to CSSStyleSelector

r=me
Comment 3 Antti Koivisto 2011-03-02 11:09:11 PST
http://trac.webkit.org/changeset/80150