haikuwebkit/LayoutTests/css3/color-filters/color-filter-parsing-expect...

39 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

Add a new "color-filter" CSS property as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=184940 Source/WebCore: rdar://problem/39664904 Reviewed by Jon Lee. Add a new CSS property called "color-filter" as an experimental feature (off by default). This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions) to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility. Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property. Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped. This patch adds support for parsing color-filter. Test: css3/color-filters/color-filter-parsing.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/parser/CSSParser.cpp: (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserMode.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::isColorFilterFunction): (WebCore::CSSPropertyParserHelpers::consumeFilterFunction): (WebCore::CSSPropertyParserHelpers::consumeFilter): * css/parser/CSSPropertyParserHelpers.h: * page/Settings.yaml: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaint const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::mutableColorFilter): (WebCore::RenderStyle::colorFilter const): (WebCore::RenderStyle::hasColorFilter const): (WebCore::RenderStyle::setColorFilter): (WebCore::RenderStyle::initialColorFilter): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): (WebCore::StyleRareInheritedData::hasColorFilters const): * rendering/style/StyleRareInheritedData.h: Source/WebKit: Reviewed by Jon Lee. Add the color-filter property as an experimental feature. * Shared/WebPreferences.yaml: LayoutTests: Reviewed by Jon Lee. * css3/color-filters/color-filter-parsing-expected.txt: Added. * css3/color-filters/color-filter-parsing.html: Added. Canonical link: https://commits.webkit.org/200451@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-25 01:50:39 +00:00
PASS Parse none
PASS Parse auto
PASS Parsing garbage value returns none
PASS Parsing garbage function returns none
PASS Parse brightness()
PASS Parse contrast()
PASS Parse grayscale()
PASS Parse hue-rotate()
PASS Parse invert
PASS Parse opacity()
PASS Parse saturate()
PASS Parse sepia()
PASS drop-shadow() is not allowed in -apple-color-filter
PASS blur() is not allowed in -apple-color-filter
PASS Canonicalize grayscale() argument
PASS Canonicalize hue-rotate() argument
PASS Negative value for brightness() is invalid
PASS Negative value for contrast() is invalid
PASS Negative value for grayscale() is invalid
PASS Negative value allowed for hue-rotate()
PASS Negative value for invert() is invalid
PASS Negative value for opacity() is invalid
PASS Negative value for saturate() is invalid
PASS Negative value for sepia() is invalid
PASS brightness(): values of amount over 100% are allowed, providing brighter results
PASS contrast(): values of amount over 100% are allowed, providing results with more contrast
PASS Values of amount over 100% are allowed but UAs must clamp the values to 1
PASS hue-rotate(): implementations must not normalize this value in order to allow animations beyond 360deg
PASS invert(): values of amount over 100% are allowed but UAs must clamp the values to 1
PASS opacity(): values of amount over 100% are allowed but UAs must clamp the values to 1
PASS saturate(): values of amount over 100% are allowed, providing super-saturated results
PASS sepia(): values of amount over 100% are allowed but UAs must clamp the values to 1
PASS Parse filter list
PASS Filter list with blur is invalid
PASS Parse apple-invert-lightness()
PASS apple-invert-lightness() takes no arguments
Add a new "color-filter" CSS property as an experimental feature https://bugs.webkit.org/show_bug.cgi?id=184940 Source/WebCore: rdar://problem/39664904 Reviewed by Jon Lee. Add a new CSS property called "color-filter" as an experimental feature (off by default). This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions) to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility. Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property. Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped. This patch adds support for parsing color-filter. Test: css3/color-filters/color-filter-parsing.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/parser/CSSParser.cpp: (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserMode.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::isColorFilterFunction): (WebCore::CSSPropertyParserHelpers::consumeFilterFunction): (WebCore::CSSPropertyParserHelpers::consumeFilter): * css/parser/CSSPropertyParserHelpers.h: * page/Settings.yaml: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaint const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::mutableColorFilter): (WebCore::RenderStyle::colorFilter const): (WebCore::RenderStyle::hasColorFilter const): (WebCore::RenderStyle::setColorFilter): (WebCore::RenderStyle::initialColorFilter): * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): (WebCore::StyleRareInheritedData::hasColorFilters const): * rendering/style/StyleRareInheritedData.h: Source/WebKit: Reviewed by Jon Lee. Add the color-filter property as an experimental feature. * Shared/WebPreferences.yaml: LayoutTests: Reviewed by Jon Lee. * css3/color-filters/color-filter-parsing-expected.txt: Added. * css3/color-filters/color-filter-parsing.html: Added. Canonical link: https://commits.webkit.org/200451@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-04-25 01:50:39 +00:00