W3C home > Mailing lists > Public > www-svg@w3.org > December 2005

Re: [SVGMobile12] SVGT12-307: setAttributeNS() raising exceptions on newly-created elements

From: Dean Jackson <dino@w3.org>
Date: Wed, 14 Dec 2005 15:12:48 +1100
Message-Id: <3E77FD9A-6A7B-44CD-849F-6F180B3A0A49@w3.org>
Cc: www-svg@w3.org
To: Ian Hickson <ian@hixie.ch>

Hi Ian,

On 09/12/2005, at 9:16 AM, Ian Hickson wrote:

> Section 5.1.2 The 'svg' element says:
>
> # This attribute is read-only and cannot be modified via the uDOM
> # api. Attempt to set the 'version' attribute with the setAttributeNS
> # must result in an NO_MODIFICATION_ALLOWED_ERR being raised.
>
> Please edit the spec so that it can't be misinterpreted to read that
> the setAttributeNS() method in DOM 3 Core should also raise that
> exception in the given case.

Given the use case that you mention below, we think the best
solution is to remove the exception throwing behaviour. Obviously
there are situations that require a script to modify the
version and baseProfile attributes via the DOM, or uDOM.

Would that satisfy your request?

The next thing to specify is what does it mean when you change
those attributes on an actively displayed/interpreted document.
We intend to add wording that specifies no change in behaviour
is required from an implementation. This is similar to the
behaviour of dynamically inserting a <script> element into HTML
or SVG. The DOM is updated but the processing doesn't
change.

Dean



>
> This is needed because a literal interpretation would make the
> following script raise an exception in a UA that implements DOM 3
> Core, which would be a problem for any dynamic content creation:
>
>    <script>
>      var svg = document.createElementNS(svgNS, 'svg');
>      svg.setAttributeNS(null, 'version', '1.2');
>    </script>
>
> This would also be incompatible with earlier versions of SVG.
>
> This same problem is also present for the "baseProfile" attribute.
>
> Cheers,
> --  
> Ian Hickson               U+1047E                ) 
> \._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _ 
> \  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'-- 
> (,_..'`-.;.'
Received on Wednesday, 14 December 2005 04:13:14 GMT

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