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

css3-conditional should be css-conditional #11

Closed
lukebjerring opened this issue Jul 19, 2018 · 7 comments
Closed

css3-conditional should be css-conditional #11

lukebjerring opened this issue Jul 19, 2018 · 7 comments

Comments

@lukebjerring
Copy link
Collaborator

From web-platform-tests/wpt#11868 (comment)

Scrape should be from the non-levelled https://drafts.csswg.org/css-conditional/, and filename should stay as css-conditional.

cc @gsnedders

@tidoust
Copy link
Member

tidoust commented Jul 19, 2018

Reffy starts from /TR/ URLs when they exist, retrieves the URL of the Editor's Draft (ED) from the W3C API, and crawls the spec at that URL.

In this case, the starting URL is https://www.w3.org/TR/css3-conditional/, the W3C API returns https://drafts.csswg.org/css-conditional-3/ as the URL of the ED, and thus Reffy crawls the leveled draft. The corresponding folder is named css-conditional-3 in the CSS repo, so using the leveled URL makes sense to me (the result is the same in any case, both URLs return the same spec).

Whatever draft Reffy crawls, this is not going to change the name of the IDL file. As explained around #3 (comment), for better or worse, the IDL file is named from the /TR/ shortname, which is css3-conditional. We automatically get rid of the level when we find it at the end of the URL, but we did not create a custom rule for css3- specs to get rid of the 3. I don't really see a situation where dropping that 3 would be a problem so happy to create such a rule.

@lukebjerring
Copy link
Collaborator Author

SGTM (and thanks for the explanation). @gsnedders you happy with that?

tidoust added a commit to w3c/reffy that referenced this issue Jul 19, 2018
@gsnedders
Copy link

I don't really see a situation where dropping that 3 would be a problem so happy to create such a rule.

FWIW, this is mostly just a legacy thing and it shows that css-conditional-3 hasn't been republished in a long time.

As for the ED URL being levelled, can one of you file a bug in w3c/csswg-drafts about that, given I'm about to go to bed? It should be consistent with everything else in the repo and be unversioned.

@foolip
Copy link
Member

foolip commented Jul 20, 2018

FWIW, in a similar effort of turning URLs into IDs, in https://github.com/foolip/day-to-day/blob/d336df7d08d57204a68877ec51866992ea78e7a2/build/specs.js#L176 I found it necessary to replace "css3" with "css", with one unfortunately exception to the rule with css3-background vs. css-backgrounds. As you can guess from the "no versions thanks" comment, I'd like it if there were no versions, and it looks like this is the only outlier.

tidoust added a commit to w3c/reffy that referenced this issue Jul 20, 2018
See comment at:
w3c/webref#11 (comment)

... and related code at:
https://github.com/foolip/day-to-day/blob/d336df7d08d57204a68877ec51866992ea78e7a2/build/specs.js#L176

Reffy now follows the same logic and has the same exception-to-the-rule for
CSS Backgrounds (that spec does not define any IDL content, but the rules are
also used to name the CSS dumps that Reffy now creates)
tidoust added a commit that referenced this issue Jul 20, 2018
See discussion in #11.

Reffy now drops the `3` for specs whose shortname starts with `css3-` to drop
the version. IDL file renamed to `css-conditional.idl` accordingly.
@tidoust
Copy link
Member

tidoust commented Jul 20, 2018

FWIW, in a similar effort of turning URLs into IDs, in https://github.com/foolip/day-to-day/blob/d336df7d08d57204a68877ec51866992ea78e7a2/build/specs.js#L176 I found it necessary to replace "css3" with "css", with one unfortunately exception to the rule with css3-background vs. css-backgrounds. As you can guess from the "no versions thanks" comment, I'd like it if there were no versions, and it looks like this is the only outlier.

I've now adopted similar rules in Reffy, including the css3-background exception. FWIW, the newly published WAI-ARIA 1.2 spec, which includes some IDL definitions, has the shortname wai-aria-1.2, which your replace(/-\d$/, '') would not capture because of the dot. But I suppose that you only run this code on ED URLs and don't need to take that into account (the ID extracted from the ED URL of that spec would simply be aria).

@tidoust
Copy link
Member

tidoust commented Jul 20, 2018

Reffy should now create a css-conditional.idl file and I changed the name of the file in the repo. Closing this issue accordingly.

Note that the URL of the ED that appears in the css-conditional.idl file in comment is still the leveled one. That won't get updated until the CSS WG adopts a consistent non-leveled-ED-URL approach, and until the URL returned by the W3C API for that particular spec gets updated (it typically would if a new version of the spec gets published).

@tidoust tidoust closed this as completed Jul 20, 2018
@gsnedders
Copy link

That won't get updated until the CSS WG adopts a consistent non-leveled-ED-URL approach

FWIW, this was done years ago, this is just a consequence of that spec not having been republished since 2013.

I wonder if it's worthwhile having the W3C API return an unversioned string for every spec?

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

No branches or pull requests

4 participants