Closed
Bug 1005268
Opened 11 years ago
Closed 7 years ago
element.type returns "text" for input type month|week|datetime|datetime-local
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: markus.popp, Assigned: robwu)
References
(Depends on 1 open bug)
Details
Attachments
(2 files)
Input types month, week, datetime and datetime-local are supported on Firefox Android, including UI. Nevertheless, the element's type value returns "text" rather than the corresponding input type. Because of this, Firefox on Android misses out many points on various tests, like html5test.com and Modernizr.
I created a JSFiddle which extracts the test code of html5test.com:
http://jsfiddle.net/mpopp75/YWwC6/
On current Firefox/Android versions, this should return true.
Comment 1•11 years ago
|
||
Simplified testcase: http://jsfiddle.net/83puL/1/
![]() |
||
Comment 2•11 years ago
|
||
Where does this support live, exactly? Who added it?
kInputTypeTable doesn't contain those values (which is why .type doesn't returne them), so core Gecko knows nothing about this support.
![]() |
||
Comment 3•11 years ago
|
||
Looks like they're hacked in directly in the Android UI (see PromptInput.java)
In particular, I seriously doubt we do correct constraint validation for those input types, since that lives in core. All we have on Android is using a slightly better keyboard/UI, not actual support for these input types.
Comment 4•8 years ago
|
||
Starting with version 57 this bug now also is in the desktop version of firefox, this breaks workarounds for the still not implmented html5 input types. See the webshim bug: -> https://github.com/aFarkas/webshim/issues/592
![]() |
||
Comment 5•8 years ago
|
||
> this bug now also is in the desktop version of firefox
The desktop version of Firefox doesn't support the month/week/datetime/datetime-local types, so returning "text" is correct there. 57 didn't change anything in this regard.
The "date" and "time" types are supported, and report "date" and "time" respectively from .type.
So I don't see what the issue is on desktop: the .type correctly indicates support.
![]() |
||
Comment 6•8 years ago
|
||
> The "date" and "time" types are supported, and report "date" and "time" respectively from .type.
As of 57, that is. They were not supported on desktop in 56.
Comment 7•8 years ago
|
||
Just done a view tests which type is reported
- Firefox 52.6.0ESR -> text
- Firefox 53.0.3 -> text
- Firefox 54.0.1 -> text
- Firefox 55.0.3 -> text
- Firefox 56.0.2 -> text
- Firefox 57.0.4 -> text
- Firefox 58.0.2 -> text
You are right, it reported text as type in the previous versions
Assignee | ||
Comment 8•7 years ago
|
||
`<input type=datetime>` was dropped from the spec many years ago,
and is not supported by the platform. To JS code, it looks like a
regular text input box.
With removed support for "datetime" inputs, we can also fix a bug in the
InputWidgetHelper. Due to the use of getAttribute, if the attribute
value was capitalized, then the special date/time picker UI would not be
shown. This is corrected by using the "type" property instead.
I verified on Android Nougat that all other input types (date,
datetime-local, week, month, time) still work as intended.
Assignee | ||
Comment 9•7 years ago
|
||
The above patch depends on bug 1498787, because the patch modifies code that I touched in that other bug.
Assignee: nobody → rob
Status: NEW → ASSIGNED
Comment 10•7 years ago
|
||
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/f992e8a4e7e6
Remove "datetime" UI from Fennec and fix capitalization issue r=jchen
Comment 11•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•