Remove navigator.vibrate without user gesture

Desktop / Chromium - binlu [google.com] - 19 April 2017 11:39 EDT

Calls to navigator.vibrate will immediately return 'false' if user hasn't tapped on the frame or any embedded frame yet.

The implementation is behind an experimental flag.

The Intent to Deprecate thread: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/QGcpjisxtik

BUG=704650

Review-Url: https://codereview.chromium.org/2778693004 Cr-Commit-Position: refs/heads/master@{#465618}

c5b5911 Remove navigator.vibrate without user gesture.
chrome/browser/about_flags.cc | 4 ++
chrome/browser/flag_descriptions.cc | 7 +++
chrome/browser/flag_descriptions.h | 6 +++
content/child/runtime_features.cc | 4 ++
content/public/common/content_features.cc | 4 ++
content/public/common/content_features.h | 1 +
third_party/WebKit/LayoutTests/TestExpectations | 13 ++++++
.../resources/feature-policy-vibrate-disabled.html | 18 +++++++-
.../resources/feature-policy-vibrate-enabled.html | 27 ++++++++---
.../feature-policy/vibrate-disabled-expected.txt | 1 +
.../tests/feature-policy/vibrate-enabledforall.php | 17 +++++--
.../feature-policy/vibrate-enabledforself.php | 17 +++++--
.../same-origin-iframe-for-vibrate-allowed.html | 14 ------
.../vibrate_in_same_origin_iframe_allowed.html | 15 ------
.../vibrate-in-cross-origin-iframe-blocked.html} | 0
...brate-in-iframe-with-user-gesture-allowed.html} | 24 ++++------
...me-origin-iframe-with-user-gesture-allowed.html | 54 ++++++++++++++++++++++
.../vibrate-with-user-gesture-allowed.html | 27 +++++++++++
...te-in-cross-origin-iframe-blocked-expected.txt} | 0
.../vibrate-in-cross-origin-iframe-blocked.html} | 2 +-
...-iframe-with-user-gesture-allowed-expected.txt} | 4 +-
...s-origin-iframe-with-user-gesture-allowed.html} | 2 +-
...n-iframe-with-user-gesture-allowed-expected.txt | 14 ++++++
...me-origin-iframe-with-user-gesture-allowed.html | 26 +++++++++++
...e-before-during-after-user-gesture-expected.txt | 5 ++
...-top-page-before-during-after-user-gesture.html | 45 ++++++++++++++++++
.../LayoutTests/resources/user-gesture-utils.js | 13 ++++++
.../cancel-vibration-during-pattern-vibrating.html | 9 +++-
.../vibration/resources/vibrate-from-iframe.html | 27 ++++++++++-
.../LayoutTests/vibration/vibration-durations.html | 11 +++++
.../vibration/vibration-exceptions.html | 6 +++
.../vibration/vibration-iframe-expected.txt | 7 ---
.../vibration/vibration-page-visibility.html | 6 +++
.../LayoutTests/vibration/vibration-patterns.html | 6 +++
.../WebKit/LayoutTests/vibration/vibration.html | 7 +++
.../WebKit/Source/core/frame/Deprecation.cpp | 6 +++
third_party/WebKit/Source/core/frame/UseCounter.h | 1 +
.../modules/vibration/NavigatorVibration.cpp | 35 +++++++++++---
.../Source/platform/RuntimeEnabledFeatures.json5 | 4 ++
tools/metrics/histograms/histograms.xml | 3 ++
40 files changed, 412 insertions(+), 80 deletions(-)

Upstream: git.chromium.org


  • Share