Skip to content

[Cocoa] Support AVIF images for macOS Ventura and iOS 16 - #1717

Merged
webkit-early-warning-system merged 1 commit into
WebKit:mainfrom
shallawa:eng/Cocoa-Support-AVIF-images-for-macOS-Ventura-and-iOS-16
Jun 25, 2022
Merged

webkit-early-warning-system merged 1 commit into
WebKit:mainfrom
shallawa:eng/Cocoa-Support-AVIF-images-for-macOS-Ventura-and-iOS-16

Conversation

@shallawa

@shallawa shallawa commented Jun 23, 2022 •

Copy link
Copy Markdown
Contributor

59d774a

[Cocoa] Support AVIF images for macOS Ventura and iOS 16
https://bugs.webkit.org/show_bug.cgi?id=241904
rdar://95742091

Reviewed by Myles C. Maxfield.

Add the mime type and the UTI of the AVIF to the list of the allowed image
formats. The system frameworks will be used to render the AVIF images on macOS
Ventura and iOS 16. Because of sand-boxing limitations, software decoding has
to be used for AVIF images.

* LayoutTests/platform/mac/TestExpectations:
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/loader/cache/CachedResourceRequest.cpp:
(WebCore::acceptHeaderValueForImageResource):
* Source/WebCore/platform/MIMETypeRegistry.cpp:
* Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions):
* Source/WebCore/platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):

Canonical link: https://commits.webkit.org/251850@main
@shallawa shallawa self-assigned this Jun 23, 2022
@shallawa shallawa added Images For bugs in image handling. WebKit Nightly Build labels Jun 23, 2022
Comment thread Source/WebCore/loader/cache/CachedResourceRequest.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh oh. Why is there both HAVE(AVIF) and USE(AVIF)? Can we consolidate them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HAVE(AVIF) is used by Apple ports where the system frameworks provide the needed support to render these images.
USE(AVIF) is used by non Apple ports. It is defined in Source/cmake/OptionsWPE.cmake and Source/cmake/OptionsGTK.cmake. They use libavif to handle the AVIF images. If we want to merge HAVE(AVIF) and USE(AVIF) and merge HAVE(WEBP) and USE(WEBP), I think it is better to handle this in a separate patch.

@litherum litherum Jun 25, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure we have a bug open for the separate patch? (Presumably the separate patch would be for both AVIF and WEBP.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread Source/WebCore/platform/MIMETypeRegistry.cpp Outdated
Comment thread Source/WTF/wtf/PlatformHave.h Outdated
Comment thread Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp Outdated
@shallawa
shallawa force-pushed the eng/Cocoa-Support-AVIF-images-for-macOS-Ventura-and-iOS-16 branch 2 times, most recently from 120c22a to 67b4e14 Compare June 25, 2022 01:27
@shallawa
shallawa requested review from pvollan and smfr June 25, 2022 04:13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not super clear if this line has any repercussions beyond HEIC or AVIF, but okay.

@shallawa shallawa added the merge-queue Applied to send a pull request to merge-queue label Jun 25, 2022
https://bugs.webkit.org/show_bug.cgi?id=241904
rdar://95742091

Reviewed by Myles C. Maxfield.

Add the mime type and the UTI of the AVIF to the list of the allowed image
formats. The system frameworks will be used to render the AVIF images on macOS
Ventura and iOS 16. Because of sand-boxing limitations, software decoding has
to be used for AVIF images.

* LayoutTests/platform/mac/TestExpectations:
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/loader/cache/CachedResourceRequest.cpp:
(WebCore::acceptHeaderValueForImageResource):
* Source/WebCore/platform/MIMETypeRegistry.cpp:
* Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::createImageSourceOptions):
* Source/WebCore/platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):

Canonical link: https://commits.webkit.org/251850@main
@webkit-early-warning-system
webkit-early-warning-system force-pushed the eng/Cocoa-Support-AVIF-images-for-macOS-Ventura-and-iOS-16 branch from 67b4e14 to 59d774a Compare June 25, 2022 08:32
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 251850@main (59d774a): https://commits.webkit.org/251850@main

Reviewed commits have been landed. Closing PR #1717 and removing active labels.

@webkit-early-warning-system
webkit-early-warning-system merged commit 59d774a into WebKit:main Jun 25, 2022
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Images For bugs in image handling.

4 participants