feat: add JS support for CSS mask properties - #58163
Open
paradowstack wants to merge 4 commits into
Open
Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
This was referenced Aug 27, 2026
lint fix add local image example
copy bitmap on background thread
paradowstack
marked this pull request as ready for review
August 27, 2026 12:13
paradowstack
force-pushed
the
feat/mask-js
branch
from
August 27, 2026 12:22
ae2459e to
d39fc84
Compare
paradowstack
force-pushed
the
feat/mask-js
branch
2 times, most recently
from
August 27, 2026 12:39
d39fc84 to
f9e24ac
Compare
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.
Rebase Note:
This branch is stacked on #54995 + #54996 + #54994 (Nishan's
url()inbackground-imagework). Once this work lands, this branch has to be rebased. Review only the last commit.Summary:
This PR adds support for the
mask-image,mask-size,mask-positionandmask-repeatCSS properties. It follows the CSS spec described here. A mask clips a view and its whole subtree to the alpha channel of a gradient or an image. The remaining mask properties (mask-clip,mask-origin,mask-mode,mask-composite) and themaskshorthand are not covered here and can be added in a follow up PR if needed.Every
mask-*property accepts exactly the same values as itsbackground-*counterpart, so the whole value pipeline is shared instead of duplicated - the same JS style processors and the same C++ prop conversions.url()masks are collected by the same shadow node code that requestsbackground-imagesources, so they go through the existing image loading path.Work has been split into three stacked PRs for more convenient reviewing process:
Changelog:
[GENERAL] [ADDED] - Add JS support for CSS mask properties
Test Plan:
yarn fantom packages/react-native/Libraries/Components/View/__tests__/View-mask-itest.jsyarn flow-check,yarn build-types(ReactNativeApi.d.tsregenerated)Rendering is covered in the iOS and Android PRs on top of this one.