Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fetch infrastructure to load external scripts #12472

Merged
merged 8 commits into from Sep 22, 2016

Conversation

@KiChjang
Copy link
Member

KiChjang commented Jul 16, 2016

Fixes #9186.


This change is Reviewable

@highfive
Copy link

highfive commented Jul 16, 2016

Heads up! This PR modifies the following files:

  • @KiChjang: components/script/dom/document.rs, components/net/resource_thread.rs, components/script/dom/webidls/HTMLScriptElement.webidl, components/script/dom/xmlhttprequest.rs, components/net_traits/lib.rs, components/net_traits/lib.rs, components/script/dom/htmlscriptelement.rs, components/net_traits/request.rs, components/net_traits/request.rs
@highfive
Copy link

highfive commented Jul 16, 2016

warning Warning warning

  • These commits modify net and script code, but no tests are modified. Please consider adding a test!
@KiChjang
Copy link
Member Author

KiChjang commented Jul 16, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jul 16, 2016

Trying commit b6a5ac6 with merge f4639fd...

bors-servo added a commit that referenced this pull request Jul 16, 2016
Make text decorations have the same color as the text if no shadows are present

Fixes  #9186.

r? @Ms2ger

<!-- 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/12472)
<!-- Reviewable:end -->
@jdm
Copy link
Member

jdm commented Jul 16, 2016

That's a weird PR title.

@KiChjang KiChjang changed the title Make text decorations have the same color as the text if no shadows are present Use fetch infrastructure to load external scripts Jul 16, 2016
@KiChjang KiChjang changed the title Use fetch infrastructure to load external scripts Use fetch infrastructure to load external scripts Jul 16, 2016
@bors-servo
Copy link
Contributor

bors-servo commented Jul 16, 2016

💔 Test failed - mac-rel-css

@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from b6a5ac6 to de36d2c Jul 16, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Jul 16, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jul 16, 2016

Trying commit de36d2c with merge f33b18b...

bors-servo added a commit that referenced this pull request Jul 16, 2016
Use fetch infrastructure to load external scripts

Fixes  #9186.

r? @Ms2ger

<!-- 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/12472)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 16, 2016

💔 Test failed - mac-rel-css

@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from de36d2c to a51bb00 Jul 16, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Jul 16, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Jul 16, 2016

Trying commit a51bb00 with merge 6291e1b...

bors-servo added a commit that referenced this pull request Jul 16, 2016
Use fetch infrastructure to load external scripts

Fixes  #9186.

r? @Ms2ger

<!-- 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/12472)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 16, 2016

💔 Test failed - mac-rel-wpt

@KiChjang
Copy link
Member Author

KiChjang commented Jul 16, 2016

Huh, looks like there's a lot more infrastructure to work on.

@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from a51bb00 to 9208353 Jul 16, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Jul 16, 2016

@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from 6fa5654 to 31e51a9 Sep 21, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Sep 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

Trying commit 31e51a9 with merge 2ef1856...

bors-servo added a commit that referenced this pull request Sep 21, 2016
Use fetch infrastructure to load external scripts

Fixes  #9186.

<!-- 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/12472)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

};

if self.is_network_error() {
return Err(NetworkError::Internal("Cannot extract metadata from network error".to_string()));
if let Some(ref mut m) = metadata {

This comment has been minimized.

@jdm

jdm Sep 21, 2016

Member

Let's move the initialization into the appropriate if let block earlier.

Metadata::default(url.clone())
Some(Metadata::default(url.clone()))
} else if self.is_network_error() {
return Err(NetworkError::Internal("Cannot extract metadata from network error".to_owned()));

This comment has been minimized.

@jdm

jdm Sep 21, 2016

Member

Let's have a separate if block for this check before we check self.url.

} else {
match metadata {
Some(m) => Ok(FetchMetadata::Unfiltered(m)),
None => Err(NetworkError::Internal("No url found in response".to_owned()))

This comment has been minimized.

@jdm

jdm Sep 21, 2016

Member

I would rather make this an unreachable!(), because we shouldn't be able to have a URL-less response with no internal response.

@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from 31e51a9 to 4f67cd8 Sep 21, 2016
@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from 4f67cd8 to 2b2ac45 Sep 21, 2016
@KiChjang KiChjang force-pushed the KiChjang:use-fetch-in-script branch from 2b2ac45 to 6fbd2aa Sep 21, 2016
@KiChjang
Copy link
Member Author

KiChjang commented Sep 21, 2016

Comments addressed.

@jdm
Copy link
Member

jdm commented Sep 21, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

📌 Commit 6fbd2aa has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Sep 21, 2016

Testing commit 6fbd2aa with merge f357afc...

bors-servo added a commit that referenced this pull request Sep 21, 2016
Use fetch infrastructure to load external scripts

Fixes  #9186.

<!-- 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/12472)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Sep 22, 2016

@bors-servo bors-servo merged commit 6fbd2aa into servo:master Sep 22, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@KiChjang KiChjang deleted the KiChjang:use-fetch-in-script branch Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.