Update bitflags to 1.0 in every servo crate

It still needs dependencies update to remove all the other bitflags
versions.
This commit is contained in:
Bastien Orivel 2017-10-09 17:03:40 +02:00
parent 4cf2ce66fc
commit e8e2d0a4b2
142 changed files with 1685 additions and 1635 deletions

View file

@ -13,7 +13,7 @@
Method("has_line_through", "bool")]) %>
<%helpers:longhand name="text-overflow" animation_value_type="discrete" boxed="True"
flags="APPLIES_TO_PLACEHOLDER"
flags="PropertyFlags::APPLIES_TO_PLACEHOLDER"
spec="https://drafts.csswg.org/css-ui/#propdef-text-overflow">
use std::fmt;
use style_traits::ToCss;
@ -141,19 +141,20 @@ ${helpers.single_keyword("unicode-bidi",
<%helpers:longhand name="text-decoration-line"
custom_cascade="${product == 'servo'}"
animation_value_type="discrete"
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
flags="""PropertyFlags::APPLIES_TO_FIRST_LETTER PropertyFlags::APPLIES_TO_FIRST_LINE
PropertyFlags::APPLIES_TO_PLACEHOLDER""",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-line">
use std::fmt;
use style_traits::ToCss;
bitflags! {
#[derive(MallocSizeOf, ToComputedValue)]
pub flags SpecifiedValue: u8 {
const NONE = 0,
const UNDERLINE = 0x01,
const OVERLINE = 0x02,
const LINE_THROUGH = 0x04,
const BLINK = 0x08,
pub struct SpecifiedValue: u8 {
const NONE = 0;
const UNDERLINE = 0x01;
const OVERLINE = 0x02;
const LINE_THROUGH = 0x04;
const BLINK = 0x08;
% if product == "gecko":
/// Only set by presentation attributes
///
@ -162,7 +163,7 @@ ${helpers.single_keyword("unicode-bidi",
///
/// For example, this gives <a href=foo><font color="red">text</font></a>
/// a red text decoration
const COLOR_OVERRIDE = 0x10,
const COLOR_OVERRIDE = 0x10;
% endif
}
}
@ -172,7 +173,7 @@ ${helpers.single_keyword("unicode-bidi",
let mut has_any = false;
macro_rules! write_value {
($line:ident => $css:expr) => {
($line:path => $css:expr) => {
if self.contains($line) {
if has_any {
dest.write_str(" ")?;
@ -182,10 +183,10 @@ ${helpers.single_keyword("unicode-bidi",
}
}
}
write_value!(UNDERLINE => "underline");
write_value!(OVERLINE => "overline");
write_value!(LINE_THROUGH => "line-through");
write_value!(BLINK => "blink");
write_value!(SpecifiedValue::UNDERLINE => "underline");
write_value!(SpecifiedValue::OVERLINE => "overline");
write_value!(SpecifiedValue::LINE_THROUGH => "line-through");
write_value!(SpecifiedValue::BLINK => "blink");
if !has_any {
dest.write_str("none")?;
}
@ -222,14 +223,17 @@ ${helpers.single_keyword("unicode-bidi",
match input.expect_ident() {
Ok(ident) => {
(match_ignore_ascii_case! { &ident,
"underline" => if result.contains(UNDERLINE) { Err(()) }
else { empty = false; result.insert(UNDERLINE); Ok(()) },
"overline" => if result.contains(OVERLINE) { Err(()) }
else { empty = false; result.insert(OVERLINE); Ok(()) },
"line-through" => if result.contains(LINE_THROUGH) { Err(()) }
else { empty = false; result.insert(LINE_THROUGH); Ok(()) },
"blink" => if result.contains(BLINK) { Err(()) }
else { empty = false; result.insert(BLINK); Ok(()) },
"underline" => if result.contains(SpecifiedValue::UNDERLINE) { Err(()) }
else { empty = false; result.insert(SpecifiedValue::UNDERLINE); Ok(()) },
"overline" => if result.contains(SpecifiedValue::OVERLINE) { Err(()) }
else { empty = false; result.insert(SpecifiedValue::OVERLINE); Ok(()) },
"line-through" => if result.contains(SpecifiedValue::LINE_THROUGH) { Err(()) }
else {
empty = false;
result.insert(SpecifiedValue::LINE_THROUGH); Ok(())
},
"blink" => if result.contains(SpecifiedValue::BLINK) { Err(()) }
else { empty = false; result.insert(SpecifiedValue::BLINK); Ok(()) },
_ => Err(())
}).map_err(|()| {
location.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone()))
@ -261,7 +265,8 @@ ${helpers.single_keyword("text-decoration-style",
"solid double dotted dashed wavy -moz-none",
products="gecko",
animation_value_type="discrete",
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
flags="""PropertyFlags::APPLIES_TO_FIRST_LETTER PropertyFlags::APPLIES_TO_FIRST_LINE
PropertyFlags::APPLIES_TO_PLACEHOLDER""",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-style")}
${helpers.predefined_type(
@ -272,7 +277,8 @@ ${helpers.predefined_type(
products="gecko",
animation_value_type="AnimatedColor",
ignored_when_colors_disabled=True,
flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER",
flags="""PropertyFlags::APPLIES_TO_FIRST_LETTER PropertyFlags::APPLIES_TO_FIRST_LINE
PropertyFlags::APPLIES_TO_PLACEHOLDER""",
spec="https://drafts.csswg.org/css-text-decor/#propdef-text-decoration-color",
)}
@ -283,5 +289,5 @@ ${helpers.predefined_type(
initial_specified_value="specified::InitialLetter::normal()",
animation_value_type="discrete",
products="gecko",
flags="APPLIES_TO_FIRST_LETTER",
flags="PropertyFlags::APPLIES_TO_FIRST_LETTER",
spec="https://drafts.csswg.org/css-inline/#sizing-drop-initials")}