diff options
author | Nazım Can Altınova <canaltinova@gmail.com> | 2017-05-06 01:12:03 +0300 |
---|---|---|
committer | Nazım Can Altınova <canaltinova@gmail.com> | 2017-05-14 01:51:50 +0300 |
commit | c54d255d07ab7cfc3a0af17ae9be262c0a863cf7 (patch) | |
tree | 0c35df4f259c7dcff95f0e86616fda7c88474da7 /ports/geckolib | |
parent | 875b07b4ec64d9ef01bafb81ecf01496c0b9fa4b (diff) | |
download | servo-c54d255d07ab7cfc3a0af17ae9be262c0a863cf7.tar.gz servo-c54d255d07ab7cfc3a0af17ae9be262c0a863cf7.zip |
stylo: Propagate quirks mode information from Gecko to Servo
Diffstat (limited to 'ports/geckolib')
-rw-r--r-- | ports/geckolib/glue.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 0b209849aae..ebe498946c9 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -65,6 +65,7 @@ use style::gecko_bindings::structs::RawGeckoPresContextOwned; use style::gecko_bindings::structs::ServoElementSnapshotTable; use style::gecko_bindings::structs::URLExtraData; use style::gecko_bindings::structs::nsCSSValueSharedList; +use style::gecko_bindings::structs::nsCompatibility; use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong}; @@ -162,8 +163,7 @@ fn create_shared_context<'a>(global_style_data: &GlobalStyleData, guards: StylesheetGuards::same(guard), error_reporter: &DEFAULT_ERROR_REPORTER, timer: Timer::new(), - // FIXME Find the real QuirksMode information for this document - quirks_mode: QuirksMode::NoQuirks, + quirks_mode: per_doc_data.stylist.quirks_mode(), traversal_flags: traversal_flags, snapshot_map: snapshot_map, } @@ -1192,13 +1192,14 @@ pub extern "C" fn Servo_ParseEasing(easing: *const nsAString, #[no_mangle] pub extern "C" fn Servo_ParseStyleAttribute(data: *const nsACString, - raw_extra_data: *mut URLExtraData) + raw_extra_data: *mut URLExtraData, + quirks_mode: nsCompatibility) -> RawServoDeclarationBlockStrong { let global_style_data = &*GLOBAL_STYLE_DATA; let value = unsafe { data.as_ref().unwrap().as_str_unchecked() }; let url_data = unsafe { RefPtr::from_ptr_ref(&raw_extra_data) }; Arc::new(global_style_data.shared_lock.wrap( - GeckoElement::parse_style_attribute(value, url_data))).into_strong() + GeckoElement::parse_style_attribute(value, url_data, quirks_mode.into()))).into_strong() } #[no_mangle] @@ -2071,7 +2072,7 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis font_metrics_provider: &metrics, cached_system_font: None, in_media_query: false, - quirks_mode: QuirksMode::NoQuirks, + quirks_mode: data.stylist.quirks_mode(), }; for (index, keyframe) in keyframes.iter().enumerate() { |