servo: Merge #18207 - Add a reusable sheets parameter to Servo_StyleSheet_FromUTF8Bytes (from bradwerth:reuseImports); r=xidorn

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. -->

Source-Repo: https://github.com/servo/servo
Source-Revision: 1e0ebf1c1ac6b00a7503dacecfa395df7daed229

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : 6e9552d2a1c9a930f1176750088d37d7f20b4581
This commit is contained in:
Brad Werth 2017-08-24 14:58:49 -05:00
Родитель 829c7d45a7
Коммит 5269f99dc1
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -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" {

Просмотреть файл

@ -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};
@ -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() };
@ -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?