privacycg / private-click-measurement

Private Click Measurement
https://privacycg.github.io/private-click-measurement/
200 stars 8 forks source link

Use camelCase for IDL attributes #5

Closed zcorpan closed 5 years ago

zcorpan commented 5 years ago
partial interface HTMLAnchorElement {
    [CEReactions=NotNeeded, Reflect] attribute DOMString adcampaignid;
    [CEReactions=NotNeeded, Reflect] attribute DOMString addestination;
};

Per convention in html these should be adCampaignId and adDestination

johnwilander commented 5 years ago

I know I wrote these in lower case for some reason but it was too far back for me to remember. I'll try to dig it up. Maybe it was for stupid implementation reasons and you are totally right.

johnwilander commented 5 years ago

Retracing my steps. The a element is specified here: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element

I remember noting that all existing attributes that unconditionally reflect their values are lower case and the two that don't are camel cased. But it's also the fact that only hreflang would be camel cased and the two existing camel cased ones are more recent.

Do you have any insights into this?

zcorpan commented 5 years ago

I would assume that hreflang casing is a mistake made a long time ago.

https://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-48250443 has hreflang on a, but also accessKey and tabIndex (which also reflect).

othermaciej commented 5 years ago

I believe @zcorpan is correct, the modern practice is to use camelCase for IDL properties that reflect HTML attributes, but some of the very oldest ones are all lowercase instead.

johnwilander commented 5 years ago

Resolved in https://github.com/WICG/ad-click-attribution/commit/554e80b6c66a080c06b72dbb783be8b2aa1eb50d.