haikuwebkit/LayoutTests/fast/filter-image/filter-image-animation-expe...

15 lines
1.6 KiB
Plaintext
Raw Permalink Normal View History

Support CSS filters without webkit prefix https://bugs.webkit.org/show_bug.cgi?id=148138 <rdar://problem/22331434> Reviewed by Sam Weinig. Source/WebCore: Add support for the un-prefixed form of the CSS filter property. This was straightforward for the general case on HTML content. It was a bit more tricky on SVG content, where there already was an existing "filter" property/attribute. The parsing code is now shared between SVG and HTML, as is the computed style output. Covered by updating the existing tests, and adding one new test: css3/filters/unprefixed.html * css/CSSComputedStyleDeclaration.cpp: Rename CSSPropertyWebkitFilter to CSSPropertyFilter. (WebCore::isLayoutDependent): (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSFilterImageValue.cpp: (WebCore::CSSFilterImageValue::customCSSText): Use "filter(" as the prefix. * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Rename CSSPropertyWebkitFilter to CSSPropertyFilter. (WebCore::CSSParser::isGeneratedImageValue): Add support for "filter()". (WebCore::CSSParser::parseGeneratedImage): Ditto. (WebCore::CSSParser::parseBuiltinFilterArguments): * css/CSSPropertyNames.in: Add filter. Make -webkit-filter an alias. * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::svgPropertyValue): Deleted. * page/animation/CSSPropertyAnimation.cpp: Rename CSSPropertyWebkitFilter to CSSPropertyFilter. (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): * page/animation/KeyframeAnimation.cpp: Ditto. (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists): * platform/graphics/GraphicsLayer.cpp: Rename AnimatedPropertyWebkitFilter to AnimatedPropertyFilter. (WebCore::GraphicsLayer::validateFilterOperations): * platform/graphics/GraphicsLayerClient.h: Ditto. * platform/graphics/ca/GraphicsLayerCA.cpp: Ditto. (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateOrRemoveFilterClients): SVG manages its own filter resources, so we shouldn't add a layer that has an SVG root to the filter clients. * rendering/RenderLayerBacking.cpp: Renaming. (WebCore::RenderLayerBacking::startAnimation): (WebCore::RenderLayerBacking::startTransition): (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty): (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty): * rendering/RenderLayerCompositor.cpp: Ditto. (WebCore::RenderLayerCompositor::requiresCompositingForAnimation): * rendering/style/SVGRenderStyle.h: Remove the SVG filter style. (WebCore::SVGRenderStyle::isolatesBlending): No need to check for hasFilter(). (WebCore::SVGRenderStyle::initialFilterResource): Deleted. (WebCore::SVGRenderStyle::setFilterResource): Deleted. (WebCore::SVGRenderStyle::filterResource): Deleted. (WebCore::SVGRenderStyle::hasFilter): Deleted. * rendering/style/SVGRenderStyleDefs.cpp: Remove the filter resource. (WebCore::StyleResourceData::StyleResourceData): Deleted. (WebCore::StyleResourceData::operator==): Deleted. * rendering/style/SVGRenderStyleDefs.h: * rendering/style/WillChangeData.cpp: Renaming. (WebCore::propertyCreatesStackingContext): (WebCore::propertyTriggersCompositing): * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::isolatesBlending): Since SVGRenderStyle no longer checks hasFilter() in its isolatesBlending(), we need to do it here. * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeResources): Dump from the CSS style value. * rendering/svg/SVGResources.cpp: Ditto. (WebCore::SVGResources::buildCachedResources): * rendering/svg/SVGResources.h: * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::addResourcesFromRenderer): * platform/graphics/texmap/TextureMapperLayer.cpp: Renaming. * platform/graphics/texmap/TextureMapperAnimation.cpp: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: Source/WebKit2: Rename WebkitFilter to Filter. * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp: (IPC::ArgumentCoder<TextureMapperAnimation>::encode): (IPC::ArgumentCoder<TextureMapperAnimation>::decode): LayoutTests: Globally change -webkit-filter to filter in as many places as possible. Then add a new test that makes sure the prefixed and unprefixed value resolve to the same computed style. * animations/resources/animation-test-helpers.js: (parseCSSImage): * css3/filters/backdrop/effect-hw-expected.html: * css3/filters/effect-blur-hw.html: * css3/filters/effect-blur.html: * css3/filters/effect-brightness-clamping-hw.html: * css3/filters/effect-brightness-clamping.html: * css3/filters/effect-brightness-hw.html: * css3/filters/effect-brightness.html: * css3/filters/effect-combined-hw.html: * css3/filters/effect-combined.html: * css3/filters/effect-contrast-hw.html: * css3/filters/effect-contrast.html: * css3/filters/effect-drop-shadow-hw.html: * css3/filters/effect-drop-shadow.html: * css3/filters/effect-grayscale-hw.html: * css3/filters/effect-grayscale.html: * css3/filters/effect-hue-rotate-hw.html: * css3/filters/effect-hue-rotate.html: * css3/filters/effect-invert-hw.html: * css3/filters/effect-invert.html: * css3/filters/effect-opacity-hw.html: * css3/filters/effect-opacity.html: * css3/filters/effect-reference-composite-hw.html: * css3/filters/effect-reference-composite.html: * css3/filters/effect-reference-hw.html: * css3/filters/effect-reference-ordering-hw.html: * css3/filters/effect-reference-ordering.html: * css3/filters/effect-reference.html: * css3/filters/effect-saturate-hw.html: * css3/filters/effect-saturate.html: * css3/filters/effect-sepia-hw.html: * css3/filters/effect-sepia.html: * css3/filters/filter-property-computed-style-expected.txt: * css3/filters/filter-property-parsing-expected.txt: * css3/filters/script-tests/filter-property-computed-style.js: (testComputedFilterRule): * css3/filters/script-tests/filter-property-parsing.js: (testFilterRule): * css3/filters/script-tests/unprefixed.js: Copied from LayoutTests/css3/filters/script-tests/filter-property-computed-style.js. (testComputedFilterRule): * css3/filters/unprefixed-expected.txt: Copied from LayoutTests/css3/filters/filter-property-computed-style-expected.txt. * css3/filters/unprefixed.html: Added. * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/filter-image/clipped-filter-expected.html: * fast/filter-image/clipped-filter.html: * fast/filter-image/filter-image-animation-expected.txt: * fast/filter-image/filter-image-animation.html: * fast/filter-image/filter-image-blur.html: * fast/filter-image/filter-image-expected.html: * fast/filter-image/filter-image-svg.html: * fast/filter-image/filter-image.html: * fast/filter-image/parse-filter-image-expected.txt: * fast/filter-image/parse-filter-image.html: * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/166305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-08-19 20:22:50 +00:00
PASS - "backgroundImage" property for "brightness" element at 1s saw something close to: filter(url(image.svg), brightness(0.5))
PASS - "backgroundImage" property for "blur" element at 1s saw something close to: filter(url(image.svg), blur(5px))
PASS - "backgroundImage" property for "grayscale" element at 1s saw something close to: filter(url(image.svg), grayscale(0.5))
PASS - "backgroundImage" property for "sepia" element at 1s saw something close to: filter(url(image.svg), sepia(0.5))
PASS - "backgroundImage" property for "no" element at 1s saw something close to: filter(url(blue.svg), sepia(0))
PASS - "backgroundImage" property for "multiple1" element at 1s saw something close to: filter(url(image.svg), sepia(0.5) blur(1.5px) hue-rotate(22.5deg))
PASS - "backgroundImage" property for "multiple2" element at 1s saw something close to: filter(url(image.svg), contrast(0.5) blur(1.5px) hue-rotate(22.5deg))
PASS - "backgroundImage" property for "urlfilter" element at 1s saw something close to: filter(url(image.svg), sepia(0.25))
PASS - "backgroundImage" property for "filterurl" element at 1s saw something close to: filter(url(image.svg), sepia(0.25))
PASS - "backgroundImage" property for "filterdiffurl" element at 1s saw something close to: filter(url(blue.svg), sepia(0.5))
PASS - "backgroundImage" property for "generated1" element at 1s saw something close to: filter(filter(url(image.svg), blur(3px)), sepia(0))
PASS - "backgroundImage" property for "generated2" element at 1s saw something close to: filter(-webkit-cross-fade(url(image.svg), url(image.svg), 50%), sepia(0))
Animate CSS Image filter() function https://bugs.webkit.org/show_bug.cgi?id=119938 Reviewed by Simon Fraser. Source/WebCore: With this patch, the new introduced CSS Image function filter() can be animated. According to the spec, just filter functions can be interpolated. The patch also prepares StyleImage blending for interpolation of other generated images like gradients or cross-fade(). http://dev.w3.org/fxtf/filters/#interpolating-filter-image Test: fast/filter-image/filter-image-animation.html * css/CSSComputedStyleDeclaration.cpp: Reuse the code that creates a CSSValueList from ComputeStyle logic. (WebCore::valueForPixel): For StyleRules we want to have not-adjusted length values. (WebCore::ComputedStyleExtractor::valueForShadow): Add argument to switch between adjusted and not-adjusted length. (WebCore::ComputedStyleExtractor::valueForFilter): Ditto. (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSComputedStyleDeclaration.h: * css/CSSFilterImageValue.h: Add helper functions for animating filters. We need to pass the FilterOperations for the image generation and the CSSValueList for StyleRule. (WebCore::CSSFilterImageValue::filterOperations): (WebCore::CSSFilterImageValue::setFilterOperations): (WebCore::CSSFilterImageValue::cachedImage): * page/animation/CSSPropertyAnimation.cpp: Add animation code to support animations between two filter() function values. (WebCore::blendFilterOperations): (WebCore::blendFunc): (WebCore::filterBlend): * rendering/style/StyleGeneratedImage.h: Add helper functions. (WebCore::CSSFilterImageValue::imageValue): LayoutTests: Add tests to test animation between two filter() function values. Furthermore, extended animation-test-helpers.js to parse all kind of CSS image function where we support animations. CSS Image function can be deeply nested as well now: -wekit-filter(-webkit-cross-fade(url(a.png), url(b.png), 50%), sepia(0.5)) Even the 50% can now be checked with a tolerance. If we should ever support animations on nested CSS Images, the new code in animation-test-helpers.js is prepared for it. Fixed a bunch of tests that passed by accident or needed an update to the new infrastructure. * animations/resources/animation-test-helpers.js: (parseCSSImage): For parsing of all kind of supported CSS Image functions. Currently supported: -webkit-cross-fade, -webkit-filter, url, none Still missing: linear and radial gradients (can not be animated yet). CSS Image functions are allowed to be nested as deep JS allows. (parseCrossFade): Add parsing of input CSS images. (parseFilterImage): Parse -webkit-filter image function as well as input images. (parseFilterFunctionList): Parse filter function list. We now parse the function name as well. Added rudimentary support for drop-shadow and url. (parseDeprecatedCustomFilterFunction): Special case old syntax of custom filter function. Shall be removed in the future. (compareCSSImages): Compares all kind (even deep nested) CSS images. (compareFilterFunctions): Now compare filter function names as well. (comparePropertyValue): Use new compareCSSImages function. * fast/filter-image/filter-image-animation-expected.txt: Added. * fast/filter-image/filter-image-animation.html: Added. Canonical link: https://commits.webkit.org/138534@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-08-30 19:29:03 +00:00