-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css/compat): Support
hwb
color (#6687)
- Loading branch information
1 parent
417278f
commit b23cf50
Showing
12 changed files
with
394 additions
and
183 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,201 @@ | ||
use swc_atoms::js_word; | ||
use swc_css_ast::{ | ||
AbsoluteColorBase, AlphaValue, Angle, ComponentValue, Delimiter, DelimiterValue, Hue, Ident, | ||
Number, Percentage, | ||
}; | ||
use swc_css_utils::{angle_to_deg, hwb_to_rgb, to_rgb255}; | ||
|
||
use crate::compiler::Compiler; | ||
|
||
impl Compiler { | ||
fn get_hue(&self, hue: Option<&ComponentValue>) -> Option<f64> { | ||
match hue { | ||
Some(ComponentValue::Hue(box hue)) => { | ||
let mut value = match hue { | ||
Hue::Number(Number { value, .. }) => *value, | ||
Hue::Angle(Angle { | ||
value: Number { value, .. }, | ||
unit: Ident { value: unit, .. }, | ||
.. | ||
}) => angle_to_deg(*value, unit), | ||
}; | ||
|
||
value %= 360.0; | ||
|
||
if value < 0.0 { | ||
value += 360.0; | ||
} | ||
|
||
Some(value) | ||
} | ||
Some(ComponentValue::Ident(box Ident { value, .. })) | ||
if value.eq_ignore_ascii_case(&js_word!("none")) => | ||
{ | ||
Some(0.0) | ||
} | ||
_ => None, | ||
} | ||
} | ||
|
||
fn get_percentage(&self, percentage: Option<&ComponentValue>) -> Option<f64> { | ||
match percentage { | ||
Some(ComponentValue::Percentage(box Percentage { | ||
value: Number { value, .. }, | ||
.. | ||
})) => { | ||
if *value > 100.0 { | ||
return Some(1.0); | ||
} else if *value < 0.0 { | ||
return Some(0.0); | ||
} | ||
|
||
Some(*value / 100.0) | ||
} | ||
Some(ComponentValue::Ident(box Ident { value, .. })) | ||
if value.eq_ignore_ascii_case(&js_word!("none")) => | ||
{ | ||
Some(0.0) | ||
} | ||
_ => None, | ||
} | ||
} | ||
|
||
fn get_alpha_value(&self, alpha_value: Option<&ComponentValue>) -> Option<f64> { | ||
match alpha_value { | ||
Some(ComponentValue::AlphaValue(box AlphaValue::Number(Number { value, .. }))) => { | ||
if *value > 1.0 { | ||
return Some(1.0); | ||
} else if *value < 0.0 { | ||
return Some(0.0); | ||
} | ||
|
||
Some(*value) | ||
} | ||
Some(ComponentValue::AlphaValue(box AlphaValue::Percentage(Percentage { | ||
value: Number { value, .. }, | ||
.. | ||
}))) => { | ||
if *value > 100.0 { | ||
return Some(1.0); | ||
} else if *value < 0.0 { | ||
return Some(0.0); | ||
} | ||
|
||
Some(*value / 100.0) | ||
} | ||
Some(ComponentValue::Ident(box Ident { value, .. })) | ||
if value.eq_ignore_ascii_case(&js_word!("none")) => | ||
{ | ||
Some(0.0) | ||
} | ||
None => Some(1.0), | ||
_ => None, | ||
} | ||
} | ||
|
||
pub(crate) fn process_color_hwb(&mut self, n: &mut AbsoluteColorBase) { | ||
if let AbsoluteColorBase::Function(function) = n { | ||
if function.name.value != js_word!("hwb") { | ||
return; | ||
} | ||
|
||
let h = match self.get_hue(function.value.get(0)) { | ||
Some(value) => value, | ||
_ => return, | ||
}; | ||
let w = match self.get_percentage(function.value.get(1)) { | ||
Some(value) => value, | ||
_ => return, | ||
}; | ||
let b = match self.get_percentage(function.value.get(2)) { | ||
Some(value) => value, | ||
_ => return, | ||
}; | ||
let a = match self.get_alpha_value(function.value.get(4)) { | ||
Some(value) => value, | ||
_ => return, | ||
}; | ||
|
||
let rgb = to_rgb255(hwb_to_rgb([h, w, b])); | ||
|
||
if a == 1.0 { | ||
*n = AbsoluteColorBase::Function(swc_css_ast::Function { | ||
name: Ident { | ||
value: js_word!("rgb"), | ||
span: Default::default(), | ||
raw: None, | ||
}, | ||
value: vec![ | ||
ComponentValue::Number(Box::new(Number { | ||
value: rgb[0].round(), | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
ComponentValue::Delimiter(box Delimiter { | ||
value: DelimiterValue::Comma, | ||
span: Default::default(), | ||
}), | ||
ComponentValue::Number(Box::new(Number { | ||
value: rgb[1].round(), | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
ComponentValue::Delimiter(box Delimiter { | ||
value: DelimiterValue::Comma, | ||
span: Default::default(), | ||
}), | ||
ComponentValue::Number(Box::new(Number { | ||
value: rgb[2].round(), | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
], | ||
span: Default::default(), | ||
}); | ||
} else { | ||
*n = AbsoluteColorBase::Function(swc_css_ast::Function { | ||
name: Ident { | ||
value: js_word!("rgba"), | ||
span: Default::default(), | ||
raw: None, | ||
}, | ||
value: vec![ | ||
ComponentValue::Number(Box::new(Number { | ||
value: rgb[0].round(), | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
ComponentValue::Delimiter(box Delimiter { | ||
value: DelimiterValue::Comma, | ||
span: Default::default(), | ||
}), | ||
ComponentValue::Number(Box::new(Number { | ||
value: rgb[1].round(), | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
ComponentValue::Delimiter(box Delimiter { | ||
value: DelimiterValue::Comma, | ||
span: Default::default(), | ||
}), | ||
ComponentValue::Number(Box::new(Number { | ||
value: rgb[2].round(), | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
ComponentValue::Delimiter(box Delimiter { | ||
value: DelimiterValue::Comma, | ||
span: Default::default(), | ||
}), | ||
ComponentValue::AlphaValue(box AlphaValue::Number(Number { | ||
value: a, | ||
span: Default::default(), | ||
raw: None, | ||
})), | ||
], | ||
span: Default::default(), | ||
}); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,15 +1 @@ | ||
#[inline] | ||
pub(crate) fn clamp_unit_f32(val: f64) -> u8 { | ||
(val * 255.).round().max(0.).min(255.) as u8 | ||
} | ||
|
||
#[inline] | ||
pub(crate) fn round_alpha(alpha: f64) -> f64 { | ||
let mut rounded_alpha = (alpha * 100.).round() / 100.; | ||
|
||
if clamp_unit_f32(rounded_alpha) != clamp_unit_f32(alpha) { | ||
rounded_alpha = (alpha * 1000.).round() / 1000.; | ||
} | ||
|
||
rounded_alpha | ||
} |
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,14 @@ | ||
.test-hwb { | ||
color: hwb(194 0% 0%); /* #00c3ff */ | ||
color: hwb(194 0% 0% / .5); /* #00c3ff with 50% opacity */ | ||
color: hwb(0 10% 90%); | ||
color: hwb(0 20% 80%); | ||
color: hwb(0 30% 70%); | ||
color: hwb(0 40% 60%); | ||
color: hwb(0 50% 50%); | ||
color: hwb(0 60% 40%); | ||
} | ||
|
||
.test-ignore { | ||
color: hwb(194, 0%, 0%, .5); /* with comma-separated values */ | ||
} |
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,13 @@ | ||
.test-hwb { | ||
color: rgb(0, 195, 255); | ||
color: rgba(0, 195, 255, 0.5); | ||
color: rgb(26, 26, 26); | ||
color: rgb(51, 51, 51); | ||
color: rgb(77, 77, 77); | ||
color: rgb(102, 102, 102); | ||
color: rgb(128, 128, 128); | ||
color: rgb(153, 153, 153); | ||
} | ||
.test-ignore { | ||
color: hwb(194, 0%, 0%, .5); | ||
} |
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
Oops, something went wrong.
b23cf50
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
302843
ns/iter (± 7280
)306880
ns/iter (± 11962
)0.99
es/full/minify/libraries/antd
1723045291
ns/iter (± 32460545
)1736122745
ns/iter (± 23055196
)0.99
es/full/minify/libraries/d3
303614755
ns/iter (± 6708953
)320277659
ns/iter (± 5863860
)0.95
es/full/minify/libraries/echarts
1298334353
ns/iter (± 14723118
)1313703528
ns/iter (± 14379375
)0.99
es/full/minify/libraries/jquery
90753124
ns/iter (± 696389
)91242207
ns/iter (± 850580
)0.99
es/full/minify/libraries/lodash
107638842
ns/iter (± 813301
)106799641
ns/iter (± 697612
)1.01
es/full/minify/libraries/moment
52715897
ns/iter (± 402240
)53161051
ns/iter (± 475067
)0.99
es/full/minify/libraries/react
18987035
ns/iter (± 118708
)19050442
ns/iter (± 104579
)1.00
es/full/minify/libraries/terser
250501635
ns/iter (± 2738023
)253151253
ns/iter (± 4460853
)0.99
es/full/minify/libraries/three
459294786
ns/iter (± 4153631
)455556129
ns/iter (± 9263250
)1.01
es/full/minify/libraries/typescript
3235582608
ns/iter (± 12152018
)3251258446
ns/iter (± 15062196
)1.00
es/full/minify/libraries/victory
710275725
ns/iter (± 9450002
)750750352
ns/iter (± 13751515
)0.95
es/full/minify/libraries/vue
132852980
ns/iter (± 1078689
)131995150
ns/iter (± 996690
)1.01
es/full/codegen/es3
27611
ns/iter (± 163
)27032
ns/iter (± 110
)1.02
es/full/codegen/es5
27639
ns/iter (± 48
)27091
ns/iter (± 44
)1.02
es/full/codegen/es2015
27574
ns/iter (± 49
)27074
ns/iter (± 50
)1.02
es/full/codegen/es2016
27602
ns/iter (± 66
)27061
ns/iter (± 36
)1.02
es/full/codegen/es2017
27587
ns/iter (± 50
)27061
ns/iter (± 41
)1.02
es/full/codegen/es2018
27599
ns/iter (± 79
)27040
ns/iter (± 48
)1.02
es/full/codegen/es2019
27608
ns/iter (± 45
)27027
ns/iter (± 69
)1.02
es/full/codegen/es2020
27581
ns/iter (± 67
)27061
ns/iter (± 66
)1.02
es/full/all/es3
163312359
ns/iter (± 3534433
)167249370
ns/iter (± 1395295
)0.98
es/full/all/es5
153121241
ns/iter (± 3391626
)159239338
ns/iter (± 3351203
)0.96
es/full/all/es2015
118042262
ns/iter (± 764743
)118837532
ns/iter (± 911566
)0.99
es/full/all/es2016
117444032
ns/iter (± 524722
)118099251
ns/iter (± 570402
)0.99
es/full/all/es2017
115980575
ns/iter (± 946575
)117552996
ns/iter (± 299977
)0.99
es/full/all/es2018
114714175
ns/iter (± 586900
)116396033
ns/iter (± 962585
)0.99
es/full/all/es2019
113764583
ns/iter (± 722106
)115200734
ns/iter (± 671037
)0.99
es/full/all/es2020
109649188
ns/iter (± 1162521
)110448849
ns/iter (± 1013588
)0.99
es/full/parser
502537
ns/iter (± 7229
)519937
ns/iter (± 8905
)0.97
es/full/base/fixer
22066
ns/iter (± 35
)21881
ns/iter (± 42
)1.01
es/full/base/resolver_and_hygiene
77715
ns/iter (± 74
)77651
ns/iter (± 36
)1.00
serialization of ast node
119
ns/iter (± 0
)118
ns/iter (± 0
)1.01
serialization of serde
124
ns/iter (± 0
)124
ns/iter (± 0
)1
css/minify/libraries/bootstrap
26827893
ns/iter (± 133781
)26928944
ns/iter (± 136213
)1.00
css/visitor/compare/clone
2085610
ns/iter (± 13202
)2081628
ns/iter (± 6845
)1.00
css/visitor/compare/visit_mut_span
2249047
ns/iter (± 4686
)2279352
ns/iter (± 9005
)0.99
css/visitor/compare/visit_mut_span_panic
2303935
ns/iter (± 7806
)2308912
ns/iter (± 4610
)1.00
css/visitor/compare/fold_span
2998789
ns/iter (± 27094
)2984699
ns/iter (± 27242
)1.00
css/visitor/compare/fold_span_panic
3118083
ns/iter (± 18227
)3117846
ns/iter (± 24334
)1.00
css/lexer/bootstrap_5_1_3
5178678
ns/iter (± 1434
)5176268
ns/iter (± 5200
)1.00
css/lexer/foundation_6_7_4
4355084
ns/iter (± 2516
)4360558
ns/iter (± 1878
)1.00
css/lexer/tailwind_3_1_1
827409
ns/iter (± 1509
)826069
ns/iter (± 512
)1.00
css/parser/bootstrap_5_1_3
20783355
ns/iter (± 69493
)20725430
ns/iter (± 102949
)1.00
css/parser/foundation_6_7_4
16534879
ns/iter (± 30123
)16504813
ns/iter (± 20909
)1.00
css/parser/tailwind_3_1_1
3202702
ns/iter (± 4041
)3186409
ns/iter (± 5001
)1.01
es/codegen/colors
333159
ns/iter (± 187221
)322813
ns/iter (± 181848
)1.03
es/codegen/large
1077868
ns/iter (± 549422
)1224204
ns/iter (± 631237
)0.88
es/codegen/with-parser/colors
46075
ns/iter (± 262
)46082
ns/iter (± 415
)1.00
es/codegen/with-parser/large
515727
ns/iter (± 1794
)515159
ns/iter (± 1543
)1.00
es/minify/libraries/antd
1505844239
ns/iter (± 26897697
)1512478031
ns/iter (± 14657650
)1.00
es/minify/libraries/d3
256456162
ns/iter (± 3365684
)261862349
ns/iter (± 4240974
)0.98
es/minify/libraries/echarts
1127607755
ns/iter (± 9941444
)1129535531
ns/iter (± 15777284
)1.00
es/minify/libraries/jquery
78529747
ns/iter (± 404657
)79159986
ns/iter (± 581416
)0.99
es/minify/libraries/lodash
94826988
ns/iter (± 884518
)95047273
ns/iter (± 954216
)1.00
es/minify/libraries/moment
46189842
ns/iter (± 259937
)45854454
ns/iter (± 314180
)1.01
es/minify/libraries/react
16740508
ns/iter (± 74006
)17020353
ns/iter (± 90805
)0.98
es/minify/libraries/terser
214891458
ns/iter (± 1272267
)214781454
ns/iter (± 2932196
)1.00
es/minify/libraries/three
384676410
ns/iter (± 8159281
)378082590
ns/iter (± 7406074
)1.02
es/minify/libraries/typescript
2733600962
ns/iter (± 24131813
)2795995484
ns/iter (± 17930626
)0.98
es/minify/libraries/victory
589260404
ns/iter (± 8779888
)619274024
ns/iter (± 20721219
)0.95
es/minify/libraries/vue
116776681
ns/iter (± 749375
)116932355
ns/iter (± 783123
)1.00
es/visitor/compare/clone
2419140
ns/iter (± 5224
)2426551
ns/iter (± 13648
)1.00
es/visitor/compare/visit_mut_span
2812898
ns/iter (± 3429
)2818497
ns/iter (± 5236
)1.00
es/visitor/compare/visit_mut_span_panic
2865075
ns/iter (± 3694
)2849323
ns/iter (± 21509
)1.01
es/visitor/compare/fold_span
3968315
ns/iter (± 12193
)3994194
ns/iter (± 9751
)0.99
es/visitor/compare/fold_span_panic
4121378
ns/iter (± 7850
)4143200
ns/iter (± 23230
)0.99
es/lexer/colors
17328
ns/iter (± 32
)17237
ns/iter (± 7
)1.01
es/lexer/angular
8213544
ns/iter (± 2665
)8173117
ns/iter (± 6867
)1.00
es/lexer/backbone
1070329
ns/iter (± 685
)1066864
ns/iter (± 567
)1.00
es/lexer/jquery
5933284
ns/iter (± 4526
)5919345
ns/iter (± 1409
)1.00
es/lexer/jquery mobile
9114890
ns/iter (± 8279
)9099157
ns/iter (± 5683
)1.00
es/lexer/mootools
4643199
ns/iter (± 2635
)4638427
ns/iter (± 1439
)1.00
es/lexer/underscore
893419
ns/iter (± 1755
)890938
ns/iter (± 239
)1.00
es/lexer/three
27607135
ns/iter (± 12496
)27659109
ns/iter (± 21675
)1.00
es/lexer/yui
5045214
ns/iter (± 3447
)5013355
ns/iter (± 2442
)1.01
es/parser/colors
30770
ns/iter (± 260
)30919
ns/iter (± 122
)1.00
es/parser/angular
15577497
ns/iter (± 100432
)15780768
ns/iter (± 222443
)0.99
es/parser/backbone
2306206
ns/iter (± 9443
)2323238
ns/iter (± 11166
)0.99
es/parser/jquery
12505208
ns/iter (± 58819
)12586492
ns/iter (± 96462
)0.99
es/parser/jquery mobile
19867086
ns/iter (± 267847
)19946941
ns/iter (± 450407
)1.00
es/parser/mootools
9589804
ns/iter (± 26451
)9631761
ns/iter (± 41050
)1.00
es/parser/underscore
1959248
ns/iter (± 11956
)1965783
ns/iter (± 10859
)1.00
es/parser/three
58831527
ns/iter (± 838893
)60391384
ns/iter (± 582911
)0.97
es/parser/yui
9607207
ns/iter (± 50324
)9603783
ns/iter (± 128671
)1.00
es/preset-env/usage/builtin_type
143908
ns/iter (± 33737
)144792
ns/iter (± 34151
)0.99
es/preset-env/usage/property
21680
ns/iter (± 70
)21443
ns/iter (± 73
)1.01
es/resolver/typescript
116727632
ns/iter (± 2629148
)122782482
ns/iter (± 2850305
)0.95
es/fixer/typescript
95921067
ns/iter (± 1149141
)97588538
ns/iter (± 1721106
)0.98
es/hygiene/typescript
187543572
ns/iter (± 1207473
)196616731
ns/iter (± 982556
)0.95
es/resolver_with_hygiene/typescript
320022745
ns/iter (± 1935664
)328600094
ns/iter (± 2114614
)0.97
es/visitor/base-perf/module_clone
76116
ns/iter (± 1021
)77152
ns/iter (± 1784
)0.99
es/visitor/base-perf/fold_empty
85562
ns/iter (± 1559
)85928
ns/iter (± 1783
)1.00
es/visitor/base-perf/fold_noop_impl_all
85879
ns/iter (± 979
)85830
ns/iter (± 1139
)1.00
es/visitor/base-perf/fold_noop_impl_vec
86588
ns/iter (± 2240
)86539
ns/iter (± 2154
)1.00
es/visitor/base-perf/boxing_boxed_clone
56
ns/iter (± 0
)58
ns/iter (± 0
)0.97
es/visitor/base-perf/boxing_unboxed_clone
60
ns/iter (± 0
)59
ns/iter (± 0
)1.02
es/visitor/base-perf/boxing_boxed
103
ns/iter (± 0
)105
ns/iter (± 0
)0.98
es/visitor/base-perf/boxing_unboxed
101
ns/iter (± 0
)102
ns/iter (± 0
)0.99
es/visitor/base-perf/visit_contains_this
3532
ns/iter (± 54
)3542
ns/iter (± 66
)1.00
es/base/parallel/resolver/typescript
5663909412
ns/iter (± 518171900
)5976636415
ns/iter (± 537032501
)0.95
es/base/parallel/hygiene/typescript
2205971525
ns/iter (± 31968284
)2258958129
ns/iter (± 28953954
)0.98
misc/visitors/time-complexity/time 5
102
ns/iter (± 0
)102
ns/iter (± 0
)1
misc/visitors/time-complexity/time 10
316
ns/iter (± 0
)325
ns/iter (± 2
)0.97
misc/visitors/time-complexity/time 15
646
ns/iter (± 0
)659
ns/iter (± 12
)0.98
misc/visitors/time-complexity/time 20
1243
ns/iter (± 14
)1241
ns/iter (± 12
)1.00
misc/visitors/time-complexity/time 40
6695
ns/iter (± 23
)6696
ns/iter (± 40
)1.00
misc/visitors/time-complexity/time 60
17142
ns/iter (± 69
)17082
ns/iter (± 27
)1.00
es/full-target/es2016
188716
ns/iter (± 788
)189005
ns/iter (± 512
)1.00
es/full-target/es2017
183349
ns/iter (± 860
)183092
ns/iter (± 628
)1.00
es/full-target/es2018
172697
ns/iter (± 761
)173274
ns/iter (± 230
)1.00
es2020_nullish_coalescing
67392
ns/iter (± 120
)67206
ns/iter (± 161
)1.00
es2020_optional_chaining
96075
ns/iter (± 409
)96888
ns/iter (± 5773
)0.99
es2022_class_properties
93696
ns/iter (± 142
)94748
ns/iter (± 134
)0.99
es2018_object_rest_spread
71659
ns/iter (± 131
)71735
ns/iter (± 81
)1.00
es2019_optional_catch_binding
61801
ns/iter (± 147
)61687
ns/iter (± 153
)1.00
es2017_async_to_generator
62113
ns/iter (± 117
)61806
ns/iter (± 119
)1.00
es2016_exponentiation
65577
ns/iter (± 241
)65584
ns/iter (± 139
)1.00
es2015_arrow
70831
ns/iter (± 167
)70690
ns/iter (± 305
)1.00
es2015_block_scoped_fn
66247
ns/iter (± 124
)66275
ns/iter (± 79
)1.00
es2015_block_scoping
149333
ns/iter (± 8940
)139164
ns/iter (± 5211
)1.07
es2015_classes
116597
ns/iter (± 385
)116252
ns/iter (± 375
)1.00
es2015_computed_props
61514
ns/iter (± 93
)61514
ns/iter (± 106
)1
es2015_destructuring
116319
ns/iter (± 237
)116025
ns/iter (± 418
)1.00
es2015_duplicate_keys
64647
ns/iter (± 79
)64529
ns/iter (± 74
)1.00
es2015_parameters
79812
ns/iter (± 237
)79865
ns/iter (± 167
)1.00
es2015_fn_name
67061
ns/iter (± 540
)66744
ns/iter (± 412
)1.00
es2015_for_of
64882
ns/iter (± 105
)64326
ns/iter (± 72
)1.01
es2015_instanceof
63795
ns/iter (± 114
)63366
ns/iter (± 103
)1.01
es2015_shorthand_property
61367
ns/iter (± 103
)61352
ns/iter (± 97
)1.00
es2015_spread
61553
ns/iter (± 109
)61374
ns/iter (± 57
)1.00
es2015_sticky_regex
62593
ns/iter (± 98
)62503
ns/iter (± 73
)1.00
es2015_typeof_symbol
62613
ns/iter (± 73
)62541
ns/iter (± 109
)1.00
es/transform/baseline/base
52372
ns/iter (± 110
)52166
ns/iter (± 98
)1.00
es/transform/baseline/common_reserved_word
62808
ns/iter (± 109
)62874
ns/iter (± 104
)1.00
es/transform/baseline/common_typescript
168695
ns/iter (± 9701
)142729
ns/iter (± 226
)1.18
es/target/es3
169559
ns/iter (± 160
)169892
ns/iter (± 320
)1.00
es/target/es2015
626662
ns/iter (± 1363
)630585
ns/iter (± 1393
)0.99
es/target/es2016
65569
ns/iter (± 153
)65549
ns/iter (± 135
)1.00
es/target/es2017
62311
ns/iter (± 120
)61954
ns/iter (± 100
)1.01
es/target/es2018
82022
ns/iter (± 85
)81723
ns/iter (± 185
)1.00
es/target/es2020
133388
ns/iter (± 480
)133852
ns/iter (± 246
)1.00
babelify-only
680562
ns/iter (± 1496
)668647
ns/iter (± 985
)1.02
parse_and_babelify_angular
43593527
ns/iter (± 912958
)42938332
ns/iter (± 520564
)1.02
parse_and_babelify_backbone
5322693
ns/iter (± 34459
)5338520
ns/iter (± 38274
)1.00
parse_and_babelify_jquery
32262250
ns/iter (± 481678
)33438636
ns/iter (± 393694
)0.96
parse_and_babelify_jquery_mobile
54604649
ns/iter (± 660305
)56860692
ns/iter (± 947843
)0.96
parse_and_babelify_mootools
33571698
ns/iter (± 530632
)34641760
ns/iter (± 468472
)0.97
parse_and_babelify_underscore
4272272
ns/iter (± 29631
)4315145
ns/iter (± 30223
)0.99
parse_and_babelify_yui
33100982
ns/iter (± 381982
)33497782
ns/iter (± 563155
)0.99
html/minify/document/css_spec
41484365
ns/iter (± 169540
)42664891
ns/iter (± 517786
)0.97
html/minify/document/github
17326646
ns/iter (± 50167
)17382943
ns/iter (± 42946
)1.00
html/minify/document/stackoverflow
15493484
ns/iter (± 24783
)15515253
ns/iter (± 38772
)1.00
html/minify/document_fragment/css_spec
39717165
ns/iter (± 119225
)40387587
ns/iter (± 303003
)0.98
html/minify/document_fragment/github
16642910
ns/iter (± 21255
)16685854
ns/iter (± 75190
)1.00
html/minify/document_fragment/stackoverflow
15018719
ns/iter (± 19253
)15173290
ns/iter (± 79434
)0.99
html/document/visitor/compare/clone
341709
ns/iter (± 1266
)340403
ns/iter (± 2755
)1.00
html/document/visitor/compare/visit_mut_span
369573
ns/iter (± 2332
)365919
ns/iter (± 1702
)1.01
html/document/visitor/compare/visit_mut_span_panic
377834
ns/iter (± 1607
)376268
ns/iter (± 1440
)1.00
html/document/visitor/compare/fold_span
408843
ns/iter (± 2537
)404620
ns/iter (± 2259
)1.01
html/document/visitor/compare/fold_span_panic
465409
ns/iter (± 3118
)461273
ns/iter (± 2510
)1.01
html/document_fragment/visitor/compare/clone
339246
ns/iter (± 2093
)337294
ns/iter (± 1480
)1.01
html/document_fragment/visitor/compare/visit_mut_span
363781
ns/iter (± 2014
)367157
ns/iter (± 2352
)0.99
html/document_fragment/visitor/compare/visit_mut_span_panic
375710
ns/iter (± 1877
)373919
ns/iter (± 2748
)1.00
html/document_fragment/visitor/compare/fold_span
405310
ns/iter (± 2832
)403060
ns/iter (± 1629
)1.01
html/document_fragment/visitor/compare/fold_span_panic
460192
ns/iter (± 1707
)462868
ns/iter (± 3212
)0.99
html/lexer/css_2021_spec
15596391
ns/iter (± 16565
)15590931
ns/iter (± 92973
)1.00
html/lexer/github_com_17_05_2022
6025020
ns/iter (± 2174
)6051707
ns/iter (± 5724
)1.00
html/lexer/stackoverflow_com_17_05_2022
5634222
ns/iter (± 4813
)5663729
ns/iter (± 1995
)0.99
html/parser/parser_document/css_2021_spec
25780436
ns/iter (± 234292
)25781087
ns/iter (± 75219
)1.00
html/parser/parser_document/github_com_17_05_2022
8818410
ns/iter (± 12172
)8780538
ns/iter (± 7586
)1.00
html/parser/parser_document/stackoverflow_com_17_05_2022
7757448
ns/iter (± 5309
)7751769
ns/iter (± 8337
)1.00
html/parser/parser_document_fragment/css_2021_spec
25535133
ns/iter (± 91383
)28111304
ns/iter (± 210206
)0.91
html/parser/parser_document_fragment/github_com_17_05_2022
8801488
ns/iter (± 9222
)9226917
ns/iter (± 10432
)0.95
html/parser/parser_document_fragment/stackoverflow_com_17_05_2022
7762645
ns/iter (± 5515
)8455241
ns/iter (± 4562
)0.92
This comment was automatically generated by workflow using github-action-benchmark.