mirror of
https://github.com/servo/servo.git
synced 2025-07-02 04:53:39 +01:00
Store blink value for text-decoration-line
The spec does say user agents may not blink, but it doesn't say this value can be ignored during parsing.
This commit is contained in:
parent
ad1b11771b
commit
66af7e4d3a
2 changed files with 15 additions and 7 deletions
|
@ -2315,6 +2315,9 @@ fn static_assert() {
|
||||||
if v.line_through {
|
if v.line_through {
|
||||||
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH as u8;
|
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH as u8;
|
||||||
}
|
}
|
||||||
|
if v.blink {
|
||||||
|
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_BLINK as u8;
|
||||||
|
}
|
||||||
self.gecko.mTextDecorationLine = bits;
|
self.gecko.mTextDecorationLine = bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,8 +117,7 @@ ${helpers.single_keyword("unicode-bidi",
|
||||||
pub underline: bool,
|
pub underline: bool,
|
||||||
pub overline: bool,
|
pub overline: bool,
|
||||||
pub line_through: bool,
|
pub line_through: bool,
|
||||||
// 'blink' is accepted in the parser but ignored.
|
pub blink: bool,
|
||||||
// Just not blinking the text is a conforming implementation per CSS 2.1.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToCss for SpecifiedValue {
|
impl ToCss for SpecifiedValue {
|
||||||
|
@ -140,6 +139,13 @@ ${helpers.single_keyword("unicode-bidi",
|
||||||
try!(dest.write_str(" "));
|
try!(dest.write_str(" "));
|
||||||
}
|
}
|
||||||
try!(dest.write_str("line-through"));
|
try!(dest.write_str("line-through"));
|
||||||
|
space = true;
|
||||||
|
}
|
||||||
|
if self.blink {
|
||||||
|
if space {
|
||||||
|
try!(dest.write_str(" "));
|
||||||
|
}
|
||||||
|
try!(dest.write_str("blink"));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -148,7 +154,7 @@ ${helpers.single_keyword("unicode-bidi",
|
||||||
pub type T = super::SpecifiedValue;
|
pub type T = super::SpecifiedValue;
|
||||||
#[allow(non_upper_case_globals)]
|
#[allow(non_upper_case_globals)]
|
||||||
pub const none: T = super::SpecifiedValue {
|
pub const none: T = super::SpecifiedValue {
|
||||||
underline: false, overline: false, line_through: false
|
underline: false, overline: false, line_through: false, blink: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#[inline] pub fn get_initial_value() -> computed_value::T {
|
#[inline] pub fn get_initial_value() -> computed_value::T {
|
||||||
|
@ -157,12 +163,11 @@ ${helpers.single_keyword("unicode-bidi",
|
||||||
/// none | [ underline || overline || line-through || blink ]
|
/// none | [ underline || overline || line-through || blink ]
|
||||||
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
|
||||||
let mut result = SpecifiedValue {
|
let mut result = SpecifiedValue {
|
||||||
underline: false, overline: false, line_through: false,
|
underline: false, overline: false, line_through: false, blink: false
|
||||||
};
|
};
|
||||||
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
|
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
|
||||||
return Ok(result)
|
return Ok(result)
|
||||||
}
|
}
|
||||||
let mut blink = false;
|
|
||||||
let mut empty = true;
|
let mut empty = true;
|
||||||
|
|
||||||
while input.try(|input| {
|
while input.try(|input| {
|
||||||
|
@ -174,8 +179,8 @@ ${helpers.single_keyword("unicode-bidi",
|
||||||
else { empty = false; result.overline = true },
|
else { empty = false; result.overline = true },
|
||||||
"line-through" => if result.line_through { return Err(()) }
|
"line-through" => if result.line_through { return Err(()) }
|
||||||
else { empty = false; result.line_through = true },
|
else { empty = false; result.line_through = true },
|
||||||
"blink" => if blink { return Err(()) }
|
"blink" => if result.blink { return Err(()) }
|
||||||
else { empty = false; blink = true },
|
else { empty = false; result.blink = true },
|
||||||
_ => return Err(())
|
_ => return Err(())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue