Bug 4568
Summary: | DOM tests expect hierarchy exception adding wrong types of nodes to parents | ||
---|---|---|---|
Product: | WebKit | Reporter: | Darin Adler <darin> |
Component: | DOM | Assignee: | Vicki Murley <vicki> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | andersca, cdumez, curt.arnold |
Priority: | P2 | ||
Version: | 420+ | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
Bug Depends on: | |||
Bug Blocks: | 4565 |
Darin Adler
There are 4 tests in the W3C DOM Level 1 Core suite that are failing because we allow any node to have
any parent:
hc_attrappendchild2
hc_nodeappendchildinvalidnodetype
hc_nodeinsertbeforeinvalidnodetype
hc_nodereplacechildinvalidnodetype
In the past I have been under the impression that any node could be put anywhere, mimicing the fact
that XML allows any node to be anywhere. But the standard disagrees. We need to look into behavior of
other browsers to see if we can implement this behavior without hurting anything. I think there's a
chance that we might need to change the test for at least the attrappendchild2 test, which also fails in
Firefox (the other tests succeed in Firefox, so it must be doing at least some checking of this type).
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Darin Adler
Curt, do you have any insight into this issue?
Curt Arnold
Section 1.1.1 of the DOM Core recommendation (http://www.w3.org/TR/1998/REC-DOM-
Level-1-19981001/level-one-core.html#ID-1590626202) explicitly specifies the structure model and
addresses both HTML and XML documents. XML does not allow any node to be anywhere. There is no
means in XML to author a well-formed document where an attribute has a element as a child as is
attempted in hc_attrappendchild2.
The recommendation could have been written to allow infeasible structures and throw exception when
attempting to serialize or other action that required a feasible document structure. However, section
1.1.1 and the definition and usage of HIERARCHY_REQUEST_ERR within the recommendation seem fairly
clear that attempts to create a structurally infeasible document should result in an exception.
I am overdue in preparing an updated test results matrix so that you can compare Safari's results with a
large number of other implementations. I hope I can get to that tomorrow.
Vicki Murley
<rdar://problem/4288276>
Vicki Murley
Fixed.
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.