Open Bug 1291193 Opened 8 years ago Updated 2 years ago

The input type="url" with datalist example in WHATWG spec does not use the value for matching

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

People

(Reporter: alice0775, Unassigned)

References

(Blocks 1 open bug, )

Details

(Keywords: parity-chrome, Whiteboard: DUPEME)

Attachments

(1 file)

The exsample in WHATWG spec does not work as expected <input type="url" name="location" list="urls" style="width:300px"> <datalist id="urls"> <option label="MIME: Format of Internet Message Bodies" value="https://tools.ietf.org/html/rfc2045"> <option label="HTML" value="https://html.spec.whatwg.org/"> <option label="DOM" value="https://dom.spec.whatwg.org/"> <option label="Fullscreen" value="https://fullscreen.spec.whatwg.org/"> <option label="Media Session" value="https://mediasession.spec.whatwg.org/"> <option label="The Single UNIX Specification, Version 3" value="http://www.unix.org/version3/"> </datalist> Steps to reproduce: 1. Open attached 2. Type spec.w Actual Results: Nothing is displayed Expected Results: Four URLs(match the input text) should be displayed Chrome Dev54 works as expected.
Summary: The exsample in WHATWG spec does not work as expected → The input type="url" with datalist exsample in WHATWG spec does not work as expected
Hi Jessica, do you know if we have implemented this feature yet or not?
Flags: needinfo?(jjong)
We do support list attribute in type=url, however, we use 'label' to match user's input and not 'value'. IMHO, the spec is a little bit ambiguous about this, in the example in [1], it is using 'value' to match user's input, but in [2], it says: "The user agent may use the suggestion's label to identify the suggestion if appropriate." I tested Chrome (52.0.2743.82) on Ubuntu, it uses 'value' to do the matching, but it has to be an exact match, typing 'spec.w' shows nothing. Am I doing anything wrong? [1] https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url) [2] https://html.spec.whatwg.org/multipage/forms.html#attr-input-list
Flags: needinfo?(jjong)
Sounds like Chrome is doing wrong here by using value and not label. And we do substring matching and Chrome uses prefix matching I think. Mounir, do you happen to know why Chrome does what it does? Does it just always ignore label?
Flags: needinfo?(mounir)
Blink's code says that it is using label and value because Firefox uses label and Edge uses value: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLInputElement.cpp?rcl=0&l=1601 The change was written in July 2016 so it might be in Chrome Dev. It should be in Chrome 54.
Flags: needinfo?(mounir)
Summary: The input type="url" with datalist exsample in WHATWG spec does not work as expected → The input type="url" with datalist example in WHATWG spec does not work as expected
So, is there anything we need to do here? Or should we file a spec bug to make things clearer?
Priority: -- → P2
(In reply to Jessica Jong [:jessica] from comment #6) > So, is there anything we need to do here? Or should we file a spec bug to > make things clearer? That's best, yes. Be sure to CC Anne. Thanks!
Flags: needinfo?(jjong)
Priority: P2 → P3
(In reply to Andrew Overholt [:overholt] from comment #7) > (In reply to Jessica Jong [:jessica] from comment #6) > > So, is there anything we need to do here? Or should we file a spec bug to > > make things clearer? > > That's best, yes. Be sure to CC Anne. Thanks! Filed https://github.com/whatwg/html/issues/1811. Keeping the NI for tracking.
A quick update, the spec [1] will be suggesting to use label and value to match the user's input. [1] https://github.com/whatwg/html/pull/1836
Flags: needinfo?(jessi3py)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: The input type="url" with datalist example in WHATWG spec does not work as expected → The input type="url" with datalist example in WHATWG spec does not use the value for matching
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Keywords: parity-chrome
Whiteboard: DUPEME,[parity-Chrome] → DUPEME,
Whiteboard: DUPEME, → DUPEME
Component: DOM → DOM: Core & HTML
Blocks: input-list
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: