summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2009-12-02 08:32:13 -0500
committerPatrick Scott <phanna@android.com>2009-12-09 12:36:31 -0500
commit4b81185780aaef7695b652ceb7770e2307867c59 (patch)
treea2944783f6d398e343e6dfa87e62f8607a2a9680 /WebCore
parentbf16ddc110ef3fde2cfa1ae43ab31d993377981d (diff)
downloadexternal_webkit-4b81185780aaef7695b652ceb7770e2307867c59.zip
external_webkit-4b81185780aaef7695b652ceb7770e2307867c59.tar.gz
external_webkit-4b81185780aaef7695b652ceb7770e2307867c59.tar.bz2
Enable orientation events.
Remove our old orientation hacks as webkit now supports the orientation event. Call down into webkit when the orientation changes to send the js event. The change to Frame.cpp has been submited to bugs.webkit.org as issue 32321.
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/Android.derived.jscbindings.mk2
-rw-r--r--WebCore/Android.derived.v8bindings.mk2
-rw-r--r--WebCore/config.h3
-rw-r--r--WebCore/page/DOMWindow.cpp7
-rw-r--r--WebCore/page/DOMWindow.h3
-rw-r--r--WebCore/page/DOMWindow.idl3
-rw-r--r--WebCore/page/Frame.cpp2
-rw-r--r--WebCore/page/Screen.h3
-rw-r--r--WebCore/platform/android/ScreenAndroid.cpp26
9 files changed, 3 insertions, 48 deletions
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index 88bf830..2eb19f5 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -49,7 +49,7 @@ js_binding_scripts := $(addprefix $(LOCAL_PATH)/,\
bindings/scripts/generate-bindings.pl \
)
-FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1 ENABLE_CHANNEL_MESSAGING=1
+FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1 ENABLE_CHANNEL_MESSAGING=1
# CSS
GEN := \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 015aab6..e0b5d98 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -30,7 +30,7 @@ js_binding_scripts := \
$(LOCAL_PATH)/bindings/scripts/IDLStructure.pm \
$(LOCAL_PATH)/bindings/scripts/generate-bindings.pl
-FEATURE_DEFINES := ANDROID_ORIENTATION_SUPPORT ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1
+FEATURE_DEFINES := ENABLE_ORIENTATION_EVENTS=1 ENABLE_TOUCH_EVENTS=1 V8_BINDING ENABLE_DATABASE=1 ENABLE_OFFLINE_WEB_APPLICATIONS=1 ENABLE_DOM_STORAGE=1 ENABLE_VIDEO=1 ENABLE_WORKERS=1 ENABLE_GEOLOCATION=1
# CSS
GEN := \
diff --git a/WebCore/config.h b/WebCore/config.h
index 127d1cb..19b60c8 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -151,9 +151,6 @@
// PLUGIN_SCHEDULE_TIMER)
#define ANDROID_PLUGINS
-// Add support for the orientation window property
-#define ANDROID_ORIENTATION_SUPPORT
-
// This enables a portable implementation of NPN_[Un]ScheduleTimer
// Will submit this as a patch to apple
#define PLUGIN_SCHEDULE_TIMER
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 64aae8d..8452e55 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -914,13 +914,6 @@ int DOMWindow::scrollX() const
return static_cast<int>(view->scrollX() / m_frame->pageZoomFactor());
}
-#ifdef ANDROID_ORIENTATION_SUPPORT
-int DOMWindow::orientation() const
-{
- return screen()->orientation();
-}
-#endif
-
int DOMWindow::scrollY() const
{
if (!m_frame)
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index c116f5b..235c9a0 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -154,9 +154,6 @@ namespace WebCore {
int scrollY() const;
int pageXOffset() const { return scrollX(); }
int pageYOffset() const { return scrollY(); }
-#ifdef ANDROID_ORIENTATION_SUPPORT
- int orientation() const;
-#endif
bool closed() const;
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index dfafa35..c7bcf82 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -106,9 +106,6 @@ module window {
attribute [Replaceable] long scrollY;
readonly attribute long pageXOffset;
readonly attribute long pageYOffset;
-#if defined(ANDROID_ORIENTATION_SUPPORT)
- attribute [Replaceable] long orientation;
-#endif
[RequiresAllArguments] void scrollBy(in long x, in long y);
[RequiresAllArguments] void scrollTo(in long x, in long y);
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index dac6553..b9bf94e 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -296,7 +296,7 @@ void Frame::sendOrientationChangeEvent(int orientation)
{
m_orientation = orientation;
if (Document* doc = document())
- doc->dispatchWindowEvent(eventNames().orientationchangeEvent, false, false);
+ doc->dispatchWindowEvent(Event::create(eventNames().orientationchangeEvent, false, false));
}
#endif // ENABLE(ORIENTATION_EVENTS)
diff --git a/WebCore/page/Screen.h b/WebCore/page/Screen.h
index 6f34195..2c84abd 100644
--- a/WebCore/page/Screen.h
+++ b/WebCore/page/Screen.h
@@ -52,9 +52,6 @@ namespace WebCore {
unsigned availTop() const;
unsigned availHeight() const;
unsigned availWidth() const;
-#ifdef ANDROID_ORIENTATION_SUPPORT
- int orientation() const;
-#endif
private:
Screen(Frame*);
diff --git a/WebCore/platform/android/ScreenAndroid.cpp b/WebCore/platform/android/ScreenAndroid.cpp
index 881c246..ad6e008 100644
--- a/WebCore/platform/android/ScreenAndroid.cpp
+++ b/WebCore/platform/android/ScreenAndroid.cpp
@@ -60,32 +60,6 @@ bool screenIsMonochrome(Widget* page)
return false;
}
-#ifdef ANDROID_ORIENTATION_SUPPORT
-int Screen::orientation() const
-{
- android::DisplayInfo info;
- android::SurfaceComposerClient::getDisplayInfo(
- android::DisplayID(0), &info);
- // getDisplayInfo returns an enum describing the orientation. Map the enum
- // to the values described here
- // (http://developer.apple.com/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/chapter_8_section_6.html)
- switch (info.orientation) {
- case android::ISurfaceComposer::eOrientationDefault:
- return 0;
- case android::ISurfaceComposer::eOrientation90:
- return 90;
- case android::ISurfaceComposer::eOrientation180:
- return 180;
- case android::ISurfaceComposer::eOrientation270:
- return -90;
- default:
- LOGE("Bad orientation returned from getDisplayIndo %d",
- info.orientation);
- return 0;
- }
-}
-#endif
-
// The only place I have seen these values used is
// positioning popup windows. If we support multiple windows
// they will be most likely full screen. Therefore,