New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Media element never populates its UA shadow if it was initially created in a document without browsing context #2955
Conversation
| @@ -1153,6 +1150,9 @@ class HTMLMediaElement | |||
| bool m_shouldVideoPlaybackRequireUserGesture : 1; | |||
| bool m_volumeLocked : 1; | |||
|
|
|||
| enum class ControlsState { None, Initializing, Ready }; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify the width of uint8_t?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
…ed in a document without browsing context https://bugs.webkit.org/show_bug.cgi?id=222657 <rdar://problem/75266631> Reviewed by Eric Carlson. Previously, `HTMLMediaElement` relied on `didAddUserAgentShadowRoot` to call the JS `createControls` that actually populates the UA shadow root. This did not work with `adoptNode` because in that case the UA shadow root already existed and was already attached to the `<video>`, so it was not called. Rather than rely on this single path to set up everything, instead have a `ControlsState` enum that `HTMLMediaElement` can internally reason about to decide whether or not it needs to inject the JS that creates `createControls` and then call it. This also has the added benefit of having those two steps now be in the same place, whereas before they were split across two unrelated functions. * Source/WebCore/html/HTMLMediaElement.h: * Source/WebCore/html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::updateCaptionContainer): (WebCore::HTMLMediaElement::virtualHasPendingActivity const): (WebCore::HTMLMediaElement::configureTextTrackDisplay): (WebCore::HTMLMediaElement::updateTextTrackDisplay): (WebCore::HTMLMediaElement::updateTextTrackRepresentationImageIfNeeded): (WebCore::HTMLMediaElement::configureMediaControls): (WebCore::HTMLMediaElement::ensureMediaControls): Added. (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): (WebCore::HTMLMediaElement::ensureMediaControlsShadowRoot): Deleted. (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): Deleted. (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): Deleted. * LayoutTests/media/audio-controls-adoptNode.html: Added. * LayoutTests/media/audio-controls-adoptNode-expected.txt: Added. * LayoutTests/media/video-controls-adoptNode.html: Added. * LayoutTests/media/video-controls-adoptNode-expected.txt: Added. Canonical link: https://commits.webkit.org/253225@main
a0c48b5
to
f331cc9
Compare
|
Committed 253225@main (f331cc9): https://commits.webkit.org/253225@main Reviewed commits have been landed. Closing PR #2955 and removing active labels. |
f331cc9