haikuwebkit/LayoutTests/svg/css/buffered-rendering-expected...

21 lines
859 B
Plaintext
Raw Permalink Normal View History

[SVG2] Add support for the buffered-rendering hint https://bugs.webkit.org/show_bug.cgi?id=104207 Reviewed by Stephen Chenney. Source/WebCore: This patch adds the SVG2 buffered-rendering property and implements it for the image element. For reference, the spec can be found at: https://svgwg.org/svg2-draft/single-page.html#painting-BufferedRendering The buffered-rendering hint causes our implementation to create a temporary image buffer for caching an element's foreground rendering. This behavior has been designed to support other graphical and container elements in followup patches (such as the use and g elements). This patch should not affect rendering, and a test has been added showing the image results are unchanged. The performance aspects of this patch can be tested using the following test: http://philbit.com/bouncingTigers.html Without the patch, rendering is below 1fps. With the patch, rendering is fluid. Tests: svg/css/buffered-rendering.html svg/repaint/buffered-rendering-dynamic-image.html svg/repaint/buffered-rendering-static-image.html Other than the changes to RenderSVGImage and SVGRenderingContext, the changes below are to support the new buffered-rendering property: * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore): (WebCore::CSSPrimitiveValue::operator EBufferedRendering): * css/CSSProperty.cpp: (WebCore::CSSProperty::isInheritedProperty): * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getSVGPropertyCSSValue): * css/SVGCSSParser.cpp: (WebCore::CSSParser::parseSVGValue): * css/SVGCSSPropertyNames.in: * css/SVGCSSStyleSelector.cpp: (WebCore::StyleResolver::applySVGProperty): * css/SVGCSSValueKeywords.in: * rendering/style/SVGRenderStyle.cpp: (WebCore::SVGRenderStyle::diff): * rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialBufferedRendering): (WebCore::SVGRenderStyle::setBufferedRendering): (WebCore::SVGRenderStyle::bufferedRendering): (WebCore::SVGRenderStyle::setBitDefaults): * rendering/style/SVGRenderStyleDefs.h: * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::paint): The foreground painting has been extracted out into a separate function. This has also been changed so that if the buffered-rendering hint is present, bufferForeground is used. (WebCore::RenderSVGImage::paintForeground): (WebCore): (WebCore::RenderSVGImage::invalidateBufferedForeground): This function could be replaced with "m_bufferedForeground.clear()" but other renderers (such as container elements) will require more complex invalidation logic. To maintain consistency with this future code, invalidateBufferedForeground has been used. (WebCore::RenderSVGImage::imageChanged): * rendering/svg/RenderSVGImage.h: (RenderSVGImage): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::bufferForeground): (WebCore): * rendering/svg/SVGRenderingContext.h: (SVGRenderingContext): * svg/SVGStyledElement.cpp: (WebCore::SVGStyledElement::cssPropertyIdForSVGAttributeName): (WebCore::cssPropertyToTypeMap): * svg/svgattrs.in: LayoutTests: * svg/css/buffered-rendering-expected.txt: Added. * svg/css/buffered-rendering.html: Added. * svg/repaint/buffered-rendering-dynamic-image-expected.html: Added. * svg/repaint/buffered-rendering-dynamic-image.html: Added. * svg/repaint/buffered-rendering-static-image-expected.html: Added. * svg/repaint/buffered-rendering-static-image.html: Added. Canonical link: https://commits.webkit.org/132035@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-04-01 18:55:24 +00:00
Test that an SVG image accepts all buffered rendering values
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS computedStyle("buffered-rendering", "") is "auto"
PASS computedStyle("buffered-rendering", "auto") is "auto"
PASS computedStyle("buffered-rendering", "dynamic") is "dynamic"
PASS computedStyle("buffered-rendering", "static") is "static"
PASS computedStyle("buffered-rendering", "0") is "static"
PASS computedStyle("buffered-rendering", "1") is "static"
PASS computedStyle("buffered-rendering", "true") is "static"
PASS computedStyle("buffered-rendering", "dynamic") is "dynamic"
PASS computedStyle("buffered-rendering", "0") is "dynamic"
PASS computedStyle("buffered-rendering", "1") is "dynamic"
PASS computedStyle("buffered-rendering", "true") is "dynamic"
PASS successfullyParsed is true
TEST COMPLETE