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

What should happen to hover, focus and active chains when the flat tree changes? #4795

Open
emilio opened this issue Jul 24, 2019 · 2 comments

Comments

@emilio
Copy link
Contributor

emilio commented Jul 24, 2019

All browsers have similar invalidation issues:

See the test-case in the chromium issue for an example.

I proposed to handle it in Gecko the same way content removal is handled, but @smaug---- disagreed. I think it's simpler to do it that way since then you don't need to differentiate when you're getting re-assigned from when you're getting assigned to an unexisting slot for example.

Anyhow, should the focus be kept in the same element silently? Or should the focus be removed the same way it happens for content removals? Same for :active.

cc @lilles @rniwa @annevk

@emilio emilio changed the title What should happen to focus and active change when the flat tree changes? What should happen to hover, focus and active chains when the flat tree changes? Jul 24, 2019
@lilles
Copy link
Contributor

lilles commented Jul 24, 2019

I think I tend to agree with @smaug----.

One case where I'd be surprised to lose focus: if you attach a shadow root to an element in your ancestor chain and just add a slot to it. No rendering changes, but focus lost?

With my implementor hat on, handling it as a DOM remove/add is simpler, of course.

@rniwa
Copy link

rniwa commented Jul 24, 2019

if you attach a shadow root to an element in your ancestor chain and just add a slot to it. No rendering changes, but focus lost?

Yeah, this would be indeed a surprising behavior. I tend to agree with @smaug---- here that the expectation is to keep focus, hover, active, etc... states intact.

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

No branches or pull requests

5 participants