Closed Bug 1665655 Opened 4 years ago Closed 1 year ago

<input type=tel> does not follow the HTML standard for directionality and :dir() pseudo-class

Categories

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

defect

Tracking

()

RESOLVED FIXED
109 Branch
Tracking Status
firefox82 --- wontfix
firefox109 --- fixed

People

(Reporter: zcorpan, Assigned: jfkthame)

References

Details

Attachments

(1 file)

Test: https://github.com/web-platform-tests/wpt/pull/25599

Firefox fails this test. It doesn't seem to implement this part of the spec:

If the element is an input element whose type attribute is in the Telephone state, and the dir attribute is not in a defined state (i.e. it is not present or has an invalid value)

The directionality of the element is 'ltr'.

https://html.spec.whatwg.org/multipage/dom.html#the-directionality

Here's a simpler demo: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=8479

<!DOCTYPE html>
<span dir=rtl>
 <input type=tel id=tel>
</span>
<script>
 w(tel.matches(':dir(ltr)') ? 'PASS' : 'FAIL');
</script>

Related code is SetDirectionFromValue I suspect...

Do you know out of curiosity what's the reasoning for making <input type=tel> special?

Component: Layout: Text and Fonts → DOM: Core & HTML

Also note this part of the Rendering section:

[dir]:dir(ltr), bdi:dir(ltr), input[type=tel i]:dir(ltr) { direction: ltr; }

https://html.spec.whatwg.org/multipage/rendering.html#bidi-rendering

I haven't written a wpt test for this, but it seems none of Gecko, WebKit, Chromium get this right. See demo: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/8485

Firefox fails this test. It doesn't seem to implement this part of the spec:

I'm seeing the same behavior on Blink and WebKit too, are we proposing a new change?

Severity: -- → S3

The spec change was from 2013, but it seems it hasn't been implemented yet.

I don't really know if it's the right place to fix this, but it looks like we can handle it in RecomputeDirectionality.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/37b80bf4bf5a
Implement the HTML spec special-case of directionality for <input type=tel>. r=emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/36989 for changes under testing/web-platform/tests

Backed out for causing multiple StyleSheet related failures

Backout link

Push with failures

Failure log
Failure log 2

This only seems to be happening on debug platform

Flags: needinfo?(jfkthame)
Upstream PR was closed without merging
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b8c51f8839e6
Implement the HTML spec special-case of directionality for <input type=tel>. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1801380
Flags: needinfo?(jfkthame)
Duplicate of this bug: 1780917
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: