diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-07-14 11:55:44 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-14 11:55:44 -0700 |
commit | 4b78b9adab916cc4fdde6248e785030b79f406da (patch) | |
tree | 93cba375688da2cb779ed1aabc04c7abdd55b0d7 /components/script/script_thread.rs | |
parent | 48a912f57ec51e55e7905983b2bf368a07a9902f (diff) | |
parent | d6c1f7b5e3909d9b11544dae4b4c7d0793fef5f7 (diff) | |
download | servo-4b78b9adab916cc4fdde6248e785030b79f406da.tar.gz servo-4b78b9adab916cc4fdde6248e785030b79f406da.zip |
Auto merge of #12416 - canaltinova:referrer, r=jdm
Implement Document.referrer
<!-- Please describe your changes on the following line: -->
---
<!-- 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
- [X] These changes fix #12389 (github issue number if applicable).
<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because _____
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- 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/12416)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 9a439f63ab9..aeed396fbb1 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1711,6 +1711,11 @@ impl ScriptThread { _ => IsHTMLDocument::HTMLDocument, }; + let referrer = match metadata.referrer { + Some(ref referrer) => Some(referrer.clone().into_string()), + None => None, + }; + let document = Document::new(window.r(), Some(&browsing_context), Some(final_url.clone()), @@ -1718,7 +1723,8 @@ impl ScriptThread { content_type, last_modified, DocumentSource::FromParser, - loader); + loader, + referrer); if using_new_context { browsing_context.init(&document); } else { |