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)
Tracking
()
| 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.
| Reporter | ||
Comment 1•5 years ago
|
||
It seems the behavior is same on Windows except that it opens an actual context menu. Since this is styling related:
Actually I guess it needs more investigation.
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.
Updated•4 years ago
|
Comment 6•4 years ago
•
|
||
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?
Comment 7•4 years ago
|
||
I would expect active state to be cleared when touch is removed, at latest.
Does Chrome on Windows not clear the active state ever?
(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.
Updated•4 years ago
|
Unassigning myself from inactive bugs. Please retriage.
Comment 10•4 years ago
|
||
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.
Updated•2 years ago
|
| Assignee | ||
Comment 12•2 years ago
|
||
This is a sort of an APZ issue. On a touchend event;
- APZ resets the active state if the touchend event wasn't for
click - Whether the touchend event was
clickis depending onaArgin APZEventState::ProcessAPZStateChange - The
aArgvalue come from SetSingleTapOccurred call in AsyncPanZoomController::GenerateSingleTap - The GenerateSingleTap is also called for longpress case not only for single-tap.
So I would say that a proper fix is not to call SetSingleTapOccurred in the case of longpress events.
| Assignee | ||
Comment 13•2 years ago
|
||
Oops, I forgot saying an important fact. We don't fire any click events on the longpress event case.
| Assignee | ||
Comment 14•2 years ago
|
||
Updated•2 years ago
|
Comment 15•2 years ago
|
||
Comment 16•2 years ago
|
||
| bugherder | ||
Updated•2 years ago
|
Description
•