The default bug view has changed. See this FAQ.

Unprefix battery and vibrator APIs

RESOLVED FIXED in mozilla16

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: sicking, Assigned: mounir)

Tracking

({dev-doc-complete})

Trunk
mozilla16
dev-doc-complete
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox16-)

Details

Attachments

(2 attachments, 2 obsolete attachments)

Comment hidden (empty)
(Assignee)

Updated

5 years ago
Blocks: 678694, 679966
(Assignee)

Comment 1

5 years ago
Created attachment 638124 [details] [diff] [review]
Part 1 - Unprefix Battery API
Assignee: nobody → mounir
Status: NEW → ASSIGNED
Attachment #638124 - Flags: superreview?(bugs)
Attachment #638124 - Flags: review?(jonas)
(Assignee)

Comment 2

5 years ago
Created attachment 638125 [details] [diff] [review]
Part 2 - Unprefix WebVibrator
Attachment #638125 - Flags: superreview?(bugs)
Attachment #638125 - Flags: review?(justin.lebar+bug)
(Assignee)

Comment 3

5 years ago
This wasn't mentioned in comment 0 but those two APIs are being unprefixed because they are now at CR state and no major change should now happen.
Attachment #638124 - Flags: review?(jonas) → review+
Comment on attachment 638125 [details] [diff] [review]
Part 2 - Unprefix WebVibrator

r=me, but let's coordinate landing with the Gaia folks so we don't break them too hard.
Attachment #638125 - Flags: review?(justin.lebar+bug) → review+
Thanks for keeping us up to date! We will land https://github.com/mozilla-b2g/gaia/pull/2107 once this has landed.

Comment 6

5 years ago
Comment on attachment 638124 [details] [diff] [review]
Part 1 - Unprefix Battery API

You should remove NavigatorBattery and merge it to Navigator.
Per the spec NavigatorBattery is [NoInterfaceObject]
Attachment #638124 - Flags: superreview?(bugs) → superreview-

Updated

5 years ago
Attachment #638125 - Flags: superreview?(bugs) → superreview+
(Assignee)

Comment 7

5 years ago
Created attachment 639011 [details] [diff] [review]
Unprefix Battery API

This is changing the behavior of |navigator.battery| when the pref is disabled.
I haven't write test for that because I am not sure whether we will return |null| as I did or if we should return the default values (like if the device was plugged and fully charged). I would tend for the later because that would prevent failures in websites checking if the object is present by doing |'battery' in navigator|.

I will open a follow-up for that.
Attachment #638124 - Attachment is obsolete: true
Attachment #639011 - Flags: superreview?(bugs)

Comment 8

5 years ago
Comment on attachment 639011 [details] [diff] [review]
Unprefix Battery API

I don't think we should do this.

I missed DOM_CLASSINFO_MAP_CONDITIONAL_ENTRY(nsIDOMMozNavigatorBattery,
                                        battery::BatteryManager::HasSupport()) 
earlier, but I think we should rename nsIDOMMozNavigatorBattery to
nsINavigatorBattery so that it doesn't show up in the global scope, yet it
is possible to disable it.
Attachment #639011 - Flags: superreview?(bugs) → superreview-
(Assignee)

Comment 9

5 years ago
Created attachment 639112 [details] [diff] [review]
Unprefix Battery API
Attachment #639011 - Attachment is obsolete: true
Attachment #639112 - Flags: superreview?(bugs)
Comment on attachment 639112 [details] [diff] [review]
Unprefix Battery API


> {
>+  if (!battery::BatteryManager::HasSupport()) {
>+    if (mBatteryManager) {
>+      mBatteryManager->Shutdown();
>+      mBatteryManager = nsnull;
>+    }
>+
>+    *aBattery = nsnull;
>+    return NS_OK;
>+  }
>+
Don't make this change.
Attachment #639112 - Flags: superreview?(bugs) → superreview+
(Assignee)

Updated

5 years ago
tracking-firefox16: --- → ?
Flags: in-testsuite+
Keywords: dev-doc-needed
Target Milestone: --- → mozilla16
(Assignee)

Updated

5 years ago
Attachment #638125 - Flags: checkin+
(Assignee)

Updated

5 years ago
Attachment #639112 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/3626afc51095
https://hg.mozilla.org/mozilla-central/rev/9f088e7bd533
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Updated

5 years ago
tracking-firefox16: ? → -

Updated

4 years ago
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.