mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
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
This commit is contained in:
parent
949fd0e172
commit
1ce75ff7dd
17 changed files with 70 additions and 220 deletions
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue