Title: [126057] trunk
Revision
126057
Author
[email protected]
Date
2012-08-20 12:53:44 -0700 (Mon, 20 Aug 2012)

Log Message

Respect runtime flags for Device Orientation and Device Motion
https://bugs.webkit.org/show_bug.cgi?id=94479

Reviewed by Adam Barth.

Source/WebCore:

There are flags that allows disabling of device orientation and device
motion at runtime. These flags determine the availability of the
corresponding event constructors in DOMWindow.

However, the flags should also control the ability to add event
listeners for these events, otherwise the feature can be used even if
it is disabled.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):

Source/WebKit/chromium:

WebRuntimeFeatures::enableDeviceMotion should not be hard-coded to
false.

* src/WebViewImpl.cpp:
(WebKit::WebView::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (126056 => 126057)


--- trunk/Source/WebCore/ChangeLog	2012-08-20 19:52:16 UTC (rev 126056)
+++ trunk/Source/WebCore/ChangeLog	2012-08-20 19:53:44 UTC (rev 126057)
@@ -1,3 +1,21 @@
+2012-08-20  Hans Wennborg  <[email protected]>
+
+        Respect runtime flags for Device Orientation and Device Motion
+        https://bugs.webkit.org/show_bug.cgi?id=94479
+
+        Reviewed by Adam Barth.
+
+        There are flags that allows disabling of device orientation and device
+        motion at runtime. These flags determine the availability of the
+        corresponding event constructors in DOMWindow.
+
+        However, the flags should also control the ability to add event
+        listeners for these events, otherwise the feature can be used even if
+        it is disabled.
+
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::addEventListener):
+
 2012-08-20  Philip Rogers  <[email protected]>
 
         Remove incorrect getBBox() code

Modified: trunk/Source/WebCore/page/DOMWindow.cpp (126056 => 126057)


--- trunk/Source/WebCore/page/DOMWindow.cpp	2012-08-20 19:52:16 UTC (rev 126056)
+++ trunk/Source/WebCore/page/DOMWindow.cpp	2012-08-20 19:53:44 UTC (rev 126057)
@@ -1576,10 +1576,10 @@
     else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
         addBeforeUnloadEventListener(this);
 #if ENABLE(DEVICE_ORIENTATION)
-    else if (eventType == eventNames().devicemotionEvent) {
+    else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
         if (DeviceMotionController* controller = DeviceMotionController::from(page()))
             controller->addListener(this);
-    } else if (eventType == eventNames().deviceorientationEvent) {
+    } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
         if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
             controller->addListener(this);
     }

Modified: trunk/Source/WebKit/chromium/ChangeLog (126056 => 126057)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-08-20 19:52:16 UTC (rev 126056)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-08-20 19:53:44 UTC (rev 126057)
@@ -1,3 +1,16 @@
+2012-08-20  Hans Wennborg  <[email protected]>
+
+        Respect runtime flags for Device Orientation and Device Motion
+        https://bugs.webkit.org/show_bug.cgi?id=94479
+
+        Reviewed by Adam Barth.
+
+        WebRuntimeFeatures::enableDeviceMotion should not be hard-coded to
+        false.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebView::create):
+
 2012-08-20  David Reveman  <[email protected]>
 
         [Chromium] Schedule texture uploads based on hard-coded timer and vsync.

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (126056 => 126057)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-20 19:52:16 UTC (rev 126056)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-08-20 19:53:44 UTC (rev 126057)
@@ -266,9 +266,6 @@
 
 WebView* WebView::create(WebViewClient* client)
 {
-    // Keep runtime flag for device motion turned off until it's implemented.
-    WebRuntimeFeatures::enableDeviceMotion(false);
-
     // Pass the WebViewImpl's self-reference to the caller.
     return adoptRef(new WebViewImpl(client)).leakRef();
 }

Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (126056 => 126057)


--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-08-20 19:52:16 UTC (rev 126056)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp	2012-08-20 19:53:44 UTC (rev 126057)
@@ -119,6 +119,7 @@
     , m_isDisplayingModalDialog(false)
 {
     WebRuntimeFeatures::enableDataTransferItems(true);
+    WebRuntimeFeatures::enableDeviceMotion(false);
     WebRuntimeFeatures::enableGeolocation(true);
     WebRuntimeFeatures::enablePointerLock(true);
     WebRuntimeFeatures::enableIndexedDatabase(true);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to