Closed Bug 1014581 Opened 10 years ago Closed 10 years ago

Update Vibration API to conform to latest W3C spec

Categories

(Core :: DOM: Device Interfaces, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla32
Tracking Status
relnote-firefox --- 32+

People

(Reporter: marcosc, Assigned: mounir)

References

()

Details

(Keywords: dev-doc-complete, Whiteboard: [good next bug] )

Attachments

(1 file, 1 obsolete file)

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
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]
I'm happy to help answer questions related to the specification if needed (I'm the spec editor).
(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)
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: nobody → mounir
QA Contact: mounir
Attached patch Patch with tests (obsolete) — Splinter Review
Attachment #8428635 - Flags: review?(bugs)
Attachment #8428635 - Flags: review?(bugs) → review+
Attached patch Patch with testsSplinter Review
Attachment #8428635 - Attachment is obsolete: true
Flags: in-testsuite+
Keywords: checkin-needed
Target Milestone: --- → mozilla32
https://hg.mozilla.org/mozilla-central/rev/989acfceca7b
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
(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!
Oups, there was a typo that smaug and I missed. Landed a fix here:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0ea62f66f109
Lawrence added it in the release notes with "Vibration API updated to latest W3C spec" as wording.
You need to log in before you can comment on or make changes to this bug.