Closed Bug 1724759 Opened 5 years ago Closed 2 years ago

Firefox does not remove the active pseudo class from button once the button is pressed by a long tap, and then released

Categories

(Core :: Panning and Zooming, defect, P3)

defect

Tracking

()

RESOLVED FIXED
123 Branch
Tracking Status
firefox123 --- fixed

People

(Reporter: kbrosnan, Assigned: hiro)

References

Details

Attachments

(2 files, 1 obsolete file)

From github: https://github.com/mozilla-mobile/fenix/issues/20606.

Steps to reproduce

Below is some simple code to reproduce the behaviour.

The css used for the button:

.button {
background: white;
font-size: 40px;
font-weight: bold;
height: 100%;
width: 100%;
}

.button:active {
background-color: #f3f3f3;
color: black;
}

<div style="width: 100%;height: 100%">
<button class="button" >Button </button>
</div>

Expected behaviour

After pressing, holding and finally releasing the button, the background should return to white.

Actual behaviour

When the button is pressed, held and then released the button background colour remains #f3f3f3. That behaviour is present in Firefox on Android only, the Firefox for iOS works as expected.

Device name

Samsung S9, Google Pixel C tablet

Android version

10 on S9, 8.1.0 on Pixel C

Firefox release type

Firefox

Firefox version

90.1.3 on S9, 90.1.2 on Pixel C

Device logs

No response

Additional information

No response

Change performed by the Move to Bugzilla add-on.

Attached file 1724759.html β€”

It seems the behavior is same on Windows except that it opens an actual context menu. Since this is styling related:

Component: DOM: Events → Layout

Actually I guess it needs more investigation.

Component: Layout → DOM: Events
Flags: needinfo?(krosylight)

Chrome on Windows tend to (but somehow not always) remove the active state when the touch contact is removed and then opens a context menu, while Gecko always keeps the active state.

This is seemingly because EventStateManager::PostHandleEvent only calls ClearGlobalActiveContent on mouseup event and the long touch gesture does not fire a mouseup event but only contextmenu event.

Assignee: nobody → krosylight
Status: NEW → ASSIGNED

This now confuses me since Chrome behaves differently on Windows and Android.

On this example https://codepen.io/SaschaNaz/pen/ZEyGQPR (You can open arrow button->Console to read it on mobile):

  • On Windows, when holding touch contact on the button, Chrome keeps the active state, just as Firefox does.
  • On Android, Chrome clears the active state. The timing is unknown, it does not clear during the context menu event or right after it, but some unknown time after that. I'm not sure this is even intended.

:smaug, what do you think? I'm not sure what the patch should look like. Maybe I should file the issue on Chromium instead?

Flags: needinfo?(bugs)

I would expect active state to be cleared when touch is removed, at latest.

Does Chrome on Windows not clear the active state ever?

Flags: needinfo?(bugs)

(In reply to Olli Pettay [:smaug] from comment #7)

I would expect active state to be cleared when touch is removed, at latest.

Does Chrome on Windows not clear the active state ever?

It does but not after a touch hold (for 500+ ms I guess), which is exactly what this bug is about.

Attachment #9238076 - Attachment is obsolete: true

Unassigning myself from inactive bugs. Please retriage.

Assignee: krosylight → nobody
Severity: S3 → --
Status: ASSIGNED → NEW
Priority: P3 → --

Currently, it affects only for the pseudo-class. I think that we should give higher priority if this causes a web-compat issue in web apps in the wild.

Severity: -- → S3
OS: Android → All
Priority: -- → P3
Hardware: Unspecified → All
Summary: [Bug]: Firefox for Android does not remove the active pseudo class from button once the button is pressed, held for some time and then released → Firefox does not remove the active pseudo class from button once the button is pressed by a long tap, and then released
Duplicate of this bug: 1806400
Blocks: 1806400
No longer duplicate of this bug: 1806400

This is a sort of an APZ issue. On a touchend event;

So I would say that a proper fix is not to call SetSingleTapOccurred in the case of longpress events.

Oops, I forgot saying an important fact. We don't fire any click events on the longpress event case.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d738f187f15 Skip calling SetSingleTapOccurred for long-tap events. r=botond
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Regressions: 1873591
Component: DOM: Events → Panning and Zooming
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: