Closed Bug 1620778 Opened 5 years ago Closed 5 years ago

Keyboard shortcuts Alt+↑, Alt+↓ should display the list without value increment/decrement (input type="number" with an associated datalist)

Categories

(Core :: Layout: Form Controls, enhancement)

74 Branch
Desktop
Windows 10
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox-esr68 --- unaffected
firefox73 --- unaffected
firefox74 --- wontfix
firefox75 --- wontfix
firefox76 --- fixed

People

(Reporter: alice0775, Assigned: emilio)

References

(Regressed 1 open bug, )

Details

(4 keywords)

Attachments

(1 file)

Steps to reproduce:

  1. Open http://jsbin.com/quluwijohe/1/edit
  2. Focus the field
  3. Keypress Alt+↑ or Alt+↓

Actual results:
The value increases and decreases, then suggestions display.

Expected results:
#1 If value is empty, all list should be shown without number increment/decrement.
ux-consistency: <input type="text" list="datalist">).
parity-chrome: Alt+↓ on Chrome).

#2 If value is not empty, adequate suggestions should be shown without number increment/decrement.

Is this a regression in 74? Possibly from bug 981248?

Flags: needinfo?(alice0775)

(In reply to :Gijs (he/him) from comment #1)

Is this a regression in 74? Possibly from bug ?

This is not a regression. I think this is an implementation bug.

The range in which the bug is reproduced:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=8e31404a73e9920d7d01411fc1a377d8940d9955&tochange=010bd182aff8707a95a53310a3e1234bbb8a15dd

Before landing of Bug 981248, <input type="number"> does not support list="datalist".
After landing of Bug 981248, this bug appears.

Flags: needinfo?(alice0775)
Blocks: 981248

Ok, I can poke.

Flags: needinfo?(emilio)

So, this is because of this line:

https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/dom/html/HTMLInputElement.cpp#3724

The nested text input is no longer a thing, but I can't just make it DefaultPrevented(). At first I thought to just prevent the edit action, but the edit action doesn't happen on the first place because of this line:

https://searchfox.org/mozilla-central/rev/557a0e222dd104c5d805ba344c45d6abc27d3db0/toolkit/components/satchel/nsFormFillController.cpp#1147

With autocomplete=off, I get the more expected:

#0  0x00007f8b6f2af6dc in mozilla::BaseEventFlags::PreventDefault(bool) (this=0x7ffc03d658c8, aCalledByDefaultHandler=true) at /home/emilio/src/moz/gecko/obj-debug/dist/include/mozilla/BasicEvents.h:201
#1  mozilla::WidgetEvent::PreventDefault(bool, nsIPrincipal*) (this=0x7ffc03d65890, aCalledByDefaultHandler=true, aPrincipal=<optimized out>) at /home/emilio/src/moz/gecko/widget/WidgetEventImpl.cpp:592
#2  0x00007f8b6e742e3e in mozilla::dom::Event::PreventDefaultInternal(bool, nsIPrincipal*) (this=0x7f8b58296980, aCalledByDefaultHandler=<optimized out>, aPrincipal=0x0) at /home/emilio/src/moz/gecko/dom/events/Event.cpp:401
#3  0x00007f8b6e7605c6 in mozilla::dom::Event::PreventDefault() (this=0x7f8b58296980) at /home/emilio/src/moz/gecko/dom/events/Event.cpp:369
#4  mozilla::KeyEventHandler::DispatchXBLCommand(mozilla::dom::EventTarget*, mozilla::dom::Event*) (this=<optimized out>, aTarget=<optimized out>, aEvent=0x7f8b58296980) at /home/emilio/src/moz/gecko/dom/events/KeyEventHandler.cpp:274
#5  0x00007f8b6e8aea75 in mozilla::TextInputListener::HandleEvent(mozilla::dom::Event*) (this=<optimized out>, aEvent=0x7f8b58296980) at /home/emilio/src/moz/gecko/dom/html/TextControlState.cpp:972
#6  0x00007f8b6e74af13 in mozilla::EventListenerManager::HandleEventSubType(mozilla::EventListenerManager::Listener*, mozilla::dom::Event*, mozilla::dom::EventTarget*)
    (this=0x7f8b593e07b0, aListener=<optimized out>, aDOMEvent=0x7f8b58296980, aCurrentTarget=0x7f8b569ed880) at /home/emilio/src/moz/gecko/dom/events/EventListenerManager.cpp:1079
#7  0x00007f8b6e74b5bc in mozilla::EventListenerManager::HandleEventInternal(nsPresContext*, mozilla::WidgetEvent*, mozilla::dom::Event**, mozilla::dom::EventTarget*, nsEventStatus*, bool)
    (this=<optimized out>, aPresContext=0x7f8b57d2ec00, aEvent=<optimized out>, aDOMEvent=<optimized out>, aCurrentTarget=0x7f8b569ed880, aEventStatus=0x7ffc03d65228, aItemInShadowTree=<optimized out>)
    at /home/emilio/src/moz/gecko/dom/events/EventListenerManager.cpp:1271
#8  0x00007f8b6e764760 in mozilla::EventTargetChainItem::HandleEvent(mozilla::EventChainPostVisitor&, mozilla::ELMCreationDetector&) (this=0x7f8b59377008, aVisitor=..., aCd=...)
    at /home/emilio/src/moz/gecko/dom/events/EventDispatcher.cpp:356
#9  0x00007f8b6e744b94 in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&)
    (aChain=..., aVisitor=..., aCallback=<optimized out>, aCd=...) at /home/emilio/src/moz/gecko/dom/events/EventDispatcher.cpp:558
#10 0x00007f8b6e74500b in mozilla::EventTargetChainItem::HandleEventTargetChain(nsTArray<mozilla::EventTargetChainItem>&, mozilla::EventChainPostVisitor&, mozilla::EventDispatchingCallback*, mozilla::ELMCreationDetector&)

That being said, I don't think that in the following test-case:

data:text/html,<input type=text autocomplete=off value=asdf><input type=text value=asdf>

Behavior of the up/down keys is expected to be different...

Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/00ab51ea2723 Fix interaction of up/down keys with autocomplete and <input type=number>. r=masayuki,smaug

Backed out changeset 00ab51ea2723 (Bug 1620778) for test_autocomplete_mac_caret.xhtml failures

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=db8b8c03eb6655382a4e9b8d2606993ab6ca295f&tochange=74668ef6e164f444c042355b94652e4e711c265e&selectedJob=292417098

Backout link: https://hg.mozilla.org/integration/autoland/rev/74668ef6e164f444c042355b94652e4e711c265e

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=292417098&repo=autoland&lineNumber=12658

[task 2020-03-10T10:08:23.405Z] 10:08:23     INFO - TEST-START | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml
[task 2020-03-10T10:08:23.472Z] 10:08:23     INFO - GECKO(2302) | [2302, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /builds/worker/checkouts/gecko/dom/base/nsContentUtils.cpp, line 3785
[task 2020-03-10T10:08:23.472Z] 10:08:23     INFO - TEST-INFO | started process screencapture
[task 2020-03-10T10:08:23.608Z] 10:08:23     INFO - TEST-INFO | screencapture: exit 0
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - TEST-UNEXPECTED-FAIL | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | no value up keypress event should not be fired - got true, expected false
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:383:14
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - checkKeyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:62:5
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - keyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:24:20
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:788:41
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - onload@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:1:11
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - callStackHandler@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:162:24
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | no value up selectionStart 
[task 2020-03-10T10:08:23.609Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | no value up selectionEnd 
[task 2020-03-10T10:08:23.610Z] 10:08:23     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-03-10T10:08:23.614Z] 10:08:23     INFO - TEST-UNEXPECTED-FAIL | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | no value down keypress event should not be fired - got true, expected false
[task 2020-03-10T10:08:23.614Z] 10:08:23     INFO - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:383:14
[task 2020-03-10T10:08:23.614Z] 10:08:23     INFO - checkKeyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:62:5
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - keyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:25:20
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:788:41
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - onload@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:1:11
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - callStackHandler@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:162:24
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | no value down selectionStart 
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | no value down selectionEnd 
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with caret in middle keypress event should be fired 
[task 2020-03-10T10:08:23.615Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with caret in middle selectionStart 
[task 2020-03-10T10:08:23.616Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with caret in middle selectionEnd 
[task 2020-03-10T10:08:23.616Z] 10:08:23     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-03-10T10:08:23.616Z] 10:08:23     INFO - TEST-UNEXPECTED-FAIL | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with caret in middle again keypress event should not be fired - got true, expected false
[task 2020-03-10T10:08:23.616Z] 10:08:23     INFO - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:383:14
[task 2020-03-10T10:08:23.616Z] 10:08:23     INFO - checkKeyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:62:5
[task 2020-03-10T10:08:23.617Z] 10:08:23     INFO - keyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:32:20
[task 2020-03-10T10:08:23.617Z] 10:08:23     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:788:41
[task 2020-03-10T10:08:23.617Z] 10:08:23     INFO - onload@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:1:11
[task 2020-03-10T10:08:23.617Z] 10:08:23     INFO - callStackHandler@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:162:24
[task 2020-03-10T10:08:23.617Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with caret in middle again selectionStart 
[task 2020-03-10T10:08:23.618Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with caret in middle again selectionEnd 
[task 2020-03-10T10:08:23.618Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with caret in middle keypress event should be fired 
[task 2020-03-10T10:08:23.618Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with caret in middle selectionStart 
[task 2020-03-10T10:08:23.618Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with caret in middle selectionEnd 
[task 2020-03-10T10:08:23.619Z] 10:08:23     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-03-10T10:08:23.619Z] 10:08:23     INFO - TEST-UNEXPECTED-FAIL | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with caret in middle again keypress event should not be fired - got true, expected false
[task 2020-03-10T10:08:23.619Z] 10:08:23     INFO - SimpleTest.is@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:383:14
[task 2020-03-10T10:08:23.619Z] 10:08:23     INFO - checkKeyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:62:5
[task 2020-03-10T10:08:23.619Z] 10:08:23     INFO - keyCaretTest@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:37:20
[task 2020-03-10T10:08:23.620Z] 10:08:23     INFO - setTimeout handler*SimpleTest_setTimeoutShim@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:788:41
[task 2020-03-10T10:08:23.620Z] 10:08:23     INFO - onload@chrome://mochitests/content/chrome/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml:1:11
[task 2020-03-10T10:08:23.620Z] 10:08:23     INFO - callStackHandler@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:162:24
[task 2020-03-10T10:08:23.620Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with caret in middle again selectionStart 
[task 2020-03-10T10:08:23.620Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with caret in middle again selectionEnd 
[task 2020-03-10T10:08:23.620Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with selection keypress event should be fired 
[task 2020-03-10T10:08:23.621Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with selection selectionStart 
[task 2020-03-10T10:08:23.621Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value up with selection selectionEnd 
[task 2020-03-10T10:08:23.621Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with selection keypress event should be fired 
[task 2020-03-10T10:08:23.622Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with selection selectionStart 
[task 2020-03-10T10:08:23.624Z] 10:08:23     INFO - TEST-PASS | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | value down with selection selectionEnd 
[task 2020-03-10T10:08:23.624Z] 10:08:23     INFO - GECKO(2302) | MEMORY STAT | vsize 7604MB | residentFast 362MB | heapAllocated 131MB
[task 2020-03-10T10:08:23.624Z] 10:08:23     INFO - TEST-OK | toolkit/content/tests/chrome/test_autocomplete_mac_caret.xhtml | took 150ms
Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/eda75d901f4c Fix interaction of up/down keys with autocomplete and <input type=number>. r=masayuki,smaug
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b8649ceb79c5 Fix interaction of up/down keys with autocomplete and <input type=number>. r=masayuki,smaug
Flags: needinfo?(emilio)
Regressions: 1622947
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

QA Whiteboard: [qa-76b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: