{"action":"created","issue":{"url":"https://api.github.com/repos/w3c/webcomponents/issues/654","repository_url":"https://api.github.com/repos/w3c/webcomponents","labels_url":"https://api.github.com/repos/w3c/webcomponents/issues/654/labels{/name}","comments_url":"https://api.github.com/repos/w3c/webcomponents/issues/654/comments","events_url":"https://api.github.com/repos/w3c/webcomponents/issues/654/events","html_url":"https://github.com/w3c/webcomponents/issues/654","id":248588578,"number":654,"title":"Custom attribute names conflicting with built-in attribute names","user":{"login":"treshugart","id":136556,"avatar_url":"https://avatars3.githubusercontent.com/u/136556?v=4","gravatar_id":"","url":"https://api.github.com/users/treshugart","html_url":"https://github.com/treshugart","followers_url":"https://api.github.com/users/treshugart/followers","following_url":"https://api.github.com/users/treshugart/following{/other_user}","gists_url":"https://api.github.com/users/treshugart/gists{/gist_id}","starred_url":"https://api.github.com/users/treshugart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treshugart/subscriptions","organizations_url":"https://api.github.com/users/treshugart/orgs","repos_url":"https://api.github.com/users/treshugart/repos","events_url":"https://api.github.com/users/treshugart/events{/privacy}","received_events_url":"https://api.github.com/users/treshugart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-08-08T03:11:56Z","updated_at":"2017-08-08T08:00:25Z","closed_at":null,"body":"Say I have a custom element that responds to the `hidden` attribute. This custom element may hide itself in a particular way, or have a particular semantic meaning for \"hidden\" in this context that is different to \"the browser should hide this element\".\r\n\r\n```js\r\nclass MyElement extends HTMLElement {\r\n  static observedAttributes = ['hidden']\r\n  attributeChangedCallback (name, oldValue, newValue) {\r\n    // go do some hidy stuff\r\n  }\r\n}\r\n```\r\n\r\nNow let's say this element is in production, correctly responding to the semantics of its custom `hidden` attribute. Then along comes a new, standardised, attribute with of the same name in what normally would be an innocuous change. The new attribute takes the element and hides it immediately. All of our custom elements that implement our own semantics for this attribute are now broken.\r\n\r\nThis example is somewhat contrived in the context of `HTMLElement` because `hidden` is fairly concrete behaviour. This would be more likely to happen with customised built-ins. That said, this is still possible at the `HTMLElement` level with more abstract use cases.\r\n\r\nOne could say that this isn't limited to custom elements as people have been doing this with existing component systems for a long time (jQuery plugins, Moo Tools, Angular, etc.). Previously, people have been encouraged to use `data` prefixed attributes (maybe not with certain component models such as Angular which have seen similar issues). With the arrival of custom elements, people have been encouraged to use non-prefixed attribute names.\r\n\r\nI'd really appreciate a discussion on how we can prevent this from happening at the standards level so custom element authors don't have to worry about this.\r\n\r\nThe origination of this issue was a [discussion](https://twitter.com/sebmarkbage/status/894678380225875968) started by @sebmarkbage. I don't have any prior art to offer, but maybe others do.\r\n"},"comment":{"url":"https://api.github.com/repos/w3c/webcomponents/issues/comments/320881586","html_url":"https://github.com/w3c/webcomponents/issues/654#issuecomment-320881586","issue_url":"https://api.github.com/repos/w3c/webcomponents/issues/654","id":320881586,"user":{"login":"annevk","id":1544111,"avatar_url":"https://avatars0.githubusercontent.com/u/1544111?v=4","gravatar_id":"","url":"https://api.github.com/users/annevk","html_url":"https://github.com/annevk","followers_url":"https://api.github.com/users/annevk/followers","following_url":"https://api.github.com/users/annevk/following{/other_user}","gists_url":"https://api.github.com/users/annevk/gists{/gist_id}","starred_url":"https://api.github.com/users/annevk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annevk/subscriptions","organizations_url":"https://api.github.com/users/annevk/orgs","repos_url":"https://api.github.com/users/annevk/repos","events_url":"https://api.github.com/users/annevk/events{/privacy}","received_events_url":"https://api.github.com/users/annevk/received_events","type":"User","site_admin":false},"created_at":"2017-08-08T08:00:25Z","updated_at":"2017-08-08T08:00:25Z","body":"@treshugart well, the validator discourages it, no?"}}
{"actor":{"display_login":"annevk"}}