Skip to content

Commit

Permalink
Update autoprefixer data for text-decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Feb 12, 2023
1 parent 0e84e8e commit a58ea6f
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 99 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
"@codemirror/theme-one-dark": "^6.1.0",
"@mdn/browser-compat-data": "^5.1.6",
"@napi-rs/cli": "^2.14.0",
"autoprefixer": "^10.4.8",
"autoprefixer": "^10.4.13",
"codemirror": "^6.0.1",
"cssnano": "^5.0.8",
"esbuild": "^0.13.10",
Expand Down
85 changes: 40 additions & 45 deletions src/compat.rs
Expand Up @@ -292,7 +292,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -384,7 +384,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -429,7 +429,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -492,7 +492,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -537,7 +537,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -582,7 +582,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -627,7 +627,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -719,7 +719,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -764,7 +764,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -838,7 +838,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -883,7 +883,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -973,7 +973,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -1018,7 +1018,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand All @@ -1032,26 +1032,11 @@ impl Feature {
}
}
Feature::CssAutofill => {
if let Some(version) = browsers.chrome {
if version < 6291456 {
return false;
}
}
if let Some(version) = browsers.edge {
if version < 6291456 {
return false;
}
}
if let Some(version) = browsers.firefox {
if version < 5636096 {
return false;
}
}
if let Some(version) = browsers.opera {
if version < 5373952 {
return false;
}
}
if let Some(version) = browsers.safari {
if version < 983040 {
return false;
Expand All @@ -1062,12 +1047,13 @@ impl Feature {
return false;
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
return false;
}
}
if browsers.ie.is_some() || browsers.samsung.is_some() {
if browsers.android.is_some()
|| browsers.chrome.is_some()
|| browsers.edge.is_some()
|| browsers.ie.is_some()
|| browsers.opera.is_some()
|| browsers.samsung.is_some()
{
return false;
}
}
Expand Down Expand Up @@ -1150,7 +1136,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -1195,7 +1181,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down Expand Up @@ -1243,7 +1229,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand All @@ -1257,6 +1243,11 @@ impl Feature {
}
}
Feature::CssHas => {
if let Some(version) = browsers.edge {
if version < 6881280 {
return false;
}
}
if let Some(version) = browsers.chrome {
if version < 6881280 {
return false;
Expand All @@ -1267,18 +1258,22 @@ impl Feature {
return false;
}
}
if let Some(version) = browsers.opera {
if version < 5963776 {
return false;
}
}
if let Some(version) = browsers.ios_saf {
if version < 984064 {
return false;
}
}
if browsers.android.is_some()
|| browsers.edge.is_some()
|| browsers.firefox.is_some()
|| browsers.ie.is_some()
|| browsers.opera.is_some()
|| browsers.samsung.is_some()
{
if let Some(version) = browsers.android {
if version < 7077888 {
return false;
}
}
if browsers.firefox.is_some() || browsers.ie.is_some() || browsers.samsung.is_some() {
return false;
}
}
Expand Down Expand Up @@ -1314,7 +1309,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6750208 {
if version < 7077888 {
return false;
}
}
Expand Down
62 changes: 57 additions & 5 deletions src/lib.rs
Expand Up @@ -11449,7 +11449,6 @@ mod tests {
indoc! {r#"
.foo {
-webkit-text-decoration: underline dotted;
-moz-text-decoration: underline dotted;
text-decoration: underline dotted;
}
"#},
Expand Down Expand Up @@ -11542,12 +11541,12 @@ mod tests {
r#"
.foo {
-webkit-text-decoration: underline dotted;
-moz-text-decoration: underline dotted;
text-decoration: underline dotted;
}
"#,
indoc! {r#"
.foo {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
}
"#},
Expand All @@ -11558,6 +11557,62 @@ mod tests {
},
);

prefix_test(
r#"
.foo {
text-decoration: double underline;
}
"#,
indoc! {r#"
.foo {
-webkit-text-decoration: underline double;
text-decoration: underline double;
}
"#},
Browsers {
safari: Some(16 << 16),
..Browsers::default()
},
);

prefix_test(
r#"
.foo {
text-decoration: underline;
text-decoration-style: double;
}
"#,
indoc! {r#"
.foo {
-webkit-text-decoration: underline double;
text-decoration: underline double;
}
"#},
Browsers {
safari: Some(16 << 16),
..Browsers::default()
},
);

prefix_test(
r#"
.foo {
text-decoration: underline;
text-decoration-color: red;
}
"#,
indoc! {r#"
.foo {
-webkit-text-decoration: underline red;
text-decoration: underline red;
}
"#},
Browsers {
safari: Some(16 << 16),
..Browsers::default()
},
);

prefix_test(
r#"
.foo {
Expand All @@ -11567,7 +11622,6 @@ mod tests {
indoc! {r#"
.foo {
-webkit-text-decoration: var(--test);
-moz-text-decoration: var(--test);
text-decoration: var(--test);
}
"#},
Expand Down Expand Up @@ -11596,10 +11650,8 @@ mod tests {
indoc! {r#"
.foo {
-webkit-text-decoration: underline #ee00be;
-moz-text-decoration: underline #ee00be;
text-decoration: underline #ee00be;
-webkit-text-decoration: underline lch(50.998% 135.363 338);
-moz-text-decoration: underline lch(50.998% 135.363 338);
text-decoration: underline lch(50.998% 135.363 338);
}
"#},
Expand Down

0 comments on commit a58ea6f

Please sign in to comment.