Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 4b4a31ba711780267092644970214807bc0cfbac https://github.com/WebKit/WebKit/commit/4b4a31ba711780267092644970214807bc0cfbac Author: Ahmad Saleem <ahmad.saleem792+git...@gmail.com> Date: 2022-11-30 (Wed, 30 Nov 2022)
Changed paths: M LayoutTests/css3/supports-dom-api-expected.txt M LayoutTests/css3/supports-dom-api.html M Source/WebCore/css/DOMCSSNamespace.cpp Log Message: ----------- 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 _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes