Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't allow text selection to start on a HTMLMediaElement
Don't allow text selection to start on a HTMLMediaElement https://bugs.webkit.org/show_bug.cgi?id=249249 Reviewed by Ryosuke Niwa. This patch is to align Webkit with Blink / Chromium and Gecko / Firefox. Merge - https://src.chromium.org/viewvc/blink?revision=196741&view=revision This patch introduces a bool function with the return value of 'false' to disable text selection on media element controls. * Source/WebCore/html/HTMLMediaElement.h: Add 'bool' with return value of 'false' * LayoutTests/media/video-controls-start-selection.html: Add Test Case * LayoutTests/media/video-controls-start-selection-expected.txt: Add Test Case Expectation Canonical link: https://commits.webkit.org/257876@main
- Loading branch information
1 parent
0b8cd1e
commit 45eab14
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
LayoutTests/media/video-controls-start-selection-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
PASS document.getSelection().rangeCount is 0 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Start selection on video with controls | ||
|
||
Some text here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<script src="../resources/js-test.js"></script> | ||
<p>Start selection on video with controls</p> | ||
<video controls></video> | ||
<span>Some text here</span> | ||
<script> | ||
var video = document.querySelector('video'); | ||
var span = document.querySelector('span'); | ||
if (window.eventSender) { | ||
eventSender.mouseMoveTo(video.offsetLeft + video.offsetWidth / 2, video.offsetTop + video.offsetHeight / 2); | ||
eventSender.mouseDown(); | ||
eventSender.mouseMoveTo(span.offsetLeft + span.offsetWidth / 2, span.offsetTop + span.offsetHeight / 2); | ||
eventSender.mouseUp(); | ||
} | ||
shouldBe('document.getSelection().rangeCount', '0'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters