mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Auto merge of #15983 - canaltinova:pseudo-classes, r=upsuper
Stylo: Add some missing pseudo classes --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Bug 1341739](https://bugzilla.mozilla.org/show_bug.cgi?id=1341739) <!-- Either: --> - [X] These changes do not require tests because they are stylo changes. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/15983) <!-- Reviewable:end -->
This commit is contained in:
commit
403bfdaaee
3 changed files with 18 additions and 2 deletions
|
@ -37,7 +37,13 @@ bitflags! {
|
|||
const IN_TARGET_STATE = 0x100,
|
||||
#[doc = "https://fullscreen.spec.whatwg.org/#%3Afullscreen-pseudo-class"]
|
||||
const IN_FULLSCREEN_STATE = 0x200,
|
||||
#[doc = "https://html.spec.whatwg.org/multipage/#selector-valid"]
|
||||
const IN_VALID_STATE = 0x400,
|
||||
#[doc = "https://html.spec.whatwg.org/multipage/#selector-invalid"]
|
||||
const IN_INVALID_STATE = 0x800,
|
||||
#[doc = "Non-standard: https://developer.mozilla.org/en-US/docs/Web/CSS/:-moz-ui-valid"]
|
||||
const IN_MOZ_UI_VALID_STATE = 0x1000,
|
||||
#[doc = "https://html.spec.whatwg.org/multipage/#selector-read-write"]
|
||||
const IN_READ_WRITE_STATE = 0x400,
|
||||
const IN_READ_WRITE_STATE = 0x2000,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,11 @@ macro_rules! apply_non_ts_list {
|
|||
("disabled", Disabled, disabled, IN_DISABLED_STATE, _),
|
||||
("checked", Checked, checked, IN_CHECKED_STATE, _),
|
||||
("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _),
|
||||
("placeholder-shown", PlaceholderShown, placeholderShown, IN_PLACEHOLDER_SHOWN_STATE, _),
|
||||
("target", Target, target, IN_TARGET_STATE, _),
|
||||
("valid", Valid, valid, IN_VALID_STATE, _),
|
||||
("invalid", Invalid, invalid, IN_INVALID_STATE, _),
|
||||
("-moz-ui-valid", MozUIValid, mozUIValid, IN_MOZ_UI_VALID_STATE, _),
|
||||
("read-write", ReadWrite, _, IN_READ_WRITE_STATE, _),
|
||||
("read-only", ReadOnly, _, IN_READ_WRITE_STATE, _),
|
||||
|
||||
|
|
|
@ -651,7 +651,12 @@ impl<'le> ::selectors::Element for GeckoElement<'le> {
|
|||
NonTSPseudoClass::Checked |
|
||||
NonTSPseudoClass::ReadWrite |
|
||||
NonTSPseudoClass::Fullscreen |
|
||||
NonTSPseudoClass::Indeterminate => {
|
||||
NonTSPseudoClass::Indeterminate |
|
||||
NonTSPseudoClass::PlaceholderShown |
|
||||
NonTSPseudoClass::Target |
|
||||
NonTSPseudoClass::Valid |
|
||||
NonTSPseudoClass::Invalid |
|
||||
NonTSPseudoClass::MozUIValid => {
|
||||
self.get_state().contains(pseudo_class.state_flag())
|
||||
},
|
||||
NonTSPseudoClass::ReadOnly => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue