This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
http://dom.spec.whatwg.org/#interface-mutationobserver [[ If attributeOldValue is true and attributes is not true, throw a "SyntaxError". If attributeFilter is a non-empty array and attributes is not true, throw a "SyntaxError". If characterDataOldValue is true and characterData is not true, throw a "SyntaxError". ]] Why not consider that attributes is automatically set to true for the first two, and likewise characterData for the third? It's certainly what the developer meant, and it's less typing.
I do think we want { attributes: false, attributeOldValue: true } and { characterData: false, characterOldData: true } to both throw an exception. What we could do is to make the default value of attributes/characterData depend on the value of the *Old* properties though, rather than being statically set in the WebIDL.
Yeah, if attributes is not set and attributeOldValue or attributeFilter is set (true or false and any array), then attributes becomes implicitly true. Same with characterData
So a new model would look like: dictionary MutationObserverInit { boolean childList = false; boolean attributes; boolean characterData; boolean subtree = false; boolean attributeOldValue = false; boolean characterDataOldValue = false; sequence<DOMString> attributeFilter; }; * If options' attributeOldValue is true and options' attributes is omitted, set options' attributes to true. * If options' attributeFilter is present and options' attributes is omitted, set options' attributes to true. * If options' characterDataOldValue is true and options' characterData is omitted, set options' characterData to true. * If none of options' childList, attributes, and characterData is true, throw a TypeError. * If attributeOldValue is true and attributes is false, throw a TypeError. * If attributeFilter is a non-empty array and attributes is false, throw a TypeError. * If characterDataOldValue is true and characterData is false, throw a TypeError. (I also changed the exception to a JavaScript TypeError in our quest to more closely integrate with JavaScript.)
That LGTM.
I made a few more tweaks relative to comment 3. Only check for attributeFilter being present, rather than non-empty. Not have default values at all for the *OldValue members and check for their presence rather than checking if they are true when setting attributes/characterData to true. https://github.com/whatwg/dom/commit/a770b11981f4c147f98753cf726e44b14d17affc