Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split pictureInPictureElement to avoid mixin page #2653

Merged
merged 10 commits into from
Mar 3, 2021
3 changes: 2 additions & 1 deletion files/en-us/_redirects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7566,7 +7566,8 @@
/en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement /en-US/docs/Web/API/Document/fullscreenElement
/en-US/docs/Web/API/DocumentOrShadowRoot/nodeFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot
/en-US/docs/Web/API/DocumentOrShadowRoot/nodesFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot
/en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureEnabled /en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureElement
/en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureElement /en-US/docs/Web/API/Document/pictureInPictureElement
/en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureEnabled /en-US/docs/Web/API/Document/pictureInPictureElement
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved
/en-US/docs/Web/API/DocumentTouch.createTouch /en-US/docs/Web/API/Document/createTouch
/en-US/docs/Web/API/DocumentTouch.createTouchList /en-US/docs/Web/API/Document/createTouchList
/en-US/docs/Web/API/DocumentTouch/createTouch /en-US/docs/Web/API/Document/createTouch
Expand Down
16 changes: 8 additions & 8 deletions files/en-us/_wikihistory.json
Original file line number Diff line number Diff line change
Expand Up @@ -44405,13 +44405,6 @@
"mattwojo"
]
},
"Web/API/DocumentOrShadowRoot/pictureInPictureElement": {
"modified": "2020-10-25T11:04:35.581Z",
"contributors": [
"chrisdavidmills",
"germain"
]
},
"Web/API/DocumentOrShadowRoot/pointerLockElement": {
"modified": "2020-10-15T21:25:15.470Z",
"contributors": [
Expand Down Expand Up @@ -165876,5 +165869,12 @@
"ziyunfei",
"ernestd"
]
},
"Web/API/Document/pictureInPictureElement": {
"modified": "2020-10-25T11:04:35.581Z",
"contributors": [
"chrisdavidmills",
"germain"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("HTMLVideoElement.autoPictureInPicture")}}</li>
<li>{{DOMxRef("HTMLVideoElement.disablePictureInPicture")}}</li>
<li>{{DOMxRef("Document.pictureInPictureEnabled")}}</li>
<li>{{DOMxRef("DocumentOrShadowRoot.pictureInPictureElement")}}</li>
<li>{{DOMxRef("Document.pictureInPictureElement")}}</li>
<li>{{CSSxRef(":picture-in-picture")}}</li>
</ul>
6 changes: 4 additions & 2 deletions files/en-us/web/api/document/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ <h2 id="Properties">Properties</h2>
<dd>Returns a list of all the hyperlinks in the document.</dd>
<dt>{{DOMxRef("Document.mozSyntheticDocument")}} {{Non-standard_Inline}}</dt>
<dd>Returns a {{JSxRef("Boolean")}} that is <code>true</code> only if this document is synthetic, such as a standalone image, video, audio file, or the like.</dd>
<dt>{{DOMxRef("Document.pictureInPictureEnabled")}}{{ReadOnlyInline}}</dt>
<dd>Returns true if the picture-in-picture feature is enabled</dd>
<dt>{{DOMxRef("Document.pictureInPictureElement")}} {{ReadOnlyInline}}</dt>
<dd>Returns the {{DOMxRef('HTMLVideoElement')}} is currently being presented in picture-in-picture mode in this document.</dd>
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved
<dt>{{DOMxRef("Document.pictureInPictureEnabled")}} {{ReadOnlyInline}}</dt>
<dd>Returns true if the picture-in-picture feature is enabled.</dd>
<dt>{{DOMxRef("Document.plugins")}}{{ReadOnlyInline}}</dt>
<dd>Returns a list of the available plugins.</dd>
<dt>{{DOMxRef("Document.featurePolicy")}} {{Experimental_Inline}}{{ReadOnlyInline}}</dt>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
---
title: DocumentOrShadowRoot.pictureInPictureElement
slug: Web/API/DocumentOrShadowRoot/pictureInPictureElement
title: Document.pictureInPictureElement
slug: Web/API/Document/pictureInPictureElement
tags:
- API
- Document
- DocumentOrShadowRoot
- Graphics
- Picture-in-Picture
- Picture-in-Picture API
- Property
- Read-only
- Reference
- pictureInPictureElement
- pip
- API
- Document
- Graphics
- Picture-in-Picture
- Picture-in-Picture API
- Property
- Read-only
- Reference
- pictureInPictureElement
- pip
---
<div>{{ApiRef("Fullscreen API")}}</div>

<p><span class="seoSummary">The
<code><strong>DocumentOrShadowRoot.pictureInPictureElement</strong></code> read-only
property returns the {{ domxref("HTMLVideoElement") }} that is currently being
<code><strong>Document.pictureInPictureElement</strong></code> read-only
property returns the {{ domxref("Element") }} that is currently being
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved
presented in picture-in-picture mode in this document, or <code>null</code> if
picture-in-picture mode is not currently in use.</span></p>

Expand All @@ -28,11 +27,11 @@
<h2 id="Syntax">Syntax</h2>

<pre
class="brush: js"><var>var video</var> = <var>document</var>.pictureInPictureElement;</pre>
class="brush: js"><var>document</var>.pictureInPictureElement;</pre>

<h3 id="Return_value">Return value</h3>

<p>A reference to the {{domxref("HTMLVideoElement")}} object that's currently in
<p>A reference to the {{domxref("Element")}} object that's currently in
picture-in-picture mode; if picture-in-picture mode isn't currently in use by the
<code><var>document</var></code>, the returned value is <code>null</code>.</p>

Expand All @@ -57,24 +56,18 @@ <h2 id="Specifications">Specifications</h2>
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("Picture-in-Picture",
"#dom-documentorshadowroot-pictureinpictureelement",
"Document.pictureInPictureElement")}}</td>
<td>{{Spec2("Picture-in-Picture")}}</td>
<td>Initial definition</td>
<td>{{SpecName("Picture-in-Picture", "#dom-documentorshadowroot-pictureinpictureelement", "Document.pictureInPictureElement")}}</td>
</tr>
</tbody>
</table>

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

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("HTMLVideoElement.autoPictureInPicture")}}</li>
<li>{{DOMxRef("HTMLVideoElement.disablePictureInPicture")}}</li>
<li>{{DOMxRef("Document.exitPictureInPicture()")}}</li>
<li>{{DOMxRef("DocumentOrShadowRoot.pictureInPictureElement")}}</li>
<li>{{DOMxRef("Document.pictureInPictureElement")}}</li>
<li>{{CSSxRef(":picture-in-picture")}}</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("HTMLVideoElement.disablePictureInPicture")}}</li>
<li>{{DOMxRef("Document.pictureInPictureEnabled")}}</li>
<li>{{DOMxRef("Document.exitPictureInPicture()")}}</li>
<li>{{DOMxRef("DocumentOrShadowRoot.pictureInPictureElement")}}</li>
<li>{{DOMxRef("Document.pictureInPictureElement")}}</li>
<li>{{CSSxRef(":picture-in-picture")}}</li>
</ul>
10 changes: 5 additions & 5 deletions files/en-us/web/api/picture-in-picture_api/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ <h3 id="Properties_on_the_Document_interface">Properties on the Document interfa
<h3 id="Properties_on_the_DocumentOrShadowRoot_interface">Properties on the DocumentOrShadowRoot interface</h3>
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved

<dl>
<dt>{{DOMxRef("DocumentOrShadowRoot.pictureInPictureElement")}}</dt>
<dd>The <code>pictureInPictureElement</code> property tells you which {{DOMxRef("Element")}} is currently being displayed in the floating window. If this is <code>null</code>, the document has no node currently in picture-in-picture mode.</dd>
<dt>{{DOMxRef("Document.pictureInPictureElement")}} / {{DOMxRef("ShadowRoot.pictureInPictureElement")}}</dt>
<dd>The <code>pictureInPictureElement</code> property tells you which {{DOMxRef("Element")}} is currently being displayed in the floating window (or in the shadow DOM). If this is <code>null</code>, the document (or shadow DOM) has no node currently in picture-in-picture mode.</dd>
</dl>

