[whatwg] API design restrictions due to barewords in onxxx="" attributes

Yehuda Katz
(ph) 718.877.1325


On Fri, Nov 25, 2011 at 8:06 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 11/25/11 10:19 PM, Cameron McCormack wrote:
>
>> 1. if property name is in set S, then:
>> a. look on element
>> b. look on element's form (if it has one)
>> c. look on document
>> otherwise:
>> a. look at element's named properties (if it has any)
>> b. look at element's form's named properties (if it has a form)
>> 2. look on window
>>
>> where S is the set of property names corresponding to
>>
>> * the IDL attributes, operations and constants on element's
>> interface,
>> * those on HTMLFormElement (if the element has a form), and
>> * those on Document
>>
>> for the current set of APIs we have deployed.
>>
>> Would this work? Does it sound too brittle or hacky?
>>
>
> It would break existing pages that use expandos on elements or documents
> via barewords in on* attributes.
>

Honestly, before this discussion, I would have been surprised to hear that
this works at all. It also seems to me that the group of people who know
how to add an expando and the group of people who use onxxx= is pretty
small to begin with.


>
> One important question is whether pages do that, of course.
>
> -Boris
>

Received on Friday, 25 November 2011 22:03:14 UTC