-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cannot use well-known attribute names with custom elements #45
Comments
Could you take a second to look at which exact package the problem is? Might not be this exact package. If it is this package, a broken test is nice. Though, I'd think:
|
As far as I tracked it (sorry, on the phone) the behaviour comes from
serializeAttribute in combination with the upstream property-information
library.
The problem is, the way it's written it's not exactly a fault per se - more
like a situation that wasn't thought of (and probably was impossible to
foresee at the time).
Property information delivers the correct information for the selected
attribute because it doesn't (as far as I can tell) have the tagname
available.
hast-util-to-html on the other hand could just skip querying
property-information for custom elements, the question is whether that is
the correct solution.
…On Wed, Dec 4, 2024, 18:39 Titus ***@***.***> wrote:
Could you take a second to look at which exact package the problem is?
Might not be this exact package. If it is this package, a broken test is
nice.
Though, I'd think:
- Weird values for a Boolean should indeed be passed through as is
- Actually select=select, I can see that being turned into select,
which I think custom elements should support?
—
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOHZTRJD5YSEMHBIV3YIDL2D4443AVCNFSM6AAAAABS5B2NDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJYGEYTMOJTGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Right so what I am thinking is: if some value is a string ( Whether specific custom element handling is needed in this (or other) projects can then be ignored/delayed. This might be a can of worms, because it is vague whether If |
Sure, let me check that out in a bit more depth tomorrow
…On Thu, Dec 5, 2024, 18:25 Titus ***@***.***> wrote:
Right so what I am thinking is: if some value is a string (asd) where a
boolean is normally expected (say for hidden), we can still serialize
that string here (hidden=asd)
Whether specific custom element handling is needed in this (or other)
projects can then be ignored/delayed. This might be a can of worms, because
it is vague whether class for example is a space separated list. It will
be for some things (CSS). It might not be for the code handling the custom
element. That’s what I worry about.
If serializeAttribute is the only thing causing your problem, then it’s
not too hard to solve. Are you interesting in working on a PR?
—
Reply to this email directly, view it on GitHub
<#45 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACOHZTSN5SOXFF4CSFKOU3L2ECEBRAVCNFSM6AAAAABS5B2NDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRQHE3TQNZQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Released in |
Initial checklist
Affected package
https://esm.sh/hast-util-to-html@9?bundle
Steps to reproduce
See here: https://jsbin.com/jelewudote/3/edit?html,console,output
Copy Pasta'd repro for later reference
Basically:
Actual behavior
Serialization enforces the well-known definition over its intended usage.
Expected behavior
Serialization should not enforce the well-known definition in the case of custom elements. It should align with what is rendered by the browser.
Runtime
Firefox/Chrome
Package manager
No response
Operating system
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: