Closed Bug 1686662 Opened 3 years ago Closed 3 years ago

Middle mouse click on a result link of DuckDuckGo not only opens the link but also causes auto-scrolling

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

Desktop
Windows 10
defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- wontfix
firefox87 --- wontfix
firefox88 --- wontfix
firefox89 --- fixed

People

(Reporter: alice0775, Assigned: masayuki)

References

Details

(Keywords: nightly-community)

Attachments

(1 file)

Reproducible: always

Steps to Reproduce:

  1. Open https://duckduckgo.com/?t=ffab&q=mozilla&ia=web
  2. Middle-click the description part, not the title of the search results

Actual results:
The link open in background tab as expected.
However, It also causes auto-scrolling.

Expected results:
If the user event opened the link, it shouldn't trigger auto-scrolling.

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=1aff06604426eae04041386d1b2d9443f0a99d69&tochange=3d3c6b9521dca33b6367571bb5012062e976c922

This also happens before Bug 1686045 if the user allows the website to open a popup.

(In reply to Edgar Chen [:edgar] from comment #1)

This also happens before Bug 1686045 if the user allows the website to open a popup.

yes.

This seems vaguely related to bug 1528289 and bug 1521396.

Hi Masayuki, do you happen to have some quick idea here?

Flags: needinfo?(masayuki)

Hmm, I have a patch for bug 1528289, but does not have automated tests because of test framework issue, IIRC.

I'll take a look whether we can land it.

Cool!

Severity: -- → S3

This does not depend on bug 1528289, but I got the reason why this occurs.

First, this is a bug of DuckDuckGo. It handles the middle button click as opening related link of the paragraph in new window by themselves. However, they don't prevent its default. Therefore, we set focus to the clicked point and window as default action of a middle click. Therefore, the old tab gets back focus after opening a new tab. On the other hand, in this case, Blink does not set focus to the clicked window. This incompatible behavior is the other cause of this bug.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
No longer depends on: 1528289
Flags: needinfo?(masayuki)

AutoScrollParent starts autoscroll even if the requested tab has already
been in background tab. In this case, it does not make sense to start
autoscrolling in new foreground window since it may not be scrollable.

Additionally, our mousedown event default action activates the DOM window,
but in the DuckDuckGo's case, focus shouldn't be backed to the clicked tab.

Depends on D104652

Pushed by masayuki@d-toybox.com:
https://hg.mozilla.org/integration/autoland/rev/8fcec4a428e2
Stop starting autoscroll if requested browsing context is not in foreground tab anymore r=smaug,Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: