Bug 50790 - Add simple pseudoelement style resolution and adapt slider thumb to use it.
Summary: Add simple pseudoelement style resolution and adapt slider thumb to use it.
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Dimitri Glazkov (Google)
URL:
Keywords:
Depends on:
Blocks: 46595
  Show dependency treegraph
 
Reported: 2010-12-09 16:17 PST by Dimitri Glazkov (Google)
Modified: 2010-12-17 08:48 PST (History)
4 users (show)

See Also:


Attachments
Patch (4.63 KB, patch)
2010-12-09 16:22 PST, Dimitri Glazkov (Google)
hyatt: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitri Glazkov (Google) 2010-12-09 16:17:35 PST
Add simple pseudoelement style resolution and adapt slider thumb to use it.
Comment 1 Dimitri Glazkov (Google) 2010-12-09 16:22:15 PST
Created attachment 76134 [details]
Patch
Comment 2 Dimitri Glazkov (Google) 2010-12-09 16:24:02 PST
Dave, this is still pretty hacky, but at least there's no double-resolving the style as it was in the first RenderSlider patch.

Long-term, I guess we should rework pseudoElement resolution to be more like normal element matching. WDYT?
Comment 3 Dave Hyatt 2010-12-10 13:58:41 PST
Comment on attachment 76134 [details]
Patch

This feature is comparable to the :xbl-pseudo.

http://www.w3.org/TR/xbl/#the-xblpseudo

It's basically something new, a hybrid, that is both an element with a shadow DOM position (that needs to match normal rules that apply to that element type), but that also matches pseudo-element rules.

*This is not a pseudo style.*

It's a normal style that happens to also match a pseudo-element rule.  Your instinct to patch styleForElement is correct, but you need to implement it such that you don't lose normal rule matching as well.

Here's the basic template I would use.

(1) Remove the hard-coded pseudo-element from the pseudo-element list.  It shouldn't be there any more.
(2) Have elements know their shadowPseudoId.  That part is fine.
(3) Flag rules that have unrecognized pseudo-elements (and that are therefore potentially matched by a shadow pseudo). You should be able to make another hash (similar to the id, tag, class hashes) that lets you easily grab rules for your shadow pseudo id.
(4) Match on it treating the shadow pseudo id as yourself (and then you have to go to the parent to test it for the rest of the rule, similar to a > selector).
Comment 4 Dimitri Glazkov (Google) 2010-12-17 08:48:32 PST
(In reply to comment #3)
> (From update of attachment 76134 [details])
> This feature is comparable to the :xbl-pseudo.
> 
> http://www.w3.org/TR/xbl/#the-xblpseudo
> 
> It's basically something new, a hybrid, that is both an element with a shadow DOM position (that needs to match normal rules that apply to that element type), but that also matches pseudo-element rules.
> 
> *This is not a pseudo style.*
> 
> It's a normal style that happens to also match a pseudo-element rule.  Your instinct to patch styleForElement is correct, but you need to implement it such that you don't lose normal rule matching as well.
> 
> Here's the basic template I would use.
> 
> (1) Remove the hard-coded pseudo-element from the pseudo-element list.  It shouldn't be there any more.
> (2) Have elements know their shadowPseudoId.  That part is fine.
> (3) Flag rules that have unrecognized pseudo-elements (and that are therefore potentially matched by a shadow pseudo). You should be able to make another hash (similar to the id, tag, class hashes) that lets you easily grab rules for your shadow pseudo id.
> (4) Match on it treating the shadow pseudo id as yourself (and then you have to go to the parent to test it for the rest of the rule, similar to a > selector).

This is basically the TODO list for bug 46595, closing this as invalid.