Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHandle properly alternate stylesheet #14911
Conversation
highfive
commented
Jan 7, 2017
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @cbrewster (or someone else) soon. |
highfive
commented
Jan 7, 2017
highfive
commented
Jan 7, 2017
|
An automated reference test that verifies that the style present in an alternate stylesheet is not applied would be valuable. It could be created in |
| @@ -147,6 +150,9 @@ impl FetchResponseListener for StylesheetContext { | |||
| } | |||
| StylesheetContextSource::Import(ref import) => { | |||
| let import = import.read(); | |||
| if elem.downcast::<HTMLLinkElement>().unwrap().is_alternate() { | |||
This comment has been minimized.
This comment has been minimized.
jdm
Jan 7, 2017
Member
I suspect this will break if we have <style>@import 'foo.css'</style>, since the element is a HTMLStyleElement. Try running ./mach test-wpt tests/wpt/mozilla/tests/mozilla/restyle-out-of-document.html to verify this.
This comment has been minimized.
This comment has been minimized.
charlesvdv
Jan 7, 2017
Author
Contributor
The test pass.
But it's true that's bizarre. As style also support alternate I should also create a method is_alternate for the Import type ?
This comment has been minimized.
This comment has been minimized.
jdm
Jan 7, 2017
Member
My mistake, that test doesn't include any stylesheets. Try ./mach test-wpt tests/wpt/mozilla/tests/mozilla/stylesheet-adopt-panic.html instead.
My reading of the spec doesn't include any way of specifying a style element as an alternate stylesheet. Where did you see that?
This comment has been minimized.
This comment has been minimized.
charlesvdv
Jan 7, 2017
Author
Contributor
Indeed it fails. I will rebase with the change.
And indeed it say alternate flags Unset. So I guess it's not a flag after all.
|
You're right! |
b74e41a
to
d20695f
|
@charlesvdv Could you modify the test from #10319 to verify that imported stylesheets from alternate stylesheets do not get applied? |
|
@jdm the test pass without code modification. |
|
@bors-servo r+ |
|
|
Handle properly alternate stylesheet <!-- Please describe your changes on the following line: --> Alternate stylesheet are now fetched and then desactivated instead of ignoring them. I don't know if tests are required to check if the stylesheet is correctly loaded and disabled ? <!-- 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 #14881 (github issue number if applicable). <!-- Either: --> - [ ] 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/14911) <!-- Reviewable:end -->
|
|
|
@bors-servo: retry |
|
|
|
|
Good, we're fixing the test behaviour that made us file #14881! |
|
nice ! |
|
@Charlesdv: yes :) |
fc149a8
to
f25efc3
f25efc3
to
cb9940f
|
@bors-servo: r=cbrewster |
|
|
Handle properly alternate stylesheet <!-- Please describe your changes on the following line: --> Alternate stylesheet are now fetched and then desactivated instead of ignoring them. I don't know if tests are required to check if the stylesheet is correctly loaded and disabled ? <!-- 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 #14881 (github issue number if applicable). <!-- Either: --> - [ ] 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/14911) <!-- Reviewable:end -->
|
|
charlesvdv commentedJan 7, 2017
•
edited
Alternate stylesheet are now fetched and then desactivated instead of ignoring them.
I don't know if tests are required to check if the stylesheet is correctly loaded and disabled ?
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is