The current Vibration implementation should be updated to match the latest spec (and to match Chrome). The following needs to be supported from : 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  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?
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).
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
Created attachment 8428635 [details] [diff] [review] Patch with tests
Attachment #8428635 - Flags: review?(bugs)
Attachment #8428635 - Flags: review?(bugs) → review+
Created attachment 8429562 [details] [diff] [review] Patch with tests
Attachment #8428635 - Attachment is obsolete: true
Target Milestone: --- → mozilla32
Status: ASSIGNED → RESOLVED
Last Resolved: 5 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.
relnote-firefox: ? → 32+
Doc updated: https://developer.mozilla.org/en-US/docs/Web/API/Navigator.vibrate and https://developer.mozilla.org/en-US/Firefox/Releases/32
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.