Changeset 126057 in webkit


Ignore:
Timestamp:
Aug 20, 2012 12:53:44 PM (12 years ago)
Author:
hans@chromium.org
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):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126056 r126057  
     12012-08-20  Hans Wennborg  <hans@chromium.org>
     2
     3        Respect runtime flags for Device Orientation and Device Motion
     4        https://bugs.webkit.org/show_bug.cgi?id=94479
     5
     6        Reviewed by Adam Barth.
     7
     8        There are flags that allows disabling of device orientation and device
     9        motion at runtime. These flags determine the availability of the
     10        corresponding event constructors in DOMWindow.
     11
     12        However, the flags should also control the ability to add event
     13        listeners for these events, otherwise the feature can be used even if
     14        it is disabled.
     15
     16        * page/DOMWindow.cpp:
     17        (WebCore::DOMWindow::addEventListener):
     18
    1192012-08-20  Philip Rogers  <pdr@google.com>
    220
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r125832 r126057  
    15771577        addBeforeUnloadEventListener(this);
    15781578#if ENABLE(DEVICE_ORIENTATION)
    1579     else if (eventType == eventNames().devicemotionEvent) {
     1579    else if (eventType == eventNames().devicemotionEvent && RuntimeEnabledFeatures::deviceMotionEnabled()) {
    15801580        if (DeviceMotionController* controller = DeviceMotionController::from(page()))
    15811581            controller->addListener(this);
    1582     } else if (eventType == eventNames().deviceorientationEvent) {
     1582    } else if (eventType == eventNames().deviceorientationEvent && RuntimeEnabledFeatures::deviceOrientationEnabled()) {
    15831583        if (DeviceOrientationController* controller = DeviceOrientationController::from(page()))
    15841584            controller->addListener(this);
  • trunk/Source/WebKit/chromium/ChangeLog

    r126055 r126057  
     12012-08-20  Hans Wennborg  <hans@chromium.org>
     2
     3        Respect runtime flags for Device Orientation and Device Motion
     4        https://bugs.webkit.org/show_bug.cgi?id=94479
     5
     6        Reviewed by Adam Barth.
     7
     8        WebRuntimeFeatures::enableDeviceMotion should not be hard-coded to
     9        false.
     10
     11        * src/WebViewImpl.cpp:
     12        (WebKit::WebView::create):
     13
    1142012-08-20  David Reveman  <reveman@chromium.org>
    215
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r125219 r126057  
    267267WebView* WebView::create(WebViewClient* client)
    268268{
    269     // Keep runtime flag for device motion turned off until it's implemented.
    270     WebRuntimeFeatures::enableDeviceMotion(false);
    271 
    272269    // Pass the WebViewImpl's self-reference to the caller.
    273270    return adoptRef(new WebViewImpl(client)).leakRef();
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r125651 r126057  
    120120{
    121121    WebRuntimeFeatures::enableDataTransferItems(true);
     122    WebRuntimeFeatures::enableDeviceMotion(false);
    122123    WebRuntimeFeatures::enableGeolocation(true);
    123124    WebRuntimeFeatures::enablePointerLock(true);
Note: See TracChangeset for help on using the changeset viewer.