Auto merge of #23048 - c410-f3r:image-url, r=jdm

Add url for LayoutImageContext

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #23043

<!-- 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/23048)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-03-16 13:16:44 -04:00 committed by GitHub
commit db7bb2a510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,7 @@ struct LayoutImageContext {
cache: Arc<dyn ImageCache>,
resource_timing: ResourceFetchTiming,
doc: Trusted<Document>,
url: ServoUrl,
}
impl FetchResponseListener for LayoutImageContext {
@ -64,10 +65,7 @@ impl FetchResponseListener for LayoutImageContext {
impl ResourceTimingListener for LayoutImageContext {
fn resource_timing_information(&self) -> (InitiatorType, ServoUrl) {
(
InitiatorType::Other,
self.resource_timing_global().get_url().clone(),
)
(InitiatorType::Other, self.url.clone())
}
fn resource_timing_global(&self) -> DomRoot<GlobalScope> {
@ -90,6 +88,7 @@ pub fn fetch_image_for_layout(
cache: cache,
resource_timing: ResourceFetchTiming::new(ResourceTimingType::Resource),
doc: Trusted::new(&document),
url: url.clone(),
}));
let document = document_from_node(node);