Bug 4567 - removed attributes yield null rather than empty string
Summary: removed attributes yield null rather than empty string
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 4565
  Show dependency treegraph
 
Reported: 2005-08-21 17:17 PDT by Darin Adler
Modified: 2022-08-02 08:18 PDT (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2005-08-21 17:17:40 PDT
The W3C DOM test named hc_elementremoveattribute is failing because we return a JavaScript null rather 
than an empty string. This behavior makes sense and matches Firefox. Perhaps the test needs to be 
revised.
Comment 1 Darin Adler 2005-08-26 19:54:33 PDT
Curt, what do you think? Is this a mistake in the test?
Comment 2 Darin Adler 2005-08-26 19:54:40 PDT
Curt, what do you think? Is this a mistake in the test?
Comment 3 Curt Arnold 2005-08-26 20:32:56 PDT
This one is worth pushing up to the DOM IG.  I haven't had time to do a full survey, but this seems to be 
one that the Java implementations pass and the ECMAScript implementations (IE, Mozilla and Safari) fail.  

The descriptions of getAttribute in DOM L1 Core and subsequent do not specify any conditions that 
getAttribute is allowed to return null and the conditions in the test satisify the criteria under which an 
empty string is specified as the return value.

There would seem to be a reasonable case to support an errata allowing null as an acceptible return value 
and modify the test to accept either null or empty string.
Comment 4 Darin Adler 2005-12-10 17:44:53 PST
Some history. Originally we returned empty string in these cases. Then we had to change to be compatible 
with sites that assumed the behavior of Gecko (and presumably WinIE).

So far the DOM committee does not seem sympathetic about the possibility of creating errata covering 
this.
Comment 5 Ian 'Hixie' Hickson 2008-01-06 17:22:28 PST
We should fix this in Web DOM Core.
Comment 6 Lucas Forschler 2019-02-06 09:03:01 PST
Mass moving XML DOM bugs to the "DOM" Component.
Comment 7 Ahmad Saleem 2022-08-02 04:26:21 PDT
From the test case URL - https://www.w3.org/2007/03/dom-tests/hc_elementremoveattribute.html

I am getting following behavior across browsers:

> Firefox Nightly 105:

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute
    Status: failure
    Detail: attrValue: assertEquals failed, actual null, expected .

> Chrome Canary 106:

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute
Status: failure
Detail: attrValue: assertEquals failed, actual null, expected .

> Safari 15.6 on macOS 12.5

Test: http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_elementremoveattribute
Status: failure
Detail: attrValue: assertEquals failed, actual null, expected .

__________

Since all browsers are matching, we can mark this as 'RESOLVED CONFIGURATION CHANGED". Thanks!