-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update acceptable anchor element algorithm #195
Conversation
✅ Deploy Preview for anchor-polyfill ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for anchor-position-wpt canceled.
|
@ayoreis Thanks for this PR! This is a huge help. I haven't done a full review yet, but I did run it through the Web Platform Tests locally. This PR makes many more tests pass 🥳 , but there is a regression in anchor-name-inline-001.html. It looks like originally all the anchor-sizes were resolving to 20, and in this PR, they now are all resolving to 30. Per @xiaochengh in #103, "An element can use absolutely positioned anchors that come earlier in tree order". This is laid out more explicitly in the spec, with- An element el is a acceptable anchor element for an absolutely positioned element query el if all of the following are true:
... |
Thanks for looking at this @jamesnw. Turns out I only ran the unit tests, I'm already working on fixing the e2e tests. When running the Web Platform Tests ( |
Apologies for that- we're aware that WPT is one area that needs attention as we resume active development. What I'd recommend for right now-
Note that there are roughly 6000 failures right now, so your goal isn't to get all WPT tests passing- that will be a larger effort. |
Hi, sorry for taking so long. Quick update: I found the issue and started fixing it (Floating UI's To check for regressions on a WPT run do you just use expectations metadata and then search for |
I ran on main, and then on my branch, and exported the results as JSON from both. Then I did a diff between the two, which was incredibly noisy and pretty annoying. I would love to make that easier. |
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.
Thanks for this contribution! Aside from the bug you and @jamesnw have already discussed, I made a few minor suggestions to simplify the example CSS.
Co-authored-by: Jonny Gerig Meyer <jonny@oddbird.net>
Hi, sorry I took so long again. The problem was using the Also:
All previous Web Platform Tests pass + 46 new ones. I've been using this script I made to compare the results: https://github.com/ayoreis/wptr (It's been a great help, feel free to try it out). Some end-to-end tests that are outdated compared with spec started failing, should I rewrite them? |
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 is great -- thanks again! 👏
Some end-to-end tests that are outdated compared with spec started failing, should I rewrite them?
Yes, if you're willing to adjust the 5 failing tests, then this is good to merge.
<a href="#anchor-absolute" aria-hidden="true">🔗</a> | ||
Absolutely positioned anchor | ||
</h2> | ||
<div style="position: relative; height: 150px;" class="demo-elements"> |
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.
I guess the linter complains about this extra semicolon 🤷
<div style="position: relative; height: 150px;" class="demo-elements"> | |
<div style="position: relative; height: 150px" class="demo-elements"> |
@ayoreis We're going to merge this and fix up the tests on our end so we can cut a new release. Thanks again for your contribution! |
Thanks! |
Hi, I updated the acceptable anchor element algorithm because I needed it for a project but I think it's good to merge upstream.
All test pass (one needed updating) and I added a new example to the home page.
I left a TODO which I already started to fix but decided it would be better to separate into another PR (pseudo-element anchors).
Closes #103