mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Auto merge of #18867 - emilio:parse-hack, r=heycam
style: Dishonor display: -moz-box if -webkit-box was specified before This is a compatibility hack that Gecko supports that is apparently important for android. I want to remove it, but let's see... See https://bugzilla.mozilla.org/show_bug.cgi?id=1407701 for reference. <!-- 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/18867) <!-- Reviewable:end -->
This commit is contained in:
commit
2be76c5fd7
7 changed files with 162 additions and 79 deletions
|
@ -113,7 +113,7 @@ use style::gecko_properties::style_structs;
|
|||
use style::invalidation::element::restyle_hints;
|
||||
use style::media_queries::{Device, MediaList, parse_media_query_list};
|
||||
use style::parser::{ParserContext, self};
|
||||
use style::properties::{CascadeFlags, ComputedValues, Importance};
|
||||
use style::properties::{CascadeFlags, ComputedValues, DeclarationSource, Importance};
|
||||
use style::properties::{IS_FIELDSET_CONTENT, IS_LINK, IS_VISITED_LINK, LonghandIdSet};
|
||||
use style::properties::{LonghandId, PropertyDeclaration, PropertyDeclarationBlock, PropertyId};
|
||||
use style::properties::{PropertyDeclarationId, ShorthandId};
|
||||
|
@ -2191,7 +2191,11 @@ pub extern "C" fn Servo_ParseProperty(
|
|||
Ok(()) => {
|
||||
let global_style_data = &*GLOBAL_STYLE_DATA;
|
||||
let mut block = PropertyDeclarationBlock::new();
|
||||
block.extend(declarations.drain(), Importance::Normal);
|
||||
block.extend(
|
||||
declarations.drain(),
|
||||
Importance::Normal,
|
||||
DeclarationSource::CssOm,
|
||||
);
|
||||
Arc::new(global_style_data.shared_lock.wrap(block)).into_strong()
|
||||
}
|
||||
Err(_) => RawServoDeclarationBlockStrong::null()
|
||||
|
@ -2483,7 +2487,11 @@ fn set_property(
|
|||
Ok(()) => {
|
||||
let importance = if is_important { Importance::Important } else { Importance::Normal };
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.extend_reset(source_declarations.drain(), importance)
|
||||
decls.extend(
|
||||
source_declarations.drain(),
|
||||
importance,
|
||||
DeclarationSource::CssOm
|
||||
)
|
||||
})
|
||||
},
|
||||
Err(_) => false,
|
||||
|
@ -2711,7 +2719,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetIdentStringValue(
|
|||
XLang => Lang(Atom::from(value)),
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2757,7 +2765,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetKeywordValue(
|
|||
BorderLeftStyle => BorderStyle::from_gecko_keyword(value),
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2778,7 +2786,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetIntValue(
|
|||
MozScriptLevel => MozScriptLevel::Relative(value),
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2835,7 +2843,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPixelValue(
|
|||
},
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2875,7 +2883,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetLengthValue(
|
|||
MozScriptMinSize => MozScriptMinSize(nocalc),
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2896,7 +2904,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetNumberValue(
|
|||
MozScriptLevel => MozScriptLevel::Absolute(value as i32),
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2926,7 +2934,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetPercentValue(
|
|||
FontSize => LengthOrPercentage::from(pc).into(),
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2952,7 +2960,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetAutoValue(
|
|||
MarginLeft => auto,
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -2974,7 +2982,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetCurrentColor(
|
|||
BorderLeftColor => cc,
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3002,7 +3010,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetColorValue(
|
|||
BackgroundColor => color,
|
||||
};
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(prop, Importance::Normal);
|
||||
decls.push(prop, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3023,7 +3031,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetFontFamily(
|
|||
if parser.is_exhausted() {
|
||||
let decl = PropertyDeclaration::FontFamily(family);
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(decl, Importance::Normal);
|
||||
decls.push(decl, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -3052,7 +3060,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetBackgroundImage(
|
|||
vec![Either::Second(Image::Url(url))]
|
||||
));
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(decl, Importance::Normal);
|
||||
decls.push(decl, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -3068,7 +3076,7 @@ pub extern "C" fn Servo_DeclarationBlock_SetTextDecorationColorOverride(
|
|||
decoration |= text_decoration_line::COLOR_OVERRIDE;
|
||||
let decl = PropertyDeclaration::TextDecorationLine(decoration);
|
||||
write_locked_arc(declarations, |decls: &mut PropertyDeclarationBlock| {
|
||||
decls.push(decl, Importance::Normal);
|
||||
decls.push(decl, Importance::Normal, DeclarationSource::CssOm);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3764,7 +3772,11 @@ pub extern "C" fn Servo_StyleSet_GetKeyframesForName(
|
|||
id
|
||||
}
|
||||
PropertyDeclarationId::Custom(..) => {
|
||||
custom_properties.push(declaration.clone(), Importance::Normal);
|
||||
custom_properties.push(
|
||||
declaration.clone(),
|
||||
Importance::Normal,
|
||||
DeclarationSource::CssOm,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue