summaryrefslogtreecommitdiffstats
path: root/Source/WebKit
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit')
-rw-r--r--Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h4
-rw-r--r--Source/WebKit/android/jni/WebSettings.cpp30
-rw-r--r--Source/WebKit/android/jni/WebViewCore.cpp27
-rw-r--r--Source/WebKit/scripts/generate-webkitversion.pl1
4 files changed, 56 insertions, 6 deletions
diff --git a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index 4d27605..3a6eb06 100644
--- a/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/Source/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -192,6 +192,10 @@ namespace android {
virtual void* webView() const { return 0; }
+#if ENABLE(REQUEST_ANIMATION_FRAME) && !USE(REQUEST_ANIMATION_FRAME_TIMER)
+ virtual void scheduleAnimation() { }
+#endif
+
private:
android::WebFrame* m_webFrame;
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebKit/android/jni/WebSettings.cpp b/Source/WebKit/android/jni/WebSettings.cpp
index 1bd3e36..6aff63e 100644
--- a/Source/WebKit/android/jni/WebSettings.cpp
+++ b/Source/WebKit/android/jni/WebSettings.cpp
@@ -1,5 +1,7 @@
/*
* Copyright 2007, The Android Open Source Project
+ * Copyright (c) 2011, 2012 Code Aurora Forum. All rights reserved.
+ * Copyright (C) 2011, Sony Ericsson Mobile Communications AB
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -133,6 +135,9 @@ struct FieldIds {
mSyntheticLinksEnabled = env->GetFieldID(clazz, "mSyntheticLinksEnabled", "Z");
mUseDoubleTree = env->GetFieldID(clazz, "mUseDoubleTree", "Z");
mPageCacheCapacity = env->GetFieldID(clazz, "mPageCacheCapacity", "I");
+#if ENABLE(WEBGL)
+ mWebGLEnabled = env->GetFieldID(clazz, "mWebGLEnabled", "Z");
+#endif
#if ENABLE(WEB_AUTOFILL)
mAutoFillEnabled = env->GetFieldID(clazz, "mAutoFillEnabled", "Z");
mAutoFillProfile = env->GetFieldID(clazz, "mAutoFillProfile", "Landroid/webkit/WebSettingsClassic$AutoFillProfile;");
@@ -197,6 +202,9 @@ struct FieldIds {
ALOG_ASSERT(mPageCacheCapacity, "Could not find field mPageCacheCapacity");
ALOG_ASSERT(mPasswordEchoEnabled, "Could not find field mPasswordEchoEnabled");
ALOG_ASSERT(mMediaPlaybackRequiresUserGesture, "Could not find field mMediaPlaybackRequiresUserGesture");
+#if ENABLE(WEBGL)
+ ALOG_ASSERT(mWebGLEnabled, "Could not find field mWebGLEnabled");
+#endif
jclass enumClass = env->FindClass("java/lang/Enum");
ALOG_ASSERT(enumClass, "Could not find Enum class!");
@@ -247,6 +255,9 @@ struct FieldIds {
jfieldID mSyntheticLinksEnabled;
jfieldID mUseDoubleTree;
jfieldID mPageCacheCapacity;
+#if ENABLE(WEBGL)
+ jfieldID mWebGLEnabled;
+#endif
// Ordinal() method and value field for enums
jmethodID mOrdinal;
jfieldID mTextSizeValue;
@@ -584,6 +595,11 @@ public:
} else
s->setUsesPageCache(false);
+#if ENABLE(WEBGL)
+ flag = env->GetBooleanField(obj, gFieldIds->mWebGLEnabled);
+ s->setWebGLEnabled(flag);
+#endif
+
#if ENABLE(WEB_AUTOFILL)
flag = env->GetBooleanField(obj, gFieldIds->mAutoFillEnabled);
// TODO: This updates the Settings WebCore side with the user's
@@ -623,8 +639,16 @@ public:
flag = env->GetBooleanField(obj, gFieldIds->mMediaPlaybackRequiresUserGesture);
s->setMediaPlaybackRequiresUserGesture(flag);
}
-};
+ static bool IsWebGLAvailable(JNIEnv* env, jobject obj)
+ {
+#if !ENABLE(WEBGL)
+ return false;
+#else
+ return true;
+#endif
+ }
+};
//-------------------------------------------------------------
// JNI registration
@@ -632,7 +656,9 @@ public:
static JNINativeMethod gWebSettingsMethods[] = {
{ "nativeSync", "(I)V",
- (void*) WebSettings::Sync }
+ (void*) WebSettings::Sync },
+ { "nativeIsWebGLAvailable", "()Z",
+ (void*) WebSettings::IsWebGLAvailable }
};
int registerWebSettings(JNIEnv* env)
diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp
index aa38222..f8cd5ca 100644
--- a/Source/WebKit/android/jni/WebViewCore.cpp
+++ b/Source/WebKit/android/jni/WebViewCore.cpp
@@ -1,5 +1,8 @@
/*
* Copyright 2006, The Android Open Source Project
+ * Copyright (C) 2012 Sony Ericsson Mobile Communications AB.
+ * Copyright (C) 2012 Sony Mobile Communications AB
+ * Copyright (c) 2011,2012 The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -2573,7 +2576,7 @@ Node* WebViewCore::getNextAnchorNode(Node* anchorNode, bool ignoreFirstNode, int
|| isContentInputElement(currentNode))
return currentNode;
if (direction == DIRECTION_FORWARD)
- currentNode = currentNode->traverseNextNode();
+ currentNode = currentNode->traverseNextNodeFastPath();
else
currentNode = currentNode->traversePreviousNodePostOrder(body);
}
@@ -2695,7 +2698,7 @@ Node* WebViewCore::getIntermediaryInputElement(Node* fromNode, Node* toNode, int
while (currentNode && currentNode != toNode) {
if (isContentInputElement(currentNode))
return currentNode;
- currentNode = currentNode->traverseNextNode();
+ currentNode = currentNode->traverseNextNodeFastPath();
}
} else {
Node* currentNode = fromNode->traversePreviousNode();
@@ -2827,7 +2830,7 @@ bool WebViewCore::isVisible(Node* node)
else
element = node->parentElement();
// check renderer
- if (!element->renderer()) {
+ if (!element || !element->renderer()) {
return false;
}
// check size
@@ -4859,6 +4862,15 @@ static void Pause(JNIEnv* env, jobject obj, jint nativeClass)
WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass);
Frame* mainFrame = viewImpl->mainFrame();
+
+ for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) {
+#if ENABLE(WEBGL)
+ Document* document = frame->document();
+ if (document)
+ document->suspendDocument();
+#endif
+ }
+
if (mainFrame)
mainFrame->settings()->setMinDOMTimerInterval(BACKGROUND_TIMER_INTERVAL);
@@ -4875,6 +4887,15 @@ static void Resume(JNIEnv* env, jobject obj, jint nativeClass)
{
WebViewCore* viewImpl = reinterpret_cast<WebViewCore*>(nativeClass);
Frame* mainFrame = viewImpl->mainFrame();
+
+ for (Frame* frame = mainFrame; frame; frame = frame->tree()->traverseNext()) {
+#if ENABLE(WEBGL)
+ Document* document = frame->document();
+ if (document)
+ document->resumeDocument();
+#endif
+ }
+
if (mainFrame)
mainFrame->settings()->setMinDOMTimerInterval(FOREGROUND_TIMER_INTERVAL);
diff --git a/Source/WebKit/scripts/generate-webkitversion.pl b/Source/WebKit/scripts/generate-webkitversion.pl
index 1136277..8cdb418 100644
--- a/Source/WebKit/scripts/generate-webkitversion.pl
+++ b/Source/WebKit/scripts/generate-webkitversion.pl
@@ -39,7 +39,6 @@ use strict;
use Config;
use Getopt::Long;
use File::Path;
-use Switch;
my $usage = "generate-webkitversion --config WebKit/mac/Configurations/Version.xcconfig --outputDir <outputdir>";