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

Don't make a network request when the media attribute of a link element is modified #16404

Closed
jdm opened this issue Apr 13, 2017 · 2 comments
Closed

Comments

@jdm
Copy link
Member

@jdm jdm commented Apr 13, 2017

Spun off from #16399 because this is a separate issue from the panic that was being triggered.

@jdm jdm added the A-content/dom label Apr 13, 2017
@jdm
Copy link
Member Author

@jdm jdm commented Feb 22, 2018

According to https://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet:concept-link-obtain we should only initiate the network request when one of the given conditions is true. The media attribute changing is not included in that list.

Code: components/script/dom/htmllinkelement.rs, see the attribute_mutated method.

The easiest way to verify that this is working is to set up a local HTTP server (like python -m SimpleHTTPServer) and make a page that contains a <link> stylesheet with an href that uses the server, and dynamically updates the media attribute of the link element. After this change, there should not be an additional network request for the stylesheet.

@janvi-palan
Copy link
Contributor

@janvi-palan janvi-palan commented Feb 23, 2018

@jdm I will take this up!

@jdm jdm added the C-assigned label Feb 23, 2018
bors-servo added a commit that referenced this issue Feb 24, 2018
…try>

Dont make a network request when the media attribute of a link element is modified

<!-- 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 #16404 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this needs to be tested manually

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20115)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Feb 25, 2018
…milio

Dont make a network request when the media attribute of a link element is modified

<!-- 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 #16404 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because this needs to be tested manually

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/20115)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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