Closed Bug 849438 Opened 12 years ago Closed 11 years ago

HTML <select> incremental search for item beginning with &nbsp; does not ignore the whitespace

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: sanduleac.dan, Assigned: mounir)

Details

Attachments

(2 files)

Attached file test.html
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130305164032

Steps to reproduce:

My bank uses some <select>s in its online authentication where all but the default option texts begin with a "&nbsp;", e.g. "&nbsp;a". 


Actual results:

Because of the &nbsp;, incremental search using the keyboard won't work (not even if I try to press space first). Possibly the designer wanted to indent the options using this trick, but this shouldn't prevent incremental selection from working.


Expected results:

Pressing a on the keyboard should select the option with the text "&nbsp;a". This behavior works in Chrome and Safari.
Attachment #723006 - Attachment mime type: text/plain → text/html
Which keyboard key do you use to earch?
Flags: needinfo?(sanduleac.dan)
I press 'a' and I'm expecting <option>&nbsp;a</option> to be selected.
Flags: needinfo?(sanduleac.dan)
I tried with IE9 on Win 7, same behavior as FF19.
Even if Chrome behaves differently, it doesn't mean it is the right way.

What does the spec say about that?
Could not select "a" from list by pressing "a" from keyboard for the testcase from comment 0 on Firefox 20.0 beta 3 (20130305164032), Chrome or Safari.
As it is supposed to search the beginning, and there is already an item starting with “P”, the question is whether space characters should be ignored completely, even if they can be used for search distinction.
Core → Layout or Tech Evangelism.
Component: Untriaged → Layout: Form Controls
Product: Firefox → Core
Summary: HTML <select> incremental search for item beginning with &nbsp; → HTML <select> incremental search for item beginning with &nbsp; does not ignore the whitespace
:Aleksej That is a good point. It's convenient, that's for sure, I don't really know what the standard says about it though.
: virgil it works as I mentioned on my version of Chrome, 25.0.1364.172 (Mac OS X 10.8.2), as well as Safari 6.0.2 (8536.26.17). All I do is load the page, press tab to focus the select, then press `a`, or `b`, and the item gets selected.
OS: Mac OS X → All
Hardware: x86 → All
Version: 20 Branch → Trunk
Attached patch PatchSplinter Review
Assignee: nobody → mounir
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #725612 - Flags: review?(bzbarsky)
Comment on attachment 725612 [details] [diff] [review]
Patch

>+    is(select.options[1].selected, true, "the secend option is selected");

"second"

r=me
Attachment #725612 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b2de9cc2f59
Flags: in-testsuite+
Target Milestone: --- → mozilla22
Backed out for B2G mochitest failures.
https://hg.mozilla.org/integration/mozilla-inbound/rev/7731f5947789

https://tbpl.mozilla.org/php/getParsedLog.php?id=20841801&tree=Mozilla-Inbound

13:01:07     INFO -  821 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/forms/test/test_listcontrol_search.html | Test timed out.
13:01:07     INFO -  822 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/forms/test/test_listcontrol_search.html | [SimpleTest.finish()] waitForFocus() was called a different number of times from the number of callbacks run.  Maybe the test terminated prematurely -- be sure to use SimpleTest.waitForExplicitFinish(). - got 1, expected 0
13:01:07     INFO -  823 INFO TEST-END | /tests/layout/forms/test/test_listcontrol_search.html | finished in 319748ms
Also:
https://tbpl.mozilla.org/php/getParsedLog.php?id=20842137&tree=Mozilla-Inbound

13:06:38     INFO -  25380 INFO TEST-START | /tests/docshell/test/navigation/test_bug344861.html
13:06:38     INFO -  25381 INFO Error: Unable to restore focus, expect failures and timeouts.
13:06:38     INFO -  creating 1!
13:06:38     INFO -  25382 ERROR TEST-UNEXPECTED-FAIL | /tests/docshell/test/navigation/test_bug344861.html | uncaught exception - TypeError: newwindow is null at http://mochi.test:8888/tests/docshell/test/navigation/test_bug344861.html:24
13:06:38     INFO -  25383 INFO TEST-END | /tests/docshell/test/navigation/test_bug344861.html | finished in 4773ms
(In reply to Ryan VanderMeulen [:RyanVM] from comment #12)
> Also:
> https://tbpl.mozilla.org/php/getParsedLog.php?id=20842137&tree=Mozilla-
> Inbound

This wasn't your push after all, coalescing just made it appear that way. Only comment 11 was from your push.
Sent a patch to try that exclude the test on B2G and Android because we do not implement <select> the same way on Mobile:
https://tbpl.mozilla.org/?tree=Try&rev=59fe1753563c
https://hg.mozilla.org/mozilla-central/rev/8a6271c71427
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Search in test.html still won't work.
Firefox 51.0.1, MacOS Sierra.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: