Skip to content

Commit

Permalink
Update compat data
Browse files Browse the repository at this point in the history
  • Loading branch information
devongovett committed Jul 31, 2022
1 parent c1c67e0 commit b658cb9
Show file tree
Hide file tree
Showing 5 changed files with 230 additions and 124 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"detect-libc": "^1.0.3"
},
"devDependencies": {
"@mdn/browser-compat-data": "^4.1.12",
"@mdn/browser-compat-data": "^5.1.6",
"@napi-rs/cli": "^2.6.2",
"autoprefixer": "^10.4.4",
"caniuse-lite": "^1.0.30001319",
"autoprefixer": "^10.4.8",
"caniuse-lite": "^1.0.30001373",
"cssnano": "^5.0.8",
"esbuild": "^0.13.10",
"jest-diff": "^27.4.2",
Expand Down
10 changes: 5 additions & 5 deletions scripts/build-prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const BROWSER_MAPPING = {
bb: null,
kaios: null,
op_mini: null,
oculus: null,
};

const MDN_BROWSER_MAPPING = {
Expand All @@ -24,7 +25,8 @@ const MDN_BROWSER_MAPPING = {
opera_android: 'opera',
safari_ios: 'ios_saf',
samsunginternet_android: 'samsung',
webview_android: 'android'
webview_android: 'android',
oculus: null,
};

// Caniuse data for clip-path is incorrect.
Expand Down Expand Up @@ -56,8 +58,6 @@ prefixes['any-pseudo'] = {
})
}

console.log(prefixes['any-pseudo'])

let flexSpec = {};
let oldGradient = {};
let p = new Map();
Expand All @@ -69,7 +69,7 @@ for (let prop in prefixes) {
continue;
}
let prefix = browsers[name].prefix_exceptions?.[version] || browsers[name].prefix;

// https://github.com/postcss/autoprefixer/blob/main/lib/hacks/backdrop-filter.js#L11
if (prefix === 'ms' && prop === 'backdrop-filter') {
prefix = 'webkit';
Expand Down Expand Up @@ -225,7 +225,7 @@ let mdnFeatures = {
labColors: mdn.css.types.color.lab.__compat.support,
oklabColors: {},
colorFunction: mdn.css.types.color.color.__compat.support,
spaceSeparatedColorFunction: mdn.css.types.color.space_separated_functional_notation.__compat.support,
spaceSeparatedColorFunction: mdn.css.types.color.rgb.space_separated_parameters.__compat.support,
textDecorationThicknessPercent: mdn.css.properties['text-decoration-thickness'].percentage.__compat.support,
textDecorationThicknessShorthand: mdn.css.properties['text-decoration']['text-decoration-thickness'].__compat.support,
cue: mdn.css.selectors.cue.__compat.support,
Expand Down
109 changes: 83 additions & 26 deletions src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -382,7 +382,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -427,7 +427,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -490,7 +490,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -535,7 +535,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -580,7 +580,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -625,7 +625,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -717,7 +717,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -762,7 +762,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -836,7 +836,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -881,7 +881,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -971,7 +971,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -1016,7 +1016,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -1061,7 +1061,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -1193,7 +1193,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -1241,7 +1241,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6488064 {
if version < 6750208 {
return false;
}
}
Expand All @@ -1255,6 +1255,11 @@ impl Feature {
}
}
Feature::CssHas => {
if let Some(version) = browsers.chrome {
if version < 6881280 {
return false;
}
}
if let Some(version) = browsers.safari {
if version < 984064 {
return false;
Expand All @@ -1266,7 +1271,6 @@ impl Feature {
}
}
if browsers.android.is_some()
|| browsers.chrome.is_some()
|| browsers.edge.is_some()
|| browsers.firefox.is_some()
|| browsers.ie.is_some()
Expand Down Expand Up @@ -1308,7 +1312,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 6553600 {
if version < 6750208 {
return false;
}
}
Expand Down Expand Up @@ -1537,14 +1541,22 @@ impl Feature {
}
}
Feature::MediaRangeSyntax => {
if let Some(version) = browsers.chrome {
if version < 6815744 {
return false;
}
}
if let Some(version) = browsers.firefox {
if version < 4128768 {
return false;
}
}
if browsers.android.is_some()
|| browsers.chrome.is_some()
|| browsers.edge.is_some()
if let Some(version) = browsers.android {
if version < 6815744 {
return false;
}
}
if browsers.edge.is_some()
|| browsers.ie.is_some()
|| browsers.ios_saf.is_some()
|| browsers.opera.is_some()
Expand All @@ -1554,7 +1566,7 @@ impl Feature {
return false;
}
}
Feature::LogicalBorders | Feature::LogicalMargin | Feature::LogicalPadding => {
Feature::LogicalBorders => {
if let Some(version) = browsers.chrome {
if version < 4521984 {
return false;
Expand Down Expand Up @@ -1616,7 +1628,7 @@ impl Feature {
}
}
if let Some(version) = browsers.opera {
if version < 3145728 {
if version < 4063232 {
return false;
}
}
Expand Down Expand Up @@ -1689,6 +1701,51 @@ impl Feature {
return false;
}
}
Feature::LogicalMargin | Feature::LogicalPadding => {
if let Some(version) = browsers.chrome {
if version < 5701632 {
return false;
}
}
if let Some(version) = browsers.edge {
if version < 5701632 {
return false;
}
}
if let Some(version) = browsers.firefox {
if version < 2686976 {
return false;
}
}
if let Some(version) = browsers.opera {
if version < 4063232 {
return false;
}
}
if let Some(version) = browsers.safari {
if version < 786688 {
return false;
}
}
if let Some(version) = browsers.ios_saf {
if version < 786944 {
return false;
}
}
if let Some(version) = browsers.samsung {
if version < 917504 {
return false;
}
}
if let Some(version) = browsers.android {
if version < 5701632 {
return false;
}
}
if browsers.ie.is_some() {
return false;
}
}
Feature::LogicalInset => {
if let Some(version) = browsers.chrome {
if version < 5701632 {
Expand Down Expand Up @@ -1981,7 +2038,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 2424832 {
if version < 263168 {
return false;
}
}
Expand Down Expand Up @@ -2021,7 +2078,7 @@ impl Feature {
}
}
if let Some(version) = browsers.android {
if version < 2424832 {
if version < 263168 {
return false;
}
}
Expand Down

0 comments on commit b658cb9

Please sign in to comment.