W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

[Bug 14354] New: Rename append/replaceChild/insertBefore(<some text>) to appendText, replaceWithText, insertTextBefore

From: <bugzilla@jessica.w3.org>
Date: Sun, 02 Oct 2011 10:31:16 +0000
To: www-dom@w3.org
Message-ID: <bug-14354-4009@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=14354

           Summary: Rename append/replaceChild/insertBefore(<some text>)
                    to appendText, replaceWithText, insertTextBefore
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM Core
        AssignedTo: annevk@opera.com
        ReportedBy: Olli.Pettay@gmail.com
         QAContact: member-webapi-cvs@w3.org
                CC: mike@w3.org, www-dom@w3.org


Current draft allows adding new text nodes using appendChild(string param) etc.

That is not only a bit misleading, since things like
appendChild("<div>") doesn't do what one would expect, but it can also
lead to other unexpected results if one does
for example element.appendChild(anchorElement); 
One could assume that the href (stringifier) of anchorElement gets appended to
element, or one could assume that the element gets appended. Both are
perfectly fine interpretations, IMO.
API shouldn't allow that, but should be clear what happens in each case.

Also, I don't see any good reasons to re-use the same method names for doing
something else than just inserting nodes.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
Received on Sunday, 2 October 2011 10:31:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT