diff options
author | Andrei Popescu <andreip@google.com> | 2009-08-19 18:23:07 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-08-19 18:23:07 +0100 |
commit | cabf1bfc240bac8f24ff95e3bcc9d2d01d3b8a37 (patch) | |
tree | b87e7a4fafac15d2f51fee7db2547be38db7cf9c | |
parent | 72f4ed34e756eaa90b94b74b7a6f43ec33310822 (diff) | |
parent | 1a2d2faa29b8d2ca981ec4f1ccc5d48d24e638cc (diff) | |
download | external_webkit-cabf1bfc240bac8f24ff95e3bcc9d2d01d3b8a37.zip external_webkit-cabf1bfc240bac8f24ff95e3bcc9d2d01d3b8a37.tar.gz external_webkit-cabf1bfc240bac8f24ff95e3bcc9d2d01d3b8a37.tar.bz2 |
Merge commit 'goog/master' into merge
-rw-r--r-- | V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.cc | 4 | ||||
-rw-r--r-- | V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.h | 9 | ||||
-rw-r--r-- | WebCore/html/HTMLBodyElement.cpp | 10 | ||||
-rw-r--r-- | WebCore/html/HTMLDocument.cpp | 4 | ||||
-rw-r--r-- | WebCore/html/HTMLMetaElement.cpp | 20 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 12 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.h | 5 | ||||
-rw-r--r-- | WebKitTools/android/webkitmerge/webkitmerge.cpp | 4 |
8 files changed, 62 insertions, 6 deletions
diff --git a/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.cc b/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.cc index 27a66bc..bc81076 100644 --- a/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.cc +++ b/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.cc @@ -38,6 +38,7 @@ namespace v8 { namespace internal { +#ifdef V8_NATIVE_REGEXP /* * This assembler uses the following register assignment convention * - edx : current character. Must be loaded using LoadCurrentCharacter @@ -1172,4 +1173,7 @@ void RegExpMacroAssemblerIA32::LoadCurrentCharacterUnchecked(int cp_offset, #undef __ + +#endif // V8_NATIVE_REGEXP + }} // namespace v8::internal diff --git a/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.h b/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.h index e8b5b2e..d114392 100644 --- a/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.h +++ b/V8Binding/v8/src/ia32/regexp-macro-assembler-ia32.h @@ -31,6 +31,14 @@ namespace v8 { namespace internal { +#ifndef V8_NATIVE_REGEXP +class RegExpMacroAssemblerIA32: public RegExpMacroAssembler { + public: + RegExpMacroAssemblerIA32() { } + virtual ~RegExpMacroAssemblerIA32() { } +}; + +#else class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler { public: RegExpMacroAssemblerIA32(Mode mode, int registers_to_save); @@ -224,6 +232,7 @@ class RegExpMacroAssemblerIA32: public NativeRegExpMacroAssembler { Label check_preempt_label_; Label stack_overflow_label_; }; +#endif // V8_NATIVE_REGEXP }} // namespace v8::internal diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp index be6663f..c8ae037 100644 --- a/WebCore/html/HTMLBodyElement.cpp +++ b/WebCore/html/HTMLBodyElement.cpp @@ -37,6 +37,7 @@ #ifdef ANDROID_META_SUPPORT #include "Settings.h" +#include "WebViewCore.h" #endif namespace WebCore { @@ -179,9 +180,16 @@ void HTMLBodyElement::insertedIntoDocument() Settings * settings = document()->settings(); String host = document()->baseURI().host().lower(); if (settings->viewportWidth() == -1 && (host.startsWith("m.") || host.startsWith("mobile.") - || host.contains(".m.") || host.contains(".mobile."))) + || host.contains(".m.") || host.contains(".mobile."))) { // fit mobile sites directly in the screen settings->setMetadataSettings("width", "device-width"); + // update the meta data if it is the top document + if (!ownerElement) { + FrameView* view = document()->view(); + if (view) + android::WebViewCore::getWebViewCore(view)->updateViewport(); + } + } #endif // FIXME: This call to scheduleRelayout should not be needed here. diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp index 2457c4f..d60d3fa 100644 --- a/WebCore/html/HTMLDocument.cpp +++ b/WebCore/html/HTMLDocument.cpp @@ -78,6 +78,7 @@ #ifdef ANDROID_META_SUPPORT #include "FrameTree.h" #include "Settings.h" +#include "WebViewCore.h" #endif namespace WebCore { @@ -385,6 +386,9 @@ void HTMLDocument::determineParseMode() strstr(pubIDStr.data(), "-//wapforum//dtd xhtml mobile 1.") == pubIDStr.data()) { // fit mobile sites directly in the screen frame()->settings()->setMetadataSettings("width", "device-width"); + FrameView* frameView = view(); + if (frameView) + android::WebViewCore::getWebViewCore(frameView)->updateViewport(); } #endif // Look up the entry in our gperf-generated table. diff --git a/WebCore/html/HTMLMetaElement.cpp b/WebCore/html/HTMLMetaElement.cpp index 5d3e925..83e38fe 100644 --- a/WebCore/html/HTMLMetaElement.cpp +++ b/WebCore/html/HTMLMetaElement.cpp @@ -29,6 +29,7 @@ #ifdef ANDROID_META_SUPPORT #include "Settings.h" +#include "WebViewCore.h" #endif namespace WebCore { @@ -70,12 +71,25 @@ void HTMLMetaElement::process() #ifdef ANDROID_META_SUPPORT if (!inDocument() || m_content.isNull()) return; - if (equalIgnoringCase(name(), "viewport") || equalIgnoringCase(name(), "format-detection")) + bool updateViewport = false; + if (equalIgnoringCase(name(), "viewport")) { document()->processMetadataSettings(m_content); - else if (equalIgnoringCase(name(), "HandheldFriendly") && equalIgnoringCase(m_content, "true") - && document()->settings()->viewportWidth() == -1) + updateViewport = true; + } else if (equalIgnoringCase(name(), "format-detection")) + document()->processMetadataSettings(m_content); + else if (equalIgnoringCase(name(), "HandheldFriendly") + && equalIgnoringCase(m_content, "true") + && document()->settings()->viewportWidth() == -1) { // fit mobile sites directly in the screen document()->settings()->setMetadataSettings("width", "device-width"); + updateViewport = true; + } + // update the meta data if it is the top document + if (updateViewport && !document()->ownerElement()) { + FrameView* view = document()->view(); + if (view) + android::WebViewCore::getWebViewCore(view)->updateViewport(); + } #endif // Get the document to process the tag, but only if we're actually part of DOM tree (changing a meta tag while // it's not in the tree shouldn't have any effect on the document) diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 3ede30a..670b64a 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -168,6 +168,7 @@ struct WebViewCore::JavaGlue { jmethodID m_jsUnload; jmethodID m_jsInterrupt; jmethodID m_didFirstLayout; + jmethodID m_updateViewport; jmethodID m_sendNotifyProgressFinished; jmethodID m_sendViewInvalidate; jmethodID m_updateTextfield; @@ -242,6 +243,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_jsUnload = GetJMethod(env, clazz, "jsUnload", "(Ljava/lang/String;Ljava/lang/String;)Z"); m_javaGlue->m_jsInterrupt = GetJMethod(env, clazz, "jsInterrupt", "()Z"); m_javaGlue->m_didFirstLayout = GetJMethod(env, clazz, "didFirstLayout", "(Z)V"); + m_javaGlue->m_updateViewport = GetJMethod(env, clazz, "updateViewport", "()V"); m_javaGlue->m_sendNotifyProgressFinished = GetJMethod(env, clazz, "sendNotifyProgressFinished", "()V"); m_javaGlue->m_sendViewInvalidate = GetJMethod(env, clazz, "sendViewInvalidate", "(IIII)V"); m_javaGlue->m_updateTextfield = GetJMethod(env, clazz, "updateTextfield", "(IZLjava/lang/String;I)V"); @@ -839,6 +841,16 @@ void WebViewCore::didFirstLayout() m_history.setDidFirstLayout(true); } +void WebViewCore::updateViewport() +{ + DEBUG_NAV_UI_LOGD("%s", __FUNCTION__); + LOG_ASSERT(m_javaGlue->m_obj, "A Java widget was not associated with this view bridge!"); + + JNIEnv* env = JSC::Bindings::getJNIEnv(); + env->CallVoidMethod(m_javaGlue->object(env).get(), m_javaGlue->m_updateViewport); + checkException(env); +} + void WebViewCore::restoreScale(int scale) { DEBUG_NAV_UI_LOGD("%s", __FUNCTION__); diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h index 1408cb7..97018f0 100644 --- a/WebKit/android/jni/WebViewCore.h +++ b/WebKit/android/jni/WebViewCore.h @@ -152,6 +152,11 @@ namespace android { void didFirstLayout(); /** + * Notify the view to update the viewport. + */ + void updateViewport(); + + /** * Notify the view to restore the screen width, which in turn restores * the scale. */ diff --git a/WebKitTools/android/webkitmerge/webkitmerge.cpp b/WebKitTools/android/webkitmerge/webkitmerge.cpp index c769f5a..22eeb54 100644 --- a/WebKitTools/android/webkitmerge/webkitmerge.cpp +++ b/WebKitTools/android/webkitmerge/webkitmerge.cpp @@ -1159,7 +1159,7 @@ void CompareDirs(const char* workingDir, bool renamePass) workingDir, oldFile); if (sandOrder < 0 && renamePass == false) { // file added by android -- should always have name 'android?' - char* android = strstr(sandFile, "ndroid"); + const char* android = strstr(sandFile, "ndroid"); if (android == NULL) fprintf(stderr, "warning: expect added %s to contain 'android': %s/%s\n", sandDir ? "directory" : "file" , workingDir, sandFile); @@ -1202,7 +1202,7 @@ void CompareDirs(const char* workingDir, bool renamePass) if (iter != renameMap.end()) { string newName = renameMap[rename]; renamedDir = newName.c_str(); - char* renamed = strrchr(renamedDir, '/'); + char* renamed = (char*) strrchr(renamedDir, '/'); *renamed++ = '\0'; // splits rename into two strings if (options.emitPerforceCommands) { fprintf(commandFile, "p4 integrate \"%s/%s/%s\" \"%s/%s/%s\"\n", sandboxCmd, workingDir, oldFile, |