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

Add anchor attribute #9144

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Changes from 5 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
95ebedf
Add anchor attribute
josepharhar Apr 10, 2023
cc6d05d
move new section, remove popover reference
josepharhar Apr 10, 2023
e028845
Merge remote-tracking branch 'origin/main' into anchor
josepharhar Jun 28, 2023
b7bf329
point links to new redirects
josepharhar Jun 28, 2023
add4841
improve implicit anchor element definition
josepharhar Jun 28, 2023
b590be2
add referenced link
josepharhar Jun 28, 2023
86f0fc3
inline list
josepharhar Jul 5, 2023
81d51b7
fix ids in attribute index
josepharhar Jul 5, 2023
3b69887
code->span
josepharhar Jul 5, 2023
8bdce1c
add ref CSSANCHOR
josepharhar Jul 5, 2023
610ae3f
add presentational paragraph
josepharhar Jul 10, 2023
87532cc
Merge branch 'main' into anchor
josepharhar Jan 23, 2024
9ad8934
Move IDL from HTMLElement to Element
josepharhar Jan 24, 2024
0489d5b
fix ref tag
josepharhar Mar 13, 2024
b5be1a3
Merge branch 'main' into anchor
josepharhar Mar 13, 2024
f11da28
add popover integration
josepharhar Mar 26, 2024
06049f9
fix end tag
josepharhar Mar 26, 2024
382b064
move section
josepharhar Apr 8, 2024
fb5e5bb
remove first sentence
josepharhar Apr 8, 2024
3dca84e
remove presentational
josepharhar Apr 9, 2024
420012f
remove presentational paragraph
josepharhar Apr 9, 2024
b354492
remove anchor-name
josepharhar Apr 9, 2024
85e059f
re-add dfn
josepharhar Apr 9, 2024
7da97b5
move idl and use algorithm
josepharhar Apr 9, 2024
b88238e
remove semicolons
josepharhar Apr 9, 2024
0c02dbb
node->element
josepharhar Apr 9, 2024
59d976c
specified->sets
josepharhar Apr 9, 2024
5116e00
add missing p start tag
josepharhar Apr 9, 2024
acdf3ee
Merge remote-tracking branch 'upstream/main' into anchor
josepharhar Apr 9, 2024
ee9c79f
add whitespace to help trigger build
josepharhar Apr 9, 2024
b7da26d
remove get the anchor element algorithm
josepharhar Apr 9, 2024
26a6ab3
add comment to idl
josepharhar Apr 12, 2024
b0be02a
switch back to HTML elements
josepharhar Apr 12, 2024
f7c6b36
move up description sentence
josepharhar Apr 18, 2024
e154788
use attr-label-for text
josepharhar Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -4049,8 +4049,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://drafts.csswg.org/css-contain/#containment-layout">layout
containment</dfn></li>
</ul>
</dd>

<p>The following terms are defined in <cite>CSS Anchor Positioning</cite>: <ref spec=CSSANCHOR></p>

<ul class="brief">
<li><dfn data-x-href="https://drafts.csswg.org/css-anchor-position-1/#implicit-anchor-element">implicit anchor element</dfn></li>
</ul>
</dd>

<dt>Intersection Observer</dt>

Expand Down Expand Up @@ -11577,6 +11582,8 @@ interface <dfn interface>HTMLElement</dfn> : <span>Element</span> {
undefined <span data-x="dom-hidePopover">hidePopover</span>();
boolean <span data-x="dom-togglePopover">togglePopover</span>(optional boolean force);
[<span>CEReactions</span>] attribute DOMString? <span data-x="dom-popover">popover</span>;

[<span>CEReactions</span>] attribute Element? <span data-x="dom-anchorElement">anchorElement</span>;
};

<span>HTMLElement</span> includes <span>GlobalEventHandlers</span>;
Expand Down Expand Up @@ -12811,6 +12818,7 @@ https://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20HTML%3E%

<ul class="brief">
<li><code data-x="attr-accesskey">accesskey</code></li>
<li><code data-x="attr-anchor">anchor</code></li>
<li><code data-x="attr-autocapitalize">autocapitalize</code></li>
<li><code data-x="attr-fe-autofocus">autofocus</code></li>
<li><code data-x="attr-contenteditable">contenteditable</code></li>
Expand Down Expand Up @@ -13975,6 +13983,49 @@ interface <dfn interface>DOMStringMap</dfn> {

</div>

<h5>The <code data-x="attr-anchor">anchor</code> attribute</h5>

<p>All <span>HTML elements</span> may have the <dfn element-attr for="html-global"><code
data-x="attr-anchor">anchor</code></dfn> attribute set. If specified, the <code
zcorpan marked this conversation as resolved.
Show resolved Hide resolved
data-x="attr-anchor">anchor</code> attribute value must be the <span data-x="concept-ID">ID</span>
of an element in the same <span>tree</span> as the element with the <code
data-x="attr-anchor">anchor</code> attribute.</p>

<p>For an <span data-x="HTML elements">HTML element</span> <var>element</var>, the <span>implicit
anchor element</span> is determined by the following algorithm:</p>

<ol>
<li><p>Return <var>element</var>'s <span data-x="attr-anchor"><code
data-x="">anchor</code>-associated element</span>.</p></li>
</ol>

<p>The <dfn data-x="dom-anchorElement"><code>anchorElement</code></dfn> IDL attribute must
<span>reflect</span> the <code data-x="attr-anchor">anchor</code> attribute.

<div class="example">
<p>The following example shows how to use CSS anchor positioning by using the <code
data-x="attr-anchor">anchor</code> attribute without the need for the <code
data-x="">anchor-name</code> CSS property:</p>

<pre><code class="html">&lt;div id="myanchor">myanchor&lt;/div>
&lt;div id="target" anchor="myanchor">target&lt;/div>

&lt;style>
#myanchor {
margin: 100px;
width: 100px;
height: 100px;
}
#target {
position: absolute;
left: anchor(left);
top: anchor(bottom);
width: 100px;
height: 100px;
}
foolip marked this conversation as resolved.
Show resolved Hide resolved
&lt;/style></code></pre>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
</div>


<h4 id="the-innertext-idl-attribute">The <code data-x="dom-innerText">innerText</code> and <code
data-x="dom-outerText">outerText</code> properties</h4>
Expand Down Expand Up @@ -131269,6 +131320,11 @@ interface <dfn interface>External</dfn> {
<code data-x="attr-input-alt">input</code>
<td> Replacement text for use when images are not available
<td> <a href="#attribute-text">Text</a>*
<tr>
<th> <code data-x="">anchor</code>
<td> <code data-x="attr-anchor">HTML elements</code>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
<td> Makes the specified element the <span>implicit anchor element</span> of this element
<td> ID of the element to anchor to
<tr>
<th> <code data-x="">as</code>
<td> <code data-x="attr-link-as">link</code>
Expand Down Expand Up @@ -133721,6 +133777,9 @@ INSERT INTERFACES HERE
<dt id="refsCSSALIGN">[CSSALIGN]</dt>
<dd><cite><a href="https://w3c.github.io/csswg-drafts/css-align/">CSS Box Alignment</a></cite>, E. Etemad, T. Atkins. W3C.</dd>

<dt id="refsCSSANCHOR">[CSSANCHOR]</dt>
<dd><cite><a href="https://drafts.csswg.org/css-anchor-position-1/">CSS Anchor Positioning</a></cite>, T. Atkins, J. Tompkins, I. Kilpatrick. W3C.</dd>

<dt id="refsCSSANIMATIONS">[CSSANIMATIONS]</dt>
<dd><cite><a href="https://w3c.github.io/csswg-drafts/css-animations/">CSS Animations</a></cite>, D. Jackson, D. Hyatt, C. Marrin, S. Galineau, L. Baron. W3C.</dd>

Expand Down