mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
stylo: Fix propagation of quirks mode information to servo side
It was getting inial value from gecko side before and that was always eCompatibility_NavQuirks. Created an FFI to fetch quirks mode.
This commit is contained in:
parent
15fe48f3f6
commit
309531e5b3
2 changed files with 20 additions and 0 deletions
|
@ -1874,6 +1874,10 @@ extern "C" {
|
||||||
pub fn Servo_StyleSet_MediumFeaturesChanged(set: RawServoStyleSetBorrowed)
|
pub fn Servo_StyleSet_MediumFeaturesChanged(set: RawServoStyleSetBorrowed)
|
||||||
-> bool;
|
-> bool;
|
||||||
}
|
}
|
||||||
|
extern "C" {
|
||||||
|
pub fn Servo_StyleSet_CompatModeChanged(raw_data:
|
||||||
|
RawServoStyleSetBorrowed);
|
||||||
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed,
|
pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed,
|
||||||
sheet: RawServoStyleSheetBorrowed,
|
sheet: RawServoStyleSheetBorrowed,
|
||||||
|
|
|
@ -81,6 +81,7 @@ use style::gecko_bindings::structs::StyleRuleInclusion;
|
||||||
use style::gecko_bindings::structs::URLExtraData;
|
use style::gecko_bindings::structs::URLExtraData;
|
||||||
use style::gecko_bindings::structs::nsCSSValueSharedList;
|
use style::gecko_bindings::structs::nsCSSValueSharedList;
|
||||||
use style::gecko_bindings::structs::nsCompatibility;
|
use style::gecko_bindings::structs::nsCompatibility;
|
||||||
|
use style::gecko_bindings::structs::nsIDocument;
|
||||||
use style::gecko_bindings::structs::nsStyleTransformMatrix::MatrixTransformOperator;
|
use style::gecko_bindings::structs::nsStyleTransformMatrix::MatrixTransformOperator;
|
||||||
use style::gecko_bindings::structs::nsresult;
|
use style::gecko_bindings::structs::nsresult;
|
||||||
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI};
|
use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI};
|
||||||
|
@ -1546,6 +1547,21 @@ pub extern "C" fn Servo_StyleSet_Drop(data: RawServoStyleSetOwned) {
|
||||||
let _ = data.into_box::<PerDocumentStyleData>();
|
let _ = data.into_box::<PerDocumentStyleData>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Updating the stylesheets and redoing selector matching is always happens
|
||||||
|
/// before the document element is inserted. Therefore we don't need to call
|
||||||
|
/// `force_dirty` here.
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn Servo_StyleSet_CompatModeChanged(raw_data: RawServoStyleSetBorrowed) {
|
||||||
|
let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut();
|
||||||
|
let quirks_mode = unsafe {
|
||||||
|
(*(*data.stylist.device().pres_context).mDocument
|
||||||
|
.raw::<nsIDocument>()).mCompatMode
|
||||||
|
};
|
||||||
|
|
||||||
|
data.stylist.set_quirks_mode(quirks_mode.into());
|
||||||
|
}
|
||||||
|
|
||||||
fn parse_property_into(declarations: &mut SourcePropertyDeclaration,
|
fn parse_property_into(declarations: &mut SourcePropertyDeclaration,
|
||||||
property_id: PropertyId,
|
property_id: PropertyId,
|
||||||
value: *const nsACString,
|
value: *const nsACString,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue