This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 9529 - output element reset algorithm should set value mode flag to default _before_ setting textContent
Summary: output element reset algorithm should set value mode flag to default _before_...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-15 12:32 UTC by Mounir Lamouri
Modified: 2010-10-04 13:54 UTC (History)
5 users (show)

See Also:


Attachments

Description Mounir Lamouri 2010-04-15 12:32:08 UTC
At the moment, the output element reset algorithm has to set the textContent then it has to change the value mode flag to default.
It looks like it is to prevent setting the textContent to the defaultValue then the defaultValue to the textContent. Indeed, when in default mode, if an element descendant is changed, the defaultValue has to be set to the textContent.
However, by setting the textContent, the reset algorithm may fire a mutation event which can change the .value and change the mode to the value mode but the mode is changed just after to the default mode.

So we should set the mode to the default mode algorithm before setting textContent and let implementors prevent setting / getting the same value which is not harmful.
Comment 1 Ian 'Hixie' Hickson 2010-04-16 00:58:02 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.

Hopefully nobody will notice that now, while resetting, it's possible for the value mode flag to be in mode default but the contents of the element to be a value other than its default value...
Comment 2 contributor 2010-04-16 00:58:52 UTC
Checked in as WHATWG revision r5058.
Check-in comment: Tweak how things are defined for <output>'s reset algorithm so that it avoids confusion with respect to mutation events.
http://html5.org/tools/web-apps-tracker?from=5057&to=5058