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 1 commit
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 54 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -4012,8 +4012,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-1/#implicit-anchor-element">implicit anchor element</dfn></li>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
</ul>
</dd>

<dt>Intersection Observer</dt>

Expand Down Expand Up @@ -11529,6 +11534,8 @@ interface <dfn interface>HTMLElement</dfn> : <span>Element</span> {
undefined <span data-x="dom-hidePopover">hidePopover</span>();
undefined <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 @@ -12763,6 +12770,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 @@ -82898,6 +82906,43 @@ dictionary <dfn dictionary>ToggleEventInit</dfn> : <span>EventInit</span> {
data-x="popover-showing-state">showing</span>; otherwise "<code data-x="">open</code>".</p>


<h4>The <code data-x="attr-anchor">anchor</code> attribute</h4>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved

<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
data-x="attr-anchor">anchor</code> attribute value must be the <span data-x="concept-ID">ID</span>
of another element in the same <span>tree</span> as the element with the <code
data-x="attr-anchor">anchor</code> attribute. The other element is considered to be the
<span>implicit anchor element</span> of the element with the <code
data-x="attr-anchor">anchor</code> attribute.</p>

<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;
}
&lt;/style></code></pre>
</div>

<h2 split-filename="browsers" id="browsers">Loading web pages</h2>

<div w-nodev>
Expand Down Expand Up @@ -130677,6 +130722,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>
<td> Makes the specified element a parent of this element in the popover hierarchy if both elements have the <span data-x="attr-popover">popover</span> attribute
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
<td> Id of the popover parent element
<tr>
josepharhar marked this conversation as resolved.
Show resolved Hide resolved
<th> <code data-x="">as</code>
<td> <code data-x="attr-link-as">link</code>
Expand Down Expand Up @@ -133129,6 +133179,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-1/">CSS Anchor Positioning</a></cite>, T. Atkins, J. Tompkins, I. Kilpatrick. W3C.</dd>

josepharhar marked this conversation as resolved.
Show resolved Hide resolved
<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