New issue
Advanced search Search tips

Issue 850972 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 700338


Participants' hotlists:
Hotlist-Bindings-IDLCompiler


Sign in to add a comment

IDL identifier needs to allow a leading hyphen

Project Member Reported by peria@chromium.org, Jun 8 2018

Issue description

Quote from issue 580323  #6 ;
> Per the CSSOM spec, we should be generating actual IDL attributes for each CSS property to be implemented on CSSStyleDeclaration. We, as of right now, implement this as an anonymous getter, but this creates some interoperability issues (see bug 700338 for more information). The problem is with dashed properties, as according to the spec (https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-_dashed_attribute) they need both an attribute in camel case and with the dash. WebIDL identifiers are defined as /_?[A-Za-z][0-9A-Z_a-z-]*/ (note that a leading dash is not allowed), so e.g. -webkit-line-clamp would not be a valid IDL attribute.
> 
> (incidentally, our current IDL parser does not allow dashes anywhere in an attribute name, but that's something that can be fixed)

So in order to follow CSSOM spec, our implementation and Web IDL spec need to be updated to allow a leading hyphen in IDL identifier.
 

Comment 1 by peria@chromium.org, Jun 8 2018

Filed an issue in Web IDL spec. https://github.com/heycam/webidl/issues/564

Comment 2 by peria@chromium.org, Jun 8 2018

Status: WontFix (was: Started)
My understanding was wrong.
We have conversions between CSS property name and corresponding IDL attribute identifier, and because of the conversion, leading hyphens are not needed in .idl.
Algorithm to convert them is also described in CSSOM spec.

e.g. CSS property "-webkit-foo"  <==>  IDL attribute "webkitFoo"
Status: Assigned (was: WontFix)
Reopening this per the spec issue.

Sign in to add a comment