mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
Auto merge of #16831 - heycam:autofill, r=emilio
style: Support :-moz-autofill and :-moz-autofill-preview in Gecko. <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16831) <!-- Reviewable:end -->
This commit is contained in:
commit
52240c21d9
3 changed files with 9 additions and 1 deletions
|
@ -115,5 +115,9 @@ bitflags! {
|
||||||
const IN_HANDLER_VULNERABLE_NO_UPDATE_STATE = 1 << 42,
|
const IN_HANDLER_VULNERABLE_NO_UPDATE_STATE = 1 << 42,
|
||||||
/// https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo
|
/// https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo
|
||||||
const IN_FOCUS_WITHIN_STATE = 1 << 43,
|
const IN_FOCUS_WITHIN_STATE = 1 << 43,
|
||||||
|
/// Non-standard & undocumented.
|
||||||
|
const IN_AUTOFILL_STATE = 1 << 50,
|
||||||
|
/// Non-standard & undocumented.
|
||||||
|
const IN_AUTOFILL_PREVIEW_STATE = 1 << 51,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@ macro_rules! apply_non_ts_list {
|
||||||
("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _),
|
("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _),
|
||||||
("-moz-loading", MozLoading, mozLoading, IN_LOADING_STATE, _),
|
("-moz-loading", MozLoading, mozLoading, IN_LOADING_STATE, _),
|
||||||
("-moz-suppressed", MozSuppressed, mozSuppressed, IN_SUPPRESSED_STATE, PSEUDO_CLASS_INTERNAL),
|
("-moz-suppressed", MozSuppressed, mozSuppressed, IN_SUPPRESSED_STATE, PSEUDO_CLASS_INTERNAL),
|
||||||
|
("-moz-autofill", MozAutofill, mozAutofill, IN_AUTOFILL_STATE, PSEUDO_CLASS_INTERNAL),
|
||||||
|
("-moz-autofill-preview", MozAutofillPreview, mozAutofillPreview, IN_AUTOFILL_PREVIEW_STATE, PSEUDO_CLASS_INTERNAL),
|
||||||
|
|
||||||
("-moz-handler-clicktoplay", MozHandlerClickToPlay, mozHandlerClickToPlay, IN_HANDLER_CLICK_TO_PLAY_STATE, PSEUDO_CLASS_INTERNAL),
|
("-moz-handler-clicktoplay", MozHandlerClickToPlay, mozHandlerClickToPlay, IN_HANDLER_CLICK_TO_PLAY_STATE, PSEUDO_CLASS_INTERNAL),
|
||||||
("-moz-handler-vulnerable-updatable", MozHandlerVulnerableUpdatable, mozHandlerVulnerableUpdatable, IN_HANDLER_VULNERABLE_UPDATABLE_STATE, PSEUDO_CLASS_INTERNAL),
|
("-moz-handler-vulnerable-updatable", MozHandlerVulnerableUpdatable, mozHandlerVulnerableUpdatable, IN_HANDLER_VULNERABLE_UPDATABLE_STATE, PSEUDO_CLASS_INTERNAL),
|
||||||
|
|
|
@ -1180,7 +1180,9 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
||||||
NonTSPseudoClass::MozUIInvalid |
|
NonTSPseudoClass::MozUIInvalid |
|
||||||
NonTSPseudoClass::MozMeterOptimum |
|
NonTSPseudoClass::MozMeterOptimum |
|
||||||
NonTSPseudoClass::MozMeterSubOptimum |
|
NonTSPseudoClass::MozMeterSubOptimum |
|
||||||
NonTSPseudoClass::MozMeterSubSubOptimum => {
|
NonTSPseudoClass::MozMeterSubSubOptimum |
|
||||||
|
NonTSPseudoClass::MozAutofill |
|
||||||
|
NonTSPseudoClass::MozAutofillPreview => {
|
||||||
// NB: It's important to use `intersect` instead of `contains`
|
// NB: It's important to use `intersect` instead of `contains`
|
||||||
// here, to handle `:any-link` correctly.
|
// here, to handle `:any-link` correctly.
|
||||||
self.get_state().intersects(pseudo_class.state_flag())
|
self.get_state().intersects(pseudo_class.state_flag())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue