Use bitflags for multikeyword properties

This commit is contained in:
deror1869107 2017-02-17 01:42:57 +08:00
parent 1afae52c47
commit 2dec238d1c
3 changed files with 31 additions and 31 deletions

View file

@ -2502,16 +2502,16 @@ fn static_assert() {
pub fn set_text_decoration_line(&mut self, v: longhands::text_decoration_line::computed_value::T) {
let mut bits: u8 = 0;
if v.underline {
if v.contains(longhands::text_decoration_line::UNDERLINE) {
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE as u8;
}
if v.overline {
if v.contains(longhands::text_decoration_line::OVERLINE) {
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_OVERLINE as u8;
}
if v.line_through {
if v.contains(longhands::text_decoration_line::LINE_THROUGH) {
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH as u8;
}
if v.blink {
if v.contains(longhands::text_decoration_line::BLINK) {
bits |= structs::NS_STYLE_TEXT_DECORATION_LINE_BLINK as u8;
}
self.gecko.mTextDecorationLine = bits;