mirror of
https://github.com/servo/servo.git
synced 2025-08-27 16:18:21 +01:00
Expose the source map URL on a style sheet
This changes Servo to track the source map URL of a style sheet. This parallels a change going in to Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1388855
This commit is contained in:
parent
fbabcaf614
commit
7224a5617f
7 changed files with 61 additions and 17 deletions
|
@ -1056,6 +1056,18 @@ pub extern "C" fn Servo_StyleSheet_GetOrigin(
|
|||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn Servo_StyleSheet_GetSourceMapURL(
|
||||
sheet: RawServoStyleSheetContentsBorrowed,
|
||||
result: *mut nsAString
|
||||
) {
|
||||
let contents = StylesheetContents::as_arc(&sheet);
|
||||
let url_opt = contents.source_map_url.read();
|
||||
if let Some(ref url) = *url_opt {
|
||||
write!(unsafe { &mut *result }, "{}", url).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
fn read_locked_arc<T, R, F>(raw: &<Locked<T> as HasFFI>::FFIType, func: F) -> R
|
||||
where Locked<T>: HasArcFFI, F: FnOnce(&T) -> R
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue