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

Inconsistent / Incorrect "Missing Value Defaults" for rehype-minify-enumerated-attribute #38

Closed
karlhorky opened this issue Dec 29, 2020 · 3 comments
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have

Comments

@karlhorky
Copy link

karlhorky commented Dec 29, 2020

Subject of the feature

Copied from the comments in #36 #36 (comment)

Going through MDN and the HTML spec, found some more inconsistencies / additions:

  1. the missing value for ol[type] should be '1'
  2. the missing value for ul[type] should be 'circle'
  3. the missing value for form[target] should be '_self'
  4. [autocomplete]: should this have an array of tagNames? MDN says <input>, <textarea>, <select>, and <form>
  5. img[decoding]: missing value default of 'auto'
  6. [loading] should be ordered after [keytype] and [kind]
  7. [formmethod] should have a missing of null (from the spec: "The formmethod attribute ... has no missing value default."). Maybe also change the comment to update the [method], because it isn't actually 100% synced...
  8. [formenctype] should have a missing of null (from the spec: "The formenctype attribute ... has no missing value default."). Maybe also change the comment to update the [enctype], because it isn't actually 100% synced...
  9. [formtarget] probably should have a missing of null (couldn't find it in the spec, but seems consistent with the others). Maybe also change the comment to update the [target], because it isn't actually 100% synced...
  10. the missing value default for li[type] should maybe be null instead? (from MDN: "This type overrides the one used by its parent <ol> element, if any.")

Problem

I'm trying to gather a list of "missing value defaults" for a new ESLint rule:

jsx-eslint/eslint-plugin-react#2866

Also see #36

Expected behavior

The list should be complete and correct.

@wooorm
Copy link
Member

wooorm commented Sep 11, 2021

Going through this now, I’ll jot some notes down here:

  • ul[type] — the default is not circle, the default is based on CSS inheritance
  • autoComplete:
    • form[autoComplete] is a simple enum, so I added tagNames: 'form'
    • autoComplete applies to: select, textarea, input[type=hidden,text,search,tel,url,email,password,date,month,week,time,datetime-local,number,range,color]
    • autoComplete does not apply on: input[type=checkbox,radio,file,submit,image,reset,button]
    • on and off are not allowed on input[type=hidden]
    • On input, select, textarea, the default depends on the corresponding form
    • As autoComplete on input, select, textarea are so complex, I instead ignore them here

@github-actions github-actions bot added the 🤞 phase/open Post is being triaged manually label Sep 11, 2021
@wooorm wooorm added 💪 phase/solved Post is done and removed 🦋 type/enhancement This is great to have 🙉 open/needs-info This needs some more info 🤞 phase/open Post is being triaged manually labels Sep 11, 2021
@wooorm wooorm closed this as completed in b34a034 Sep 11, 2021
@wooorm wooorm added 🗄 area/interface This affects the public interface 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change labels Sep 11, 2021
@wooorm
Copy link
Member

wooorm commented Sep 11, 2021

Thanks! Went through most of these with a browser, to make sure the input and minified result are the same, for the DOM or as the visual result!

@karlhorky
Copy link
Author

Amazing, thanks! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

No branches or pull requests

2 participants