Stylo: match both ::placehoder & ::moz-placeholder for placeholder pseudo-elements.

This commit is contained in:
cku 2017-05-23 23:51:20 +08:00
parent 84c1f904cb
commit 6143e95d74
5 changed files with 22 additions and 4 deletions

View file

@ -102,6 +102,15 @@ impl PseudoElement {
pub fn is_precomputed(&self) -> bool {
self.is_anon_box()
}
/// Covert non-canonical pseudo-element to canonical one, and keep a
/// canonical one as it is.
pub fn canonical(&self) -> PseudoElement {
match *self {
PseudoElement::MozPlaceholder => PseudoElement::Placeholder,
_ => self.clone(),
}
}
}
impl ToCss for PseudoElement {