Auto merge of #18207 - bradwerth:reuseImports, r=xidorn

Add a reusable sheets parameter to Servo_StyleSheet_FromUTF8Bytes.

MozReview-Commit-ID: DdMQpUY1WcJ

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1387933
https://reviewboard.mozilla.org/r/171308/

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18207)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-24 14:58:49 -05:00 committed by GitHub
commit 1e0ebf1c1a
2 changed files with 8 additions and 4 deletions

View file

@ -1929,7 +1929,9 @@ extern "C" {
extra_data: extra_data:
*mut RawGeckoURLExtraData, *mut RawGeckoURLExtraData,
line_number_offset: u32, line_number_offset: u32,
quirks_mode: nsCompatibility) quirks_mode: nsCompatibility,
reusable_sheets:
*mut LoaderReusableStyleSheets)
-> RawServoStyleSheetContentsStrong; -> RawServoStyleSheetContentsStrong;
} }
extern "C" { extern "C" {

View file

@ -69,7 +69,8 @@ use style::gecko_bindings::bindings::nsTArrayBorrowed_uintptr_t;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowed; use style::gecko_bindings::bindings::nsTimingFunctionBorrowed;
use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut; use style::gecko_bindings::bindings::nsTimingFunctionBorrowedMut;
use style::gecko_bindings::structs; 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::{RawServoStyleRule, ServoStyleContextStrong};
use style::gecko_bindings::structs::{ServoStyleSheet, SheetParsingMode, nsIAtom, nsCSSPropertyID}; use style::gecko_bindings::structs::{ServoStyleSheet, SheetParsingMode, nsIAtom, nsCSSPropertyID};
use style::gecko_bindings::structs::{nsCSSFontFaceRule, nsCSSCounterStyleRule}; use style::gecko_bindings::structs::{nsCSSFontFaceRule, nsCSSCounterStyleRule};
@ -867,7 +868,8 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(
mode: SheetParsingMode, mode: SheetParsingMode,
extra_data: *mut URLExtraData, extra_data: *mut URLExtraData,
line_number_offset: u32, line_number_offset: u32,
quirks_mode: nsCompatibility quirks_mode: nsCompatibility,
reusable_sheets: *mut LoaderReusableStyleSheets
) -> RawServoStyleSheetContentsStrong { ) -> RawServoStyleSheetContentsStrong {
let global_style_data = &*GLOBAL_STYLE_DATA; let global_style_data = &*GLOBAL_STYLE_DATA;
let input = unsafe { data.as_ref().unwrap().as_str_unchecked() }; let input = unsafe { data.as_ref().unwrap().as_str_unchecked() };
@ -884,7 +886,7 @@ pub extern "C" fn Servo_StyleSheet_FromUTF8Bytes(
let loader = if loader.is_null() { let loader = if loader.is_null() {
None None
} else { } 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? // FIXME(emilio): loader.as_ref() doesn't typecheck for some reason?