Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
base: main
Are you sure you want to change the base?
Add anchor attribute #9144
Changes from all commits
95ebedf
cc6d05d
e028845
b7bf329
add4841
b590be2
86f0fc3
81d51b7
3b69887
8bdce1c
610ae3f
87532cc
9ad8934
0489d5b
b5be1a3
f11da28
06049f9
382b064
fb5e5bb
3dca84e
420012f
b354492
85e059f
7da97b5
b88238e
0c02dbb
59d976c
5116e00
acdf3ee
ee9c79f
b7da26d
26a6ab3
b0be02a
f7c6b36
e154788
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't catch this before, but "get an attribute by name" will return an
Attr
node, but what you want is the element in the same tree with that ID. Maybe wording like "the element in the something tree with the something ID, if any". I couldn't find any easily copy-pastable examples :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://html.spec.whatwg.org/#attr-label-for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I used "get an attribute by name" is because it uses the
Element?
reflection machinery from the DOM spec here: https://dom.spec.whatwg.org/#concept-element-attributes-get-by-nameCan I just extract the element from the Attr somehow...? Or should I just copy exactly what https://html.spec.whatwg.org/#attr-label-for does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bit you could copy and adjust from https://html.spec.whatwg.org/#attr-label-for is:
I don't think you have any use of an
Attr
node, in code what you want is basicallyroot.getElementById(element.getAttribute('anchor'))
, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I did my best to merge this paragraph into the above one and replace the text with the attr-label-for text. how does it look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still seems broken to me by the way in the popover section. The step only gives you an attribute, but the next step assumes it's a node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intention behind this rule? Doesn't this basically end up showing at the static position? Which is still a bit problematic, see w3c/csswg-drafts#9939.