Update Vibration API to conform to latest W3C spec

RESOLVED FIXED in mozilla32

Status

()

RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: marcosc, Assigned: mounir)

Tracking

({dev-doc-complete})

Trunk
mozilla32
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(relnote-firefox 32+)

Details

(Whiteboard: [good next bug] , URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

5 years ago
The current Vibration implementation should be updated to match the latest spec (and to match Chrome). The following needs to be supported from [1]:

4. "If the length of pattern is greater than max length, truncate pattern, leaving only the first max length entries."

Currently, we return false. 

"7. For each entry in pattern whose value is greater than max duration, set the entry's value to max duration."

Not sure what we do here, but I'm told it's not right. 

Relevant bits of code:
http://lxr.mozilla.org/mozilla-central/source/dom/base/Navigator.cpp#793
http://lxr.mozilla.org/mozilla-central/source/dom/base/Navigator.cpp#797

[1] http://www.w3.org/TR/vibration/#dfn-processing-vibration-patterns
(Reporter)

Updated

5 years ago
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [good first bug]
Version: 31 Branch → Trunk
This looks like a better good-next than good-first. Marcos, would you be willing to mentor this bug?
Flags: needinfo?(mcaceres)
Whiteboard: [good first bug] → [good next bug]

Comment 2

5 years ago
I'm happy to help answer questions related to the specification if needed (I'm the spec editor).
(Reporter)

Comment 3

5 years ago
(In reply to Mike Hoye [:mhoye] from comment #1)
> This looks like a better good-next than good-first. Marcos, would you be
> willing to mentor this bug?

I'm still not confident enough with the process of getting things in Gecko to be able to mentor this bug. Also, as this involves c++, I won't really be able to help much (I'm mostly a JS shop).
Flags: needinfo?(mcaceres)
(Assignee)

Comment 4

5 years ago
Taking the bug. I have a patch for this but can't upload it yet. Will do ASAP.

Though, Anssi, as long as you are around, it seems that the step 6 isn't followed by Gecko. Do you know the rationale of that step?
Status: NEW → ASSIGNED
QA Contact: mounir
(Assignee)

Updated

5 years ago
Assignee: nobody → mounir
QA Contact: mounir
(Assignee)

Comment 5

5 years ago
Created attachment 8428635 [details] [diff] [review]
Patch with tests
Attachment #8428635 - Flags: review?(bugs)
Attachment #8428635 - Flags: review?(bugs) → review+
(Assignee)

Comment 7

5 years ago
Created attachment 8429562 [details] [diff] [review]
Patch with tests
Attachment #8428635 - Attachment is obsolete: true
(Assignee)

Updated

5 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Target Milestone: --- → mozilla32
https://hg.mozilla.org/mozilla-central/rev/989acfceca7b
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED

Comment 10

5 years ago
(In reply to Mounir Lamouri (:mounir) from comment #4)
> Taking the bug. I have a patch for this but can't upload it yet. Will do
> ASAP.
> 
> Though, Anssi, as long as you are around, it seems that the step 6 isn't
> followed by Gecko. Do you know the rationale of that step?

The rationale:

http://www.w3.org/2009/dap/track/issues/149

The full story:

http://lists.w3.org/Archives/Public/public-device-apis/2014May/0046.html

Mounir - thanks for the patch!
(Assignee)

Comment 11

5 years ago
Oups, there was a typo that smaug and I missed. Landed a fix here:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ea62f66f109
relnote-firefox: --- → +
relnote-firefox: + → ?
Lawrence added it in the release notes with "Vibration API updated to latest W3C spec" as wording.
relnote-firefox: ? → 32+
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.