diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/html/element%2Fportal.html | |
new repository
Diffstat (limited to 'devdocs/html/element%2Fportal.html')
| -rw-r--r-- | devdocs/html/element%2Fportal.html | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/devdocs/html/element%2Fportal.html b/devdocs/html/element%2Fportal.html new file mode 100644 index 00000000..54f1da5c --- /dev/null +++ b/devdocs/html/element%2Fportal.html @@ -0,0 +1,73 @@ +<header><h1><portal>: The Portal element</h1></header><div class="section-content"> +<div class="notecard experimental" id="sect1"><p><strong>Experimental:</strong> <strong>This is an <a href="https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Experimental_deprecated_obsolete#experimental">experimental technology</a></strong><br>Check the <a href="#browser_compatibility">Browser compatibility table</a> carefully before using this in production.</p></div> <p>The <code><portal></code> <a href="../index">HTML</a> element enables the embedding of another HTML page into the current one for the purposes of allowing smoother navigation into new pages.</p> <p>A <code><portal></code> is similar to an <code><iframe></code>. An <code><iframe></code> allows a separate <a href="https://developer.mozilla.org/en-US/docs/Glossary/Browsing_context">browsing context</a> to be embedded. However, the embedded content of a <code><portal></code> is more limited than that of an <code><iframe></code>. It cannot be interacted with, and therefore is not suitable for embedding widgets into a document. Instead, the <code><portal></code> acts as a preview of the content of another page. It can be navigated into therefore allowing for seamless transition to the embedded content.</p> +</div> +<h2 id="attributes">Attributes</h2> +<div class="section-content"> +<p>This element includes the <a href="../global_attributes">global attributes</a>.</p> <dl> <dt id="referrerpolicy"><a href="#referrerpolicy"><code>referrerpolicy</code></a></dt> <dd> <p>Sets the <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy">referrer policy</a> to use when requesting the page at the URL given as the value of the <code>src</code> attribute.</p> </dd> <dt id="src"><a href="#src"><code>src</code></a></dt> <dd> <p>The URL of the page to embed.</p> </dd> </dl> +</div> +<h2 id="examples">Examples</h2> + +<h3 id="basic_example">Basic example</h3> +<div class="section-content"> +<p>The following example will embed the contents of <code>https://example.com</code> as a preview.</p> <div class="code-example"> +<p class="example-header"><span class="language-name">html</span></p> +<pre data-signature="BkkdrCpVu4CLKRpLt4O0P9P5K19EvJl/qZBKf1erhWs=" data-language="html"><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>portal</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>exampleportal<span class="token punctuation">"</span></span> <span class="token attr-name">src</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>https://example.com/<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>portal</span><span class="token punctuation">></span></span> +</pre> +</div> +</div> +<h2 id="accessibility_concerns">Accessibility concerns</h2> +<div class="section-content"> +<p>The preview displayed by a <code><portal></code> is not interactive, therefore does not receive input events or focus. Therefore the embedded contents of the portal are not exposed as elements in the <a href="https://developer.mozilla.org/en-US/docs/Glossary/Accessibility_tree">accessibility tree</a>. The portal can be navigated to and activated like a button, the default behavior when clicking on the portal is to activate it.</p> <p>Portals are given a default label which is the title of the embedded page. If no title is present the visible text in the preview is concatenated to create a label. The <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label"><code>aria-label</code></a> attribute can be used to override this.</p> <p>Portals used for prerendering only should be hidden with the hidden HTML attribute or the CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/display"><code>display</code></a> property with a value of <code>none</code>.</p> <p>When using animations during portal activation the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion"><code>prefers-reduced-motion</code></a> <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media#media_features">media feature</a> should be respected.</p> +</div> +<h2 id="technical_summary">Technical summary</h2> +<div class="section-content"><figure class="table-container"><div class="_table"><table class="properties"> <tbody> <tr> <th scope="row">Implicit ARIA role</th> <td><a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role">button</a></td> </tr> <tr> <th scope="row">DOM interface</th> <td><a class="page-not-created"><code>HTMLPortalElement</code></a></td> </tr> </tbody> </table></div></figure></div> +<h2 id="specifications">Specifications</h2> +<div class="_table"><table class="standard-table"> +<thead><tr><th scope="col">Specification</th></tr></thead> +<tbody><tr><td><a href="https://wicg.github.io/portals/#the-portal-element">Portals <br><small># the-portal-element</small></a></td></tr></tbody> +</table></div> +<h2 id="browser_compatibility">Browser compatibility</h2> +<div class="_table"><table> +<thead> +<tr id="bct-browser-type"> +<th></th> +<th colspan="6">Desktop</th> +<th colspan="6">Mobile</th> +</tr> +<tr id="bct-browsers"> +<th></th> +<th>Chrome</th> +<th>Edge</th> +<th>Firefox</th> +<th>Internet Explorer</th> +<th>Opera</th> +<th>Safari</th> +<th>WebView Android</th> +<th>Chrome Android</th> +<th>Firefox for Android</th> +<th>Opera Android</th> +<th>Safari on IOS</th> +<th>Samsung Internet</th> +</tr> +</thead> +<tbody><tr> +<th><code>portal</code></th> +<td class="bc-supports-yes">85</td> +<td class="bc-supports-yes">90</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-yes">73</td> +<td class="bc-supports-no">No</td> +<td>?</td> +<td class="bc-supports-yes">85</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-no">No</td> +<td class="bc-supports-no">No</td> +</tr></tbody> +</table></div><div class="_attribution"> + <p class="_attribution-p"> + © 2005–2023 MDN contributors.<br>Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.<br> + <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/portal" class="_attribution-link">https://developer.mozilla.org/en-US/docs/Web/HTML/Element/portal</a> + </p> +</div> |
