[Bug 29151] Clarify if assigning wrong enumeration value to an attribute should throw

# bugzilla at jessica.w3.org (2 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=29151

--- Comment #1 from Christophe Dumez dchris@gmail.com ---

I work on WebKit and looking at our ECMAScript bindings, it seems that we behave as indicated in the Note: """ Note In the ECMAScript binding, assignment of an invalid string value to an attribute is ignored, while passing such a value as an operation argument results in an exception being thrown. """

Contact us to advertise here
# bugzilla at jessica.w3.org (2 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=29151

Boris Zbarsky bzbarsky@mit.edu changed:

       What    |Removed                     |Added

             CC|                            |bzbarsky@mit.edu

--- Comment #2 from Boris Zbarsky bzbarsky@mit.edu ---

This behavior is specified in heycam.github.io/webidl/#dfn-attribute-setter step 4 which doesn't invoke heycam.github.io/webidl/#es-enumeration at all but instead uses a slightly different algorithm. So heycam.github.io/webidl/#es-enumeration is only invoked for operation arguments, dictionary members, sequence members, and so forth.

I agree that it's a bit confusing to do it that way, but it avoids the problem of saying in heycam.github.io/webidl/#es-enumeration that the behavior depends on "where it's called from", which is a bit hard to define precisely.

# bugzilla at jessica.w3.org (2 years ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=29151

--- Comment #3 from Christophe Dumez dchris@gmail.com --- (In reply to Boris Zbarsky from comment #2)

This behavior is specified in heycam.github.io/webidl/#dfn-attribute-setter step 4 which doesn't invoke heycam.github.io/webidl/#es-enumeration at all but instead uses a slightly different algorithm. So heycam.github.io/webidl/#es-enumeration is only invoked for operation arguments, dictionary members, sequence members, and so forth.

I agree that it's a bit confusing to do it that way, but it avoids the problem of saying in heycam.github.io/webidl/#es-enumeration that the behavior depends on "where it's called from", which is a bit hard to define precisely.

Ok, thank you. I assumed there was something I missed in the spec what I wanted to confirm. I think it is fine to leave as is then.

# bugzilla at jessica.w3.org (7 months ago)

www.w3.org/Bugs/Public/show_bug.cgi?id=29151

Domenic Denicola d@domenic.me changed:

       What    |Removed                     |Added

         Status|NEW                         |RESOLVED
             CC|                            |d@domenic.me
     Resolution|---                         |WORKSFORME

Want more features?

Request early access to our private beta of readable email premium.