This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23698 - Rename ParentNode to ContainerNode or some other unambiguous name
Summary: Rename ParentNode to ContainerNode or some other unambiguous name
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-01 08:59 UTC by Ryosuke Niwa
Modified: 2013-11-04 11:18 UTC (History)
4 users (show)

See Also:


Attachments

Description Ryosuke Niwa 2013-11-01 08:59:25 UTC
The name ParentNode is exceedingly confusing because we already have parentNode() on Node.  Talking about the parentNode() of ParentNode, for example, will be very confusing.

In WebKit/Blink, we use call it ContainerNode since it's a node that could contain other nodes.

I'm open to other names but please disambiguate from other DOM class and method names.
Comment 1 Olli Pettay 2013-11-01 11:12:24 UTC
Well, we have ChildNode too. So either call them ParentNode and ChildNode, 
or change both names.


But, I think having Node.parentNode pointing to a ParentNode looks pretty
good.
Comment 2 Anne 2013-11-01 11:41:27 UTC
I would not know how to rename ChildNode. And I agree with Olli that the current names make a certain amount of sense.
Comment 3 Geoffrey Garen 2013-11-01 20:46:43 UTC
Is the value produced by Node.parentNode always of type ParentNode?
Comment 4 Geoffrey Garen 2013-11-01 21:20:43 UTC
> I would not know how to rename ChildNode.

Let's not let a past bad naming decision justify a future bad naming decision. Or, as my mom likes to say, two wrongs don't make a right.
Comment 5 Ryosuke Niwa 2013-11-03 00:56:42 UTC
Can't simply rename ChildNode to LeafNode?
Comment 6 Olli Pettay 2013-11-03 17:49:12 UTC
ChildNode is not necessarily a leaf.
Comment 7 Anne 2013-11-04 11:18:02 UTC
(In reply to Geoffrey Garen from comment #3)
> Is the value produced by Node.parentNode always of type ParentNode?

As far as I know, yes.