[csswg-drafts] [resize-observer-1] Does the HTML or DOM or CSS specification own resize of <video> element? (#4266)

guest271314 has just created a new issue for https://github.com/w3c/csswg-drafts:

== [resize-observer-1] Does the HTML or DOM or CSS specification own resize of <video> element? ==
Background
--

**MDN [Window: resize event](https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event)**

> In some earlier browsers it was possible to register resize event handlers on any HTML element. It is still possible to set onresize attributes or use addEventListener() to set a handler on any element. However, resize events are only fired on the window object (i.e. returned by document.defaultView). Only handlers registered on the window object will receive resize events.
> 
> There is a proposal to allow all elements to be notified of resize changes. See [Resize Observer](https://wicg.github.io/ResizeObserver/) to read the draft document, and GitHub issues to read the on-going discussions.

**Specifications linked at MDN**

- https://www.w3.org/TR/2014/WD-DOM-Level-3-Events-20140925/#event-type-resize (**1** occurence of the text "resize")
- https://drafts.csswg.org/cssom/#event-type-resize (**0** occurence of the text "resize")

**Resize Observer https://drafts.csswg.org/resize-observer-1/**

> The ResizeObserver API is an interface for observing changes to Element’s size. It is an Element's counterpart to window.resize event.

Issue
--

Record video using `MediaRecorder` where the input pixel dimensions are variable at Chromium, Firefox and Nighlty browsers. For example input frames to the `MediaStream` being 

WidthxHeight
`768x576`
`480x240`
`640x360`
`400x300`
`1280x720`

Chromium browser (78) **does not** display correct pixel dimensions save for the first (initial) pixel dimensions when the WebM file recored at Chromium using `MediaRecorder` and VP8 or VP9 codecs is played back at HTML `<video>` element at Chromium (the same browser which output the WebM file) and **does not** dispatch `resize` event at the element save for the first pixel dimension being set from the default, initial dimensions of the `<video>` element.

The same WebM file output by Chromium browser **does** display correct pixel dimensions at Mozilla Firefox (68) and Nightly (70) browsers.

Mozilla Firefox and Nightly both display the correct pixel dimensions corresponding the variable width and height input frames.

Chromium **does** display correct variable pixel dimensions during playback and dispatch `resize` event **only** when the codec set at `MediaRecorder` options is H264 or AVC1.

It is not immediately clear which specification and implementation (`MediaRecorder`; `HTML`; `DOM`; `CSS`) owns the `resize` event and is responsible for HTML `<video>` element resizing during playback corresponding the potentially variable pixel dimensions encoded into the video;  and what specifically needs to be changed at the governing specification or standard and source code of Chromium browser for the expected result of HTML `<video>` element  displaying variable `width` and `height`, and to be notified by `ResizeObserver` when the underlying encoded pixel dimensions change during playback of the video.

Related issues
--

- https://bugs.chromium.org/p/chromium/issues/detail?id=972470
- https://bugs.chromium.org/p/chromium/issues/detail?id=983777

Question
--

Does the HTML or DOM or CSS specification own resize of HTML `<video>` element?


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4266 using your GitHub account

Received on Monday, 2 September 2019 14:45:31 UTC