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

Clean up the data for navigator.getBattery() #9626

Merged
merged 1 commit into from
Apr 16, 2021
Merged

Conversation

foolip
Copy link
Collaborator

@foolip foolip commented 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 #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 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.
@github-actions github-actions bot added the data:api 🐇 Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Mar 26, 2021
@foolip
Copy link
Collaborator Author

foolip commented Mar 26, 2021

Reviewers, there are two things here I expect some might disagree with and are worth flagging.

First, should navigator.battery and its prefixed forms instead be treated as aliases of navigator.getBattery() and merged into that entry? I didn't do this because it was changed from an attributes to an async method, and I'm not sure how to avoid the impression that there was a navigator.battery(). If we ever add types to BCD, this entry would be problematic.

Second, I nuked a lot of notes for Firefox. They don't seem relevant to anyone today, but I'm not sure, should some of it be preserved to help people understand why this was remove from Firefox?

Copy link
Collaborator

@ddbeck ddbeck left a comment

Choose a reason for hiding this comment

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

First, should navigator.battery and its prefixed forms instead be treated as aliases of navigator.getBattery() and merged into that entry?

No, I think you've made the right choice here. I think it's fine to treat this as a materially different feature which was removed. It so happens that it was removed sufficiently long ago that it's now irrelevant. Let's put it in the 🗑️.

That said, would you mind opening a PR on mdn/content to redirect https://developer.mozilla.org/en-US/docs/Web/API/Navigator/battery to https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getBattery?

Second, I nuked a lot of notes for Firefox. They don't seem relevant to anyone today, but I'm not sure, should some of it be preserved to help people understand why this was remove from Firefox?

I think you made the right call here too. The prefixes are ancient history and would be removed if they were standalone features. The prefs would also be irrelevant by now. The chrome code stuff is off-topic and could also be removed legitimately. What's left makes sense. 👍

I do have one suggestion in a line comment, about the experimental status for all of this.

api/BatteryManager.json Show resolved Hide resolved
@ddbeck ddbeck merged commit 60214ba into mdn:main Apr 16, 2021
ddbeck added a commit to ddbeck/browser-compat-data that referenced this pull request Apr 21, 2021
ddbeck added a commit to ddbeck/browser-compat-data that referenced this pull request Apr 21, 2021
ddbeck added a commit that referenced this pull request Apr 22, 2021
* Bump version to 3.3.1
* Add release note for #9626
* Add release note for #10033
* Add release note for #10000
* Add release stats
* Fix inconsistency in release notes stats
@foolip foolip deleted the battery branch November 23, 2021 13:26
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.

3 participants