RESOLVED FIXED Bug 54103
Implement fast path for matching simple selectors
https://bugs.webkit.org/show_bug.cgi?id=54103
Summary Implement fast path for matching simple selectors
Antti Koivisto
Reported 2011-02-09 07:20:00 PST
Common selectors consisting of id, class and tag rules only can be resolved much faster using a specialized fast path.
Attachments
patch (11.95 KB, patch)
2011-02-09 15:36 PST, Antti Koivisto
darin: review+
Antti Koivisto
Comment 1 2011-02-09 15:36:26 PST
Created attachment 81885 [details] patch Implement a fast path for single and descendant selectors consisting of id, class and tag selectors only. Selectors like this are marked on style selector initialization. When encountered during style matching the are resolved using a fast path. Since selectors like are very common, this speeds up style matching quite a bit (up to 50% on some sites according to Shark).
WebKit Review Bot
Comment 2 2011-02-09 15:38:45 PST
Attachment 81885 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/css/CSSStyleSelector.cpp:2122: A case label should not be indented, but line up with its switch statement. [whitespace/indent] [4] Total errors found: 1 in 3 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3 2011-02-09 16:02:36 PST
Comment on attachment 81885 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=81885&action=review > Source/WebCore/css/CSSStyleSelector.cpp:365 > + bool canFastCheckSelector() const { return m_canFastCheckSelector; } > + bool hasMultipartSelector() const { return m_hasMultipartSelector; } > + bool topHTMLSelectorMatchesBasedOnRuleHash() const { return m_topHTMLSelectorMatchesBasedOnRuleHash; } When possible I prefer booleans that read like sentences “rule data <xxx>”. The first and third names here don’t really work that way.
Antti Koivisto
Comment 4 2011-02-10 02:43:41 PST
Note You need to log in before you can comment on or make changes to this bug.