- From: Steve Lee <stevelee@w3.org>
- Date: Tue, 12 Mar 2019 08:39:20 +0000
- To: Charles LaPierre <charlesl@benetech.org>, "lisa.seeman" <lisa.seeman@zoho.com>
- Cc: public-personalization-tf <public-personalization-tf@w3.org>
I still think the key issue is a potential global namespace clash. data-* attributes are a global namespace so if NOT treated as application scope specific (private) then clashes are likely to occur. These could break backward compatibility - a major "sin". Specifically, if we reserve any name then someone may have already used it - or want to. Any we will have broken their use of it. Here's a recent example of the serious problems clashes in a global namespace breaking backward compatibility [1][2]. ECMA wanted to add Array.prototype.contains() to the JavaScript standard but the very popular Moot Tools library had already used that so ESC had to define Array.protype.includes. Arguably Moo Tools should not have effectively reserved this name as they also could have broken someone else's code when Moo Tools was included. But the issues is the same in both cases - Global a namespace clash. We need to avoid this with data-* attributes. 1: http://2ality.com/2016/02/js-name-clashes.html 2: https://bugzilla.mozilla.org/show_bug.cgi?id=1075059 Steve On 11/03/2019 15:28, Charles LaPierre wrote: > That was the statements which was preventing us from using data- to > insert mathML into a page so that it could be used by a plugin etc. So > I was never quite sure why we couldn’t use data- for that purpose but > could for this purpose since both seem similar in my thinking. I don’t > remember who though putting the mathML into the data-mathml = “enter raw > mathML here” thought that was a violation of the use of data- But if > this isn’t the case we could have created a plugin which could interact > with the mathML. Or there could be data-latex as another option. Would > be really good to know why we can’t do that or if the spec on data- > needs to be updated. > > > Thanks > EOM > Charles LaPierre > Technical Lead, DIAGRAM and Born Accessible > Twitter: @CLaPierreA11Y > Skype: charles_lapierre > Phone: 650-600-3301 > >> On Mar 11, 2019, at 8:13 AM, lisa.seeman <lisa.seeman@zoho.com >> <mailto:lisa.seeman@zoho.com>> wrote: >> >> >> Folks, are we braking the html standard by using data- attributes? >> >> I quote >> >> " >> >> Custom data attributes >> <https://www.w3.org/TR/html50/dom.html#custom-data-attribute>are >> intended to store custom data private to the page or application, for >> which there are no more appropriate attributes or elements. >> >> These attributes are not intended for use by software that is >> independent of the site that uses the attributes. >> >> " >> >> >> >> >> From w3c schools (IE out in the wieled...) >> " >> *Note:*Custom attributes prefixed with "data-" will be completely >> ignored by the user agent." >> >> In pother words we are going against how dat- is intended to be used. >> >> >> All the best >> >> Lisa Seeman >> >> LinkedIn <http://il.linkedin.com/in/lisaseeman/>, Twitter >> <https://twitter.com/SeemanLisa> >> >> >> >> >
Received on Tuesday, 12 March 2019 08:39:23 UTC