> Like I said, the spec says checked="anything" means the checkbox is checked.

Expectation  when  using  new  Element()  is  that  underlying it is a
wrapped/emulated  DOM  method.  Whether you are internally calling DOM
dot-property or DOM setAttribute, however, is not clear.

·  Using  dot-property,  the  "one-value  value  list"  attrs  such as
`checked`  or  `disabled` are definitely to be exposed as booleans per
the DOM spec, although using dot-property at all is deprecated.

·  Using setAttribute('checked',...) is to be more of a dumb injection
of   the   string   value  as  it  would  appear  in  the  markup,  so
setAttribute('checked','checked')  would  be  the underlying logic *if
you  are specifying the value*.  However, setAttribute('checked',null)
is  deprecated!   You are supposed to use removeAttribute (or just not
set the attribute).

So  when you're given upper level abstraction offered by the framework
(just  passing a default attributes object in to the constructor), you
have  a  choice  between  two deprecated interpretations.  My personal
feeling  is  that  dot-property  is the clearest mechanism to emulate,
since  at  least  both  "directions"  are  obvious, but I could see an
argument for the other way.

-- Sandy

Reply via email to