Closed
Bug 1365399
Opened 9 years ago
Closed 9 years ago
Option element constructor is not per spec
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla55
| Tracking | Status | |
|---|---|---|
| firefox55 | --- | fixed |
People
(Reporter: d, Assigned: jessica)
References
Details
Attachments
(1 file)
|
7.18 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
In particular it appears to handle defaultSelected incorrectly and sets dirtiness incorrectly. See test at http://w3c-test.org/html/semantics/forms/the-option-element/option-element-constructor.html and spec at https://html.spec.whatwg.org/#dom-option
This is probably related to (a dupe of?) https://bugzilla.mozilla.org/show_bug.cgi?id=1300282
Updated•9 years ago
|
Priority: -- → P2
| Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jjong
| Assignee | ||
Comment 1•9 years ago
|
||
Some of the work has been done in Bug 1365598.
This bug fixes this statement in the spec (https://html.spec.whatwg.org/#dom-option):
If selected is true, then set option's selectedness to true; otherwise set its
selectedness to false (even if defaultSelected is true).
And also reset the dirtiness.
This patch also reverts the changes in Bug 927796 and 942648, which was added
because IsSelected() returned inaccurately (called from SelectSomething()).
Verified that the tests added in Bug 927796 and 942648 do pass.
Attachment #8871643 -
Flags: review?(bugs)
Comment 2•9 years ago
|
||
Comment on attachment 8871643 [details] [diff] [review]
patch, v1.
So mSelectedChanged is used only by HTMLOptionElement::SetSelectedInternal now and checked in HTMLOptionElement::BeforeSetAttr
Attachment #8871643 -
Flags: review?(bugs) → review+
| Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 8871643 [details] [diff] [review]
> patch, v1.
>
> So mSelectedChanged is used only by HTMLOptionElement::SetSelectedInternal
> now and checked in HTMLOptionElement::BeforeSetAttr
Exactly, and cleared (set to false) in Option constructor (added in this patch) and in HTMLSelectElement::Reset.
| Assignee | ||
Comment 4•9 years ago
|
||
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/933ff638ea34
Handle selectedness and dirtiness correctly in Option constructor. r=smaug
Keywords: checkin-needed
Comment 6•9 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox55:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in
before you can comment on or make changes to this bug.
Description
•