stylo: Propagate quirks mode information from Gecko to Servo

This commit is contained in:
Nazım Can Altınova 2017-05-06 01:12:03 +03:00
parent 875b07b4ec
commit c54d255d07
No known key found for this signature in database
GPG key ID: AF9BCD7CE6449954
9 changed files with 48 additions and 14 deletions

View file

@ -189,16 +189,17 @@ impl<'a> ExtraStyleData<'a> {
}
impl Stylist {
/// Construct a new `Stylist`, using a given `Device`. If more members are
/// added here, think about whether they should be reset in clear().
/// Construct a new `Stylist`, using given `Device` and `QuirksMode`.
/// If more members are added here, think about whether they should
/// be reset in clear().
#[inline]
pub fn new(device: Device) -> Self {
pub fn new(device: Device, quirks_mode: QuirksMode) -> Self {
let mut stylist = Stylist {
viewport_constraints: None,
device: Arc::new(device),
is_device_dirty: true,
is_cleared: true,
quirks_mode: QuirksMode::NoQuirks,
quirks_mode: quirks_mode,
element_map: PerPseudoElementSelectorMap::new(),
pseudos_map: Default::default(),
@ -778,6 +779,11 @@ impl Stylist {
self.viewport_constraints.as_ref()
}
/// Returns the Quirks Mode of the document.
pub fn quirks_mode(&self) -> QuirksMode {
self.quirks_mode
}
/// Sets the quirks mode of the document.
pub fn set_quirks_mode(&mut self, quirks_mode: QuirksMode) {
// FIXME(emilio): We don't seem to change the quirks mode dynamically