Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generated IDL attribute names to CSS properties #611

Merged
merged 3 commits into from
May 28, 2021

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented May 28, 2021

See related discussion in:
w3c/webref#51

This update adds a styleDeclaration property to CSS property definitions in CSS extracts. The property contains the list of IDL attribute names that the CSS property generates per the CSSOM spec on the CSSStyleDeclaration interface:
https://drafts.csswg.org/cssom/#ref-for-css-property-to-idl-attribute

The implementation of the CSS property to IDL attribute algorithm was copied over from:
https://github.com/foolip/mdn-bcd-collector/blob/c2126e8f367f08333a0f7b0604e42c8fdc11d182/build.js#L569

Note that the creation of this property is done after the crawl and not directly within the extract-cssdfn.mjs logic because that logic only extracts CSS properties that are defined in table, and the crawler completes that list afterwards with CSS properties that are defined in prose (such as those in the compat spec).

See related discussion in:
w3c/webref#51

This update adds a `styleDeclaration` property to CSS property definitions in
CSS extracts. The property contains the list of IDL attribute names that the
CSS property generates per the CSSOM spec on the `CSSStyleDeclaration`
interface:
https://drafts.csswg.org/cssom/#ref-for-css-property-to-idl-attribute

The implementation of the CSS property to IDL attribute algorithm was copied
over from:
https://github.com/foolip/mdn-bcd-collector/blob/c2126e8f367f08333a0f7b0604e42c8fdc11d182/build.js#L569
Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and I grant a license to the copied code under https://github.com/w3c/reffy/blob/master/LICENSE.

tests/util.js Outdated Show resolved Hide resolved
src/lib/util.js Outdated
res.push(property);
}

return res.sort();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be more convenient if the result was ordered in a predictable way, perhaps with the dashed (unmodified) attribute first, then camel-case if it's different, and finally the webkit special case if different. I'd then use the first entry for some tests.

tidoust and others added 2 commits May 28, 2021 18:01
Co-authored-by: Philip Jägenstedt <philip@foolip.org>
@tidoust tidoust merged commit f312bcf into master May 28, 2021
@tidoust tidoust deleted the add-style-declaration branch July 9, 2021 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants