W3C home > Mailing lists > Public > public-webapi@w3.org > July 2007

Ambiguity in removeAttributeNode

From: Travis Leithead <travil@windows.microsoft.com>
Date: Thu, 26 Jul 2007 22:49:32 -0700
Message-ID: <096A2EC46B3C084BA8D73D2280C55DD50691B844@WIN-MSG-21.wingroup.windeploy.ntdev.microsoft.com>
To: <public-webapi@w3.org>, <ian@hixie.ch>, <bjoern@hoehrmann.de>
CC: Chris Wilson <chris.wilson@microsoft.com>
In light of the DOM Core L3 Second Edition...


We happened to notice an interesting behavior difference in
removeAttributeNode recently, and an appeal to the standard didn't seem
to help...




   <script type=text/javascript>

      function doFoo()


            var pElem = document.getElementById('foo');

            var newAttr = document.createAttribute('align');

            // To illustrate that these are not the same attribute

            newAttr.value = "right";

            try {

                  var oldAttr = pElem.removeAttributeNode(newAttr);

                  alert(oldAttr.value + ": command successful");

            } catch (e) {

                  alert("removeAttributeNode failed with message: " +





 <body onload="doFoo()">

      <p id="foo" align="left">Sample text</p>




IE fails in this example and triggers the try/catch. FF works, Opera
also fails. It seems that some browser implementers deciphered the DOM
Core spec::removeAttributeNode to mean that "object" comparison is used
as the delete criteria, but others seem to only base it on the "name" of
the Attr. 


Is there hope in coming to harmony across implementations on this point?
Or how should the spec be interpreted?


-Travis Leithead

MS Windows Internet Explorer
Received on Saturday, 28 July 2007 05:44:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:24 UTC