[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 11:21:40 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2e986f8f18dc69fdf8137e1d15d8293a3914ca5b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jul 20 17:08:31 2010 +0000
2010-07-20 Hans Wennborg <hans at chromium.org>
Reviewed by Steve Block.
Runtime feature switch for device orientation
https://bugs.webkit.org/show_bug.cgi?id=42265
Add a runtime feature switch that decides whether device orientation
events are available or not. Defaults to true.
* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled):
(WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled):
(WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled):
(WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.idl:
* page/Page.cpp:
(WebCore::Page::Page):
2010-07-20 Hans Wennborg <hans at chromium.org>
Reviewed by Steve Block.
Runtime feature switch for device orientation
https://bugs.webkit.org/show_bug.cgi?id=42265
Add a runtime feature switch that decides whether device orientation
events are available or not. Defaults to true.
* public/WebRuntimeFeatures.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableDeviceOrientation):
(WebKit::WebRuntimeFeatures::isDeviceOrientationEnabled):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6bbe17c..317dcfc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,27 @@
+2010-07-20 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Steve Block.
+
+ Runtime feature switch for device orientation
+ https://bugs.webkit.org/show_bug.cgi?id=42265
+
+ Add a runtime feature switch that decides whether device orientation
+ events are available or not. Defaults to true.
+
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ * bindings/generic/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled):
+ (WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled):
+ (WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled):
+ (WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::addEventListener):
+ (WebCore::DOMWindow::removeEventListener):
+ (WebCore::DOMWindow::removeAllEventListeners):
+ * page/DOMWindow.idl:
+ * page/Page.cpp:
+ (WebCore::Page::Page):
+
2010-07-20 Hayato Ito <hayato at chromium.org>
Reviewed by Darin Adler.
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index 7d4e5c1..153f995 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -47,6 +47,7 @@ bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
bool RuntimeEnabledFeatures::isWebGLEnabled = false;
bool RuntimeEnabledFeatures::isPushStateEnabled = false;
bool RuntimeEnabledFeatures::isTouchEnabled = true;
+bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
#if ENABLE(VIDEO)
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.h b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
index 73bbf0f..d8eae23 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.h
@@ -113,6 +113,11 @@ public:
static bool ontouchcancelEnabled() { return isTouchEnabled; }
#endif
+ static void setDeviceOrientationEnabled(bool isEnabled) { isDeviceOrientationEnabled = isEnabled; }
+ static bool deviceOrientationEnabled() { return isDeviceOrientationEnabled; }
+ static bool deviceOrientationEventEnabled() { return isDeviceOrientationEnabled; }
+ static bool ondeviceorientationEnabled() { return isDeviceOrientationEnabled; }
+
private:
// Never instantiate.
RuntimeEnabledFeatures() { }
@@ -126,6 +131,7 @@ private:
static bool isWebGLEnabled;
static bool isPushStateEnabled;
static bool isTouchEnabled;
+ static bool isDeviceOrientationEnabled;
};
} // namespace WebCore
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 918a83a..062d0df 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -1413,8 +1413,8 @@ bool DOMWindow::addEventListener(const AtomicString& eventType, PassRefPtr<Event
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
addBeforeUnloadEventListener(this);
#if ENABLE(DEVICE_ORIENTATION)
- else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page())
- frame()->page()->deviceOrientation()->addListener(this);
+ else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
+ frame()->page()->deviceOrientationController()->addListener(this);
#endif
return true;
@@ -1430,8 +1430,8 @@ bool DOMWindow::removeEventListener(const AtomicString& eventType, EventListener
else if (eventType == eventNames().beforeunloadEvent && allowsBeforeUnloadListeners(this))
removeBeforeUnloadEventListener(this);
#if ENABLE(DEVICE_ORIENTATION)
- else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page())
- frame()->page()->deviceOrientation()->removeListener(this);
+ else if (eventType == eventNames().deviceorientationEvent && frame() && frame()->page() && frame()->page()->deviceOrientationController())
+ frame()->page()->deviceOrientationController()->removeListener(this);
#endif
return true;
@@ -1508,8 +1508,8 @@ void DOMWindow::removeAllEventListeners()
EventTarget::removeAllEventListeners();
#if ENABLE(DEVICE_ORIENTATION)
- if (frame() && frame()->page())
- frame()->page()->deviceOrientation()->removeAllListeners(this);
+ if (frame() && frame()->page() && frame()->page()->deviceOrientationController())
+ frame()->page()->deviceOrientationController()->removeAllListeners(this);
#endif
removeAllUnloadEventListeners(this);
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index c500ee7..82521ba 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -304,8 +304,8 @@ module window {
attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
- attribute [Conditional=DEVICE_ORIENTATION] DeviceOrientationEventConstructor DeviceOrientationEvent;
- attribute [Conditional=DEVICE_ORIENTATION] EventListener ondeviceorientation;
+ attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] DeviceOrientationEventConstructor DeviceOrientationEvent;
+ attribute [Conditional=DEVICE_ORIENTATION, EnabledAtRuntime] EventListener ondeviceorientation;
// EventTarget interface
[Custom] void addEventListener(in DOMString type,
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 59c2238..aaf3d4c 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -57,6 +57,7 @@
#include "ProgressTracker.h"
#include "RenderTheme.h"
#include "RenderWidget.h"
+#include "RuntimeEnabledFeatures.h"
#include "ScriptController.h"
#include "SelectionController.h"
#include "Settings.h"
@@ -139,7 +140,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
, m_geolocationController(new GeolocationController(this, geolocationControllerClient))
#endif
#if ENABLE(DEVICE_ORIENTATION)
- , m_deviceOrientationController(new DeviceOrientationController(this, deviceOrientationClient))
+ , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, deviceOrientationClient) : 0)
#endif
#if ENABLE(INPUT_SPEECH)
, m_speechInputClient(0)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 8a87a64..d4a5222 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-20 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Steve Block.
+
+ Runtime feature switch for device orientation
+ https://bugs.webkit.org/show_bug.cgi?id=42265
+
+ Add a runtime feature switch that decides whether device orientation
+ events are available or not. Defaults to true.
+
+ * public/WebRuntimeFeatures.h:
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableDeviceOrientation):
+ (WebKit::WebRuntimeFeatures::isDeviceOrientationEnabled):
+
2010-07-19 Victoria Kirst <vrk at google.com>
Reviewed by David Levin.
diff --git a/WebKit/chromium/public/WebRuntimeFeatures.h b/WebKit/chromium/public/WebRuntimeFeatures.h
index 03ff681..95307a2 100644
--- a/WebKit/chromium/public/WebRuntimeFeatures.h
+++ b/WebKit/chromium/public/WebRuntimeFeatures.h
@@ -77,6 +77,9 @@ public:
WEBKIT_API static void enableTouch(bool);
WEBKIT_API static bool isTouchEnabled();
+ WEBKIT_API static void enableDeviceOrientation(bool);
+ WEBKIT_API static bool isDeviceOrientationEnabled();
+
private:
WebRuntimeFeatures();
};
diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp
index 595a47f..efb287c 100644
--- a/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -226,4 +226,14 @@ bool WebRuntimeFeatures::isTouchEnabled()
#endif
}
+void WebRuntimeFeatures::enableDeviceOrientation(bool enable)
+{
+ RuntimeEnabledFeatures::setDeviceOrientationEnabled(enable);
+}
+
+bool WebRuntimeFeatures::isDeviceOrientationEnabled()
+{
+ return RuntimeEnabledFeatures::deviceOrientationEnabled();
+}
+
} // namespace WebKit
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list