mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
stylo: Propagate quirks mode information from Gecko to Servo
This commit is contained in:
parent
875b07b4ec
commit
c54d255d07
9 changed files with 48 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue