Bug 100582

Summary: Get rid of StyleResolver state related to unknown pseudo-elements.
Product: WebKit Reporter: Dimitri Glazkov (Google) <dglazkov>
Component: New BugsAssignee: Dimitri Glazkov (Google) <dglazkov>
Status: RESOLVED FIXED    
Severity: Normal CC: allan.jensen, cmarcelo, eric, koivisto, macpherson, menard, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 89879    
Attachments:
Description Flags
Patch
none
Patch none

Dimitri Glazkov (Google)
Reported 2012-10-26 17:06:30 PDT
Get rid of StyleResolver state related to unknown pseudo-elements.
Attachments
Patch (8.00 KB, patch)
2012-10-26 17:13 PDT, Dimitri Glazkov (Google)
no flags
Patch (16.53 KB, patch)
2012-10-28 09:09 PDT, Dimitri Glazkov (Google)
no flags
Dimitri Glazkov (Google)
Comment 1 2012-10-26 17:13:43 PDT
Eric Seidel (no email)
Comment 2 2012-10-26 17:59:06 PDT
Comment on attachment 171056 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171056&action=review > Source/WebCore/css/StyleResolver.h:364 > + bool checkSelector(const RuleData&, const ContainerNode* scope, RuleApplicability); Should this default to CanBeAnything? (Which is a confusing name, btw.) Maybe these should be RestrictToUnknownPseudoElements, NoRestrictions? I"m not fully sure what this does to provide better naming help...
Dimitri Glazkov (Google)
Comment 3 2012-10-26 18:49:00 PDT
Comment on attachment 171056 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171056&action=review >> Source/WebCore/css/StyleResolver.h:364 >> + bool checkSelector(const RuleData&, const ContainerNode* scope, RuleApplicability); > > Should this default to CanBeAnything? (Which is a confusing name, btw.) > > Maybe these should be RestrictToUnknownPseudoElements, NoRestrictions? > > I"m not fully sure what this does to provide better naming help... Sure, I'd love naming help: CanBeAnything --> there are no restrictions in this TreeScope (which is like a little document-type subtree -- think Shadow DOM subtree), the rule can just do normal matching NeedsUnknownPseudoElement --> this rule is very likely _not_ to match, because it's probably in a different TreeScope, but just in case it contains an unknown pseudo-element, it _could_ match, so we have to check the full selector. Does this make a bit more sense?
Eric Seidel (no email)
Comment 4 2012-10-26 20:41:18 PDT
Comment on attachment 171056 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=171056&action=review >>> Source/WebCore/css/StyleResolver.h:364 >>> + bool checkSelector(const RuleData&, const ContainerNode* scope, RuleApplicability); >> >> Should this default to CanBeAnything? (Which is a confusing name, btw.) >> >> Maybe these should be RestrictToUnknownPseudoElements, NoRestrictions? >> >> I"m not fully sure what this does to provide better naming help... > > Sure, I'd love naming help: > > CanBeAnything --> there are no restrictions in this TreeScope (which is like a little document-type subtree -- think Shadow DOM subtree), the rule can just do normal matching > NeedsUnknownPseudoElement --> this rule is very likely _not_ to match, because it's probably in a different TreeScope, but just in case it contains an unknown pseudo-element, it _could_ match, so we have to check the full selector. > > Does this make a bit more sense? What's an unknown pseudo element? :)
Dimitri Glazkov (Google)
Comment 5 2012-10-26 20:50:30 PDT
(In reply to comment #4) > What's an unknown pseudo element? :) It's a pseudo-element that's known neither to standard CSS3/4 pseudo-elements nor WebKit's internal plumbing (like scrollbars pseudo-elements). An unknown pseudo-element in a selector means one of two things: 1) the author made a typo 2) the author is using custom pseudo-elements in shadow DOM (http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#custom-pseudo-elements). We use these in pretty much all of the built-in HTML controls (like "-webkit-slider-thumb" is used to style the little knob on the range slider). Did I succeed in explaining? :)
Dimitri Glazkov (Google)
Comment 6 2012-10-27 21:12:03 PDT
Comment on attachment 171056 [details] Patch I have a much better patch. Please hold.
Dimitri Glazkov (Google)
Comment 7 2012-10-28 09:09:24 PDT
Eric Seidel (no email)
Comment 8 2012-10-28 12:50:25 PDT
Comment on attachment 171130 [details] Patch LGTM.
WebKit Review Bot
Comment 9 2012-10-28 15:35:51 PDT
Comment on attachment 171130 [details] Patch Clearing flags on attachment: 171130 Committed r132754: <http://trac.webkit.org/changeset/132754>
WebKit Review Bot
Comment 10 2012-10-28 15:35:55 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.