[Model Element] Require CORS for loading model sources and environment maps#45447
Conversation
|
EWS run on previous version of this PR (hash c45724a) Details |
c45724a to
f57ea62
Compare
|
EWS run on previous version of this PR (hash f57ea62) Details |
|
Actually, this is not correct yet. I need to look more into this. |
|
Yeah, this will hit an assert in |
f57ea62 to
0eb5c74
Compare
|
EWS run on previous version of this PR (hash 0eb5c74) Details |
annevk
left a comment
There was a problem hiding this comment.
This looks good to me, but let's wait for Youenn as well to be sure.
youennf
left a comment
There was a problem hiding this comment.
LGTM with a test where load would fail.
0eb5c74 to
282b48b
Compare
|
EWS run on previous version of this PR (hash 282b48b) Details |
282b48b to
3aa42ef
Compare
|
EWS run on previous version of this PR (hash 3aa42ef) Details |
3aa42ef to
2ec5bbd
Compare
|
EWS run on previous version of this PR (hash 2ec5bbd) Details |
2ec5bbd to
40d70b3
Compare
|
EWS run on previous version of this PR (hash 40d70b3) Details |
youennf
left a comment
There was a problem hiding this comment.
LGTM.
If you have some time, we could add a few additional tests:
- a data URL load from a HTTP origin (should succeed)
- a blob URL load from a HTTP origin (should succeed)
- a file URL load from a file origin (should succeed)
- a file URL load with a crossorigin attribute (whatever value, should fail)
- a HTTP URL load with an empty crossorigin attribute (should be the same as anonymous).
There was a problem hiding this comment.
| CachedResourceRequest HTMLModelElement::createResourceRequest(const URL& resourceURL, const FetchOptions::Destination& destination) | |
| CachedResourceRequest HTMLModelElement::createResourceRequest(const URL& resourceURL, FetchOptions::Destination destination) |
There was a problem hiding this comment.
I'll add more tests in a separate PR.
There was a problem hiding this comment.
Filed: https://bugs.webkit.org/show_bug.cgi?id=293371 (Add more tests around model source loading across different origins)
40d70b3 to
2409c48
Compare
|
EWS run on current version of this PR (hash 2409c48) Details |
…t maps https://bugs.webkit.org/show_bug.cgi?id=293063 rdar://151364606 Reviewed by Youenn Fablet and Anne van Kesteren. Make sure CORS is always enabled with model source and environment map requests, by passing a non-null crossorigin attribute to createPotentialAccessControlRequest(). Also make sure we null out m_model once source is reset. * LayoutTests/TestExpectations: * LayoutTests/http/tests/security/model-element/model-element-crossorigin-allowed-with-all-access-header-expected.txt: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-allowed-with-all-access-header.html: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-allowed-with-header-expected.txt: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-allowed-with-header.html: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-allowed-with-same-origin-expected.txt: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-allowed-with-same-origin.html: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-blocked-with-header-expected.txt: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-blocked-with-header.html: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-blocked-with-use-credentials-and-all-access-header-expected.txt: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-blocked-with-use-credentials-and-all-access-header.html: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-blocked-without-header-expected.txt: Added. * LayoutTests/http/tests/security/model-element/model-element-crossorigin-blocked-without-header.html: Added. * LayoutTests/http/tests/security/resources/cube.usdz: Added. * LayoutTests/http/tests/security/resources/model-access-control.py: Added. * Source/WebCore/Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::setSourceURL): (WebCore::HTMLModelElement::environmentMapRequestResource): Canonical link: https://commits.webkit.org/295219@main
2409c48 to
74ab595
Compare
|
Committed 295219@main (74ab595): https://commits.webkit.org/295219@main Reviewed commits have been landed. Closing PR #45447 and removing active labels. |
🛠 🧪 jsc-arm64
74ab595
2409c48
🛠 win🧪 wpe-wk2🧪 win-tests🧪 ios-wk2-wpt🧪 api-ios🧪 mac-AS-debug-wk2🧪 gtk-wk2🛠 mac-safer-cpp🛠 watch-sim