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 Antti Koivisto. 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 not completely clear in the spec but likely the intended behaviour and similar to CSSStyleDeclaration from the CSSOM (which says 'value can not include "!important"' for setProperty). 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/257196@main
- Loading branch information
1 parent
60a1d6d
commit 4b4a31ba711780267092644970214807bc0cfbac
Showing
3 changed files
with
146 additions
and
45 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