Fwd: MutationObserver does not observe state changes

Meant for mailing list.

---------- Forwarded message ----------
From: Bradley Meck <bradley.meck@gmail.com>
Date: Wed, Jul 31, 2013 at 11:27 AM
Subject: Re: MutationObserver does not observe state changes
To: Anne van Kesteren <annevk@annevk.nl>


Maybe I am not understanding something after reading the forms last week
and a quick look through again today. Default value is not in question
here. The current value is mutable (
http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#a-form-control's-value).
The default value is set during initialization but the value may
change
over time.

There are some odd things in the spec like raw value, but I see nothing
that says the value attribute once changed still maps to the defaultValue
property. In "4.10.13 The textarea element" it goes so far as to explicitly
define the difference in value vs defaultValue.

Is there a reference to where the value attribute directly maps to the
defaultValue after mutation?


On Wed, Jul 31, 2013 at 11:07 AM, Anne van Kesteren <annevk@annevk.nl>
wrote:
>
> On Wed, Jul 31, 2013 at 4:50 PM, Bradley Meck <bradley.meck@gmail.com>
wrote:
> > For me if we can just get the mapped attributes that would be a win.
Right
> > now we have the ability to set but not read internal state using
attributes.
> > This leads to some confusion, because it makes attributes
uni-directional,
> > and not representative of state.
> >
> > http://jsfiddle.net/ZUMze/
>
> No, you are not understanding how the value attribute works. The value
> attribute is reflected by the defaultValue property. The value
> property is internal state, and will sometimes reflect the value
> attribute (because it happens to specify the default value).
>
> This also goes for the checked attribute. It's reflected by the
> defaultChecked property. I suggest studying the forms chapter of
> http://www.whatwg.org/html if you're interested in this.
>
>
> --
> http://annevankesteren.nl/

Received on Wednesday, 31 July 2013 16:29:07 UTC