Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix CSS.supports behaviour with regards to !important and whitespace
Fix CSS.supports behaviour with regards to !important and whitespace https://bugs.webkit.org/show_bug.cgi?id=248450 Reviewed by Darin Adler. This patch is to align Webkit with Blink / Chromium, Gecko / Firefox and Web-Specification. Web-Spec: [1] https://drafts.csswg.org/css-conditional-3/#the-csssupportsrule-interface [2] https://drafts.csswg.org/cssom-1/#dom-cssstyledeclaration-setpropertyvalue Merge - https://chromium.googlesource.com/chromium/blink/+/36890765b05b48d8065737682b4e878645b601b2 This patch changes some small issues in CSS.supports: 1) Whitespace in CSS properties are not allowed. This aligns with FF and the spec. 2) !important in a value is not removed. The !important flag is not part of a CSS value, so something like CSS.supports("left","10px !important") should return false. This is aligned with Web-Spec: https://drafts.csswg.org/css-conditional-3/#the-css-namespace >> Note: !important flags are not part of property grammars, and will cause value to parse as invalid, just as they would in the value argument to element.style.setProperty(). More Details - w3c/csswg-drafts#5692 3) Newlines are not turned into spaces. These are not equivalent in CSS, as newlines will cause strings to become bad string tokens. * Source/WebCore/css/DOMCSSNamespace.cpp: (valeWithoutImportant): Removed (DOMCSSNamespace::supports): Update to remove "whitespace" and return 'value' rather than 'normalizedValue' * LayoutTests/css3/supports-dom-api.html: Rebaselined * LayoutTests/css3/supports-dom-api-expected.txt: Rebaselined Canonical link: https://commits.webkit.org/257313@main
- Loading branch information
1 parent
bf5f525
commit 30880fe8446d7f010017a987501ef31e4643b2a5
Showing
3 changed files
with
147 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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