-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support is attribute, with a warning - fixes #3182
- Loading branch information
1 parent
120ee28
commit 7836f40
Showing
7 changed files
with
57 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export default { | ||
warnings: [{ | ||
code: "avoid-is", | ||
message: "The 'is' attribute is not supported cross-browser and should be avoided", | ||
pos: 97, | ||
start: { | ||
character: 97, | ||
column: 8, | ||
line: 7 | ||
}, | ||
end: { | ||
character: 114, | ||
column: 25, | ||
line: 7 | ||
} | ||
}] | ||
}; |
2 changes: 2 additions & 0 deletions
2
test/custom-elements/samples/extended-builtin/fancy-button.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,2 @@ | ||
class FancyButton extends HTMLButtonElement {} | ||
customElements.define('fancy-button', FancyButton, { extends: 'button' }); |
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,7 @@ | ||
<svelte:options tag="custom-element"/> | ||
|
||
<script> | ||
import './fancy-button.js'; | ||
</script> | ||
|
||
<button is="fancy-button">click me</button> |
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,15 @@ | ||
import * as assert from 'assert'; | ||
import CustomElement from './main.svelte'; | ||
|
||
export default function (target) { | ||
new CustomElement({ | ||
target | ||
}); | ||
|
||
assert.equal(target.innerHTML, '<custom-element></custom-element>'); | ||
|
||
const el = target.querySelector('custom-element'); | ||
const button = el.shadowRoot.querySelector('button'); | ||
|
||
assert.ok(button instanceof customElements.get('fancy-button')); | ||
} |