Skip to content

Commit

Permalink
Demix Parentnode.{first,last}ElementChild to Element, Document, Docum…
Browse files Browse the repository at this point in the history
…entFragment pages (#4070)
  • Loading branch information
Elchi3 authored Apr 15, 2021
1 parent 4e249d4 commit cd12c02
Show file tree
Hide file tree
Showing 14 changed files with 419 additions and 280 deletions.
28 changes: 12 additions & 16 deletions files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1356,10 +1356,10 @@
/en-US/docs/DOM/Element.childElementCount /en-US/docs/Web/API/Element/childElementCount
/en-US/docs/DOM/Element.children /en-US/docs/Web/API/Element/children
/en-US/docs/DOM/Element.contentEditable /en-US/docs/Web/API/HTMLElement/contentEditable
/en-US/docs/DOM/Element.firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/DOM/Element.firstElementChild /en-US/docs/Web/API/Element/firstElementChild
/en-US/docs/DOM/Element.getElementsByClassName /en-US/docs/Web/API/Element/getElementsByClassName
/en-US/docs/DOM/Element.isContentEditable /en-US/docs/Web/API/HTMLElement/isContentEditable
/en-US/docs/DOM/Element.lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/DOM/Element.lastElementChild /en-US/docs/Web/API/Element/lastElementChild
/en-US/docs/DOM/Element.mozMatchesSelector /en-US/docs/Web/API/Element/matches
/en-US/docs/DOM/Element.mozRequestFullScreen /en-US/docs/Web/API/Element/requestFullScreen
/en-US/docs/DOM/Element.nextElementSibling /en-US/docs/Web/API/Element/nextElementSibling
Expand Down Expand Up @@ -2972,10 +2972,10 @@
/en-US/docs/Document_Object_Model_(DOM)/Element.childElementCount /en-US/docs/Web/API/Element/childElementCount
/en-US/docs/Document_Object_Model_(DOM)/Element.children /en-US/docs/Web/API/Element/children
/en-US/docs/Document_Object_Model_(DOM)/Element.contentEditable /en-US/docs/Web/API/HTMLElement/contentEditable
/en-US/docs/Document_Object_Model_(DOM)/Element.firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Document_Object_Model_(DOM)/Element.firstElementChild /en-US/docs/Web/API/Element/firstElementChild
/en-US/docs/Document_Object_Model_(DOM)/Element.getElementsByClassName /en-US/docs/Web/API/Element/getElementsByClassName
/en-US/docs/Document_Object_Model_(DOM)/Element.isContentEditable /en-US/docs/Web/API/HTMLElement/isContentEditable
/en-US/docs/Document_Object_Model_(DOM)/Element.lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Document_Object_Model_(DOM)/Element.lastElementChild /en-US/docs/Web/API/Element/lastElementChild
/en-US/docs/Document_Object_Model_(DOM)/Element.mozMatchesSelector /en-US/docs/Web/API/Element/matches
/en-US/docs/Document_Object_Model_(DOM)/Element.mozRequestFullScreen /en-US/docs/Web/API/Element/requestFullScreen
/en-US/docs/Document_Object_Model_(DOM)/Element.nextElementSibling /en-US/docs/Web/API/Element/nextElementSibling
Expand Down Expand Up @@ -7509,9 +7509,7 @@
/en-US/docs/Web/API/Document/defaultView/resize_event /en-US/docs/Web/API/Window/resize_event
/en-US/docs/Web/API/Document/defaultView/storage_event /en-US/docs/Web/API/Window/storage_event
/en-US/docs/Web/API/Document/domConfig /en-US/docs/Web/API/Document
/en-US/docs/Web/API/Document/firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/Document/inputEncoding /en-US/docs/Web/API/document/characterSet
/en-US/docs/Web/API/Document/lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/Document/mozCancelFullScreen /en-US/docs/Web/API/Document/exitFullscreen
/en-US/docs/Web/API/Document/mozFullScreenElement /en-US/docs/Web/API/Document/fullscreenElement
/en-US/docs/Web/API/Document/mozFullScreenEnabled /en-US/docs/Web/API/Document/fullscreenEnabled
Expand Down Expand Up @@ -7544,8 +7542,6 @@
/en-US/docs/Web/API/DocumentFragment.DocumentFragment /en-US/docs/Web/API/DocumentFragment/DocumentFragment
/en-US/docs/Web/API/DocumentFragment.querySelector /en-US/docs/Web/API/DocumentFragment/querySelector
/en-US/docs/Web/API/DocumentFragment.querySelectorAll /en-US/docs/Web/API/DocumentFragment/querySelectorAll
/en-US/docs/Web/API/DocumentFragment/firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/DocumentFragment/lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/DocumentOrShadowRoot/activeElement /en-US/docs/Web/API/Document/activeElement
/en-US/docs/Web/API/DocumentOrShadowRoot/caretPositionFromPoint /en-US/docs/Web/API/Document/caretPositionFromPoint
/en-US/docs/Web/API/DocumentOrShadowRoot/elementFromPoint /en-US/docs/Web/API/Document/elementFromPoint
Expand Down Expand Up @@ -7578,12 +7574,12 @@
/en-US/docs/Web/API/Element.clientTop /en-US/docs/Web/API/Element/clientTop
/en-US/docs/Web/API/Element.closest /en-US/docs/Web/API/Element/closest
/en-US/docs/Web/API/Element.contentEditable /en-US/docs/Web/API/HTMLElement/contentEditable
/en-US/docs/Web/API/Element.firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/Element.firstElementChild /en-US/docs/Web/API/Element/firstElementChild
/en-US/docs/Web/API/Element.getElementsByClassName /en-US/docs/Web/API/Element/getElementsByClassName
/en-US/docs/Web/API/Element.getElementsByTagName /en-US/docs/Web/API/Element/getElementsByTagName
/en-US/docs/Web/API/Element.hasAttributes /en-US/docs/Web/API/Element/hasAttributes
/en-US/docs/Web/API/Element.isContentEditable /en-US/docs/Web/API/HTMLElement/isContentEditable
/en-US/docs/Web/API/Element.lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/Element.lastElementChild /en-US/docs/Web/API/Element/lastElementChild
/en-US/docs/Web/API/Element.matches /en-US/docs/Web/API/Element/matches
/en-US/docs/Web/API/Element.matrches /en-US/docs/Web/API/Element/matches
/en-US/docs/Web/API/Element.mozMatchesSelector /en-US/docs/Web/API/Element/matches
Expand Down Expand Up @@ -7611,10 +7607,8 @@
/en-US/docs/Web/API/Element/animationiteration_event /en-US/docs/Web/API/HTMLElement/animationiteration_event
/en-US/docs/Web/API/Element/animationstart_event /en-US/docs/Web/API/HTMLElement/animationstart_event
/en-US/docs/Web/API/Element/cancel_event /en-US/docs/Web/API/HTMLDialogElement/cancel_event
/en-US/docs/Web/API/Element/firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/Element/fullscreenchange /en-US/docs/Web/API/Element/fullscreenchange_event
/en-US/docs/Web/API/Element/gotpointercapture_event /en-US/docs/Web/API/HTMLElement/gotpointercapture_event
/en-US/docs/Web/API/Element/lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/Element/lostpointercapture_event /en-US/docs/Web/API/HTMLElement/lostpointercapture_event
/en-US/docs/Web/API/Element/mozRequestFullScreen /en-US/docs/Web/API/Element/requestFullScreen
/en-US/docs/Web/API/Element/msMatchesSelector /en-US/docs/Web/API/Element/matches
Expand All @@ -7634,8 +7628,8 @@
/en-US/docs/Web/API/Element/remove /en-US/docs/Web/API/ChildNode/remove
/en-US/docs/Web/API/Element/resourcetimingbufferfull_event /en-US/docs/Web/API/Performance/resourcetimingbufferfull_event
/en-US/docs/Web/API/ElementTraversal.childElementCount /en-US/docs/Web/API/Element/childElementCount
/en-US/docs/Web/API/ElementTraversal.firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/ElementTraversal.lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/ElementTraversal.firstElementChild /en-US/docs/Web/API/Element/firstElementChild
/en-US/docs/Web/API/ElementTraversal.lastElementChild /en-US/docs/Web/API/Element/lastElementChild
/en-US/docs/Web/API/ElementTraversal.nextElementSibling /en-US/docs/Web/API/Element/nextElementSibling
/en-US/docs/Web/API/ElementTraversal.previousElementSibling /en-US/docs/Web/API/Element/previousElementSibling
/en-US/docs/Web/API/EncryptedMediaExtensions /en-US/docs/Web/API/Encrypted_Media_Extensions_API
Expand Down Expand Up @@ -8461,10 +8455,12 @@
/en-US/docs/Web/API/PannerNode.setVelocity /en-US/docs/Web/API/PannerNode/setVelocity
/en-US/docs/Web/API/ParentNode.childElementCount /en-US/docs/Web/API/Element/childElementCount
/en-US/docs/Web/API/ParentNode.children /en-US/docs/Web/API/Element/children
/en-US/docs/Web/API/ParentNode.firstElementChild /en-US/docs/Web/API/ParentNode/firstElementChild
/en-US/docs/Web/API/ParentNode.lastElementChild /en-US/docs/Web/API/ParentNode/lastElementChild
/en-US/docs/Web/API/ParentNode.firstElementChild /en-US/docs/Web/API/Element/firstElementChild
/en-US/docs/Web/API/ParentNode.lastElementChild /en-US/docs/Web/API/Element/lastElementChild
/en-US/docs/Web/API/ParentNode/childElementCount /en-US/docs/Web/API/Element/childElementCount
/en-US/docs/Web/API/ParentNode/children /en-US/docs/Web/API/Element/children
/en-US/docs/Web/API/ParentNode/firstElementChild /en-US/docs/Web/API/Element/firstElementChild
/en-US/docs/Web/API/ParentNode/lastElementChild /en-US/docs/Web/API/Element/lastElementChild
/en-US/docs/Web/API/PasswordCredential/additionalData /en-US/docs/Web/API/PasswordCredential
/en-US/docs/Web/API/PasswordCredential/idName /en-US/docs/Web/API/PasswordCredential
/en-US/docs/Web/API/PasswordCredential/passwordName /en-US/docs/Web/API/PasswordCredential
Expand Down
80 changes: 40 additions & 40 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -71025,46 +71025,6 @@
"fscholz"
]
},
"Web/API/ParentNode/firstElementChild": {
"modified": "2020-10-15T21:06:48.193Z",
"contributors": [
"Krinkle",
"akovantsev",
"Mems",
"ExE-Boss",
"K-Gun",
"kevin_martinez",
"Alhadis",
"fscholz",
"kollishivagangadhar",
"Loiro",
"khushboo_Dwivedi",
"teoli",
"Sheppy",
"ziyunfei",
"Jürgen Jeka"
]
},
"Web/API/ParentNode/lastElementChild": {
"modified": "2020-10-15T21:05:51.183Z",
"contributors": [
"sideshowbarker",
"alattalatta",
"ExE-Boss",
"K-Gun",
"Alhadis",
"LouisLazaris",
"fscholz",
"kollishivagangadhar",
"khushboo_Dwivedi",
"teoli",
"Sheppy",
"ziyunfei",
"BillyRayPreachersSon",
"RobG",
"Jürgen Jeka"
]
},
"Web/API/ParentNode/prepend": {
"modified": "2020-11-27T11:36:17.341Z",
"contributors": [
Expand Down Expand Up @@ -165633,5 +165593,45 @@
"paul.irish",
"janmoesen"
]
},
"Web/API/Element/firstElementChild": {
"modified": "2020-10-15T21:06:48.193Z",
"contributors": [
"Krinkle",
"akovantsev",
"Mems",
"ExE-Boss",
"K-Gun",
"kevin_martinez",
"Alhadis",
"fscholz",
"kollishivagangadhar",
"Loiro",
"khushboo_Dwivedi",
"teoli",
"Sheppy",
"ziyunfei",
"Jürgen Jeka"
]
},
"Web/API/Element/lastElementChild": {
"modified": "2020-10-15T21:05:51.183Z",
"contributors": [
"sideshowbarker",
"alattalatta",
"ExE-Boss",
"K-Gun",
"Alhadis",
"LouisLazaris",
"fscholz",
"kollishivagangadhar",
"khushboo_Dwivedi",
"teoli",
"Sheppy",
"ziyunfei",
"BillyRayPreachersSon",
"RobG",
"Jürgen Jeka"
]
}
}
56 changes: 56 additions & 0 deletions files/en-us/web/api/document/firstelementchild/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Document.firstElementChild
slug: Web/API/Document/firstElementChild
tags:
- API
- DOM
- Element
- Property
---
<p>{{ APIRef("DOM") }}</p>

