aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-01-16 01:22:13 -0800
committerGitHub <noreply@github.com>2017-01-16 01:22:13 -0800
commitee082d83634503834f145a1c3d01dee4aa154714 (patch)
tree3d6e40612e5a3df609a0f6fccbeff045aa2515c9
parentad1b11771b93ced67b409436c7bf0f493ec4663a (diff)
parent66af7e4d3aeabcdecf08c8ada8cf2ed1b5ba2d64 (diff)
downloadservo-ee082d83634503834f145a1c3d01dee4aa154714.tar.gz
servo-ee082d83634503834f145a1c3d01dee4aa154714.zip
Auto merge of #15038 - upsuper:text-decor-blink, r=emilio
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. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15038) <!-- Reviewable:end -->
-rw-r--r--components/style/properties/gecko.mako.rs3
-rw-r--r--components/style/properties/longhand/text.mako.rs19
2 files changed, 15 insertions, 7 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 6d5885473c4..1acc7c5c854 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -2315,6 +2315,9 @@ fn static_assert() {
if v.line_through {
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;
}
diff --git a/components/style/properties/longhand/text.mako.rs b/components/style/properties/longhand/text.mako.rs
index 912c55d98ff..6c5f34c65aa 100644
--- a/components/style/properties/longhand/text.mako.rs
+++ b/components/style/properties/longhand/text.mako.rs
@@ -117,8 +117,7 @@ ${helpers.single_keyword("unicode-bidi",
pub underline: bool,
pub overline: bool,
pub line_through: bool,
- // 'blink' is accepted in the parser but ignored.
- // Just not blinking the text is a conforming implementation per CSS 2.1.
+ pub blink: bool,
}
impl ToCss for SpecifiedValue {
@@ -140,6 +139,13 @@ ${helpers.single_keyword("unicode-bidi",
try!(dest.write_str(" "));
}
try!(dest.write_str("line-through"));
+ space = true;
+ }
+ if self.blink {
+ if space {
+ try!(dest.write_str(" "));
+ }
+ try!(dest.write_str("blink"));
}
Ok(())
}
@@ -148,7 +154,7 @@ ${helpers.single_keyword("unicode-bidi",
pub type T = super::SpecifiedValue;
#[allow(non_upper_case_globals)]
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 {
@@ -157,12 +163,11 @@ ${helpers.single_keyword("unicode-bidi",
/// none | [ underline || overline || line-through || blink ]
pub fn parse(_context: &ParserContext, input: &mut Parser) -> 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() {
return Ok(result)
}
- let mut blink = false;
let mut empty = true;
while input.try(|input| {
@@ -174,8 +179,8 @@ ${helpers.single_keyword("unicode-bidi",
else { empty = false; result.overline = true },
"line-through" => if result.line_through { return Err(()) }
else { empty = false; result.line_through = true },
- "blink" => if blink { return Err(()) }
- else { empty = false; blink = true },
+ "blink" => if result.blink { return Err(()) }
+ else { empty = false; result.blink = true },
_ => return Err(())
}
} else {