haikuwebkit/LayoutTests/css3/filters/effect-drop-shadow-negative...

18 lines
320 B
HTML
Raw Permalink Normal View History

[CSS Filters] Using negative drop-shadow radius values has slow performance https://bugs.webkit.org/show_bug.cgi?id=107848 Source/WebCore: Setting negative blur radius values in drop-shadow() and box-shadow() led to significant rendering performance loss. The invalid value overflowed and the embedder became unresponsive for few seconds. This impacted SVG too (SVGFEDropShadow and SVGFEGaussianBlur). Reviewed by Dirk Schulze. Tests: css3/filters/effect-drop-shadow-negative-radius.html fast/box-shadow/box-shadow-parsing-invalid.html svg/filters/feDropShadow-negative-deviation-expected.svg svg/filters/feDropShadow-negative-deviation.svg svg/filters/feDropShadow-zero-deviation.svg svg/filters/feGaussianBlur-negative-deviation-expected.svg svg/filters/feGaussianBlur-negative-deviation.svg svg/filters/feGaussianBlur-zero-deviation.svg * css/CSSParser.cpp: (WebCore::CSSParser::parseShadow): Negative values are skipped during parsing: as per CSS Background and Borders specs, negative values shall not be allowed. * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): Added "non-negative" assertion for negative deviations. * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::build): If a negative standard deviation is encountered, don't build the filter and returns earlier, this avoids unnecessary calls: FEGaussianBlur is not being created with wrong and potentially overflowing values. * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::build): Ditto. LayoutTests: Added a whole set of new tests for both CSS and SVG to assess the correctness of blur(), drop-shadow() and box-shadow() blur radius values. Reviewed by Dirk Schulze. * css3/filters/effect-drop-shadow-negative-radius-expected.html: Added. * css3/filters/effect-drop-shadow-negative-radius.html: Added. * css3/filters/filter-property-parsing-invalid-expected.txt: * css3/filters/script-tests/filter-property-parsing-invalid.js: * fast/box-shadow/box-shadow-parsing-invalid-expected.txt: Added. * fast/box-shadow/box-shadow-parsing-invalid.html: Added. * fast/box-shadow/script-tests/box-shadow-parsing-invalid.js: Added. (testInvalidFilterRule): * platform/chromium/svg/filters/feDropShadow-zero-deviation-expected.png: Added. * platform/chromium/svg/filters/feDropShadow-zero-deviation-expected.txt: Added. * platform/chromium/svg/filters/feGaussianBlur-zero-deviation-expected.png: Added. * platform/chromium/svg/filters/feGaussianBlur-zero-deviation-expected.txt: Added. * platform/mac/svg/filters/feDropShadow-zero-deviation-expected.png: Added. * platform/mac/svg/filters/feDropShadow-zero-deviation-expected.txt: Added. * platform/mac/svg/filters/feGaussianBlur-zero-deviation-expected.png: Added. * platform/mac/svg/filters/feGaussianBlur-zero-deviation-expected.txt: Added. * svg/filters/feDropShadow-negative-deviation-expected.svg: Added. * svg/filters/feDropShadow-negative-deviation.svg: Added. * svg/filters/feDropShadow-zero-deviation.svg: Added. * svg/filters/feGaussianBlur-negative-deviation-expected.svg: Added. * svg/filters/feGaussianBlur-negative-deviation.svg: Added. * svg/filters/feGaussianBlur-zero-deviation.svg: Added. Canonical link: https://commits.webkit.org/131526@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@146762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-03-25 13:10:13 +00:00
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>drop-shadow with negative radius</title>
<style type="text/css">
#target {
width: 100px;
height: 100px;
background-color: rgb(0, 255, 0);
}
</style>
</head>
<body>
<div id="target"></div>
</body>
</html>