-
Notifications
You must be signed in to change notification settings - Fork 43
Support type=text
and type=color
Input Pseudo Element Selector
#198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support type=text
and type=color
Input Pseudo Element Selector
#198
Conversation
Signed-off-by: stevennovaryo <[email protected]>
Signed-off-by: stevennovaryo <[email protected]>
80ec17c
to
591932e
Compare
// Gecko definitely has pseudo-elements with style attributes, like | ||
// ::-moz-color-swatch. | ||
debug_assert!( | ||
cfg!(feature = "gecko") || style_attribute.is_none() || pseudo_element.is_none(), | ||
"Style attributes do not apply to pseudo-elements" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are also allowing style attributes for pseudo element. Notice that, in Servo, this will applies only for the pseudo element with a concrete element behind it (i.e. implemented pseudo element).
Could you help with the review of the companion PR as well? Thank you! @xiaochengh |
style/servo/selector_parser.rs
Outdated
@@ -190,7 +202,7 @@ impl PseudoElement { | |||
/// Whether this pseudo-element is the ::-moz-color-swatch pseudo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Whether this pseudo-element is the ::-moz-color-swatch pseudo. | |
/// Whether this pseudo-element is the ::-servo-input-color-swatch pseudo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit
Signed-off-by: stevennovaryo <[email protected]>
I suppose both of the changes for pseudo element in Stylo and Servo is ready to be merged, could someone with a permission help with the merge? |
Add
::-servo-text-control-inner-editor
,::-servo-text-control-inner-container
,::-servo-text-control-placeholder
, and::-servo-input-color-swatch
pseudo element selector supporting the implementation of oftype=text
andtype=color
input element.These selectors would have a lazy cascade type. Additionally, implement
PseudoElement::is_color_swatch
for::-servo-input-color-swatch
which would prevent the tampering of its background color .Stylo companion of servo/servo#37427.