Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(html/minifier): Handle
crossorigin
(#6261)
- Loading branch information
1 parent
ab4fd93
commit 782da5c
Showing
7 changed files
with
133 additions
and
49 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
22 changes: 22 additions & 0 deletions
22
crates/swc_html_minifier/tests/fixture/attribute/crossorigin/input.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,22 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Document</title> | ||
<link rel="stylesheet" href="test.css" crossorigin="anonymous"> | ||
</head> | ||
<body> | ||
<img src="test.png" alt="test" crossorigin=""> | ||
<img src="test.png" alt="test" crossorigin="unknown"> | ||
<img src="test.png" alt="test" crossorigin="anonymous"> | ||
<img src="test.png" alt="test" crossorigin="use-credentials"> | ||
<audio src="test.mp3" crossorigin="anonymous"></audio> | ||
<video src="test.mp4" crossorigin="anonymous"></video> | ||
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"> | ||
<image href="mdn_logo_only_color.png" height="200" width="200" crossorigin="anonymous" /> | ||
</svg> | ||
<script | ||
src="https://example.com/example-framework.js" | ||
crossorigin="anonymous"></script> | ||
</body> | ||
</html> |
10 changes: 10 additions & 0 deletions
10
crates/swc_html_minifier/tests/fixture/attribute/crossorigin/output.min.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,10 @@ | ||
<!doctype html><html lang=en><meta charset=UTF-8><title>Document</title><link rel=stylesheet href=test.css crossorigin><img src=test.png alt=test crossorigin> | ||
<img src=test.png alt=test crossorigin=unknown> | ||
<img src=test.png alt=test crossorigin> | ||
<img src=test.png alt=test crossorigin=use-credentials> | ||
<audio src=test.mp3 crossorigin></audio> | ||
<video src=test.mp4 crossorigin></video> | ||
<svg width=200 height=200> | ||
<image href=mdn_logo_only_color.png height=200 width=200 crossorigin/> | ||
</svg> | ||
<script src=https://example.com/example-framework.js crossorigin></script> |
2 changes: 1 addition & 1 deletion
2
crates/swc_html_minifier/tests/fixture/element/script/output.min.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
782da5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark
es/full/bugs-1
372969
ns/iter (± 197640
)366183
ns/iter (± 36637
)1.02
es/full/minify/libraries/antd
1906719838
ns/iter (± 60376461
)1948103139
ns/iter (± 63621037
)0.98
es/full/minify/libraries/d3
432136029
ns/iter (± 25410991
)438779909
ns/iter (± 34882646
)0.98
es/full/minify/libraries/echarts
1617301679
ns/iter (± 41457861
)1623728382
ns/iter (± 72599388
)1.00
es/full/minify/libraries/jquery
115021948
ns/iter (± 4587068
)107646934
ns/iter (± 3959842
)1.07
es/full/minify/libraries/lodash
132318824
ns/iter (± 6858028
)135957770
ns/iter (± 14182099
)0.97
es/full/minify/libraries/moment
69577365
ns/iter (± 6560088
)67129457
ns/iter (± 9895927
)1.04
es/full/minify/libraries/react
22625404
ns/iter (± 917119
)21512068
ns/iter (± 2240942
)1.05
es/full/minify/libraries/terser
355190095
ns/iter (± 21482023
)358762233
ns/iter (± 35793756
)0.99
es/full/minify/libraries/three
582006848
ns/iter (± 62832958
)594088565
ns/iter (± 16770006
)0.98
es/full/minify/libraries/typescript
3613809306
ns/iter (± 66494279
)3649113147
ns/iter (± 98081415
)0.99
es/full/minify/libraries/victory
862079462
ns/iter (± 42409133
)853269804
ns/iter (± 10586100
)1.01
es/full/minify/libraries/vue
172266290
ns/iter (± 23209983
)171201767
ns/iter (± 8209519
)1.01
es/full/codegen/es3
32783
ns/iter (± 422
)33366
ns/iter (± 1018
)0.98
es/full/codegen/es5
32785
ns/iter (± 835
)33439
ns/iter (± 933
)0.98
es/full/codegen/es2015
32730
ns/iter (± 945
)33253
ns/iter (± 2287
)0.98
es/full/codegen/es2016
32702
ns/iter (± 1034
)33446
ns/iter (± 342
)0.98
es/full/codegen/es2017
32733
ns/iter (± 637
)33322
ns/iter (± 286
)0.98
es/full/codegen/es2018
32625
ns/iter (± 623
)33394
ns/iter (± 423
)0.98
es/full/codegen/es2019
32814
ns/iter (± 603
)33462
ns/iter (± 735
)0.98
es/full/codegen/es2020
32676
ns/iter (± 750
)33489
ns/iter (± 1343
)0.98
es/full/all/es3
212479827
ns/iter (± 11982743
)211984460
ns/iter (± 18117518
)1.00
es/full/all/es5
202692639
ns/iter (± 13238644
)199474596
ns/iter (± 19521856
)1.02
es/full/all/es2015
160011448
ns/iter (± 11551966
)155228762
ns/iter (± 6761905
)1.03
es/full/all/es2016
159959199
ns/iter (± 9424651
)155341844
ns/iter (± 8340737
)1.03
es/full/all/es2017
157933475
ns/iter (± 9065317
)154040122
ns/iter (± 23910690
)1.03
es/full/all/es2018
158479888
ns/iter (± 10422918
)152436554
ns/iter (± 13654846
)1.04
es/full/all/es2019
148375646
ns/iter (± 8929590
)151156373
ns/iter (± 9532660
)0.98
es/full/all/es2020
150443719
ns/iter (± 9757128
)144890990
ns/iter (± 9623244
)1.04
es/full/parser
734967
ns/iter (± 22701
)744755
ns/iter (± 41547
)0.99
es/full/base/fixer
26141
ns/iter (± 1232
)26024
ns/iter (± 4982
)1.00
es/full/base/resolver_and_hygiene
92924
ns/iter (± 3599
)92872
ns/iter (± 8751
)1.00
serialization of ast node
214
ns/iter (± 8
)215
ns/iter (± 6
)1.00
serialization of serde
220
ns/iter (± 8
)219
ns/iter (± 23
)1.00
This comment was automatically generated by workflow using github-action-benchmark.