RESOLVED FIXED Bug 182668
Removing the controls attribute from a <video> element does not tear down the controls shadow DOM nor cancel event listeners.
https://bugs.webkit.org/show_bug.cgi?id=182668
Summary Removing the controls attribute from a <video> element does not tear down the...
Jer Noble
Reported 2018-02-09 22:12:04 PST
Removing the controls attribute from a <video> element does not tear down the controls shadow DOM nor cancel event listeners.
Attachments
Patch (38.58 KB, patch)
2018-02-09 22:17 PST, Jer Noble
no flags
Patch (46.85 KB, patch)
2018-02-09 22:53 PST, Jer Noble
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (2.63 MB, application/zip)
2018-02-09 23:58 PST, EWS Watchlist
no flags
Patch (47.60 KB, patch)
2018-02-12 09:32 PST, Jer Noble
no flags
Patch (28.19 KB, patch)
2018-02-13 16:47 PST, Antoine Quint
jer.noble: review+
Jer Noble
Comment 1 2018-02-09 22:12:41 PST
Jer Noble
Comment 2 2018-02-09 22:17:49 PST
Jer Noble
Comment 3 2018-02-09 22:53:44 PST
EWS Watchlist
Comment 4 2018-02-09 23:58:45 PST
Comment on attachment 333554 [details] Patch Attachment 333554 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/6443628 New failing tests: http/tests/contentextensions/text-track-blocked.html
EWS Watchlist
Comment 5 2018-02-09 23:58:46 PST
Created attachment 333555 [details] Archive of layout-test-results from ews106 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Antoine Quint
Comment 6 2018-02-10 01:35:23 PST
So, we already do the right thing when entering or exiting fullscreen on iOS: _updateiOSFullscreenProperties() { // On iOS, we want to make sure not to update controls when we're in fullscreen since the UI // will be completely invisible. if (!(this.layoutTraits & LayoutTraits.iOS)) return; const isFullscreen = this.isFullscreen; if (isFullscreen) this._supportingObjects.forEach(supportingObject => supportingObject.disable()); else this._supportingObjects.forEach(supportingObject => supportingObject.enable()); this.controls.visible = !isFullscreen; } Sounds to me like we could extend this to dealing with changes to the controls attribute as well. Setting .visible on the controls will not remove the controls element itself but will prevent any content from being added to its subtree and so the shadow root will be mostly empty.
Jer Noble
Comment 7 2018-02-10 07:18:02 PST
> Sounds to me like we could extend this to dealing with changes to the > controls attribute as well. Setting .visible on the controls will not remove > the controls element itself but will prevent any content from being added to > its subtree and so the shadow root will be mostly empty. It’s a bigger issue than that; we set up all the controls and listeners and repaint timers even when there’s just a visible text track, and the media element never had the controls attribute in the first place. Though we should definitely disable all the listeners when the controls are invisible, but that is a separate bug.
Jer Noble
Comment 8 2018-02-12 09:32:06 PST
Antoine Quint
Comment 9 2018-02-12 15:46:47 PST
There were some issues with Jer's patch, specifically LTR state wouldn't be preserved when turning controls back on and the AirPlay and PiP placards wouldn't be displayed. I have a patch coming up that addresses the reported issues and preserves LTR and placards.
Antoine Quint
Comment 10 2018-02-13 16:47:23 PST
Jer Noble
Comment 11 2018-02-13 17:07:08 PST
Comment on attachment 333745 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=333745&action=review Do we have a test for verifying that the AirPlay plackard is shown when initiating remote playback from a media element without a controls attribute? > Source/WebCore/Modules/modern-media-controls/media/placard-support.js:51 > + if (this.mediaController.isFullscreen) Does this need an iOS check? Presumably we still want the placards in Mac full screen?
Antoine Quint
Comment 12 2018-02-13 17:09:20 PST
(In reply to Jer Noble from comment #11) > Comment on attachment 333745 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=333745&action=review > > Do we have a test for verifying that the AirPlay plackard is shown when > initiating remote playback from a media element without a controls attribute? > > > Source/WebCore/Modules/modern-media-controls/media/placard-support.js:51 > > + if (this.mediaController.isFullscreen) > > Does this need an iOS check? Presumably we still want the placards in Mac > full screen? This code wouldn't be called on macOS fullscreen since controls will be forced in that scenario.
Antoine Quint
Comment 13 2018-02-13 17:36:27 PST
Antoine Quint
Comment 14 2018-02-15 05:56:29 PST
This caused a regression on iOS where controls were no longer disabled while in fullscreen, see https://bugs.webkit.org/show_bug.cgi?id=182830. EWS didn't catch the failure but internal bots did since the test for this behaviour only runs internally due to usage of touch events.
Antoine Quint
Comment 15 2018-02-22 22:03:17 PST
Note You need to log in before you can comment on or make changes to this bug.