<h2 id="Events">Events</h2>
Expand Down Expand Up @@ -164,11 +164,11 @@ <h3 id="Document.exitPictureInPicture"><code>Document.exitPictureInPicture</code

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

<h3 id="DocumentOrShadowRoot.pictureInPictureElement"><code>DocumentOrShadowRoot.pictureInPictureElement</code></h3>
<h3 id="Document.pictureInPictureElement"><code>Document.pictureInPictureElement</code></h3>

<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>

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

<h3 id="PictureInPictureWindow"><code>PictureInPictureWindow</code></h3>

Expand All @@ -184,6 +184,6 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("HTMLVideoElement.disablePictureInPicture")}}</li>
<li>{{DOMxRef("Document.pictureInPictureEnabled")}}</li>
<li>{{DOMxRef("Document.exitPictureInPicture()")}}</li>
<li>{{DOMxRef("DocumentOrShadowRoot.pictureInPictureElement")}}</li>
<li>{{DOMxRef("Document.pictureInPictureElement")}}</li>
<li>{{CSSxRef(":picture-in-picture")}}</li>
</ul>
2 changes: 2 additions & 0 deletions files/en-us/web/api/shadowroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h2 id="Properties">Properties</h2>
<dd>Sets or returns a reference to the DOM tree inside the <code>ShadowRoot</code>.</dd>
<dt>{{domxref("ShadowRoot.mode")}} {{readonlyinline}}</dt>
<dd>The mode of the <code>ShadowRoot</code> — either <code>open</code> or <code>closed</code>. This defines whether or not the shadow root's internal features are accessible from JavaScript.</dd>
<dt>{{DOMxRef("ShadowRoot.pictureInPictureElement")}} {{ReadOnlyInline}}</dt>
<dd>Returns the {{DOMxRef('HTMLVideoElement')}} within the shadow tree that is currently being presented in picture-in-picture mode.</dd>
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved
</dl>

<h3 id="Properties_included_from_DocumentOrShadowRoot">Properties included from DocumentOrShadowRoot</h3>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: ShadowRoot.pictureInPictureElement
slug: Web/API/ShadowRoot/pictureInPictureElement
tags:
- API
- Property
- Reference
- ShadowRoot
- Web Components
- shadow dom
---
<div>{{APIRef("Shadow DOM")}}</div>

<p>The <strong><code>pictureInPictureElement</code></strong> read-only property of the
{{domxref("ShadowRoot")}} interface returns the {{domxref("Element")}} that is currently being
presented in picture-in-picture mode in this shadow tree, or <code>null</code> if
picture-in-picture mode is not currently in use.</p>

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

<pre class="brush: js"><var>shadowRoot</var>.pictureInPictureElement</pre>

<h3 id="Value">Value</h3>

<p>A reference to the {{domxref("Element")}} object that's currently in
picture-in-picture mode, or, if picture-in-picture mode isn't currently in use by the
shadow tree, the returned value is <code>null</code>.</p>

<h2 id="Examples">Examples</h2>

<pre class="brush: js">let customElem = document.querySelector('my-shadow-dom-element');
let shadow = customElem.shadowRoot;
let pipElem = shadow.pictureInPictureElement;</pre>

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

<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName('HTML WHATWG','#dom-documentorshadowroot-pictureinpictureelement', 'pictureInPictureElement')}}</td>
Elchi3 marked this conversation as resolved.
Show resolved Hide resolved
</tr>
</tbody>
</table>

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

<p>{{Compat("api.ShadowRoot.pictureInPictureElement")}}</p>

<h2>See also</h2>

<ul>
<li>{{domxref("Document.pictureInPictureElement")}}</li>
</ul>
2 changes: 1 addition & 1 deletion files/en-us/web/css/_colon_picture-in-picture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ <h2 id="See_also">See also</h2>
<li>{{DOMxRef("HTMLVideoElement.disablePictureInPicture")}}</li>
<li>{{DOMxRef("Document.pictureInPictureEnabled")}}</li>
<li>{{DOMxRef("Document.exitPictureInPicture()")}}</li>
<li>{{DOMxRef("DocumentOrShadowRoot.pictureInPictureElement")}}</li>
<li>{{DOMxRef("Document.pictureInPictureElement")}}</li>
</ul>