gProtectionsHandler onClick does not work due to bubbling
Categories
(Firefox :: Protections UI, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox-esr128 | --- | unaffected |
firefox129 | --- | unaffected |
firefox130 | + | verified |
firefox131 | + | verified |
People
(Reporter: tschuster, Assigned: tschuster)
References
(Regressed 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
Details | Review |
onClick reacts to specific id
s, but if somone clicks on children elements of those elements it might not work? I need to test this.
Comment 1•2 months ago
|
||
Set release status flags based on info from the regressing bug 1904798
Comment 2•2 months ago
|
||
Hi, could you please verify this Paul, I think its because HTML onClicks are not allowed and EventListener would be need instead.
Comment 3•2 months ago
|
||
This could only break if we changed the element on which we added the handler and passed the event along to some existing function, right? Looking at https://searchfox.org/mozilla-central/rev/b1b87f95ecea00828298d1b3cd3d8718f9fcc3fc/browser/base/content/browser-siteProtections.js#2043-2053 we only do this for onHeaderClicked
which passes things to https://searchfox.org/mozilla-central/rev/b1b87f95ecea00828298d1b3cd3d8718f9fcc3fc/browser/base/content/browser-siteProtections.js#1782 which eventually passes it as triggerEvent
to PanelMultiView.openPopup
which won't care about the exact target ID, only about whether it was a click or keypress that triggered opening a panel.
So I think we're fine? I also audited the other patches in bug 1904798 and I think they're all good. But maybe I'm missing something?
Assignee | ||
Comment 4•2 months ago
|
||
So, I think the problem is the following:
- The user clicks on "Site information for example.com" (
<html:span id="protections-popup-mainView-panel-header-span"/>
) - The
onClick
function runs - The
event.target.id
isprotections-popup-mainView-panel-header-span
, so the case forprotections-popup-mainView-panel-header
doesn't match - Thus
onHeaderClicked
doesn't run
Comment 5•2 months ago
|
||
I can reproduce the issue
STR:
- Visit example.com
- open the protections panel
- Toggle ETP off or on
- When the toast appears click it
Expected:
The protections panel opens
Actual: The toast disappears after a while but the protections panel does not open.
Comment 6•2 months ago
|
||
Tom since you're the author of the regressing bug, would you like to take this one?
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 7•2 months ago
|
||
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Comment 10•2 months ago
|
||
[Tracking Requested - why for this release]: Broken UI interactions.
Comment 11•2 months ago
|
||
bugherder |
Comment 12•2 months ago
|
||
FYI, we build beta8 tomorrow, so an uplift request soon would be appreciated!
Assignee | ||
Comment 13•2 months ago
|
||
Comment on attachment 9419580 [details]
Bug 1912405 - Use individual event listeners for gProtectionsHandler click handlers. r?pbz,Gijs
Beta/Release Uplift Approval Request
- User impact if declined: Some UI interactions with the protections menu (the shield icon in the URL bar) would be broken
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See https://bugzilla.mozilla.org/show_bug.cgi?id=1912405#c5
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): The new code is simpler and closer to the original code
- String changes made/needed:
- Is Android affected?: No
Assignee | ||
Updated•2 months ago
|
Assignee | ||
Updated•2 months ago
|
Comment 14•2 months ago
|
||
Comment on attachment 9419580 [details]
Bug 1912405 - Use individual event listeners for gProtectionsHandler click handlers. r?pbz,Gijs
Approved for 130.0b8.
Updated•2 months ago
|
Comment 15•2 months ago
|
||
uplift |
Updated•2 months ago
|
Assignee | ||
Comment 16•2 months ago
|
||
Assignee | ||
Updated•2 months ago
|
Comment hidden (obsolete) |
Comment 18•2 months ago
|
||
Comment 19•2 months ago
|
||
Reproduced this issue on an affected nightly build from 2024-08-09, on Win 10 using the STR from Comment 5.
Verified as fixed on Firefox Nightly 131.0a1 (20240820214025) and Beta 130.0b8 (20240821091813) on Win 10, macOS 11 and Ubuntu 22.04. The protection panel opens when clicking the toast.
Comment 20•2 months ago
|
||
bugherder |
Updated•2 months ago
|
Comment 21•2 months ago
|
||
uplift |
Description
•