mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Bug 1158551 - calling valueAsString on a length with an invalid string should throw. r=dholbert
This commit is contained in:
parent
9b06d1932b
commit
0423fafd0c
@ -371,7 +371,7 @@ DOMSVGLength::SetValueAsString(const nsAString& aValue, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
if (mVal) {
|
||||
mVal->SetBaseValueString(aValue, mSVGElement, true);
|
||||
aRv = mVal->SetBaseValueString(aValue, mSVGElement, true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=539697
|
||||
-->
|
||||
<head>
|
||||
<title>Test SVGTransform behavior</title>
|
||||
<title>Test valueAsString behavior</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
@ -35,6 +35,7 @@ function run()
|
||||
|
||||
try {
|
||||
c.r.baseVal.valueAsString = 'rubbish';
|
||||
ok(false, 'setting a length to rubbish should fail');
|
||||
} catch (e) {
|
||||
is(e.name, 'SyntaxError', 'syntax error expected');
|
||||
is(e.code, DOMException.SYNTAX_ERR, 'syntax error expected');
|
||||
@ -46,6 +47,7 @@ function run()
|
||||
|
||||
try {
|
||||
m.orientAngle.baseVal.valueAsString = 'rubbish';
|
||||
ok(false, 'setting an angle to rubbish should fail');
|
||||
} catch (e) {
|
||||
is(e.name, 'SyntaxError', 'syntax error expected');
|
||||
is(e.code, DOMException.SYNTAX_ERR, 'syntax error expected');
|
||||
|
Loading…
x
Reference in New Issue
Block a user