haikuwebkit/LayoutTests/svg/css/invalid-paint-cascade-expec...

3 lines
100 B
XML
Raw Permalink Normal View History

Browser does not fall back to SVG attribute value when CSS style value is invalid or not supported https://bugs.webkit.org/show_bug.cgi?id=147932 Patch by Antoine Quint <graouts@apple.com> on 2015-11-29 Reviewed by Dean Jackson. Source/WebCore: Instead of returning an SVGPaint object of type SVG_PAINTTYPE_UNKNOWN when we encounter an SVG paint value that cannot be parsed, we now return `nullptr` which will cause that value to be ignored and let another paint value in the cascade be used instead. This is the same approach used for SVGColor. Since we're removing the only call site for `SVGPaint::createUnknown()`, we remove that function entirely. Tests: svg/css/invalid-color-cascade.svg svg/css/invalid-paint-cascade.svg * css/SVGCSSParser.cpp: (WebCore::CSSParser::parseSVGPaint): * svg/SVGPaint.h: (WebCore::SVGPaint::createUnknown): Deleted. LayoutTests: Testing that we correctly fall back to the presentation attribute for SVGPaint and SVGColor values specified with an invalid keyword in a `style` attribute. We also update the expected output for svg/css/svg-attribute-parser-mode.html which is now in line with values returned by Firefox and Chrome, where we correctly use the default value instead of null objects, which was definitely an error. * svg/css/invalid-color-cascade-expected.svg: Added. * svg/css/invalid-color-cascade.svg: Added. * svg/css/invalid-paint-cascade-expected.svg: Added. * svg/css/invalid-paint-cascade.svg: Added. * svg/css/script-tests/svg-attribute-parser-mode.js: * svg/css/svg-attribute-parser-mode-expected.txt: Canonical link: https://commits.webkit.org/169749@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-11-29 22:03:18 +00:00
<svg xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="green" />
</svg>