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

Process property information based on tag #11

Closed
StarpTech opened this issue Sep 26, 2018 · 2 comments
Closed

Process property information based on tag #11

StarpTech opened this issue Sep 26, 2018 · 2 comments

Comments

@StarpTech
Copy link
Collaborator

StarpTech commented Sep 26, 2018

Hi, I think it could be useful to evaluate the property based on a specific tag. In that case we could check if the property is a supported HTML attribute of the tag. It would also allow to handle attributes case-sensitive when a known attribute is applied on a tag which doesn't support it.

The third parameter is optional.

info.find(info.html, 'async', 'div')
{ space: 'html',
  attribute: 'async',
  property: 'async',
  supported: false
}

info.find(info.html, 'ASYNC', 'div')
{ space: 'html',
  attribute: 'ASYNC',
  property: 'ASYNC',
  supported: false
}

info.find(info.html, 'async', 'script')
{ space: 'html',
  attribute: 'async',
  property: 'async',
  supported: true
}
@wooorm
Copy link
Owner

wooorm commented Sep 28, 2018

I‘ve thought about this for stuff where the other fields, e.g., numeric and spaceSeparated, depend on the element that the prop is used on.
I’m not entirely sure about the use for supported though. Maybe html-element-attributes is better for that. The spec changes a bit. That project is strict, and I feel property-information should not be too strict.

@StarpTech
Copy link
Collaborator Author

Hi @wooorm thanks for the pointer. I can handle it with that.

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

2 participants