diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-06-07 23:09:52 +0000 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-10-02 14:37:19 +0000 |
commit | 1ce75ff7dd4d31eaba0f333e25dcbda68aef89d6 (patch) | |
tree | 556f116101b6104122e99d713e204d7f8a3962c3 /components/style/selector_parser.rs | |
parent | 949fd0e172a1cfa9db4b3634192687baa3c253f1 (diff) | |
download | servo-1ce75ff7dd4d31eaba0f333e25dcbda68aef89d6.tar.gz servo-1ce75ff7dd4d31eaba0f333e25dcbda68aef89d6.zip |
style: Unify Gecko and Servo EventState/ElementState bits
Add a dom/base/rust crate called just "dom" where we can share these.
Most of the changes are automatic:
s/mozilla::EventStates/mozilla::dom::ElementState/
s/EventStates/ElementState/
s/NS_EVENT_STATE_/ElementState::/
s/NS_DOCUMENT_STATE_/DocumentState::/
And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.
Differential Revision: https://phabricator.services.mozilla.com/D148537
Diffstat (limited to 'components/style/selector_parser.rs')
-rw-r--r-- | components/style/selector_parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/style/selector_parser.rs b/components/style/selector_parser.rs index f29cab9735d..4586c33f470 100644 --- a/components/style/selector_parser.rs +++ b/components/style/selector_parser.rs @@ -6,11 +6,11 @@ #![deny(missing_docs)] -use crate::element_state::ElementState; use crate::stylesheets::{Namespaces, Origin, UrlExtraData}; use crate::values::serialize_atom_identifier; use crate::Atom; use cssparser::{Parser as CssParser, ParserInput}; +use dom::ElementState; use selectors::parser::SelectorList; use std::fmt::{self, Debug, Write}; use style_traits::{CssWriter, ParseError, ToCss}; @@ -220,8 +220,8 @@ impl Direction { /// Gets the element state relevant to this :dir() selector. pub fn element_state(&self) -> ElementState { match self.as_horizontal_direction() { - Some(HorizontalDirection::Ltr) => ElementState::IN_LTR_STATE, - Some(HorizontalDirection::Rtl) => ElementState::IN_RTL_STATE, + Some(HorizontalDirection::Ltr) => ElementState::LTR, + Some(HorizontalDirection::Rtl) => ElementState::RTL, None => ElementState::empty(), } } |