Skip to content

Commit

Permalink
Add a reusable sheets parameter to Servo_StyleSheet_FromUTF8Bytes.
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: DdMQpUY1WcJ
  • Loading branch information
bradwerth committed Aug 24, 2017
1 parent 6eb46b1 commit cdcd7ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion components/style/gecko/generated/bindings.rs
Expand Up @@ -1929,7 +1929,9 @@ extern "C" {
extra_data:
*mut RawGeckoURLExtraData,
line_number_offset: u32,
quirks_mode: nsCompatibility)
quirks_mode: nsCompatibility,
reusable_sheets:
*mut LoaderReusableStyleSheets)
-> RawServoStyleSheetContentsStrong;
}
extern "C" {
Expand Down
8 changes: 5 additions & 3 deletions ports/geckolib/glue.rs
Expand Up @@ -69,7 +69,8 @@ use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowed;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut;
use style::gecko_bindings::structs;
use style::gecko_bindings::structs::{CSSPseudoElementType, CompositeOperation, Loader};
use style::gecko_bindings::structs::{CSSPseudoElementType, CompositeOperation};
use style::gecko_bindings::structs::{Loader, LoaderReusableStyleSheets};
use style::gecko_bindings::structs::{RawServoStyleRule, ServoStyleContextStrong};
use style::gecko_bindings::structs::{ServoStyleSheet, SheetParsingMode, nsIAtom, nsCSSPropertyID};
use style::gecko_bindings::structs::{nsCSSFontFaceRule, nsCSSCounterStyleRule};
Expand Down Expand Up @@ -867,7 +868,8 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(
mode: SheetParsingMode,
extra_data: *mut URLExtraData,
line_number_offset: u32,
quirks_mode: nsCompatibility
quirks_mode: nsCompatibility,
reusable_sheets: *mut LoaderReusableStyleSheets
) -> RawServoStyleSheetContentsStrong {
let global_style_data = &*GLOBAL_STYLE_DATA;
let input = unsafe { data.as_ref().unwrap().as_str_unchecked() };
Expand All @@ -884,7 +886,7 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(
let loader = if loader.is_null() {
None
} else {
Some(StylesheetLoader::new(loader, stylesheet, ptr::null_mut()))
Some(StylesheetLoader::new(loader, stylesheet, reusable_sheets))
};

// FIXME(emilio): loader.as_ref() doesn't typecheck for some reason?
Expand Down

0 comments on commit cdcd7ed

Please sign in to comment.