Re: [w3c/webcomponents] Custom attribute names conflicting with built-in attribute names (#654)

> With the arrival of custom elements, people have been encouraged to use non-prefixed attribute names.

> Why do you think that is the case? We've loosened the validation rules, but I don't believe we've encouraged using such attribute names.

> folks shouldn't add custom attributes without using data-*.

In addition to what was said in [earlier comments](#issuecomment-320872948) about how non-prefixed custom element attributes are already in the wild and valid, I also want to point out that https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-core-concepts literally says:

```
Autonomous custom elements have the following element definition:
...
Content attributes:
Global attributes, except the is attribute
Any other attribute that has no namespace (see prose).
```

And the prose below that says:

```
Any namespace-less attribute that is relevant to the element's functioning, as determined by 
the element's author, may be specified on an autonomous custom element, so long as the 
attribute name is XML-compatible and contains no ASCII upper alphas. The exception is the is 
attribute, which must not be specified on an autonomous custom element (and which will have 
no effect if it is).
```

> I'm more concerned when subclassing more specific elements becomes common place. Currently implementations are not widespread. Specific elements are more likely to need new attributes.

There, we're ok, since that same spec says:

```
Customized built-in elements follow the normal requirements for attributes, based on the 
elements they extend. To add custom attribute-based behavior, use data-* attributes.
```

> Adding global attributes to the platform is pretty rare, but it must now be done with the understanding that custom elements exist and should not be broken or overly burdened. 
Does that mean every specifications proposal that proposes adding a global attribute will be constrained by this? For example, https://dvcs.w3.org/hg/undomanager/raw-file/tip/undomanager.html, which proposes an `undoscope` global attribute?




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/654#issuecomment-339183517

Received on Wednesday, 25 October 2017 01:17:47 UTC