Bug 17060

Summary: Acid3 expects textNode.localName == null
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ian, sjoerdmulder, webkit
Priority: P2 Keywords: HasReduction
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: http://acid3.acidtests.org/
Bug Depends on:    
Bug Blocks: 17048, 17064    
Attachments:
Description Flags
test case
none
Fix textNode.localName and add tests to cover other node initial values
none
Fix textNode.localName and add tests to cover other node initial values darin: review+

Description Eric Seidel (no email) 2008-01-29 00:23:24 PST
Acid3 expects textNode.localName == null

      // test 66: localName on attributes, from Sylvain Pasche
      var test = document.createTextNode("test");
      assertEquals(test.localName, null, 'wrong localName');
      return 5;

We return #text.  It would be interesting to know what other browsers do.
Comment 1 Eric Seidel (no email) 2008-01-29 00:25:30 PST
Created attachment 18757 [details]
test case
Comment 2 Alexey Proskuryakov 2008-01-29 00:28:45 PST
      // test 66: localName on attributes, from Sylvain Pasche
      var test = document.createTextNode("test");

What is the attribute the comment is talking about?

See also: bug 17048 (for createAttribute).
Comment 3 Ian 'Hixie' Hickson 2008-01-30 16:14:28 PST
the comment in the test was wrong. fixed.
Comment 4 Eric Seidel (no email) 2008-02-03 04:18:29 PST
Created attachment 18880 [details]
Fix textNode.localName and add tests to cover other node initial values

 LayoutTests/ChangeLog                              |   14 ++
 .../fast/dom/Node/initial-values-expected.txt      |  102 +++++++++++++++
 LayoutTests/fast/dom/Node/initial-values.html      |   13 ++
 LayoutTests/fast/dom/Node/resources/TEMPLATE.html  |   13 ++
 .../fast/dom/Node/resources/initial-values.js      |  138 ++++++++++++++++++++
 WebCore/ChangeLog                                  |   15 ++
 WebCore/dom/Comment.cpp                            |    5 -
 WebCore/dom/Comment.h                              |    1 -
 WebCore/dom/Node.cpp                               |    2 +-
 WebCore/dom/Text.cpp                               |    5 -
 WebCore/dom/Text.h                                 |    1 -
 11 files changed, 296 insertions(+), 13 deletions(-)
Comment 5 Eric Seidel (no email) 2008-02-03 04:51:00 PST
Created attachment 18881 [details]
Fix textNode.localName and add tests to cover other node initial values

 LayoutTests/ChangeLog                              |   14 ++
 .../fast/dom/Node/initial-values-expected.txt      |  130 ++++++++++++++
 LayoutTests/fast/dom/Node/initial-values.html      |   13 ++
 LayoutTests/fast/dom/Node/resources/TEMPLATE.html  |   13 ++
 .../fast/dom/Node/resources/initial-values.js      |  178 ++++++++++++++++++++
 WebCore/ChangeLog                                  |   15 ++
 WebCore/dom/Comment.cpp                            |    5 -
 WebCore/dom/Comment.h                              |    1 -
 WebCore/dom/Node.cpp                               |    2 +-
 WebCore/dom/Text.cpp                               |    5 -
 WebCore/dom/Text.h                                 |    1 -
 11 files changed, 364 insertions(+), 13 deletions(-)
Comment 6 Eric Seidel (no email) 2008-02-03 04:52:04 PST
Comment on attachment 18880 [details]
Fix textNode.localName and add tests to cover other node initial values

I've updated this with a new patch which adds a couple more tests.
Comment 7 Eric Seidel (no email) 2008-02-03 04:56:51 PST
As previously mentioned, this test case tests for the exact behavior as spec'd in DOM Level 3.  There are a few failures remaining for WebKit.

Failures shared by FF3b2:
FAIL attr.localName should be null (of type object). Was foo (of type string).
FAIL attr.localName should be null (of type object). Was foo (of type string).
FAIL doc.namespaceURI should be http://www.w3.org/1999/xhtml (of type string). Was null (of type object).
FAIL element.localName should be null (of type object). Was pre (of type string).
(FF3b2 fails with "PRE" instead of "pre")
FAIL element.localName should be null (of type object). Was pre (of type string).
(FF3b2 fails with "pre" instead of "PRE" however.)

Failures unique to WebKit:
FAIL element.namespaceURI should be null (of type object). Was http://www.w3.org/1999/xhtml (of type string).
FAIL element.nodeName should be html:pre. Was PRE.
FAIL element.namespaceURI should be null (of type object). Was http://www.w3.org/1999/xhtml (of type string)

Comment 8 Darin Adler 2008-02-03 13:15:19 PST
Comment on attachment 18881 [details]
Fix textNode.localName and add tests to cover other node initial values

Seems OK, r=me.
Comment 9 Eric Seidel (no email) 2008-02-03 15:58:09 PST
I filed bug 17167 to track the "failures" in this test case.   Landed as r29953.  Yay for 73/100 on Acid3!
Comment 10 Alexey Proskuryakov 2008-03-03 05:01:03 PST
*** Bug 15949 has been marked as a duplicate of this bug. ***