Skip to content

Commit c7d98eb

Browse files
danae404calvaris
authored andcommitted
YouTube: Unable to move the volume slider by dragging after disabling Video Viewer
https://bugs.webkit.org/show_bug.cgi?id=276496 rdar://128587639 Reviewed by Eric Carlson. When entering fullscreen, we add a dragstart event listener to the window that we never remove. This makes it so that after we have exited fullscreen, the dragstart event listener is still active, and it has a side effect of making the elements on the page to be draggable. This is noticeable when the user is moving youtube's volume slider. Instead of this moving the knob on the slider, this drags an image of the slider. To fix this, we should remove the dragstart event listener on the window when we exit fullscreen. This will remove the event listener's side effect that is causing this bug. * Source/WebCore/Modules/modern-media-controls/controls/media-controls.js: (MediaControls.prototype.disable): (MediaControls): * Source/WebCore/Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype._updateControlsIfNeeded): Canonical link: https://commits.webkit.org/280873@main
1 parent 0dc5f2c commit c7d98eb

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Source/WebCore/Modules/modern-media-controls/controls/media-controls.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,10 @@ class MediaControls extends LayoutNode
248248
else
249249
super.commitProperty(propertyName);
250250
}
251+
252+
disable()
253+
{
254+
this.element.removeEventListener("focusin", this);
255+
window.removeEventListener("dragstart", this, true);
256+
}
251257
}

Source/WebCore/Modules/modern-media-controls/media/media-controller.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@ class MediaController
269269
supportingObject.disable();
270270
}
271271

272+
if (previousControls)
273+
previousControls.disable();
274+
272275
this.controls = new ControlsClass;
273276
this.controls.delegate = this;
274277

0 commit comments

Comments
 (0)