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

HTML: Set focus in ElementInternals-reportValidity-bubble-notref.html #47934

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Sep 3, 2024

The test currently passes in Firefox and Safari despite not showing a validation message because reportValidity() sets focus, and the element in notref did not have focus.

The test currently passes in Firefox and Safari despite not showing a validation message because `reportValidity()` sets focus, and the element in notref did not have focus.
@rniwa
Copy link
Contributor

rniwa commented Sep 3, 2024

The test currently passes in Firefox and Safari despite not showing a validation message because reportValidity() sets focus, and the element in notref did not have focus.

Safari definitely shows the validation message. But that happens outside of the viewport as a separate popup so perhaps the test harness isn't smart enough to capture it?

@zcorpan
Copy link
Member Author

zcorpan commented Sep 3, 2024

@rniwa ah, my bad. I was testing http://wpt.live/custom-elements/form-associated/ElementInternals-reportValidity-bubble.html manually and somehow didn't see the popup in Safari TP, but I see it now. Since the test passes there are no screenshots available in wpt.fyi.

The test still passes in Firefox though, which is not what I expected: https://wpt.fyi/results/custom-elements/form-associated/ElementInternals-reportValidity-bubble.html?sha=76665c1ae6&label=pr_head

The relevant Gecko bug is https://bugzilla.mozilla.org/show_bug.cgi?id=1915786

Copy link
Contributor

@rniwa rniwa left a comment

Choose a reason for hiding this comment

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

ok, this seems like an improvement in any case.

@zcorpan
Copy link
Member Author

zcorpan commented Sep 5, 2024

I changed the test to more closely match what seems to happen in browsers, which is to focus the input element. Now the test fails in Firefox, as expected. Though this doesn't match what the spec says, which tries to focus the custom element instead of the validation anchor element. I'll file a spec issue. Edit: whatwg/html#10600

Interestingly, in Live DOM Viewer, Firefox does show the validation error. https://software.hixie.ch/utilities/js/live-dom-viewer/saved/13058

@zcorpan
Copy link
Member Author

zcorpan commented Sep 11, 2024

I have changed the test to leave space above the control and wait with taking the screenshot, in case the validation bubble doesn't show up immediately. But it still fails in Safari TP in wpt.fyi.

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

Successfully merging this pull request may close these issues.

3 participants