Skip to content
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

Merged
merged 3 commits into from
Feb 28, 2018
Merged

Conversation

germain-gg
Copy link
Contributor

This should solve #968
Are you aware of any other pages that need to be migrated, I'm happy to continue helping 👍

"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager",
"support": {
"chrome": {
"version_added": "39"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "38"

"version_added": false
},
"chrome_android": {
"version_added": "42",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/charging",
"support": {
"chrome": {
"version_added": "39"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"version_added": false
},
"chrome_android": {
"version_added": "42",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/chargingTime",
"support": {
"chrome": {
"version_added": "39"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"version_added": false
},
"chrome_android": {
"version_added": "42",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/ondischargingtimechange",
"support": {
"chrome": {
"version_added": "39"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"version_added": false
},
"chrome_android": {
"version_added": "42",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"mdn_url": "https://developer.mozilla.org/docs/Web/API/BatteryManager/onlevelchange",
"support": {
"chrome": {
"version_added": "39"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

"version_added": false
},
"chrome_android": {
"version_added": "42",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

@germain-gg
Copy link
Contributor Author

Updated everything you commented on @jpmedley . Thanks!

Copy link
Contributor

@teoli2003 teoli2003 left a 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"
},
{
Copy link
Contributor

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).

Copy link
Contributor

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)

"version_added": "25"
},
"safari_ios": {
"version_added": false
Copy link
Contributor

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 teoli2003 added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Feb 16, 2018
@germain-gg
Copy link
Contributor Author

@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!

@Elchi3
Copy link
Member

Elchi3 commented Feb 28, 2018

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?

Yeah, source code, bug trackers, and changelogs mostly :-)

@Elchi3 Elchi3 dismissed teoli2003’s stale review February 28, 2018 12:56

Comments addressed

Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Elchi3 Elchi3 merged commit d7b2c79 into mdn:master Feb 28, 2018
@Elchi3 Elchi3 mentioned this pull request Mar 1, 2018
9 tasks
dontcallmedom pushed a commit to dontcallmedom/browser-compat-data that referenced this pull request Mar 17, 2018
foolip added a commit to foolip/browser-compat-data that referenced this pull request Mar 25, 2021
foolip added a commit to foolip/browser-compat-data that referenced this pull request Mar 26, 2021
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.
foolip added a commit to foolip/browser-compat-data that referenced this pull request Mar 26, 2021
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.
foolip added a commit to foolip/browser-compat-data that referenced this pull request Mar 26, 2021
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.
ddbeck pushed a commit that referenced this pull request Apr 16, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants