Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Select with multiple enabled does not consistently fire OnChange
https://bugs.webkit.org/show_bug.cgi?id=257565 Reviewed by Ryosuke Niwa. This patch aligns WebKit with Blink / Chromium and Gecko / Firefox. Partial Merge: https://src.chromium.org/viewvc/blink?view=revision&revision=164563 This patch adds logic for the case, when the listbox is scrollable to fire 'onChange' event when the selection is dropped outside of 'listbox'. * Source/WebCore/page/AutoscrollController.cpp: (AutoscrollController::startAutoscrollForSelection): As above * LayoutTests/fast/forms/select/multiselect-in-listbox-mouse-release-outside.html: Add Test Case * LayoutTests/fast/forms/select/multiselect-in-listbox-mouse-release-outside-expected.txt: Add Test Case Expectation * LayoutTests/platform/ios/TestExpectations: 'iOS' exception due to lack of 'listbox' appearance Canonical link: https://commits.webkit.org/264873@main
- Loading branch information
1 parent
e25dc49
commit 066cf30
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
LayoutTests/fast/forms/select/multiselect-in-listbox-mouse-release-outside-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,9 @@ | ||
should dispatch change event when mouse is released outside. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
50 changes: 50 additions & 0 deletions
50
LayoutTests/fast/forms/select/multiselect-in-listbox-mouse-release-outside.html
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,50 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<script src="../../../resources/js-test.js"></script> | ||
<select id="listBoxSelect" size="5" multiple="multiple"> | ||
<option value="option 1">Option 1</option> | ||
<option value="option 2">Option 2</option> | ||
<option value="option 3">Option 3</option> | ||
<option value="option 4">Option 4</option> | ||
<option value="option 5">Option 5</option> | ||
</select> | ||
<script> | ||
description('should dispatch change event when mouse is released outside.'); | ||
jsTestIsAsync = true; | ||
var select = document.getElementById('listBoxSelect'); | ||
select.onchange = function() { | ||
testPassed('A change event was dispatched.'); | ||
} | ||
|
||
window.onload = function() | ||
{ | ||
if (!window.eventSender) | ||
debug('Select listbox using mouse and release the mouse pointer outside the listbox. The test passes if "A change event was dispatched." is printed.'); | ||
else { | ||
var x = select.offsetLeft + 7; | ||
var y = select.offsetTop + 7; | ||
eventSender.dragMode = false; | ||
eventSender.mouseMoveTo(x, y); | ||
eventSender.mouseDown(); | ||
eventSender.mouseMoveTo(x, y + 20); | ||
eventSender.mouseMoveTo(x, y + 600); | ||
eventSender.mouseUp(); | ||
setTimeout(HorizontalTest, 100); | ||
} | ||
} | ||
function HorizontalTest() | ||
{ | ||
var x = select.offsetLeft + 7; | ||
var y = select.offsetTop + 7; | ||
eventSender.dragMode = false; | ||
eventSender.mouseMoveTo(x, y); | ||
eventSender.mouseDown(); | ||
eventSender.mouseMoveTo(x + 20, y); | ||
eventSender.mouseMoveTo(x + 600, y); | ||
eventSender.mouseUp(); | ||
finishJSTest(); | ||
} | ||
</script> | ||
</body> | ||
</html> |
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
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