Commit 8ff00509 authored by fs@opera.com's avatar fs@opera.com

Don't resolve rectangle as different unit if viewport is empty

SVGLengthContext::resolveRectangle would resolve oBB units as uSOU units
if the "viewport" provided was empty.
This would lead to incorrect rendering in certain cases - like with
filters on content with an empty bbox.

BUG=252696

Review URL: https://codereview.chromium.org/1313893003

git-svn-id: svn://svn.chromium.org/blink/trunk@201140 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 3134d8a2
......@@ -28,6 +28,8 @@ crbug.com/463358 [ Mac Linux Debug ] fast/backgrounds/transformed-body-backgroun
crbug.com/463358 [ Mac Linux Debug ] svg/W3C-SVG-1.1/paths-data-02-t.svg [ ImageOnlyFailure ]
crbug.com/463358 [ Mac Linux Debug ] css3/masking/clip-path-polygon.html [ ImageOnlyFailure ]
crbug.com/252696 svg/batik/text/textEffect3.svg [ NeedsRebaseline ]
crbug.com/267206 [ Mac ] virtual/rootlayerscrolls/fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ]
crbug.com/474440 [ Mac Debug ] plugins/destroy-reentry.html [ Timeout ]
......
......@@ -3,7 +3,7 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGHiddenContainer {defs} at (0,0) size 0x0
LayoutSVGResourceFilter {filter} [id="filter"] [filterUnits=objectBoundingBox] [primitiveUnits=objectBoundingBox]
LayoutSVGResourceFilter {filter} [id="filter"] [filterUnits=userSpaceOnUse] [primitiveUnits=objectBoundingBox]
[feMerge mergeNodes="1"]
[SourceGraphic]
LayoutSVGContainer {g} at (0,0) size 800x600
......
<svg xmlns="http://www.w3.org/2000/svg">
<defs>
<!-- check that WebKit doesn't crash, if an effect is not available in feMerge -->
<filter id="filter" primitiveUnits="objectBoundingBox">
<filter id="filter" filterUnits="userSpaceOnUse" primitiveUnits="objectBoundingBox">
<feMerge>
<feMergeNode in="does-not-exist"/>
</feMerge>
......
<!DOCTYPE html>
<div style="width: 100px; height: 100px; background-color: green"></div>
<!DOCTYPE html>
<svg>
<filter id="f">
<feFlood flood-color="red"/>
</filter>
<rect width="100" height="100" fill="green"/>
<line x1="50" y1="0" x2="50" y2="100" stroke="red" stroke-width="100" filter="url(#f)"/>
</svg>
......@@ -109,7 +109,7 @@ SVGLengthContext::SVGLengthContext(const SVGElement* context)
FloatRect SVGLengthContext::resolveRectangle(const SVGElement* context, SVGUnitTypes::SVGUnitType type, const FloatRect& viewport, const SVGLength& x, const SVGLength& y, const SVGLength& width, const SVGLength& height)
{
ASSERT(type != SVGUnitTypes::SVG_UNIT_TYPE_UNKNOWN);
if (type != SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE && !viewport.isEmpty()) {
if (type != SVGUnitTypes::SVG_UNIT_TYPE_USERSPACEONUSE) {
const FloatSize& viewportSize = viewport.size();
return FloatRect(
convertValueFromPercentageToUserUnits(x, viewportSize) + viewport.x(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment