Closed
Bug 1419316
Opened 7 years ago
Closed 7 years ago
Setting HTMLOutputElement.defaultValue makes it being reset to "" when it has childs and in default mode
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla59
Tracking | Status | |
---|---|---|
firefox59 | --- | fixed |
People
(Reporter: jdai, Assigned: jdai)
Details
Attachments
(1 file, 2 obsolete files)
There is a test failure at HTMLOutputElement.html[1][2][3].
[1] https://searchfox.org/mozilla-central/rev/919dce54f43356c22d6ff6b81c07ef412b1bf933/testing/web-platform/tests/custom-elements/reactions/HTMLOutputElement.html
[2] https://searchfox.org/mozilla-central/rev/919dce54f43356c22d6ff6b81c07ef412b1bf933/testing/web-platform/meta/custom-elements/reactions/HTMLOutputElement.html.ini
[3] custom-elements/reactions/HTMLOutputElement.html
Assignee | ||
Updated•7 years ago
|
Priority: -- → P2
Assignee | ||
Comment 1•7 years ago
|
||
Update [3] link: http://w3c-test.org/custom-elements/reactions/HTMLOutputElement.html
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jdai
Assignee | ||
Comment 2•7 years ago
|
||
We can't pass mDefaultValue[1] as a parameter, it'll be removed by nsContentUtils::SetNodeTextContent.
[1] https://searchfox.org/mozilla-central/rev/33c90c196bc405e628bc868a4f4ba29b992478c0/dom/html/HTMLOutputElement.cpp#153
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=fdd0327e4b34a013cd2c630d2e051240f1437260&filter-tier=1&group_state=expanded
Attachment #8931255 -
Flags: review?(bugs)
Comment 3•7 years ago
|
||
I am curious if we have some problem in https://searchfox.org/mozilla-central/rev/33c90c196bc405e628bc868a4f4ba29b992478c0/dom/html/HTMLOutputElement.cpp#62?
Comment 4•7 years ago
|
||
Comment on attachment 8931255 [details] [diff] [review]
Fix defaultValue on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element. r=smaug
Yeah, I think Reset has similar issue.
And please add some comment why mDefaultValue can't be passed. It is very much non-obvious. Had to look at the mutation observing methods.
Feel free to fix Reset (+ add a test) if needed in a separate bug.
Attachment #8931255 -
Flags: review?(bugs) → review+
Comment 5•7 years ago
|
||
We do enqueue disconnectedCallback for the removed custom element, this bug is more about the setting HTMLOutputElement.defaultValue is not handled correct.
No longer blocks: 1419295
Summary: DefaultValue on HTMLOutputElement must enqueue disconnectedCallback when removing a custom element → Setting HTMLOutputElement.defaultValue makes it being reset to "" when it has childs and in default mode
Comment 6•7 years ago
|
||
yeah, which is why reviewing took a bit time. Had to realize this isn't a custom element issue at all.
Assignee | ||
Comment 7•7 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #3)
> I am curious if we have some problem in
> https://searchfox.org/mozilla-central/rev/
> 33c90c196bc405e628bc868a4f4ba29b992478c0/dom/html/HTMLOutputElement.cpp#62?
It will not have similar issue, because per spec of reset algorithm[1] for output elements is to set the element's value mode flag to default and then to set the element's textContent IDL attribute to the value of the element's default value (thus replacing the element's child nodes). Therefore, the text node for default value should keep it and remove the element's child nodes.
[1] https://html.spec.whatwg.org/#the-output-element:concept-form-reset-control
(In reply to Olli Pettay [:smaug] (ni?s and f?s processed after r?s) from comment #4)
> Comment on attachment 8931255 [details] [diff] [review]
> Fix defaultValue on HTMLOutputElement must enqueue disconnectedCallback when
> removing a custom element. r=smaug
>
> Yeah, I think Reset has similar issue.
> And please add some comment why mDefaultValue can't be passed. It is very
> much non-obvious. Had to look at the mutation observing methods.
>
> Feel free to fix Reset (+ add a test) if needed in a separate bug.
I will add a reset testcase that also enqueue disconnectedCallback when removing a custom element. Thank you.
Comment 8•7 years ago
|
||
(In reply to John Dai[:jdai] from comment #7)
> It will not have similar issue
Spec has no problem with the reset algorithm, but our implementation has.
Consider this test: http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5597
The defaultValue is set to "" after reset steps in our implementation.
Assignee | ||
Comment 9•7 years ago
|
||
(In reply to Edgar Chen [:edgar] from comment #8)
> (In reply to John Dai[:jdai] from comment #7)
> > It will not have similar issue
>
> Spec has no problem with the reset algorithm, but our implementation has.
> Consider this test:
> http://software.hixie.ch/utilities/js/live-dom-viewer/saved/5597
> The defaultValue is set to "" after reset steps in our implementation.
I file bug 1422260 for this. Thank you.
Assignee | ||
Comment 10•7 years ago
|
||
Attachment #8931255 -
Attachment is obsolete: true
Attachment #8933590 -
Flags: review+
Assignee | ||
Comment 11•7 years ago
|
||
Address comment 4.
Attachment #8933590 -
Attachment is obsolete: true
Attachment #8933602 -
Flags: review+
Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Comment 12•7 years ago
|
||
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/63747de53588
Fix setting HTMLOutputElement.defaultValue makes it being reset to empty string when it has childs and in default mode. r=smaug
Keywords: checkin-needed
Comment 13•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox59:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in
before you can comment on or make changes to this bug.
Description
•