haikuwebkit/LayoutTests/fast/filter-image/filter-image-svg.html

29 lines
501 B
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<script>
</script>
<style>
div {
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
background-image: filter(url(image.svg), url(#filter));
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div></div>
<svg height="0">
<filter id="filter">
<feComponentTransfer>
<feFuncR type="linear" slope="0"/>
<feFuncG type="linear" slope="0"/>
<feFuncB type="linear" slope="0"/>
</feComponentTransfer>
</filter>
</svg>
</body>
</html>