Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Cannot select multiple non-adjacent items in a multiple select contro…
…l with the keyboard only https://bugs.webkit.org/show_bug.cgi?id=15816 Patch by Pascal Jacquemart <p.jacquemart@samsung.com> on 2014-01-09 Reviewed by Chris Fleizach. Source/WebCore: Test: fast/forms/listbox-non-contiguous-keyboard-selection.html * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::HTMLSelectElement): New member m_allowsNonContiguousSelection defaults to false (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): Tracking CTRL modifier to start multiple non contiguous selection * html/HTMLSelectElement.h: New member m_allowsNonContiguousSelection (WebCore::HTMLSelectElement::allowsNonContiguousSelection): New getter * rendering/RenderListBox.cpp: (WebCore::RenderListBox::addFocusRingRects): Following implementation made for spatial navigation LayoutTests: * fast/forms/listbox-non-contiguous-keyboard-selection-expected.txt: Added. * fast/forms/listbox-non-contiguous-keyboard-selection.html: Added. * platform/mac/TestExpectations: Multiple non contiguous selection with keyboard not enabled on Mac Canonical link: https://commits.webkit.org/144580@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
3c54d38
commit a7231d79b025807f673868003da931d13b349309
Showing
8 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
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
@@ -0,0 +1,11 @@ | ||
<select> selection test for multiple but non contiguous selection with keyboard. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
1) Select multiple non-adjacent items with the keyboard | ||
PASS selectionPattern("sl1") is "01010" | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
description('<select> selection test for multiple but non contiguous selection with keyboard.'); | ||
|
||
function keyDownOnSelect(selId, identifier, modifier) { | ||
document.getElementById(selId).focus(); | ||
if (window.eventSender) | ||
eventSender.keyDown(identifier, [modifier]); | ||
} | ||
|
||
function createSelect(idName, sz, mlt, selIndex) { | ||
var sl = document.createElement("select"); | ||
var i = 0; | ||
sl.size = sz; | ||
while (i < sz) { | ||
var opt = document.createElement("option"); | ||
if (i == selIndex) | ||
opt.selected = true; | ||
opt.textContent = "item " + i; | ||
sl.appendChild(opt); | ||
i++; | ||
} | ||
sl.multiple = mlt; | ||
sl.id = idName; | ||
var parent = document.getElementById("parent"); | ||
parent.appendChild(sl); | ||
} | ||
|
||
function selectionPattern(selId) { | ||
var sl = document.getElementById(selId); | ||
var result = ''; | ||
for (var i = 0; i < sl.options.length; i++) | ||
result += sl.options[i].selected ? '1' : '0'; | ||
return result; | ||
} | ||
|
||
var parent = document.createElement('div'); | ||
parent.id = "parent"; | ||
document.body.appendChild(parent); | ||
|
||
createSelect("sl1", 5, true, -1); | ||
|
||
debug("1) Select multiple non-adjacent items with the keyboard"); | ||
// Move to second item. | ||
keyDownOnSelect("sl1", "downArrow", "addSelectionKey"); | ||
keyDownOnSelect("sl1", "downArrow", "addSelectionKey"); | ||
// Select it. | ||
keyDownOnSelect("sl1", " "); | ||
// Move to fourth item. | ||
keyDownOnSelect("sl1", "downArrow", "addSelectionKey"); | ||
keyDownOnSelect("sl1", "downArrow", "addSelectionKey"); | ||
// Select it. | ||
keyDownOnSelect("sl1", " "); | ||
shouldBe('selectionPattern("sl1")', '"01010"'); | ||
</script> | ||
<script src="../../resources/js-test-post.js"></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
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
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