brightness() filter should default to 1, and not allow negative values
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 23:24:47 +0000 (23:24 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Apr 2018 23:24:47 +0000 (23:24 +0000)
commit878ae2833349d46306aecac1e943771cb4b1fb31
tree90aa7b5167474d548284d99ff6d3515ef859fc40
parent9f334db4f469e96a1cde8f94307a5261b01aa213
brightness() filter should default to 1, and not allow negative values
https://bugs.webkit.org/show_bug.cgi?id=184937

Reviewed by Dean Jackson.
Source/WebCore:

Remove the special-casing for brightness() in consumeFilterFunction(), so it now
follows the same logic as the other color-related filters in not allowing negative
values.

Removed the special-casing for brightness() in createFilterOperations() so its default
value is now 1.

Modified existing tests.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):

LayoutTests:

Added negative value tests to filter-property-parsing.html and backdropfilter-property-parsing.html,
and made these tests more similar.

Fixed expected computed value for brightness() to be brightness(1) in the tests.

The effect-brightness* test results failed because elements with invalid brightness values now
no longer create a RenderLayer.

* css3/color-filters/color-filter-parsing-expected.txt:
* css3/color-filters/color-filter-parsing.html:
* css3/filters/backdrop/backdropfilter-property-computed-style-expected.txt:
* css3/filters/backdrop/backdropfilter-property-computed-style.html:
* css3/filters/backdrop/backdropfilter-property-parsing-expected.txt:
* css3/filters/backdrop/backdropfilter-property-parsing.html:
* css3/filters/effect-brightness-expected.txt:
* css3/filters/filter-property-computed-style-expected.txt:
* css3/filters/filter-property-computed-style.html:
* css3/filters/filter-property-parsing-expected.txt:
* css3/filters/filter-property-parsing.html:
* css3/filters/unprefixed-expected.txt:
* css3/filters/unprefixed.html:
* fast/filter-image/parse-filter-image-expected.txt:
* fast/filter-image/parse-filter-image.html:
* platform/mac/css3/filters/effect-brightness-clamping-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/color-filters/color-filter-parsing-expected.txt
LayoutTests/css3/color-filters/color-filter-parsing.html
LayoutTests/css3/filters/backdrop/backdropfilter-property-computed-style-expected.txt
LayoutTests/css3/filters/backdrop/backdropfilter-property-computed-style.html
LayoutTests/css3/filters/backdrop/backdropfilter-property-parsing-expected.txt
LayoutTests/css3/filters/backdrop/backdropfilter-property-parsing.html
LayoutTests/css3/filters/effect-brightness-expected.txt
LayoutTests/css3/filters/filter-property-computed-style-expected.txt
LayoutTests/css3/filters/filter-property-computed-style.html
LayoutTests/css3/filters/filter-property-parsing-expected.txt
LayoutTests/css3/filters/filter-property-parsing.html
LayoutTests/css3/filters/unprefixed-expected.txt
LayoutTests/css3/filters/unprefixed.html
LayoutTests/fast/filter-image/parse-filter-image-expected.txt
LayoutTests/fast/filter-image/parse-filter-image.html
LayoutTests/platform/ios/css3/filters/effect-brightness-clamping-expected.txt
LayoutTests/platform/ios/css3/filters/effect-brightness-expected.txt
LayoutTests/platform/mac/css3/filters/effect-brightness-clamping-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp