-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A svelte specific custom namespace that preserves attribute case
- Loading branch information
1 parent
67dea94
commit 95ca937
Showing
4 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
test/runtime/samples/attribute-casing-native-namespace/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Test support for the external namespace preserving attribute case. | ||
|
||
export default { | ||
html: ` | ||
<page horizontalAlignment="center"> | ||
<button textWrap="true" text="button"> | ||
</page> | ||
`, | ||
options: { | ||
hydrate: false // Hydration test will fail as case sensitivity is only handled for svg elements. | ||
}, | ||
|
||
test({ assert, target }) { | ||
const attr = sel => target.querySelector(sel).attributes[0].name; | ||
assert.equal(attr('page'), 'horizontalAlignment'); | ||
assert.equal(attr('button'), 'textWrap'); | ||
} | ||
}; |
4 changes: 4 additions & 0 deletions
4
test/runtime/samples/attribute-casing-native-namespace/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<svelte:options namespace="external" /> | ||
<page horizontalAlignment="center"> | ||
<button textWrap="true" text="button"> | ||
</page> |