Closed Bug 1537689 Opened 5 years ago Closed 3 years ago

HTML output element default value

Categories

(Core :: DOM: Forms, defect, P3)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- wontfix
firefox90 --- fixed

People

(Reporter: mori79, Assigned: emilio)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36

Steps to reproduce:

It seems that Firefox doesn't understand HTMLOutputElement.defaultValue:
console.log(document.getElementById('output').defaultValue);
<output id="output">60</output>
More info: https://stackoverflow.com/questions/55263957/html-output-element-default-value-in-firefox

Actual results:

It shows an empty string.

Expected results:

It should show 60.

Hi @Mori, I've tested this issue and here is my result after that:
[Platforms affected]: Windows 10, Mac OS X, Ubuntu 16.04
[Firefox versions affected]: latest nightly 68.0a1, beta 67.0b4 and release 66.0.1
=> on all machines and Firefox versions the issue can be reproduced. An empty string is parsed after clicking on the "Reset" button.
Additionally, it could be duplicate of 1422260.

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → Desktop
Version: 65 Branch → Trunk
Priority: -- → P3

John, given bug 1422260, could you take a look at this. Should be some simple tweak somewhere.

Flags: needinfo?(jdai)

Sure, I'm going to work on this. :)

Assignee: nobody → jdai
Status: NEW → ASSIGNED
Flags: needinfo?(jdai)

I use comment0 as test case to test other browsers, it turns out Firefox(65.0.1) and Safari(12.0.3) have the same issue which is defaultValue is missing, but Chrome(72.0.3626.121) and Edge(17.17134) doesn't have this issue.

Worth to check then what the spec says :)

(In reply to Olli Pettay [:smaug] from comment #5)

Worth to check then what the spec says :)

Here is the spec said[1]. After clarifying by Anne, we should follow output.defaultValue as the spec said which expects the same result as Chrome.

[1] https://html.spec.whatwg.org/multipage/form-elements.html#concept-output-defaultvalue

Before sending the patch to review, there is an open issue for the output element's default value[1] that we need to consider.

[1] https://github.com/whatwg/html/issues/4163

Has STR: --- → yes
Assignee: jdai → nobody
Status: ASSIGNED → NEW

John, care to pick this up again? The specification has been clarified.

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2835 is another test from bug 975527.

Flags: needinfo?(jdai)
Blocks: 1422260
Component: DOM: Core & HTML → DOM: Forms

Yes, I will take a look. Keep NI for tracking.

Assignee: nobody → emilio
Flags: needinfo?(emilio)

The patch looks good and matches the spec, any reason not to land it?

Flags: needinfo?(emilio) → needinfo?(jdai)

I will s(In reply to Emilio Cobos Álvarez (:emilio) from comment #13)

The patch looks good and matches the spec, any reason not to land it?

Thank you for reminding me. I will land it soon.

Flags: needinfo?(jdai)
Pushed by jdai@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/df09780eb6be
Fix HTML output element default value is absent; r=emilio DONTBUILD
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/28957 for changes under testing/web-platform/tests
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: