Re: Custom Elements: 'data-' attributes

2014-05-15 Thread Anne van Kesteren
On Tue, May 13, 2014 at 5:44 PM, Boris Zbarsky bzbar...@mit.edu wrote: I slightly worry about the performance implications of this and the number of changes to UAs this will require: any place inside a UA that examines attribute values (only for global attributes?) would need to consult this

Re: Custom Elements: 'data-' attributes

2014-05-15 Thread David Håsäther
On Wed, May 14, 2014 at 1:18 PM, Soledad Penadés s...@mozilla.com wrote: And that's where I suggested leaving attribute handling to the component. If it self-registers as handling a certain attribute, then don't let the UA handle it as it would do if unregistered. Very much like the idea. A

Re: Custom Elements: 'data-' attributes

2014-05-13 Thread Anne van Kesteren
On Mon, May 12, 2014 at 9:39 PM, Ryosuke Niwa rn...@apple.com wrote: But expandos are usually added to HTMLElement and other builtin elements, right? Depends, might be on instances too. What we're talking about here is adding properties and methods on a custom element, which is a subclass

Re: Custom Elements: 'data-' attributes

2014-05-13 Thread Charles McCathie Nevile
On Thu, 08 May 2014 19:42:04 +0200, Ian Hickson i...@hixie.ch wrote: On Thu, 8 May 2014, Bruce Lawson wrote: On 7 May 2014 20:03, Ian Hickson i...@hixie.ch wrote: Requiring a dash is pretty ugly. I would allow any attribute, and we'll just have to be careful when introducing new global

Re: Custom Elements: 'data-' attributes

2014-05-13 Thread Dimitri Glazkov
On Tue, May 13, 2014 at 2:37 AM, Anne van Kesteren ann...@annevk.nl wrote: Sole had the idea of providing hooks for attributes so a component can say it handles them rather than the user agent. That makes a lot of sense to me. That way you can grab any name, even existing ones. 3 this idea,

Re: Custom Elements: 'data-' attributes

2014-05-13 Thread Boris Zbarsky
On 5/13/14, 7:31 AM, Dimitri Glazkov wrote: Sole had the idea of providing hooks for attributes so a component can say it handles them rather than the user agent. That makes a lot of sense to me. That way you can grab any name, even existing ones. 3 this idea, would love to hear more. It's

Re: Custom Elements: 'data-' attributes

2014-05-13 Thread Ryosuke Niwa
On May 13, 2014, at 2:37 AM, Anne van Kesteren ann...@annevk.nl wrote: On Mon, May 12, 2014 at 9:39 PM, Ryosuke Niwa rn...@apple.com wrote: But expandos are usually added to HTMLElement and other builtin elements, right? Depends, might be on instances too. Sure, authors can do anything

Re: Custom Elements: 'data-' attributes

2014-05-12 Thread Anne van Kesteren
On Fri, May 9, 2014 at 12:56 PM, Ryosuke Niwa rn...@apple.com wrote: On the other hand, if the same element had exposed contentEditable property, then UA's native contentEditable property would simply be overridden since it would appear higher up in the prototype chain. It's true that this

Re: Custom Elements: 'data-' attributes

2014-05-12 Thread Simon Pieters
On Mon, 12 May 2014 11:00:20 +0200, Anne van Kesteren ann...@annevk.nl wrote: On Fri, May 9, 2014 at 12:56 PM, Ryosuke Niwa rn...@apple.com wrote: On the other hand, if the same element had exposed contentEditable property, then UA's native contentEditable property would simply be

Re: Custom Elements: 'data-' attributes

2014-05-12 Thread Anne van Kesteren
On Mon, May 12, 2014 at 11:24 AM, Simon Pieters sim...@opera.com wrote: So when we research if it's safe to add a new global attribute, it's not enough to measure how often such an attribute is used in the wild. We need to research bare names in event handlers also. This we can thankfully

Re: Custom Elements: 'data-' attributes

2014-05-12 Thread Ryosuke Niwa
On May 12, 2014, at 2:00 AM, Anne van Kesteren ann...@annevk.nl wrote: On Fri, May 9, 2014 at 12:56 PM, Ryosuke Niwa rn...@apple.com wrote: On the other hand, if the same element had exposed contentEditable property, then UA's native contentEditable property would simply be overridden since

Re: Custom Elements: 'data-' attributes

2014-05-08 Thread Bruce Lawson
On 7 May 2014 20:03, Ian Hickson i...@hixie.ch wrote: Requiring a dash is pretty ugly. I would allow any attribute, and we'll just have to be careful when introducing new global ones. I think the ship HMS Ugly has already sailed, given a dash is compulsory for the names of custom elements.

Re: Custom Elements: 'data-' attributes

2014-05-08 Thread Anne van Kesteren
On Thu, May 8, 2014 at 12:53 AM, Ryosuke Niwa rn...@apple.com wrote: The answer to that question, IMO, is no. It's not safe to use custom attributes without 'data-' if one wanted to write a forward compatible HTML document. Note that the question is scoped to custom elements, not elements in

Re: Custom Elements: 'data-' attributes

2014-05-08 Thread Ian Hickson
On Thu, 8 May 2014, Bruce Lawson wrote: On 7 May 2014 20:03, Ian Hickson i...@hixie.ch wrote: Requiring a dash is pretty ugly. I would allow any attribute, and we'll just have to be careful when introducing new global ones. I think the ship HMS Ugly has already sailed, given a dash is

Re: Custom Elements: 'data-' attributes

2014-05-08 Thread Brian Kardell
On Thu, May 8, 2014 at 5:37 AM, Anne van Kesteren ann...@annevk.nl wrote: On Thu, May 8, 2014 at 12:53 AM, Ryosuke Niwa rn...@apple.com wrote: The answer to that question, IMO, is no. It's not safe to use custom attributes without 'data-' if one wanted to write a forward compatible HTML

Custom Elements: 'data-' attributes

2014-05-07 Thread Wilson Page
I'm unsure whether or not it is safe to use custom attributes without the 'data-', I've heard mixed opinions. How do we know that chosen attributes won't someday be global attributes?

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Anne van Kesteren
On Tue, May 6, 2014 at 7:19 PM, Wilson Page wilsonp...@me.com wrote: I'm unsure whether or not it is safe to use custom attributes without the 'data-', I've heard mixed opinions. How do we know that chosen attributes won't someday be global attributes? Yeah, we should figure something out

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Ian Hickson
On Wed, 7 May 2014, Anne van Kesteren wrote: On Tue, May 6, 2014 at 7:19 PM, Wilson Page wilsonp...@me.com wrote: I'm unsure whether or not it is safe to use custom attributes without the 'data-', I've heard mixed opinions. How do we know that chosen attributes won't someday be global

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Ryosuke Niwa
On May 7, 2014, at 12:03 PM, Ian Hickson i...@hixie.ch wrote: On Wed, 7 May 2014, Anne van Kesteren wrote: On Tue, May 6, 2014 at 7:19 PM, Wilson Page wilsonp...@me.com wrote: I'm unsure whether or not it is safe to use custom attributes without the 'data-', I've heard mixed opinions. How do

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread David Bruant
Le 07/05/2014 21:36, Ryosuke Niwa a écrit : On May 7, 2014, at 12:03 PM, Ian Hickson i...@hixie.ch wrote: On Wed, 7 May 2014, Anne van Kesteren wrote: On Tue, May 6, 2014 at 7:19 PM, Wilson Page wilsonp...@me.com wrote: I'm unsure whether or not it is safe to use custom attributes without

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Ian Hickson
On Wed, 7 May 2014, Ryosuke Niwa wrote: How are you going to quantify the risk of adding a new global attribute in the future? Same we we do today. Look to see how many pages use the attribute, find a name that's not used much, and then try to deploy it and see what breaks. I don't want

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Ryosuke Niwa
There is a difference in people not caring about forward compatibility and polluting the global namespace, and not providing a mechanism to do it right in the first place. If we're encouraging authors to define their own attributes, then we should provide a mechanism or a guideline to do so in

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Glenn Maynard
On Wed, May 7, 2014 at 5:07 PM, Ryosuke Niwa rn...@apple.com wrote: There is a difference in people not caring about forward compatibility and polluting the global namespace, and not providing a mechanism to do it right in the first place. You'll always need to be able to declare attributes

Re: Custom Elements: 'data-' attributes

2014-05-07 Thread Ryosuke Niwa
On May 7, 2014, at 4:30 PM, Glenn Maynard gl...@zewt.org wrote: On Wed, May 7, 2014 at 5:07 PM, Ryosuke Niwa rn...@apple.com wrote: There is a difference in people not caring about forward compatibility and polluting the global namespace, and not providing a mechanism to do it right in the