Commit 0c6da947 authored by rwlbuis's avatar rwlbuis
Browse files

Reviewed by Darin.

        http://bugs.webkit.org/show_bug.cgi?id=13801
        Crash when loading nonexisting symbol

        Check for referenced element and when not found just return.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 724ee47b
2007-05-23 Rob Buis <buis@kde.org>
Reviewed by Darin.
Testcase for:
http://bugs.webkit.org/show_bug.cgi?id=13801
Crash when loading nonexisting symbol
* svg/custom/use-referencing-nonexisting-symbol-expected.checksum: Added.
* svg/custom/use-referencing-nonexisting-symbol-expected.png: Added.
* svg/custom/use-referencing-nonexisting-symbol-expected.txt: Added.
* svg/custom/use-referencing-nonexisting-symbol.svg: Added.
2007-05-22 Sam Weinig <sam@webkit.org>
 
Reviewed by Adam.
7ec2fb7a8446247b14bcba27c2728173
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
RenderSVGContainer {svg} at (5,2) size 59x69
RenderSVGContainer {use} at (5,2) size 59x69
RenderSVGContainer {g} at (5,2) size 59x69
RenderSVGContainer {svg} at (146.88,18.75) size 553.12x646.88
RenderPath {rect} at (146.88,46.88) size 553.12x553.12 [fill={[type=SOLID] [color=#0000FF]}] [data="M5.00,5.00L64.00,5.00L64.00,64.00L5.00,64.00"]
RenderSVGText {text} at (17,56) size 800x69
RenderSVGInlineText {#text} at (0,-54) size 43x69
text run at (0,-54) width 43: "A"
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" onload="init()">
<script><![CDATA[
var flag=1;
var c;
function init() {
c= document.getElementById("use")
setInterval("loop()",500);
}
function loop() {
c.setAttributeNS("http://www.w3.org/1999/xlink","href","#rec"+flag)
flag= (flag+1) % 3;
}
]]>
</script>
<symbol shape-rendering="optimizeSpeed" id="rec0" viewBox="0 0 64 64">
<rect width="59" height="59" x="5" y="5" fill="blue" />
<text x="17" y="56" font-size="60" click="none" > A </text>
</symbol>
<symbol shape-rendering="optimizeSpeed" id="rec1" viewBox="0 0 64 64">
<rect width="59" height="59" x="5" y="5" fill="magenta" />
<text x="17" y="56" font-size="60" click="none" > B </text>
</symbol>
<use id="use" xlink:href="#rec0"/>
</svg>
2007-05-23 Rob Buis <buis@kde.org>
Reviewed by Darin.
http://bugs.webkit.org/show_bug.cgi?id=13801
Crash when loading nonexisting symbol
Check for referenced element and when not found just return.
* ksvg2/svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::buildPendingResource):
2007-05-22 Sam Weinig <sam@webkit.org>
 
Rubber stamped by Adam.
......@@ -239,10 +239,9 @@ void SVGUseElement::buildPendingResource()
String id = SVGURIReference::getTarget(href());
Element* targetElement = ownerDocument()->getElementById(id);
SVGElement* target = svg_dynamic_cast(targetElement);
ASSERT(target);
// Do not allow self-referencing.
if (target == this)
if (!target || target == this)
return;
// Why a seperated instance/shadow tree? SVG demands it:
......
Supports Markdown
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