W3C home > Mailing lists > Public > www-svg@w3.org > January 2010

Re: http://dev.w3.org/SVG/profiles/1.1F2/test/svg/types-dom-05-b.svg

From: Jonathan Watt <jwatt@jwatt.org>
Date: Thu, 14 Jan 2010 15:10:35 +0000
Message-ID: <4B4F33EB.5060405@jwatt.org>
To: Erik Dahlstrom <ed@opera.com>
CC: Robert Longson <longsonr@gmail.com>, www-svg@w3.org
On 2010-01-14 2:04 PM, Erik Dahlstrom wrote:
> On Thu, 14 Jan 2010 14:31:58 +0100, Robert Longson <longsonr@gmail.com>  
> wrote:
> 
>> Jonathan,
>>
>> I was looking at the following test:
>> http://dev.w3.org/SVG/profiles/1.1F2/test/svg/types-dom-05-b.svg which is
>> available from
>> http://dev.w3.org/SVG/profiles/1.1F2/errata/implementation-report.html  
>> and I
>> don't think it is correct.
>>
>> When the js interpreter encounters c.r.baseVal.valueAsString =  
>> 'rubbish'; it
>> should throw a DOM_SYNTAX_ERR. So far so good.
>>
>> However DOM_SYNTAX_ERR is not an SVG error it is a standard DOM error. So
>> what you get is NOT an SVGException it is instead an ordinary  
>> DOMException.
>> The main difference is that SVGExceptions should support the SVGException
>> interface:  
>> http://www.w3.org/TR/SVG/svgdom.html#InterfaceSVGExceptionwhereas
>> DOMExceptions have no such requirement.
>> The next part of the test is b = e.code == 12; // SYNTAX_ERR but this  
>> fails
>> as it is SVGException that defines 'code'.
>>
>> Best regards
>>
>> Robert.
> 
> SVG 1.1 requires complete support for DOM Level 2 Core[1], which defines  
> the DOMException interface[2]. In other words I think the test is correct.

Yes, the DOMException also defines a property named 'code', and the SVG 1.1 2nd
Edition draft says that the exception thrown is a DOMException, not an SVGException:

http://dev.w3.org/SVG/profiles/1.1F2/publish/types.html#__svg__SVGLength__valueAsString

> Cheers
> /Erik
> 
> [1] http://www.w3.org/TR/SVG11/svgdom.html#SVGDOMOverview
> [2] http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-17189187
> 
Received on Thursday, 14 January 2010 15:11:07 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:44 GMT