Repository navigation
Conversation
This branch has not been deployed
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.
Summary:
Two bugs in the
backgroundImagestring parser.getPositionFromCSSValueonly acceptedpxand%, so a unitless0stop likelinear-gradient(red 0, blue 100%)was treated as an invalid position and the whole gradient was dropped. CSS allows a bare0as a length, so it now parses to0.Also, when one layer of a multi-layer string failed to parse,
parseBackgroundImageCSSStringskipped it and kept the others. In CSS one invalid layer invalidates the whole value, and the array form here already returns[]in that case, so the string form now does the same.Fixes #59603
Changelog:
[GENERAL] [FIXED] - Accept unitless
0color stop positions and drop the whole value when one layer is invalid inbackgroundImagestringsTest Plan:
Added two cases to
processBackgroundImage-itest.js. Both fail onmainand pass with this change, and the rest of the file still passes. I ran the file under plain Jest (without the Fantom environment import) since I don't have the Fantom runner built locally. Prettier, ESLint and Flow are clean.