-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add compat data for BatteryManager #1102
Conversation
api/BatteryManager.json
Outdated
"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager", | ||
"support": { | ||
"chrome": { | ||
"version_added": "39" |
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.
This should be "38"
api/BatteryManager.json
Outdated
"version_added": false | ||
}, | ||
"chrome_android": { | ||
"version_added": "42", |
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.
38
api/BatteryManager.json
Outdated
"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/charging", | ||
"support": { | ||
"chrome": { | ||
"version_added": "39" |
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.
38
api/BatteryManager.json
Outdated
"version_added": false | ||
}, | ||
"chrome_android": { | ||
"version_added": "42", |
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.
38
api/BatteryManager.json
Outdated
"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/chargingTime", | ||
"support": { | ||
"chrome": { | ||
"version_added": "39" |
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.
38
api/BatteryManager.json
Outdated
"version_added": false | ||
}, | ||
"chrome_android": { | ||
"version_added": "42", |
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.
38
api/BatteryManager.json
Outdated
"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/ondischargingtimechange", | ||
"support": { | ||
"chrome": { | ||
"version_added": "39" |
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.
38
api/BatteryManager.json
Outdated
"version_added": false | ||
}, | ||
"chrome_android": { | ||
"version_added": "42", |
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.
38
api/BatteryManager.json
Outdated
"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/onlevelchange", | ||
"support": { | ||
"chrome": { | ||
"version_added": "39" |
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.
38
api/BatteryManager.json
Outdated
"version_added": false | ||
}, | ||
"chrome_android": { | ||
"version_added": "42", |
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.
38
Updated everything you commented on @jpmedley . Thanks! |
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.
@gsouquet It is really really good. Too very special cases to fix (I think you just hit too of weirdest BCD cases possible).
"version_removed": "16", | ||
"prefix": "moz" | ||
}, | ||
{ |
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.
Ok, this one is a bit tricky
So from 10-16 it was prefixed moz, from 16-52 activated by default, and 52 onwards deactivated by default.
So this is how to describe it:
[
{
version_added: "16",
version_removed:"52"
},
{
"version_added": "10",
"version_removed": "16",
"prefix": "moz"
},
{
"version_added": "52",
"flags": [
{
"type": "preference",
"name": "dom.battery.enabled"
}
],
"notes": [
"Disabled by default in Firefox 10.0, but can be enabled setting the preference dom.battery.enabled
to true
. Starting with Firefox 11.0, mozBattery
is enabled by default. The Battery API is currently supported on Android, Windows, and Linux with UPower installed. Support for MacOS is available starting with Gecko 18.0 (Firefox 18.0 / Thunderbird 18.0 / SeaMonkey 2.15). Firefox also provide support for the deprecated <a href='https://developer.mozilla.org/docs/Web/API/Navigator/battery' title='The battery read-only property returns a BatteryManager provides information about the system's battery charge level; provides also some new events you can handle to monitor the battery status. This implements the Battery Status API; see that documentation for additional details, a guide to using the API, and sample code.'>navigator.battery
."
]
}
]
(Indentation likely a bit incorrect).
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.
nit: we don't write with Gecko 18.0 (Firefox 18.0 / Thunderbird 18.0 / SeaMonkey 2.15) any more, replace this by Firefox 18. (And Firefox 11, without the .0)
api/BatteryManager.json
Outdated
"version_added": "25" | ||
}, | ||
"safari_ios": { | ||
"version_added": false |
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.
This one is a very special case: it has been added in an unknown version, and removed later in an unknown version (wasn't able to find which ones...)
So:
{
"version_added": true,
"version_removed": true
}
@teoli2003 Thanks for your feedback really appreciated. I guess I have a better understanding on how to structure all of this. I guess all the requested changes are now fixed 👍 How do you find all of those compat data in the first place? Is it just a case of you going through all the vendors changelog? Thanks! |
Yeah, source code, bug trackers, and changelogs mostly :-) |
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.
Thank you!
Bug fixed in Chromium 42: https://bugs.chromium.org/p/chromium/issues/detail?id=401553 https://storage.googleapis.com/chromium-find-releases-static/13e.html#13e397e55501bee3903bfe46edfd56f2442c1f11 In mdn#1102 without discussion: - deprecated - webview_android version
Summary of changes: - Remove navigator.battery, which has been removed since 2013/2016 in Chrome and Firefox respectively. - Simplify Firefox support to only represent when it was on by default for web content. Flags before that and chrome-only after is removed. - Remove claims of prefixes on BatteryManager, the only prefixes here have been navigator.mozBattery and navigator.webkitBattery. - Don't claim it's deprecated, https://w3c.github.io/battery/ is still a "real" spec and Chromium hasn't deprecated it. - Scope the chargingTime/dischargingTime notes to just those entries, and treat it as fixed in Chromium 42 (see below). The chargingTime/dischargingTime issue was fixed in Chromium 42: https://bugs.chromium.org/p/chromium/issues/detail?id=401553 https://storage.googleapis.com/chromium-find-releases-static/13e.html#13e397e55501bee3903bfe46edfd56f2442c1f11 All existing versions were treated as untrustworthy and data was mirrored to all Chromium browsers. Data originally from mdn#1102.
Summary of changes: - Remove navigator.battery, which has been removed since 2013/2016 in Chrome and Firefox respectively. - Treat BatteryManager as only supported since navigator.getBattery() was supported, making the data consistent but technically wrong. - Simplify Firefox support to only represent when it was on by default for web content. Flags before that and chrome-only after is removed. - Remove claims of prefixes on BatteryManager, the only prefixes here have been navigator.mozBattery and navigator.webkitBattery. - Don't claim it's deprecated, https://w3c.github.io/battery/ is still a "real" spec and Chromium hasn't deprecated it. - Scope the chargingTime/dischargingTime notes to just those entries, and treat it as fixed in Chromium 42 (see below). The chargingTime/dischargingTime issue was fixed in Chromium 42: https://bugs.chromium.org/p/chromium/issues/detail?id=401553 https://storage.googleapis.com/chromium-find-releases-static/13e.html#13e397e55501bee3903bfe46edfd56f2442c1f11 All existing versions were treated as untrustworthy and data was mirrored to all Chromium browsers. Data originally from mdn#1102.
Summary of changes: - Remove navigator.battery, which has been removed since 2013/2016 in Chrome and Firefox respectively. - Treat BatteryManager as only supported since navigator.getBattery() was supported, making the data consistent but technically wrong. - Simplify Firefox support to only represent when it was on by default for web content. Flags before that and chrome-only after is removed. - Remove claims of prefixes on BatteryManager, the only prefixes here have been navigator.mozBattery and navigator.webkitBattery. - Don't claim it's deprecated, https://w3c.github.io/battery/ is still a "real" spec and Chromium hasn't deprecated it. - Scope the chargingTime/dischargingTime notes to just those entries, and treat it as fixed in Chromium 42 (see below). The chargingTime/dischargingTime issue was fixed in Chromium 42: https://bugs.chromium.org/p/chromium/issues/detail?id=401553 https://storage.googleapis.com/chromium-find-releases-static/13e.html#13e397e55501bee3903bfe46edfd56f2442c1f11 Data originally from mdn#1102. There was no evidence for or discussion on the webview_android version being 40. All existing versions were treated as untrustworthy and data was mirrored to all Chromium browsers.
Summary of changes: - Remove navigator.battery, which has been removed since 2013/2016 in Chrome and Firefox respectively. - Treat BatteryManager as only supported since navigator.getBattery() was supported, making the data consistent but technically wrong. - Simplify Firefox support to only represent when it was on by default for web content. Flags before that and chrome-only after is removed. - Remove claims of prefixes on BatteryManager, the only prefixes here have been navigator.mozBattery and navigator.webkitBattery. - Don't claim it's deprecated, https://w3c.github.io/battery/ is still a "real" spec and Chromium hasn't deprecated it. - Scope the chargingTime/dischargingTime notes to just those entries, and treat it as fixed in Chromium 42 (see below). The chargingTime/dischargingTime issue was fixed in Chromium 42: https://bugs.chromium.org/p/chromium/issues/detail?id=401553 https://storage.googleapis.com/chromium-find-releases-static/13e.html#13e397e55501bee3903bfe46edfd56f2442c1f11 Data originally from #1102. There was no evidence for or discussion on the webview_android version being 40. All existing versions were treated as untrustworthy and data was mirrored to all Chromium browsers.
This should solve #968
Are you aware of any other pages that need to be migrated, I'm happy to continue helping 👍