Skip to content

Demix ParentNode.childElementCount - #3372

Merged
sideshowbarker merged 5 commits into
mdn:mainfrom
Elchi3:parentnode-childelementcount
Mar 23, 2021
Merged

sideshowbarker merged 5 commits into
mdn:mainfrom
Elchi3:parentnode-childelementcount

Conversation

@Elchi3

@Elchi3 Elchi3 commented Mar 22, 2021

Copy link
Copy Markdown
Member

The IDL for childElementCount is this:

interface mixin ParentNode {
  readonly attribute unsigned long childElementCount;
};

Document includes ParentNode;
DocumentFragment includes ParentNode;
Element includes ParentNode;

Therefore we need these pages (created in this PR):
http://localhost:3000/en-US/docs/Web/API/Document/childElementCount
http://localhost:3000/en-US/docs/Web/API/DocumentFragment/childElementCount
http://localhost:3000/en-US/docs/Web/API/Element/childElementCount

Currently existing is: https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/childElementCount
(I made that a redirect to http://localhost:3000/en-US/docs/Web/API/Element/childElementCount which is the oldest/original API.)

This note was fun (I removed it). ElementTraversal seems to be the old mixin here. Neither ElementTraversal nor ParentNode are really interesting to readers as the note points out.

This property was initially defined in the ElementTraversal pure interface. As this interface contained two distinct set of properties, one aimed at Node that have children, one at those that are children, they have been moved into two separate pure interfaces, ParentNode and ChildNode. In this case, childElementCount moved to ParentNode. This is a fairly technical change that shouldn't affect compatibility.

@Elchi3
Elchi3 requested review from a team and chrisdavidmills and removed request for a team March 22, 2021 15:04
@sideshowbarker
sideshowbarker merged commit a36c4da into mdn:main Mar 23, 2021
@Elchi3
Elchi3 deleted the parentnode-childelementcount branch March 23, 2021 09:00
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants