Fix: Add support for stylesheet MIME type quirk in quirks mode#36338
Fix: Add support for stylesheet MIME type quirk in quirks mode#36338jdm merged 4 commits intoservo:mainfrom
Conversation
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#51860) with upstreamable changes. |
Signed-off-by: saku-1101 <[email protected]>
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). |
| }) || (document.quirks_mode() == QuirksMode::Quirks && | ||
| document.url().origin() == metadata.final_url.origin()); |
There was a problem hiding this comment.
Do you mind linking to the specification and quoting the specification text here?
There was a problem hiding this comment.
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 <[email protected]>
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.
There was a problem hiding this comment.
This matters because web content can set document.origin so it's different than the url's origin.
Signed-off-by: saku-1101 <[email protected]>
|
📝 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 <[email protected]>
|
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