Closed Bug 2015488 Opened 7 days ago Closed 6 days ago

fullscreen img element missing backdrop

Categories

(Core :: Layout, defect)

Firefox 147
Desktop
Windows 11
defect

Tracking

()

VERIFIED FIXED
149 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox147 --- wontfix
firefox148 --- verified
firefox149 --- verified

People

(Reporter: eyalgruss, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

User Story

In an online gallery we use requestFullscreen on <img> to zoom the image to fullscreen. The recent change now leaks the underlaying page.

Attachments

(6 files)

Attached image bad.fs

Bug 2006998 removed ::backdrop on "things like a full-screen<input>, but that seems unlikely"...
well this breaks e.g. fullscreen <img> by leaking the background, and imho the assumption is not reasonable at all, as one could also imagine creative use of other leaf elements as a fullscreen element.

works in chromium.

example code: https://codepen.io/eyaler/pen/pvbQjYq

mozregression:
2026-02-09T15:58:17.353000: DEBUG : Found commit message:
Bug 2006998 - Avoid creating ::backdrop pseudo-elements for leaf frames. r=layout-reviewers,firefox-style-system-reviewers,dshin

This prevents special frames from having unexpected children. This
technically avoids having ::backdrop on things like a full-screen
<input>, but that seems unlikely and consistent with
::before / ::after / ::marker.

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

Attachment #9543558 - Attachment mime type: text/plain → image/png

Gah, sorry for missing this. FWIW I did because <img> is already sort-of-special (because it already supports rendering a shadow tree).

But that actually makes it rather easy to support. Other than image boxes, I think the remaining LEAF frames that are accessible to web content miscellaneous form controls (<input> / <progress> / etc).

Curious, I get that fullscreening an image is reasonable. I reckon you'd be fine with us not supporting the "fullscreening a textfield" use case? :)

Flags: needinfo?(eyalgruss)

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

Flags: needinfo?(emilio)

I guess <iframe> should also support this at the very least.

Assignee: nobody → emilio

thanks(In reply to Emilio Cobos Álvarez [:emilio] from comment #1)

Gah, sorry for missing this. FWIW I did because <img> is already sort-of-special (because it already supports rendering a shadow tree).

But that actually makes it rather easy to support. Other than image boxes, I think the remaining LEAF frames that are accessible to web content miscellaneous form controls (<input> / <progress> / etc).

Curious, I get that fullscreening an image is reasonable. I reckon you'd be fine with us not supporting the "fullscreening a textfield" use case? :)

thanks emilio!

i was not yet able to figure out exactly which elements (and under which conditions) are considered "leaf frames" in this context. is there an exhaustive list?

i am testing various elements and found that also <svg> and <textarea> seem to show the issue. also, people (me) some times use form controls to do weird stuff...

Yeah, <textarea> is expected. Currently all the ones that have LEAF in here would hit this.

Flags: needinfo?(emilio)

Only add exceptions for a few elements that do rely on their frame tree
size (mostly text controls). These are fixable but separate bug at the
very least.

Add reftests for <iframe> and <img>. Also, test all HTML elements in all
writing modes to ensure that they don't trigger assertions.

The <svg> case can't be easily reftested, afaict, because fullscreen
will change the size of the reftest window and <svg> doesn't support
popover.

This is the final week of beta for Fx148.
:emilio, there seems to be a few changes here. Will this be low risk for a beta uplift with little bake time?

Flags: needinfo?(emilio)

I plan to uplift only the first one.

Flags: needinfo?(emilio)
Attachment #9543644 - Attachment description: Bug 2015488 - Support backdrop on more elements. r=#layout → Bug 2015488 - Support backdrop on outer <svg> / <iframe> / <img>. r=#layout
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/57680 for changes under testing/web-platform/tests
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/27aaafd77890 https://hg.mozilla.org/integration/autoland/rev/173a24dd87f6 Add support for ::backdrop in <progress> / <input type=range>. r=layout-reviewers,dshin

Add exceptions for a few elements that do rely on their frame tree
size (mostly text controls). These are fixable but separate bug at the
very least.

Add reftests for <iframe> and <img>. Also, test all HTML elements in all
writing modes to ensure that they don't trigger assertions.

The <svg> case can't be easily reftested, afaict, because fullscreen
will change the size of the reftest window and <svg> doesn't support
popover.

Original Revision: https://phabricator.services.mozilla.com/D282451

Attachment #9544024 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Fixes regression introduced in 147.0.3
  • Code covered by automated testing: yes
  • Fix verified in Nightly: yes
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: Targetted fix restoring pre-regression behavior.
  • String changes made/needed: none
  • Is Android affected?: yes
Flags: qe-verify+
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bb530e526938 https://hg.mozilla.org/integration/autoland/rev/e2a8b6a85884 Add backdrop support for checkboxes and radio buttons. r=layout-reviewers,firefox-style-system-reviewers,dshin
QA Whiteboard: [uplift] [qa-ver-needed-c149/b148]
Attachment #9544024 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I was able to reproduce the issue on Win11x64 using Firefox build 147.0.3.
Verified as fixed on Win11x64 using Firefox build 149.0a1(20260210213212). Waiting for beta fix.

QA Contact: mchiorean
Upstream PR was closed without merging
Upstream PR was closed without merging

Verified as fixed on Win11x64 using Firefox build 148.0b14.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift] [qa-ver-needed-c149/b148] → [uplift] [qa-ver-done-c149/b148]
Flags: qe-verify+
Upstream PR merged by moz-wptsync-bot
Upstream PR was closed without merging
Flags: needinfo?(eyalgruss)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: