Skip to content

Commit

Permalink
Update prefix and compat data
Browse files Browse the repository at this point in the history
Fixes #72. Fixes #26.
  • Loading branch information
devongovett committed Jan 30, 2022
1 parent 583ee72 commit 7060ca1
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 324 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"detect-libc": "^1.0.3"
},
"devDependencies": {
"@mdn/browser-compat-data": "^4.0.12",
"@mdn/browser-compat-data": "^4.1.5",
"@napi-rs/cli": "1.0.4",
"autoprefixer": "^10.4.0",
"caniuse-lite": "^1.0.30001272",
"autoprefixer": "^10.4.2",
"caniuse-lite": "^1.0.30001304",
"cssnano": "^5.0.8",
"esbuild": "^0.13.10",
"jest-diff": "^27.4.2",
Expand Down
27 changes: 0 additions & 27 deletions scripts/build-prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,33 +27,6 @@ const MDN_BROWSER_MAPPING = {
webview_android: 'android'
};

// Fix data, autoprefixer seems wrong.
// See https://developer.mozilla.org/en-US/docs/Web/CSS/::file-selector-button
prefixes['::file-selector-button'].browsers = [
'chrome 1',
'chrome 88',
'edge 12',
'edge 88',
'safari 3',
'safari 14',
'ie 10',
'ie 11',
'ios_saf 1',
'ios_saf 14',
'opera 15',
'opera 74',
'samsung 1',
'samsung 14'
];

// Safari 14+ supports background-clip: text unprefixed. Both MDN and caniuse are incorrect.
// https://github.com/mdn/browser-compat-data/issues/13977
// https://github.com/Fyrd/caniuse/issues/6106
prefixes['background-clip'].browsers = prefixes['background-clip'].browsers.filter(x => {
let m = /^(?:safari|ios_saf) (\d+)/.exec(x);
return !m || parseInt(m[1]) < 14;
});

let flexSpec = {};
let oldGradient = {};
let p = new Map();
Expand Down
37 changes: 21 additions & 16 deletions src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -405,7 +405,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -454,7 +454,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -486,7 +486,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -528,7 +528,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -570,7 +570,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -659,7 +659,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand All @@ -675,6 +675,11 @@ impl Feature {
return true
}
}
if let Some(version) = browsers.firefox {
if version >= 6422528 {
return true
}
}
if let Some(version) = browsers.chrome {
if version >= 2424832 {
return true
Expand All @@ -686,7 +691,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -750,7 +755,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -792,7 +797,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -876,7 +881,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -918,7 +923,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -950,7 +955,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6291456 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -1034,7 +1039,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down Expand Up @@ -1076,7 +1081,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version >= 6160384 {
if version >= 6356992 {
return true
}
}
Expand Down
Loading

0 comments on commit 7060ca1

Please sign in to comment.