mirror of
https://github.com/servo/servo.git
synced 2025-08-26 07:38:21 +01:00
style: Allow placeholder import sheets.
This is necessary because we can't create GeckoStyleSheets off-main-thread, so we need a placeholder until it can be filled in. Bug: 1454030 Reviewed-by: emilio MozReview-Commit-ID: ssRme4fLYg
This commit is contained in:
parent
441f1cd231
commit
afe484e46b
7 changed files with 152 additions and 71 deletions
|
@ -2048,7 +2048,7 @@ pub extern "C" fn Servo_ImportRule_GetSheet(
|
|||
rule: RawServoImportRuleBorrowed,
|
||||
) -> *const ServoStyleSheet {
|
||||
read_locked_arc(rule, |rule: &ImportRule| {
|
||||
rule.stylesheet.0.raw() as *const ServoStyleSheet
|
||||
rule.stylesheet.as_sheet().unwrap().raw() as *const ServoStyleSheet
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -55,9 +55,8 @@ impl StyleStylesheetLoader for StylesheetLoader {
|
|||
|
||||
debug_assert!(!child_sheet.is_null(),
|
||||
"Import rules should always have a strong sheet");
|
||||
let stylesheet = unsafe {
|
||||
ImportSheet(GeckoStyleSheet::from_addrefed(child_sheet))
|
||||
};
|
||||
let sheet = unsafe { GeckoStyleSheet::from_addrefed(child_sheet) };
|
||||
let stylesheet = ImportSheet::new(sheet);
|
||||
Arc::new(lock.wrap(ImportRule { url, source_location, stylesheet }))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue