这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@blu25
Copy link
Collaborator

@blu25 blu25 commented Apr 10, 2023

@blu25 blu25 requested a review from domfarolino April 10, 2023 16:43
@domfarolino
Copy link
Collaborator

One question: Do we need to modify https://html.spec.whatwg.org/multipage/interaction.html#sequential-navigation-search-algorithm? I guess we'll catch this with the audit anyways, in which case we don't have to modify it in this PR, right?

spec.bs Outdated
<ol>
<li><p>Set <var ignore=''>element</var>'s [=previously focused element=] to null.</p></li>

<li><p>If <var ignore=''>focusPreviousElement</var> is true, then run the [=focusing steps=] for
Copy link
Collaborator

Choose a reason for hiding this comment

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

This step is identical to the one in the spec, and so is the above. Does this patch actually do anything?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I forgot to add the unfenced part to this, good catch.

spec.bs Outdated
container/fenced navigable=], and |old chain| does not also [=list/contain=] |element|, then
return.

Note: This is how we bail-out early just before calling the [=focus update steps=], in the case
Copy link
Collaborator

Choose a reason for hiding this comment

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

I added this Note:. Does it capture the intent correctly? If so (that is, if I understand what our aim is here), then I think the above step is not adequate. If you move focus from one element inside of a fenced frame to another element inside of a fenced frame, I think the logic in your step will trigger and then we'll mistakenly early-return, right? Does that logic make sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it should be checking for a document instead of an element. That should correctly handle the case of switching focus between 2 elements in a fenced frame.

Both focus chains will contain the fenced frame root's document at that point, and the function will not early return. If we switch focus from one fenced frame to another, now both of the fenced frame root documents will only exist in one of the focus chains, and the function will early return.

    add rest of cases in audit

    add rest of focus algorithms

    fix build

    Some format nits
@domfarolino
Copy link
Collaborator

I added some formatting and editorial improvements, I'll try and fix the conflicts since I caused them.

@blu25
Copy link
Collaborator Author

blu25 commented Apr 11, 2023

One question: Do we need to modify https://html.spec.whatwg.org/multipage/interaction.html#sequential-navigation-search-algorithm? I guess we'll catch this with the audit anyways, in which case we don't have to modify it in this PR, right?

I think we might need to modify it. This is operating under the assumption that "If candidate is a navigable container with a non-null content navigable" will not return anything for a fenced frame, so we'd need to add an extra case to do the same thing but with fenced navigables.

I am assuming that "starting point is a navigable" will be okay though, since a fenced navigable is still a navigable.

We could punt on this until we get to the "content navigable" stuff, but there's a ton of entries in that category, so it might be simpler to just do this now.

[=fenced navigable container/fenced navigable=], whichever is non-null.
</div>

<div algorithm=sequential-focus-navigation-patch>
Copy link
Collaborator

Choose a reason for hiding this comment

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

All of the sequential focus and navigation changes are unfenced by default it seems. I just want to double check: that's because there are only initiated with user actions, right? I think I'm going to land this right not but please respond here after just for posterity

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@domfarolino domfarolino merged commit fa7833d into master Apr 17, 2023
@domfarolino domfarolino deleted the liam-focus-patches branch April 17, 2023 12:11
github-actions bot added a commit that referenced this pull request Apr 17, 2023
SHA: fa7833d
Reason: push, by domfarolino

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
domfarolino pushed a commit that referenced this pull request Apr 24, 2023
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