[csswg-drafts] [web-animations-1] Potential misuse of WebIDL spec

stephenmcgruer has just created a new issue for https://github.com/w3c/csswg-drafts:

== [web-animations-1] Potential misuse of WebIDL spec ==
Filing this to track some concerns from yukishiino@chromium.org raised during a recent review of the Chromium Web Animations implementation (https://chromium-review.googlesource.com/c/chromium/src/+/989261).

With regards to the type of the keyframe argument in the procedure to process a keyframes argument (https://drafts.csswg.org/web-animations-1/#processing-a-keyframes-argument), yukishiino@ said:

"My main concern is whether the spec itself is well-defined or not.  Sometimes people define a new web spec that is not consistent with existing web specs.  It's easy to make such a mistake (especially when we define things out of the scope of Web IDL).  I'm afraid that such a mistake spreads out among web developers and later we find it hard to fix.

FYI, some people want to make it error when an ECMAScript object corresponding to an IDL dictionary has extra properties that are not defined in the IDL dictionary.  This feature could be introduced depending on the spec discussion.  Such a feature might conflict with this special use case.

So, I wanted you to be aware of what you're doing and its risk."

My personal opinion is that the largest risk here would be the BasePropertyIndexedKeyframe/BaseKeyframe dictionaries, as I think everywhere else (outside of the non-normative information section) we use direct objection manipulation APIs which are still valid even if the object isn't a Dicitonary (e.g. "Let method be the result of GetMethod(object, @@iterator).", "Let raw value be the result of calling the [[Get]] internal method on keyframe input", etc).

I don't think it's worth replacing the BasePropertyIndexedKeyframe/BaseKeyframe dictionaries at this point, but if needed we could rewrite it to just use object APIs.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2521 using your GitHub account

Received on Monday, 9 April 2018 13:46:06 UTC