Bug 500261 - svg images do not fire error events on any error. r=cam,sr=smaug

This commit is contained in:
Robert Longson 2014-02-18 19:57:42 +00:00
parent e0d0403de8
commit aab281c833
6 changed files with 39 additions and 20 deletions

View File

@ -1347,8 +1347,6 @@ GK_ATOM(numOctaves, "numOctaves")
GK_ATOM(multiply, "multiply")
GK_ATOM(objectBoundingBox, "objectBoundingBox")
GK_ATOM(offset, "offset")
GK_ATOM(onSVGAbort, "onSVGAbort")
GK_ATOM(onSVGError, "onSVGError")
GK_ATOM(onSVGLoad, "onSVGLoad")
GK_ATOM(onSVGResize, "onSVGResize")
GK_ATOM(onSVGScroll, "onSVGScroll")

View File

@ -1520,10 +1520,6 @@ nsIAtom* nsSVGElement::GetEventNameForAttr(nsIAtom* aAttr)
return nsGkAtoms::onSVGLoad;
if (aAttr == nsGkAtoms::onunload)
return nsGkAtoms::onSVGUnload;
if (aAttr == nsGkAtoms::onabort)
return nsGkAtoms::onSVGAbort;
if (aAttr == nsGkAtoms::onerror)
return nsGkAtoms::onSVGError;
if (aAttr == nsGkAtoms::onresize)
return nsGkAtoms::onSVGResize;
if (aAttr == nsGkAtoms::onscroll)

View File

@ -48,6 +48,7 @@ skip-if = true
[test_lengthParsing.html]
[test_nonAnimStrings.xhtml]
[test_non-scaling-stroke.html]
[test_onerror.xhtml]
[test_pathAnimInterpolation.xhtml]
[test_pathSeg.xhtml]
[test_pointAtLength.xhtml]

View File

@ -0,0 +1,36 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=500261
-->
<head>
<title>Test onerror behaviour</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=500261">Mozilla Bug 500261</a>
<p id="display"></p>
<div id="content">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="1" id="svg">
<image width="1" height="1" xlink:href="http://localhost/serverGone.gif" onerror="run()"/>
</svg>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">
<![CDATA[
SimpleTest.waitForExplicitFinish();
function run()
{
ok(true, 'onerror method called');
SimpleTest.finish();
}
]]>
</script>
</pre>
</body>
</html>

View File

@ -833,10 +833,6 @@ nsEventListenerManager::CompileEventHandlerInternal(nsListenerStruct *aListenerS
attrName = nsGkAtoms::onload;
else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGUnload)
attrName = nsGkAtoms::onunload;
else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGAbort)
attrName = nsGkAtoms::onabort;
else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGError)
attrName = nsGkAtoms::onerror;
else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGResize)
attrName = nsGkAtoms::onresize;
else if (aListenerStruct->mTypeAtom == nsGkAtoms::onSVGScroll)

View File

@ -149,7 +149,7 @@
EVENT(abort,
NS_IMAGE_ABORT,
(EventNameType_HTMLXUL | EventNameType_SVGSVG),
EventNameType_All,
NS_EVENT)
EVENT(canplay,
NS_CANPLAY,
@ -433,7 +433,7 @@ FORWARDED_EVENT(blur,
NS_FOCUS_EVENT)
ERROR_EVENT(error,
NS_LOAD_ERROR,
(EventNameType_HTMLXUL | EventNameType_SVGSVG),
EventNameType_All,
NS_EVENT)
FORWARDED_EVENT(focus,
NS_FOCUS_CONTENT,
@ -734,14 +734,6 @@ NON_IDL_EVENT(SVGUnload,
NS_SVG_UNLOAD,
EventNameType_None,
NS_EVENT)
NON_IDL_EVENT(SVGAbort,
NS_SVG_ABORT,
EventNameType_None,
NS_EVENT)
NON_IDL_EVENT(SVGError,
NS_SVG_ERROR,
EventNameType_None,
NS_EVENT)
NON_IDL_EVENT(SVGResize,
NS_SVG_RESIZE,
EventNameType_None,