[webkit-reviews] review denied: [Bug 5264] document.createElementNS() should not allow to insert a second <html> element : [Attachment 8310] Proposed patch

bugzilla-request-daemon at opendarwin.org bugzilla-request-daemon at opendarwin.org
Sun May 14 17:28:00 PDT 2006

Darin Adler <darin at apple.com> has denied Darin Adler <darin at apple.com>'s
request for review:
Bug 5264: document.createElementNS() should not allow to insert a second <html>

Attachment 8310: Proposed patch

------- Additional Comments from Darin Adler <darin at apple.com>
Despite its name, I don't think it's good to reuse the parsing function,
childAllowed, for uses other than in the parser.

This change alone would leave the code in a very confused state about when
childAllowed is called, when checkAddChild is called, and when childTypeAllowed
is called.

For clarity we should probably rename at least some of the three functions.

On the other hand, the code in Document::childAllowed is clearly good to run
even when not parsing. If we decide we want that logic all the time, then we
should change that logic to be type-based and move it into
Document::childTypeAllowed. Since all the code does is check if the new child
is an element, and then if its type is DOCUMENT_TYPE_NODE, I think the code
could be adapted that way.

Also need a layout test, of course, and some documentation about what WinIE and
Firefox do in these cases.

More information about the webkit-reviews mailing list