<p>The <strong><code>Document.firstElementChild</code></strong> read-only property
returns the document's first child {{domxref("Element")}}, or <code>null</code> if there
are no child elements.</p>

<p>For HTML documents, this is usually the only child, the root <code>&lt;html&gt;</code> element.</p>

<p>See {{domxref("Element.firstElementChild")}} for the first child element of specific elements within a document.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">
// Getter
element = document.firstElementChild;

// No setter; read-only property
</pre>
<h2 id="Example">Example</h2>

<pre class="brush: js">
document.firstElementChild;
// returns the root &lt;html&gt; element, the only child of the document
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
</tr>
<tr>
<td>{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}</td>
</tr>
</tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.Document.firstElementChild")}}</p>

<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("Element.firstElementChild")}}</li>´
</ul>
4 changes: 4 additions & 0 deletions files/en-us/web/api/document/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ <h2 id="Properties">Properties</h2>
<dd>Returns the document location as a string.</dd>
<dt>{{DOMxRef("Document.embeds")}}{{ReadOnlyInline}}</dt>
<dd>Returns a list of the embedded {{HTMLElement('embed')}} elements within the current document.</dd>
<dt>{{domxref("Document.firstElementChild")}} {{readonlyInline}}</dt>
<dd>Returns the first child element of the current document.</dd>
<dt>{{DOMxRef("Document.fonts")}}</dt>
<dd>Returns the {{DOMxRef("FontFaceSet")}} interface of the current document.</dd>
<dt>{{DOMxRef("Document.forms")}}{{ReadOnlyInline}}</dt>
Expand All @@ -64,6 +66,8 @@ <h2 id="Properties">Properties</h2>
<dd>Returns a list of the images in the current document.</dd>
<dt>{{DOMxRef("Document.implementation")}}{{ReadOnlyInline}}</dt>
<dd>Returns the DOM implementation associated with the current document.</dd>
<dt>{{domxref("Document.lastElementChild")}} {{readonlyInline}}</dt>
<dd>Returns the last child element of the current document.</dd>
<dt>{{DOMxRef("Document.links")}}{{ReadOnlyInline}}</dt>
<dd>Returns a list of all the hyperlinks in the document.</dd>
<dt>{{DOMxRef("Document.mozSyntheticDocument")}} {{Non-standard_Inline}}</dt>
Expand Down
56 changes: 56 additions & 0 deletions files/en-us/web/api/document/lastelementchild/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Document.lastElementChild
slug: Web/API/Document/lastElementChild
tags:
- API
- DOM
- Element
- Property
---
<p>{{ APIRef("DOM") }}</p>

<p>The <strong><code>Document.lastElementChild</code></strong> read-only property
returns the document's last child {{domxref("Element")}}, or <code>null</code> if there
are no child elements.</p>

<p>For HTML documents, this is usually the only child, the root <code>&lt;html&gt;</code> element.</p>

<p>See {{domxref("Element.lastElementChild")}} for the last child element of specific elements within a document.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">
// Getter
element = document.lastElementChild;

// No setter; read-only property
</pre>
<h2 id="Example">Example</h2>

<pre class="brush: js">
document.lastElementChild;
// returns the root &lt;html&gt; element, the only child of the document
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
</tr>
<tr>
<td>{{SpecName('DOM WHATWG', '#dom-parentnode-lastelementchild', 'ParentNode.lastElementChild')}}</td>
</tr>
</tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.Document.lastElementChild")}}</p>

<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("Element.lastElementChild")}}</li>´
</ul>
57 changes: 57 additions & 0 deletions files/en-us/web/api/documentfragment/firstelementchild/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
title: DocumentFragment.firstElementChild
slug: Web/API/DocumentFragment/firstElementChild
tags:
- API
- DOM
- Element
- Property
---
<p>{{ APIRef("DOM") }}</p>

<p>The <strong><code>DocumentFragment.firstElementChild</code></strong> read-only property
returns the document fragment's first child {{domxref("Element")}}, or <code>null</code> if there
are no child elements.</p>

<h2 id="Syntax">Syntax</h2>

<pre class="brush: js">
// Getter
element = fragment.firstElementChild;

// No setter; read-only property
</pre>
<h2 id="Example">Example</h2>

<pre class="brush: js">
let fragment = new DocumentFragment();
fragment.firstElementChild; // null

let paragraph = document.createElement('p');
fragment.appendChild(paragraph);

fragment.firstElementChild; // &lt;p&gt;
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
</tr>
<tr>
<td>{{SpecName('DOM WHATWG', '#dom-parentnode-firstelementchild', 'ParentNode.firstElementChild')}}</td>
</tr>
</tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p>{{Compat("api.DocumentFragment.firstElementChild")}}</p>

<h2 id="See_also">See also</h2>

<ul>
<li>{{domxref("Element.firstElementChild")}}</li>´
</ul>
4 changes: 2 additions & 2 deletions files/en-us/web/api/documentfragment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ <h2 id="Properties">Properties</h2>
<dd>Returns the amount of child {{domxref("Element","elements")}} the <code>DocumentFragment</code> has.</dd>
<dt>{{ domxref("DocumentFragment.children") }} {{readonlyInline}}</dt>
<dd>Returns a live {{domxref("HTMLCollection")}} containing all objects of type {{domxref("Element")}} that are children of the <code>DocumentFragment</code> object.</dd>
<dt>{{ domxref("ParentNode.firstElementChild") }} {{readonlyInline}}{{experimental_inline}}</dt>
<dt>{{ domxref("DocumentFragment.firstElementChild") }} {{readonlyInline}}</dt>
<dd>Returns the {{domxref("Element")}} that is the first child of the <code>DocumentFragment</code> object, or <code>null</code> if there is none.</dd>
<dt>{{ domxref("ParentNode.lastElementChild") }} {{readonlyInline}}{{experimental_inline}}</dt>
<dt>{{ domxref("DocumentFragment.lastElementChild") }} {{readonlyInline}}</dt>
<dd>Returns the {{domxref("Element")}} that is the last child of the <code>DocumentFragment</code> object, or <code>null</code> if there is none.</dd>
</dl>

Expand Down
Loading

0 comments on commit cd12c02

Please sign in to comment.