Skip to content

Commit

Permalink
Revert "Make mouse-triggered focus use flat tree traversal"
Browse files Browse the repository at this point in the history
This reverts commit 169c2ef.

Reason for revert: Causes crbug.com/939546, and fix for selection seems to be non-trivial.

Original change's description:
> Make mouse-triggered focus use flat tree traversal
>
> Previously mouse-triggered focusing on an element (e.g. clicking) uses
> repeated calls of ParentOrShadowElement() instead of using flat-tree
> traversal methods, causing it to go up its shadow-including ancestors
> instead of flat-tree. This behavior is not specified, but other
> browser vendors had implemented flat-tree traversal usage for focus
> traversal.
>
> See: WICG/webcomponents#773
>
> Bug: 894931
> Change-Id: I5666c9e973480648e8e9a1774e5d6abe026aac5c
> Reviewed-on: https://chromium-review.googlesource.com/c/1455839
> Reviewed-by: Hayato Ito <[email protected]>
> Reviewed-by: Kent Tamura <[email protected]>
> Commit-Queue: Rakina Zata Amni <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#629515}

[email protected],[email protected],[email protected]

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 894931, 939546
Change-Id: I215fe3f98c6117cd2bff8bd0930f3b8e380646f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1514433
Reviewed-by: Rakina Zata Amni <[email protected]>
Reviewed-by: Kent Tamura <[email protected]>
Commit-Queue: Rakina Zata Amni <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#639420}(cherry picked from commit 5310256007c2d3a77fdf520d2eb2e1d06a04a8d3)
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1519508
Cr-Commit-Position: refs/branch-heads/3729@{#74}
Cr-Branched-From: d4a8972-refs/heads/master@{#638880}
  • Loading branch information
rakina committed Mar 13, 2019
1 parent df786ba commit 7d66bde
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ WebInputEventResult MouseEventManager::HandleMouseFocus(
frame_->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();

Element* element = element_under_mouse_;
for (; element; element = FlatTreeTraversal::ParentElement(*element)) {
for (; element; element = element->ParentOrShadowHostElement()) {
if (element->IsFocusable() && element->IsFocusedElementInDocument())
return WebInputEventResult::kNotHandled;
if (element->IsMouseFocusable())
Expand Down
35 changes: 0 additions & 35 deletions third_party/blink/web_tests/shadow-dom/focus-flat-tree.html

This file was deleted.

0 comments on commit 7d66bde

Please sign in to comment.