-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix: Add support for stylesheet MIME type quirk in quirks mode #36338
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
Conversation
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#51860) with upstreamable changes. |
Signed-off-by: saku-1101 <sakupi1101@outlook.jp>
04f2c08 to
5d4ba6b
Compare
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#51860) title and body. |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#51860). |
mrobinson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| }) || (document.quirks_mode() == QuirksMode::Quirks && | ||
| document.url().origin() == metadata.final_url.origin()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind linking to the specification and quoting the specification text here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't!
Added them here: Add: spec link
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#51860). |
Signed-off-by: saku-1101 <sakupi1101@outlook.jp>
30ec85d to
89af76f
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#51860). |
| // Quirk: If the document has been set to quirks mode, has the same origin as the URL of the external resource, and the Content-Type metadata of the external resource is not a supported style sheet type, the user agent must instead assume it to be text/css. | ||
| // <https://html.spec.whatwg.org/multipage/#link-type-stylesheet> | ||
| document.quirks_mode() == QuirksMode::Quirks && | ||
| document.url().origin() == metadata.final_url.origin() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use https://doc.servo.org/script/dom/document/struct.Document.html#method.origin instead!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This matters because web content can set document.origin so it's different than the url's origin.
Signed-off-by: saku-1101 <sakupi1101@outlook.jp>
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#51860). |
|
🔨 Triggering try run (#14276734272) for Linux (WPT) |
|
Test results for linux-wpt from try job (#14276734272): Flaky unexpected result (18)
Stable unexpected results that are known to be intermittent (17)
|
|
✨ Try run (#14276734272) succeeded. |
|
One formatting error that you can resolve with |
Signed-off-by: saku-1101 <sakupi1101@outlook.jp>
|
Thanks for checking & reporting! |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#51860). |
This PR implements the HTML spec quirk for stylesheets: https://html.spec.whatwg.org/multipage/#link-type-stylesheet
The implementation adds a check in
stylesheet_loader.rsto handle this quirk condition correctly, and adds a new WPT test to verify that same-origin non-CSS MIME type resources are properly treated as CSS in quirks mode.Testing: Added a new WPT test (
quirk-origin-check-positive.html) that verifies the positive case for this quirk.Fixes: #36324