-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
Fix set property invalid description of priority parameter #38766
Fix set property invalid description of priority parameter #38766
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Preview URLs (comment last updated: 2025-03-22 18:15:29) |
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.
Sure, thanks
@Josh-Cena If the value is empty and the priority is invalid, no change will be applied even if the value is empty, so the changed description is invalid. Verified on chrome / firefox. |
@OlaviSau It works on Firefox. To try this, open the live example on this page. Change the stylesheet line to function setRandomBorder() {
boxParaRule.style.setProperty("border", "", "foo");
} And press the "border" button. You will see that the border disappears. The algorithm in the spec: https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty also says if value is empty then priority is not validated at all. That it does not work in Chrome or Safari may be a bug to be reported to these browsers, but Firefox is the only compliant browser for now. |
Description
This change corrects the parameter description for CSSStyleDeclaration setProperty method.
Motivation
These changes reflect the full list of accepted values and more accurately describe what happens when an invalid value is passed.
Additional details
Related issues and pull requests