Skip to content

Commit 22b825d

Browse files
committed
Merge branch 'eng/1400' into wpe-2.38
When I applied the suggested patch upstream I saw that there was some part of the code that was already upstream from another patch, so I backported both as part of the fix for this.
2 parents 0dc5f2c + 73f49fd commit 22b825d

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,4 +248,16 @@ 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+
}
257+
258+
reenable()
259+
{
260+
this.element.addEventListener("focusin", this);
261+
window.addEventListener("dragstart", this, true);
262+
}
251263
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ class MediaController
222222
deinitialize()
223223
{
224224
this.shadowRoot.removeChild(this.container);
225+
window.removeEventListener("keydown", this);
226+
if (this.controls)
227+
this.controls.disable();
225228
return true;
226229
}
227230

@@ -232,6 +235,9 @@ class MediaController
232235
this.mediaWeakRef = new WeakRef(media);
233236
this.host = host;
234237
shadowRoot.appendChild(this.container);
238+
window.addEventListener("keydown", this);
239+
if (this.controls)
240+
this.controls.reenable();
235241
return true;
236242
}
237243

@@ -269,6 +275,9 @@ class MediaController
269275
supportingObject.disable();
270276
}
271277

278+
if (previousControls)
279+
previousControls.disable();
280+
272281
this.controls = new ControlsClass;
273282
this.controls.delegate = this;
274283

0 commit comments

Comments
 (0)