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

Allow unknown namespaced attributes to be emitted in their original case #5387

Closed

Conversation

halfnelson
Copy link
Contributor

@halfnelson halfnelson commented Sep 11, 2020

This PR allows attribute case to be retained for elements not in any of the known namespaces.
Current code forces all to lowercase and fixes the SVG specific attributes. There are other namespaces which contain case sensitive attributes, such as Svelte Native.
Currently svelte native has to recurse the object prototype of the element being updated and try to resolve the correct case. This has been a never ending source of bugs.

This PR also avoids setting several other Attribute values that only apply to code in the html namespace.

<page xmlns="tns">
<label textWrap="true">Hello {name}!</label>
</page>

Before this fix

	attr(label, "textwrap", "true");

After

	attr(label, "textWrap", "true");

Might be able to be merged with #5193

Tests

Test in test/runtime/samples/attribute/casing-unknown-namespace

@halfnelson
Copy link
Contributor Author

halfnelson commented Sep 13, 2020 via email

@halfnelson halfnelson force-pushed the fix/xmlns-attribute-case branch from 8b9476e to e7125f3 Compare October 1, 2020 10:29
@halfnelson
Copy link
Contributor Author

I changed package.json's lint script to work on windows

@halfnelson
Copy link
Contributor Author

This PR will now help both svelte-native and svelte-nodegui svelte-nodegui

@halfnelson
Copy link
Contributor Author

A more comprehensive solution to out of HTML namespace support is here #5652

@Conduitry
Copy link
Member

Closing this, as #5652 has landed in 3.32.0.

@Conduitry Conduitry closed this Jan 25, 2021
@mrsauravsahu
Copy link
Contributor

Hi @Conduitry and @halfnelson
CC: @shirakaba
I was using the new foreign namespace with svelte desktop and I see I'm getting a validation error because of this -

validate_bindings_foreign() {

The validator just says all bindings are invalid. So even a bind:this fails. Let me see if I can open up a quick PR for this.

Screenshot 2021-01-29 at 10 17 04 PM

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

Successfully merging this pull request may close these issues.

5 participants