-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
audit(non-composited-animations): add UIString for custom properties #15571
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -32,6 +32,12 @@ const UIStrings = { | |||||
=1 {Unsupported CSS Property: {properties}} | ||||||
other {Unsupported CSS Properties: {properties}} | ||||||
}`, | ||||||
/** | ||||||
* @description Descriptive reason for why a user-provided animation failed to be optimized by the browser due to the animated custom CSS property not being supported on the compositor. Shown in a table with a list of other potential failure reasons. | ||||||
* @example {--my-custom-property} properties | ||||||
* */ | ||||||
unsupportedCustomCSSProperty: 'Custom CSS properties cannot be animated on the compositor: ' + | ||||||
'{properties}', | ||||||
/** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to a `transform` property being dependent on the size of the element itself. Shown in a table with a list of other potential failure reasons. */ | ||||||
transformDependsBoxSize: 'Transform-related property depends on box size', | ||||||
/** Descriptive reason for why a user-provided animation failed to be optimized by the browser due to a `filter` property possibly moving pixels. Shown in a table with a list of other potential failure reasons. */ | ||||||
|
@@ -56,6 +62,10 @@ const ACTIONABLE_FAILURE_REASONS = [ | |||||
flag: 1 << 13, | ||||||
text: UIStrings.unsupportedCSSProperty, | ||||||
}, | ||||||
{ | ||||||
flag: 1 << 13, | ||||||
text: UIStrings.unsupportedCustomCSSProperty, | ||||||
}, | ||||||
{ | ||||||
flag: 1 << 11, | ||||||
text: UIStrings.transformDependsBoxSize, | ||||||
|
@@ -91,9 +101,18 @@ function getActionableFailureReasons(failureCode, unsupportedProperties) { | |||||
.filter(reason => failureCode & reason.flag) | ||||||
.map(reason => { | ||||||
if (reason.text === UIStrings.unsupportedCSSProperty) { | ||||||
const nonCustomUnSupportedProperties = unsupportedProperties | ||||||
.filter(property => !property.startsWith('--')); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||||||
return str_(reason.text, { | ||||||
propertyCount: unsupportedProperties.length, | ||||||
properties: unsupportedProperties.join(', '), | ||||||
propertyCount: nonCustomUnSupportedProperties.length, | ||||||
properties: nonCustomUnSupportedProperties.join(', '), | ||||||
}); | ||||||
} | ||||||
if (reason.text === UIStrings.unsupportedCustomCSSProperty) { | ||||||
const customUnsupportedProperties = unsupportedProperties | ||||||
.filter(property => property.startsWith('--')); | ||||||
return str_(UIStrings.unsupportedCustomCSSProperty, { | ||||||
properties: customUnsupportedProperties.join(', '), | ||||||
}); | ||||||
} | ||||||
return str_(reason.text); | ||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.