Closed Bug 1683979 Opened 3 years ago Closed 3 years ago

audio element not rendered correctly

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

Firefox 84
Desktop
All
defect

Tracking

()

RESOLVED FIXED
86 Branch
Tracking Status
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- fixed

People

(Reporter: exekutive, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

visit a web page containing embedded audio
(<audio src="......)
a width is not explicitly coded

example:
https://carkiller.com/scottykilmer/qa/jeep-wrangler/#post-32602

Actual results:

unable to play the audio. Controls not visible. Only a small rectangle.

Expected results:

the embedded audio should be presented in such a way that it can be used ie. render the controls. The correct behaviour can be seen in Chrome and Safari browsers.

https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2020-12-17-14-27-16-8240a6.png
https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2020-12-17-14-27-12-60190c.png
https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2020-12-17-14-27-07-554838.png

Hello I have managed to reproduce the issue using the STR provided in the description with Firefox 84.0, 85.0b4 and 86.0a1(12-28-2020) on Windows 10, Ubuntu 20 and on macOS 10.15.7.
I will add a component to this issue so one of our developers could look more into it. If it's not the right component please feel free to change it to an appropriate one.

Status: UNCONFIRMED → NEW
Component: Untriaged → Audio/Video: Playback
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → Desktop
Attached file reduced.html

Audio works well on the page if you play that audio element directly, so this seems to me a CSS problem.

Component: Audio/Video: Playback → DOM: CSS Object Model

You can fix this removing the audio { max-width: 99% } rule, fwiw.

Assignee: nobody → emilio
Component: DOM: CSS Object Model → Layout: Images, Video, and HTML Frames

Otherwise the adjustments that the video controls do in response to
size changes affect the size itself, which can cause cyclic layout.

Does this help with the testcase in bug 1619247, out of curiosity?

See Also: → 1619247

A bit of a tangent:

I noticed that percent sizes seem to force the audio element to have a 0-size in Chrome, for some reason (if it's in an intrinsically-sized container). At first I thought that might have something to do with the "compressible" concept, in the spirit of bug 1585485 , but it's not behaving quite that way (in either Chrome or in Firefox) so I don't think either browser is applying quite the same logic as they do for "compressible" stuff.

Here are two testcases, which I think should behave roughly the same as each other (aside from the fact that input and audio have different intrinsic sizes and hence will prop up their container to a somewhat different extent):
audio: https://jsfiddle.net/dholbert/n63qyfb5/
input: https://jsfiddle.net/dholbert/kz7u5yf3/

Firefox Nightly and Chrome agree with each other on the input testcase, but they don't agree on the audio testcase, particularly its second line, "Percent-width, intrinsically sized container" -- and neither browser's behavior on that line agrees with the analogous line in the <input> testcase.

It feels like we should be internally consistent on that second line -- i.e. that audio elements should behave the same way as input elements in these scenarios. They feel similarly-"compressible" to <input> textfields, in that they have a relatively large min-content size, which is the same as their max-content size, and they are also OK being rendered to sizes smaller than that while handling/avoiding overflowing content on their own. So intuitively, I might expect them to behave the same, sizing-wise, under the conditions relevant to "compressible"-ness.

Anyway, that's outside the scope of this bug; but I am curious if the patch changes our behavior on this audio jsfiddle testcase.

Attachment #9195296 - Attachment description: Bug 1683979 - Audio min / pref isize should be fixed. r=dholbert,#layout → Bug 1683979 - Audio min / pref isize should not depend the controls. r=dholbert,#layout

(In reply to Daniel Holbert [:dholbert] from comment #6)

Does this help with the testcase in bug 1619247, out of curiosity?

This fixes bug 1619247 too, looks like.

(In reply to Daniel Holbert [:dholbert] from comment #7)

Anyway, that's outside the scope of this bug; but I am curious if the patch changes our behavior on this audio jsfiddle testcase.

It doesn't, afaict.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6ffa3734156
Audio min / pref isize should not depend the controls. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27052 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: