Closed Bug 1712339 Opened 3 years ago Closed 3 years ago

Selecting text on <travador.com> no longer works

Categories

(Core :: DOM: Selection, defect, P2)

Firefox 88
defect

Tracking

()

VERIFIED FIXED
92 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- wontfix
firefox89 --- wontfix
firefox90 + wontfix
firefox91 --- verified
firefox92 --- verified

People

(Reporter: soeren.hentzschel, Assigned: saschanaz)

References

(Regression, )

Details

(Keywords: regression)

Attachments

(2 files)

[Tracking Requested - why for this release]:

Selecting text on the website scm-shop.de no longer works. This is a regression of Firefox 88. According to mozregression the regressing bug is bug 1674658.

STR:

  1. open https://www.scm-shop.de/buecher/romane-erzaehlungen/historische-romane/buchset-die-meindorff-triologie.html
  2. try to select text

Expected:

You can select the text.

Actual:

You can only select a few characters.

There are no problems in Google Chrome and Apple Safari.

Flags: needinfo?(mbrodesser)

Marking it as fix-optional for 89 as it is too late to fix for GA but I would evaluate a safe uplift in a dot release if we have one.

Since selecting a few characters (four, on my machine) works, the mechanism isn't completely broken. It's unclear whether this a bug on the website, or within Gecko. I wonder if there are mechanisms other than preventDefault which are relevant here, which are different in Gecko than in the other browsers.

@krosylight,masayuki: any idea?

Flags: needinfo?(mbrodesser)
Flags: needinfo?(masayuki)
Flags: needinfo?(krosylight)

This sounds similar to what I saw in bug 1707925, where the testcase also allowed a short selection using .pageX/Y. It seems the website uses different code, though.

Flags: needinfo?(krosylight)

Oh, it seems both uses jQuery Mobile swipe event (although not sure which version).

I tried doing MouseEvent.prototype.preventDefault = () => console.error(new Error) on Chrome and it seems the page does calls it there, but somehow it does not prevent the selection. 🤔

Selection not working:
Click-and-drag horizontally

Working:
Click-and-drag vertically
Double-click
Triple-click

The same happens on Travador (for example on https://www.travador.com/kategorie/oesterreich), one of the most popular travel platforms in Germany/Austria.

Attached file bug1712339.html

This is a minimal repro, and I think it's a Chrome bug. Setting transform: translateX(9px) somewhere in the tree blocks ev.preventDefault() behavior and thus lets the selection change continue. The value 9px matters here, any smaller values are not problematic but larger values are.

Flags: needinfo?(masayuki)

Kagami: thanks for the analysis. Filed a bug for Chromium.

Summary: Selecting text on scm-shop.de no longer works → Selecting text on <scm-shop.de> and <travador.com> no longer works

[Tracking Requested - why for this release]:

Requesting tracking for Firefox 90 based on comment 6 (a very popular website is affected, at least in the region where I live).

Regarding comment 7: I don't know if there is a bug in Chrome but it works in every other browser and it also worked in Firefox until Firefox 88 so it's obvious that the current behaviour of Firefox 89+ is not the behaviour that was intended by the website's developers. So we need either a fix in Firefox for webcompat reasons or someone has to reach out to the developers of all affected websites if they have to do something differently.

By the way, I cannot see the usage of transform at all on the linked Travador page. Where does it come from in the reduced test case?

You can search in DevTools by "transform: translateX" and it's there in one of navbar__dropdown.

IMO fixing it would be an interesting story, because fixing the bug from Chrome will break the affected websites (or any websites with jQuery Mobile and CSS transform). I still think mousemove shouldn't prevent selection change, and maybe we should let Chrome fix their behavior...

Kagami, do you think you had some time for this after the wellness week? Like thinking if there was some sane way to unbreak the websites?
If not, assign this to me :)

Severity: -- → S2
Flags: needinfo?(krosylight)
Priority: -- → P2

I will be off two weeks after the wellness week, so, sorry this is yours 😆

Assignee: nobody → bugs
Flags: needinfo?(krosylight)

I can't reproduce this on https://www.scm-shop.de/buecher/romane-erzaehlungen/historische-romane/buchset-die-meindorff-triologie.html
but can on https://www.travador.com/kategorie/oesterreich
Unfortunately the behavior on Chrome is totally nuts with the transform handling.

I can't reproduce this on https://www.scm-shop.de/buecher/romane-erzaehlungen/historische-romane/buchset-die-meindorff-triologie.html

I can also no longer reproduce the issue on this website. Maybe they changed something on their end? I changed the bug title to reflect the current situation.

Summary: Selecting text on <scm-shop.de> and <travador.com> no longer works → Selecting text on <travador.com> no longer works

(In reply to Kagami :saschanaz [off 28 June - 16 July] from comment #12)

I will be off two weeks after the wellness week, so, sorry this is yours 😆

As you are back and Olly left, can you take it? :)

Oh, thanks for the ping.

Like thinking if there was some sane way to unbreak the websites?

Since fixing the Chrome side issue (comment #7, comment #8) will also break those websites on it, my current guess is that the workaround would be a site intervention to make MouseEvent#preventDefalut as no-op.

(But before that we'll need to file a bug for the problematic library, which probably is jQuery Mobile here.)

Assignee: bugs → krosylight

Okay I have the patch for that library, but I doubt anyone will adopt it since the project seems very inactive and the last release was over 6 years ago.

At this state I think we should revert the preventDefault patch, what do you think? (Mirko will not be there for a while so I'm a bit hesitant.)

Flags: needinfo?(jstutte)

(In reply to Kagami :saschanaz from comment #18)

Okay I have the patch for that library, but I doubt anyone will adopt it since the project seems very inactive and the last release was over 6 years ago.

Yes, it seems jquery-mobile is pretty unmaintained at least since 2017, see https://blog.jquerymobile.com/2017/05/11/jquery-mobile-1-5-0-alpha-1-released/. This raises the question if we should take care of websites that still use it, apparently.

At this state I think we should revert the preventDefault patch, what do you think? (Mirko will not be there for a while so I'm a bit hesitant.)

IIUC, the patch of bug 1674658 intended to increase the compatibility with other browsers, even if it violates the spec. The spec issue there seems still open and also Google did not try to fix their related bug. I am slightly confused what would be the state of compatibility if we just reverted that patch.

Flags: needinfo?(jstutte) → needinfo?(annevk)

Given

  1. The discussion kagami has had in https://github.com/w3c/uievents/issues/278 that suggests Chrome might want to align with our previous behavior (of not allowing preventDefault()).
  2. Fixing bug 1674658 wasn't motivated by a particular website.
  3. Chrome's behavior around preventDefault() apparently depends on layout in complicated (indeed, likely buggy) ways.

I agree that we should revert our patch and once more encourage Chrome and Safari to follow us in the issue mentioned above.

Flags: needinfo?(annevk)

Hi Kagami, can you take care of this, please? Thank you!

Flags: needinfo?(krosylight)
Attachment #9233124 - Attachment description: Bug 1712339 - Revert bug 1674658 r=annevk,jdai,jstutte → Bug 1712339 - Remove mouse event default action and revert bug 1674658 r=annevk,jdai,jstutte
Flags: needinfo?(krosylight)
Pushed by krosylight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a290e6bee125
Remove mouse event default action and revert bug 1674658 r=annevk
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch

Is that something we want to uplift to 91 beta?

Flags: needinfo?(krosylight)

Comment on attachment 9233124 [details]
Bug 1712339 - Remove mouse event default action and revert bug 1674658 r=annevk,jdai,jstutte

Beta/Release Uplift Approval Request

  • User impact if declined: Users won't be able to select text by mouse on websites with jquery-mobile.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This only restores pre-88 behavior.
  • String changes made/needed:
Flags: needinfo?(krosylight)
Attachment #9233124 - Flags: approval-mozilla-release?
Attachment #9233124 - Flags: approval-mozilla-beta?
See Also: 1707925, 1714368

Comment on attachment 9233124 [details]
Bug 1712339 - Remove mouse event default action and revert bug 1674658 r=annevk,jdai,jstutte

Approved for 91 beta given the number of dupes, thanks.

Attachment #9233124 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Flags: qe-verify+
QA Whiteboard: [qa-triaged]

I managed to reproduce the issue using an older bersion of Nightly. I retested everything using Firefox 91.0n8 and Nightly 92.0a1 on macOS 10.15, Windows 10 x64 and Ubuntu 18.04 x64. The issue is not reproducing anymore.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Attachment #9233124 - Flags: approval-mozilla-release? → approval-mozilla-release-
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: