Closed Bug 989061 Opened 10 years ago Closed 3 years ago

Checkbox not in DOM does not change state

Categories

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

27 Branch
x86_64
Windows 8.1
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: alexander.harding, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36

Steps to reproduce:

Insert the following code into the console:

el = document.createElement("input")
el.type = 'checkbox'
console.log("before: ", el.checked)
el.click()
console.log("after: ", el.checked)


Actual results:

Both console logs have the el.checked value of 'false'.


Expected results:

The second console log value should have been 'true'.

If I append this element to the DOM and then click it, it works fine.

The example code above works fine in Chrome and IE.
Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
It's not clear to me what, if anything, the spec says here...
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5

Our behavior has changed in the intervening years and now matches OP's expectations (and the HTML Standard).

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.