WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
77528
<style scoped>: Implement scoped selector matching in the slow path
https://bugs.webkit.org/show_bug.cgi?id=77528
Summary
<style scoped>: Implement scoped selector matching in the slow path
Roland Steiner
Reported
2012-02-01 01:37:37 PST
Implement scoped selector matching, but don't allow rules from scoped stylesheets to use the fast selector checking path for the time being.
Attachments
Patch
(31.27 KB, patch)
2012-02-10 01:58 PST
,
Roland Steiner
koivisto
: review+
koivisto
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Roland Steiner
Comment 1
2012-02-10 01:58:14 PST
Created
attachment 126478
[details]
Patch Patch, doing the slow path only, incorporating the changes to SelectorChecker compared to the old patches in
bug 73192
, also somewhat simplifed logic.
Antti Koivisto
Comment 2
2012-02-13 15:50:56 PST
Comment on
attachment 126478
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=126478&action=review
r=me, but consider the comments
> Source/WebCore/css/CSSStyleSelector.cpp:176 > + RuleData(CSSStyleRule*, CSSSelector*, unsigned position, bool canUseFastChecking = true);
Something like canUseFastCheckSelector would be a better name here and elsewhere (so it is clear what is being checked)
> Source/WebCore/css/CSSStyleSelector.h:283 > +#if ENABLE(STYLE_SCOPED) > + MatchOptions(bool includeEmptyRules, const Element* scope = 0) : scope(scope), includeEmptyRules(includeEmptyRules) { } > + const Element* scope; > + bool includeEmptyRules; > +#else > + MatchOptions(bool includeEmptyRules) : includeEmptyRules(includeEmptyRules) { } > + bool includeEmptyRules; > +#endif
I think you can remove #if ENABLE(STYLE_SCOPED) here and just default the scope to null.
> Source/WebCore/css/SelectorChecker.cpp:490 > - for (; nextContext.element; nextContext.element = nextContext.element->parentElement()) { > + for (;;) { > + if (nextContext.element == nextContext.scope) > + return SelectorFailsCompletely; > + nextContext.element = nextContext.element->parentElement(); > + if (!nextContext.element) > + return SelectorFailsCompletely;
You can keep the for loop as is if you do the following...
> Source/WebCore/css/SelectorChecker.cpp:498 > case CSSSelector::Child: > + if (nextContext.element == nextContext.scope) > + return SelectorFailsCompletely;
This test (current element is the scope) is repeated for all cases except SubSelector. I think it could be moved before the nextContext initialization with a relation != SubSelector test.
Roland Steiner
Comment 3
2012-02-16 01:31:32 PST
Committed
r107911
: <
http://trac.webkit.org/changeset/107911
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug