Repository navigation
Implement support for STL formats for the model element - #80652
Merged
webkit-commit-queue merged 1 commit intoNov 13, 2026
Merged
webkit-commit-queue merged 1 commit into
webkit-commit-queue merged 1 commit into
Conversation
jeanhbr
requested review from
cdumez,
etiennesegonzac,
mwyrzykowski and
rr-codes
as code owners
November 12, 2026 12:10
Collaborator
|
EWS run on previous version of this PR (hash eaf19e8) Details |
Contributor
There was a problem hiding this comment.
do we need a runtime feature flag?
Contributor
There was a problem hiding this comment.
or should the runtime check be in isSupportedModelType instead of here? Or that is not possible, because we don't have a document in isSupportedModelType?
mwyrzykowski
approved these changes
Nov 12, 2026
jeanhbr
force-pushed
the
eng/Implement-support-for-STL-formats-for-the-model-element
branch
from
November 13, 2026 13:28
eaf19e8 to
3015ea2
Compare
Collaborator
|
EWS run on current version of this PR (hash 3015ea2) Details |
https://bugs.webkit.org/show_bug.cgi?id=331262 rdar://185985318 Reviewed by Mike Wyrzykowski. Load STL models in the <model> element, behind the a temporary flag, off by default. STL has no signature, so WebCore recognizes it by its structure, with the same checks as USDLib's STL importer: binary STL is exactly 84 bytes plus 50 bytes per triangle, per the triangle count at offset 80, and ASCII STL starts with "solid". WebCore gives STL models the model/stl MIME type, which selects USDLib's STL file format when the stage is opened. Data that matches no format keeps its Content-Type, so a server can also send model/stl. With STL disabled, an STL model fails to load with a NotSupportedError. Test: Tools/TestWebKitAPI/Tests/WebCore/MIMESniffer.cpp Layout tests will be added in this follow-up: rdar://192563700 * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Modules/model-element/HTMLModelElement.cpp: (WebCore::HTMLModelElement::selectModelSource const): (WebCore::modelMIMEType): (WebCore::HTMLModelElement::modelResourceFinished): * Source/WebCore/platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isSTLMIMEType): (WebCore::MIMETypeRegistry::isSupportedModelMIMEType): * Source/WebCore/platform/MIMETypeRegistry.h: * Source/WebKit/GPUProcess/graphics/Model/USDModel.swift: (usdStageType(forMIMEType:)): * Source/WebKit/ModelProcess/cocoa/WKUSDStageConverter.swift: (os.usdStageType(forMIMEType:)): * Source/WebKit/WebProcess/Model/ModelProcessModelPlayer.cpp: (WebKit::ModelProcessModelPlayer::load): * Source/WebCore/platform/graphics/MIMESniffer.cpp: (WebCore::MIMESniffer::isBinarySTL): (WebCore::MIMESniffer::getModelMIMETypeFromContent): * Tools/TestWebKitAPI/Tests/WebCore/MIMESniffer.cpp: (TestWebKitAPI::TEST(MIMESniffer, ModelMIMETypes)): Canonical link: https://commits.webkit.org/326648@main
webkit-commit-queue
force-pushed
the
eng/Implement-support-for-STL-formats-for-the-model-element
branch
from
November 13, 2026 15:50
3015ea2 to
2de44da
Compare
Collaborator
|
Committed 326648@main (2de44da): https://commits.webkit.org/326648@main Reviewed commits have been landed. Closing PR #80652 and removing active labels. |
jeanhbr
deleted the
eng/Implement-support-for-STL-formats-for-the-model-element
branch
November 13, 2026 15:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2de44da
3015ea2
🛠 wpe🛠 win🧪 wpe-wk2🧪 win-tests🧪 ios-cmake-wk2🧪 api-mac🧪 api-wpe🧪 ios-cmake-wk2-wpt🧪 jsc-wpe🧪 api-ios-cmake🧪 mac-wk2🧪 mac-cmake-debug-wk2🧪 gtk-wk2🧪 mac-intel-wk2🛠 playstation