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
Contributor

@KiChjang KiChjang commented Jul 16, 2016

Fixes #9186.


This change is Reviewable

@highfive
Copy link

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

warning Warning warning

  • These commits modify net and script code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 16, 2016
@KiChjang
Copy link
Contributor Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit b6a5ac6 with merge f4639fd...

bors-servo pushed 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

💔 Test failed - mac-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 16, 2016
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 16, 2016
@KiChjang
Copy link
Contributor Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit de36d2c with merge f33b18b...

bors-servo pushed 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

💔 Test failed - mac-rel-css

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 16, 2016
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 16, 2016
@KiChjang
Copy link
Contributor Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit a51bb00 with merge 6291e1b...

bors-servo pushed 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

💔 Test failed - mac-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 16, 2016
@KiChjang
Copy link
Contributor Author

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

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 16, 2016
@KiChjang
Copy link
Contributor Author

@bors-servo try

@KiChjang
Copy link
Contributor Author

@bors-servo try

@bors-servo
Copy link
Contributor

⌛ Trying commit 31e51a9 with merge 2ef1856...

bors-servo pushed 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 -->
@KiChjang KiChjang removed the S-needs-rebase There are merge conflict errors. label Sep 21, 2016
@bors-servo
Copy link
Contributor

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

};

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 21, 2016
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Sep 21, 2016
@KiChjang
Copy link
Contributor Author

Comments addressed.

@jdm
Copy link
Member

jdm commented Sep 21, 2016

@bors-servo: r+

@bors-servo
Copy link
Contributor

📌 Commit 6fbd2aa has been approved by jdm

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Sep 21, 2016
@bors-servo
Copy link
Contributor

⌛ Testing commit 6fbd2aa with merge f357afc...

bors-servo pushed 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

☀️ Test successful - arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows-dev

@bors-servo bors-servo merged commit 6fbd2aa into servo:master Sep 22, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Sep 22, 2016
@KiChjang KiChjang deleted the use-fetch-in-script branch September 22, 2016 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants