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

meta#charset can't be set in js #20

Open
kevinresol opened this issue May 18, 2020 · 2 comments
Open

meta#charset can't be set in js #20

kevinresol opened this issue May 18, 2020 · 2 comments

Comments

@kevinresol
Copy link
Member

I wrote a test(a5ec800) to check for existence for attributes specified in Attributes.hx and noticed that meta#charset is actually not a property of the "meta" DOM element in JS.

SO says so:

there is no property that reflects the charset content attribute.

https://stackoverflow.com/a/12560258/3212365

@kevinresol
Copy link
Member Author

kevinresol commented May 18, 2020

How does renderers use these attribute specs? Do they .attr = value or .setAttribute(attr, value)? For example, I see there is role in GlobalAttr. I am pretty sure element.role = value is basically meaningless, because .role is not a JS property and changes will not be reflected to the actual DOM. On the other hand, element.setAttribute('role', value) would manipulate the DOM as-is so it could be picked up by css selectors.

I would like to ask: should we include non-JS-prop attributes in the spec?

PS Apparently it is a bloody mess regarding attributes: https://quirksmode.org/dom/core/#attributes

@back2dos
Copy link
Member

We should probably decorate all attributes that don't have a corresponding property as such, then any libraries can leverage that. For coconut.react-dom it's probably fine already, because react/preact deal with this, coconut.html uses attributes anyway and coconut.vdom can pick the infos from here.

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