feat: add iOS support for CSS mask properties - #58164
Open
paradowstack wants to merge 5 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-ios
branch
from
August 27, 2026 12:22
71bf85b to
d23d348
Compare
paradowstack
force-pushed
the
feat/mask-ios
branch
from
August 27, 2026 12:38
d23d348 to
7af2726
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) and #58163 (JS & C++ changes). 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.The mask layers are drawn with the same gradient and image helpers as
background-image, assembled into aCALayertree and assigned as the mask of the container layer, so masking is intersected with the border radius clipping shape and applies to children as well.url()masks reuse thebackground-imageURL loader, so no new image loading code is introduced.Work has been split into three stacked PRs for more convenient reviewing process:
The stack is based on the
url()inbackground-imagework, which has to land first.Changelog:
[IOS] [ADDED] - Add iOS support for CSS mask properties
Test Plan:
Run RNTester on iOS and open the Mask screen (
MaskExample.js) - gradient, local and remote image masks,mask-repeat,mask-size,mask-position, multiple layers, border radius, masked children, text, image, scroll view and text input.