Don't resolve URLs at parse time for Stylo.

It's a bit unfortunate the use separate implementations of SpecifiedUrl for Servo
and Gecko, but they're different enough at this point that I don't think it really
makes sense to try to share everything. Splitting them out has some nice
simplifications as well.

I recognize that there's still some potential correctness issues for Servo using
the resolved URI in various places where the original URI may be the right thing,
but I've got too much on my plate to look into that for now.

MozReview-Commit-ID: BeDu93TQ4Ow
This commit is contained in:
Bobby Holley 2017-03-16 23:51:26 -07:00
parent 16e04046b5
commit 63e8367eee
14 changed files with 278 additions and 244 deletions

View file

@ -42,14 +42,15 @@ impl StyleStylesheetLoader for StylesheetLoader {
// and so the Arc<Url> pointer inside will also move,
// but the Url it points to or the allocating backing the String inside that Url wont,
// so this raw pointer will still be valid.
let (spec_bytes, spec_len): (*const u8, usize) = import.url.as_slice_components()
.expect("Import only loads valid URLs");
let (spec_bytes, spec_len): (*const u8, usize) = import.url.as_slice_components();
let base_uri = import.url.base.mRawPtr;
let arc = make_arc(import);
unsafe {
Gecko_LoadStyleSheet(self.0,
self.1,
HasArcFFI::arc_as_borrowed(&arc),
base_uri,
spec_bytes,
spec_len as u32,
media_string.as_bytes().as_ptr(),