mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
parent
e6b05fa204
commit
10f3ef42bb
7 changed files with 73 additions and 27 deletions
|
@ -8,8 +8,8 @@
|
|||
|
||||
use cssparser::{Parser as CssParser, ParserInput};
|
||||
use selectors::parser::SelectorList;
|
||||
use std::fmt::{self, Debug};
|
||||
use style_traits::ParseError;
|
||||
use std::fmt::{self, Debug, Write};
|
||||
use style_traits::{ParseError, ToCss};
|
||||
use stylesheets::{Origin, Namespaces, UrlExtraData};
|
||||
|
||||
/// A convenient alias for the type that represents an attribute value used for
|
||||
|
@ -173,3 +173,25 @@ impl<T> PerPseudoElementMap<T> {
|
|||
self.entries.iter()
|
||||
}
|
||||
}
|
||||
|
||||
/// Values for the :dir() pseudo class
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Direction {
|
||||
/// left-to-right semantic directionality
|
||||
Ltr,
|
||||
/// right-to-left semantic directionality
|
||||
Rtl,
|
||||
/// Some other provided directionality value
|
||||
Other(Box<str>),
|
||||
}
|
||||
|
||||
impl ToCss for Direction {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: Write {
|
||||
let dir_str = match *self {
|
||||
Direction::Rtl => "rtl",
|
||||
Direction::Ltr => "ltr",
|
||||
Direction::Other(ref other) => other,
|
||||
};
|
||||
dest.write_str(dir_str)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue