rehypejs / rehype-minify

plugins to minify HTML
https://unifiedjs.com
MIT License
90 stars 16 forks source link

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

Closed karlhorky closed 3 years ago

karlhorky commented 3 years ago

Subject of the feature

Copied from the comments in #36 https://github.com/rehypejs/rehype-minify/issues/36#issuecomment-749083406

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:

https://github.com/yannickcr/eslint-plugin-react/issues/2866

Also see https://github.com/rehypejs/rehype-minify/issues/36

Expected behavior

The list should be complete and correct.

wooorm commented 3 years ago

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

wooorm commented 3 years ago

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 commented 3 years ago

Amazing, thanks! 🙌