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

[css-anchor-position-1] Change implicit anchor element example #9014

Merged
merged 4 commits into from
Jul 5, 2023

Conversation

josepharhar
Copy link
Contributor

I am writing an HTML spec PR to define the anchor attribute, which sets the implicit anchor element. That PR doesn't have any references to or integrations with the popover attribute, and I got feedback that the implicit anchor element seems popover-specific due to the example: whatwg/html#9144 (comment)

This PR changes the example to talk about the anchor attribute rather than the popover API. I'm not sure if the popover API is supposed to set an implicit anchor element... maybe @xiaochengh knows?

@josepharhar
Copy link
Contributor Author

@tabatkins Want to take a look?

@xiaochengh
Copy link
Contributor

I'm not sure if the popover API is supposed to set an implicit anchor element...

I don't think it should.

The current PR looks more appropriate.

to declare what element is anchoring it.
This makes the declared element the [=implicit anchor element=]
for the popover.
For example, the HTML spec defines an "anchor" attribute which allows an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a link to the HTML spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to but the PR isn't merged yet: whatwg/html#9144
If that PR is merged before this one then I can edit this PR to add a link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about linking it to https://whatpr.org/html/9144/dom.html#the-anchor-attribute for now, and then change it when the HTML PR is merged?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@tabatkins tabatkins merged commit 1e1e4a5 into w3c:main Jul 5, 2023
@tabatkins
Copy link
Member

When I initially wrote it the assumption was that the anchor attribute was part of the Popover API. If it's been separated, it makes sense to rewrite to refer to this properly, so yeah, merged. (Is there no way for the JS API to trigger an implicit anchor anymore?)

And I fixed the link to just be what will eventually link to HTML after the PR lands; it's okay for it to fail for a little bit rather than try to remember to change the link later.

@xiaochengh
Copy link
Contributor

Is there no way for the JS API to trigger an implicit anchor anymore?

There is:

element.anchorElement = anotherElement;
element.anchorElement; // returns anotherElement

@tabatkins
Copy link
Member

I knew about that one, I just thought there was a way to trigger it from the opening call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants