-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add crossorigin as valid img tag attribute (#918)
* fix: add crossorigin as valid img tag attribute * fix: add crossorigin to audio and video elements
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...lwc/template-compiler/src/__tests__/fixtures/attributes/attribute-crossorigin/actual.html
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,6 @@ | ||
<template> | ||
<!-- Issue #917 --> | ||
<img src="http://www.example.com/image.png" crossorigin="anonymous"> | ||
<video src="http://www.example.com/video.mp4" crossorigin="anonymous"></video> | ||
<audio src="http://www.example.com/video.mp3" crossorigin="anonymous"></audio> | ||
</template> |
43 changes: 43 additions & 0 deletions
43
...lwc/template-compiler/src/__tests__/fixtures/attributes/attribute-crossorigin/expected.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,43 @@ | ||
import { registerTemplate } from "lwc"; | ||
|
||
function tmpl($api, $cmp, $slotset, $ctx) { | ||
const { h: api_element } = $api; | ||
return [ | ||
api_element( | ||
"img", | ||
{ | ||
attrs: { | ||
src: "http://www.example.com/image.png", | ||
crossorigin: "anonymous" | ||
}, | ||
key: 2 | ||
}, | ||
[] | ||
), | ||
api_element( | ||
"video", | ||
{ | ||
attrs: { | ||
src: "http://www.example.com/video.mp4", | ||
crossorigin: "anonymous" | ||
}, | ||
key: 3 | ||
}, | ||
[] | ||
), | ||
api_element( | ||
"audio", | ||
{ | ||
attrs: { | ||
src: "http://www.example.com/video.mp3", | ||
crossorigin: "anonymous" | ||
}, | ||
key: 4 | ||
}, | ||
[] | ||
) | ||
]; | ||
} | ||
|
||
export default registerTemplate(tmpl); | ||
tmpl.stylesheets = []; |
8 changes: 8 additions & 0 deletions
8
...c/template-compiler/src/__tests__/fixtures/attributes/attribute-crossorigin/metadata.json
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,8 @@ | ||
{ | ||
"warnings": [], | ||
"metadata": { | ||
"definedSlots": [], | ||
"templateUsedIds": [], | ||
"templateDependencies": [] | ||
} | ||
} |
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