Closed Bug 1969829 Opened 8 months ago Closed 7 months ago

Blue overlay screen appears on top of the game during fullscreen and back on Gardens of Time game

Categories

(Core :: DOM: Selection, defect)

Firefox 139
Desktop
All
defect

Tracking

()

VERIFIED FIXED
141 Branch
Tracking Status
firefox-esr128 --- unaffected
firefox139 --- wontfix
firefox140 --- verified
firefox141 --- verified

People

(Reporter: will1212mart, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(9 files, 2 obsolete files)

1.78 MB, video/mp4
Details
162.91 KB, application/octet-stream
Details
121.88 KB, image/png
Details
2.93 MB, image/png
Details
335 bytes, text/html
Details
271 bytes, text/html
Details
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0

Steps to reproduce:

Steps to Reproduce:
Launch the game via Facebook in firefox browser (tested on Windows 10).
Proceed through any game play.
Enter fullscreen and come back.
Observe the screen.

Note: this is happening on build version 139.

Actual results:

Game enters fullscreen, but a blue overlay appears, partially covering gameplay content and after coming back to normal mode also the blue overlay still appears.

Expected results:

Game should enter fullscreen and back without any blue overlay or visual obstructions.

Group: firefox-core-security

The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Hi Team,
Just checking in to see if there are any updates regarding the issue I reported earlier (blue overlay during fullscreen). Please let me know if you need any additional information or if there's anything I can help with to assist the investigation.

Thanks!

Flags: needinfo?(jmathies)

This seems to be the same problem as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1969493 The other ticket is reported for Android, but the problem is more general with the Firefox 139 version.

Facebook WebGL games seems to exhibit this when entering full screen, and there is a Unity Forum discussion on this with a suggested workaround: https://discussions.unity.com/t/odd-issue-with-focus-in-firefox/1651226

From the thread: "Firefox wants to consider the canvas as selectable and as it goes into fullscreen, Firefox is erroneously thinking it should select the canvas element when you click on it."

I reproduced this on 139.0.1 (aarch64) on MacOS 15.5 (24F74).

Looks like a dev tools selector problem.

Component: Audio/Video: Playback → Console
Flags: needinfo?(jmathies)
Product: Core → DevTools

(In reply to Ru Cindrea from comment #3)

This seems to be the same problem as described in https://bugzilla.mozilla.org/show_bug.cgi?id=1969493 The other ticket is reported for Android, but the problem is more general with the Firefox 139 version.

Facebook WebGL games seems to exhibit this when entering full screen, and there is a Unity Forum discussion on this with a suggested workaround: https://discussions.unity.com/t/odd-issue-with-focus-in-firefox/1651226

From the thread: "Firefox wants to consider the canvas as selectable and as it goes into fullscreen, Firefox is erroneously thinking it should select the canvas element when you click on it."

I reproduced this on 139.0.1 (aarch64) on MacOS 15.5 (24F74).

Unfortunately I can't reproduce in 139 myself. Ru, could you run https://mozilla.github.io/mozregression/ to see if we can get a regression window?

Flags: needinfo?(ru.cindrea)

Bug 1954956 landed in 138 (and was uplifted to 137) and was about fullscreen, so maybe we should check that too

I ran the mozgression tool, I attached the full log and a screenshot with the results. Here is the last part:

2025-06-12T09:07:02.761000: INFO : Launching /private/var/folders/84/drkv10r94n79d07nls2hpb700000gn/T/tmp8i_7prex/Firefox Nightly.app/Contents/MacOS/firefox
2025-06-12T09:07:02.762000: INFO : Application command: /private/var/folders/84/drkv10r94n79d07nls2hpb700000gn/T/tmp8i_7prex/Firefox Nightly.app/Contents/MacOS/firefox https://redsclub.com/reds-arcade-testing/ -foreground -profile /var/folders/84/drkv10r94n79d07nls2hpb700000gn/T/tmp2lsb2s4q.mozrunner
2025-06-12T09:07:02.770000: INFO : application_buildid: 20250413073515
2025-06-12T09:07:02.770000: INFO : application_changeset: c9fadced05b5db792c315e810a145b4b2926797f
2025-06-12T09:07:02.770000: INFO : application_display_name: Firefox Nightly
2025-06-12T09:07:02.770000: INFO : application_id: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
2025-06-12T09:07:02.771000: INFO : application_name: Firefox
2025-06-12T09:07:02.771000: INFO : application_remotingname: firefox-default
2025-06-12T09:07:02.771000: INFO : application_repository: https://hg.mozilla.org/integration/autoland
2025-06-12T09:07:02.771000: INFO : application_vendor: Mozilla
2025-06-12T09:07:02.771000: INFO : application_version: 139.0a1
2025-06-12T09:07:02.771000: INFO : platform_buildid: 20250413073515
2025-06-12T09:07:02.771000: INFO : platform_changeset: c9fadced05b5db792c315e810a145b4b2926797f
2025-06-12T09:07:02.771000: INFO : platform_repository: https://hg.mozilla.org/integration/autoland
2025-06-12T09:07:02.771000: INFO : platform_version: 139.0a1
2025-06-12T09:07:40.041000: INFO : b'2025-06-12 09:07:40.040 firefox[48563:52267735] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.'
2025-06-12T09:08:08.940000: INFO : Narrowed integration regression window from [2a6769a4, ec51400e] (3 builds) to [c9fadced, ec51400e] (2 builds) (~1 steps left)
2025-06-12T09:08:08.946000: DEBUG : Starting merge handling...
2025-06-12T09:08:08.946000: DEBUG : Using url: https://hg.mozilla.org/integration/autoland/json-pushes?changeset=ec51400e8dd7aad3c1347c0746018224e20e5d80&full=1
2025-06-12T09:08:08.946000: DEBUG : redo: attempt 1/3
2025-06-12T09:08:08.946000: DEBUG : redo: retry: calling _default_get with args: ('https://hg.mozilla.org/integration/autoland/json-pushes?changeset=ec51400e8dd7aad3c1347c0746018224e20e5d80&full=1',), kwargs: {}, attempt #1
2025-06-12T09:08:08.948000: DEBUG : urllib3.connectionpool: Resetting dropped connection: hg.mozilla.org
2025-06-12T09:08:09.674000: DEBUG : urllib3.connectionpool: https://hg.mozilla.org:443 "GET /integration/autoland/json-pushes?changeset=ec51400e8dd7aad3c1347c0746018224e20e5d80&full=1 HTTP/11" 302 0
2025-06-12T09:08:11.113000: DEBUG : urllib3.connectionpool: https://hg-edge.mozilla.org:443 "GET /integration/autoland/json-pushes?changeset=ec51400e8dd7aad3c1347c0746018224e20e5d80&full=1 HTTP/11" 200 None
2025-06-12T09:08:11.118000: DEBUG : Found commit message:
Bug 1959780 - Make GetRangeForFrame() always return the inside range for non-replaced elements, not just blocks and editing hosts. r=masayuki

Otherwise you can't insert stuff in something like an empty
inline-block, there are tests for that luckily, yay.

Differential Revision: https://phabricator.services.mozilla.com/D245266

2025-06-12T09:08:11.119000: DEBUG : Did not find a branch, checking all integration branches
2025-06-12T09:08:11.123000: INFO : The bisection is done.
2025-06-12T09:08:11.124000: INFO : Stopped
Flags: needinfo?(ru.cindrea)
Attached file mozgression_full.log

Mozgression full log

Attached image mozgression_result.png

Thanks a lot Ru
So it looks like Bug 1959780 is causing the issue.
Can you tell me which website you're testing this on? https://lande-audio.itch.io/lunar-crash-defense ? Do you need to have DevTools opened to see the issue? Can you post detailed steps to reproduce so we can investigate ourselves?

Thanks again

Keywords: regression
Regressed by: 1959780

I have been testing this with an internal Facebook game, so I cannot share that link as it's not available publicly. But the original reporter was using Gardens of Time game on Facebook and I just tried it and was able to reproduce the problem with that one too.

So here are the steps:

  1. Go to https://apps.facebook.com/gardensoftime/
  2. Sign-in with Facebook if you're not already signed in.
  3. Go through the game tutorial up to the point where you are allowed to put the game in Full Screen mode from the top right corner button.
  4. Once game is in full-screen, click anywhere on the screen -> this causes the canvas to get selected and so the screen gets the blue tint all over it. As you are in full-screen mode, you are not able to click outside the canvas, so you cannot get rid of the blue tint.

I have tried with the game you shared (https://lande-audio.itch.io/lunar-crash-defense), but I can't reproduce it there.

:emilio, since you are the author of the regressor, bug 1959780, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Okay Thanks Ru, I did try with gardensoftime yesterday but couldn't reproduce for some reason, now I can see it
I'm attaching a screenshot of the page after triggering the issue, and then hitting Escape to exit fullscreen. We can indeed see that the canvas element is "selected" (my OS selection color is pink-ish , not blue like the one from the original reporter)
I'm reproducing without DevTools opened, and I don't think DevTools are involved here.

Component: Console → DOM: Selection
Product: DevTools → Core

I don't have a facebook account, would it be possible for someone to provide steps that don't require it? I'll look into borrowing one somehow... Last time I tried to create a throwaway account it got insta-closed.

Attached file simple test page (obsolete) —

Emilio, I think the attached page should reproduce. Click the fullscreen button, then when in fullscreen, click on the rect -> canvas gets selected

Attachment #9494276 - Attachment mime type: text/plain → text/html
Attached file Simple test page
Attachment #9494276 - Attachment is obsolete: true

Thanks! I can repro with that test-case. Masayuki, we're hitting this codepath extending the selection, even tho aFocusMode is kCollapseToNewPoint. That seems surprising to me?

Let me try adjusting that and see what breaks, but extending the selection when trying to collapse it seems backwards to me :)

Flags: needinfo?(masayuki)
Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attached file reduced test-case.

This doesn't need fullscreen or anything.

Set release status flags based on info from the regressing bug 1959780

Well, I don't understand what's going on. Why aContentEndOffset != aContentOffset? One of them is adjusted only for user-select style by the caller? If so, it's the caller's bug. The bug keeps staying even after applying your patch once Ctrl (or Command) is pressed at clicking the <canvas>.

Flags: needinfo?(masayuki)

So... canvas usually has user-select: none since bug 294852. But if fullscreen (or otherwise overridden to user-select: text) then this issue happens. I need to dig on why it doesn't happen on, e.g. a regular <img> element, it's indeed a bit surprising.

See Also: → 294852
See Also: → 1754459

Bug 1754459 is also relevant, and is the reason why we don't see this for non-draggable images...

Ok, so I think I have a low-risk fix to uplift.

Flags: needinfo?(emilio)
Attachment #9494283 - Attachment is obsolete: true
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/fd1e4fe85947 https://hg.mozilla.org/integration/autoland/rev/b47b552e50ed Non-editable <canvas> elements should use the frame edge for selection targetting. r=masayuki
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/53155 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

Comment on attachment 9494679 [details]
Bug 1969829 - Non-editable <canvas> elements should use the frame edge for selection targetting. r=masayuki,saschanaz

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: comment 0
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Matches images, very targetted fix.
  • String changes made/needed: none
  • Is Android affected?: Yes
Flags: needinfo?(emilio)
Attachment #9494679 - Flags: approval-mozilla-release?
Attachment #9494679 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9494679 [details]
Bug 1969829 - Non-editable <canvas> elements should use the frame edge for selection targetting. r=masayuki,saschanaz

Approved for 140.0 RC1
Rejecting release uplift request since we are in RC week for

Attachment #9494679 - Flags: approval-mozilla-release?
Attachment #9494679 - Flags: approval-mozilla-release-
Attachment #9494679 - Flags: approval-mozilla-beta?
Attachment #9494679 - Flags: approval-mozilla-beta+
QA Whiteboard: [uplift][qa-triage-done-c141/b140][qa-ver-needed-c141/b140]

I can't seem to reproducethe issue using the original game mentioned in comment 11: https://apps.facebook.com/gardensoftime/ .
The attached demo video shows that the game is interrupted (frozen for a few seconds, then it shows the interrupt message) when the user clicks the "Exit Full Screen (ESC)" button from the "Full Screen notification" displayed when entering Full Screen. The blue overlay issue appears to be somewhat linked with that interrupt.

The issue could only be reproduced using the Reduced Test Case from comment 19, in Nightly v141.0a1 from 2025-06-14 and Beta v140.0b9; The reduced test case behaved as followed:

  1. Clicking the green rectangle selects the rectangle.
  2. Clicking outside of the rectangle, selects the rectangle.

The fix is confirmed in Beta v140.0 (RC) and Nightly v141.0a1 from 2025-06-17. The reduced test case behaved as followed:

  1. Clicking the green rectangle, does NOT select it.
  2. Clicking outside the green rectangle, does select the green rectangle.
  3. Double-clicking the green rectangle, selects the green rectangle.

Assuming that the reduced test case behaves as expected, I can confirm this fix in Windows 10, MacOS 15 and Ubuntu 22.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift][qa-triage-done-c141/b140][qa-ver-needed-c141/b140] → [uplift][qa-triage-done-c141/b140][qa-ver-done-c141/b140]
Flags: qe-verify+
OS: Unspecified → All
Hardware: Unspecified → Desktop
Regressions: 1972967
Regressions: 1978673
https://github.com/mozilla-firefox/firefox/commit/f18a70c3608c https://hg.mozilla.org/releases/mozilla-beta/rev/1a1c782c259a Revert "Bug 1969829 - Remove now unnecessary user-select override on <canvas>. r=masayuki,dshin" for causing bug 1978673 a=backout Backed out of 142.0b5 for causing bug 1978673

As im not familiar with the behavior of each patch, not sure what to change the tracking flag to for 142. (not all patches were reverted)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: