diff options
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | ThirdPartyProject.prop | 9 | ||||
-rw-r--r-- | WebCore/html/HTMLCollection.cpp | 8 | ||||
-rw-r--r-- | WebCore/platform/android/KeyEventAndroid.cpp | 136 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/FontAndroid.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/text/TextBreakIteratorICU.cpp | 40 | ||||
-rw-r--r-- | WebCore/rendering/RenderBlock.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/jni/WebViewCore.cpp | 4 | ||||
-rw-r--r-- | WebKit/android/nav/WebView.cpp | 12 | ||||
-rw-r--r-- | WebKit/android/plugins/ANPKeyCodes.h | 34 | ||||
-rw-r--r-- | WebKit/android/plugins/ANPSurfaceInterface.cpp | 2 |
11 files changed, 138 insertions, 114 deletions
@@ -278,7 +278,6 @@ LOCAL_SHARED_LIBRARIES := \ libui \ libcutils \ libicuuc \ - libicudata \ libicui18n \ libmedia \ libsurfaceflinger_client diff --git a/ThirdPartyProject.prop b/ThirdPartyProject.prop new file mode 100644 index 0000000..3984909 --- /dev/null +++ b/ThirdPartyProject.prop @@ -0,0 +1,9 @@ +# Copyright 2010 Google Inc. All Rights Reserved. +#Fri Jul 16 10:03:09 PDT 2010 +currentVersion=55486 +version=54731 +isNative=true +name=webkit +keywords=webkit +onDevice=true +homepage=http\://webkit.org/ diff --git a/WebCore/html/HTMLCollection.cpp b/WebCore/html/HTMLCollection.cpp index 5e42d30..8a942c3 100644 --- a/WebCore/html/HTMLCollection.cpp +++ b/WebCore/html/HTMLCollection.cpp @@ -251,14 +251,6 @@ Node* HTMLCollection::firstItem() const Node* HTMLCollection::nextItem() const { resetCollectionInfo(); - -#ifdef ANDROID_FIX - // resetCollectionInfo() can set info->current to be 0. If this is the - // case, we need to go back to the firstItem. Otherwise traverseNextItem - // will crash. - if (!m_info->current) - return firstItem(); -#endif // Look for the 'second' item. The first one is currentItem, already given back. Element* retval = itemAfter(m_info->current); diff --git a/WebCore/platform/android/KeyEventAndroid.cpp b/WebCore/platform/android/KeyEventAndroid.cpp index af29598..ed0a0f7 100644 --- a/WebCore/platform/android/KeyEventAndroid.cpp +++ b/WebCore/platform/android/KeyEventAndroid.cpp @@ -42,124 +42,124 @@ static int windowsKeyCodeForKeyEvent(unsigned int keyCode) { // Does not provide all key codes, and does not handle all keys. switch (keyCode) { - case kKeyCodeDel: + case AKEYCODE_DEL: return VK_BACK; - case kKeyCodeTab: + case AKEYCODE_TAB: return VK_TAB; - case kKeyCodeClear: + case AKEYCODE_CLEAR: return VK_CLEAR; - case kKeyCodeDpadCenter: - case kKeyCodeNewline: + case AKEYCODE_DPAD_CENTER: + case AKEYCODE_ENTER: return VK_RETURN; - case kKeyCodeShiftLeft: - case kKeyCodeShiftRight: + case AKEYCODE_SHIFT_LEFT: + case AKEYCODE_SHIFT_RIGHT: return VK_SHIFT; // back will serve as escape, although we probably do not have access to it - case kKeyCodeBack: + case AKEYCODE_BACK: return VK_ESCAPE; - case kKeyCodeSpace: + case AKEYCODE_SPACE: return VK_SPACE; - case kKeyCodeHome: + case AKEYCODE_HOME: return VK_HOME; - case kKeyCodeDpadLeft: + case AKEYCODE_DPAD_LEFT: return VK_LEFT; - case kKeyCodeDpadUp: + case AKEYCODE_DPAD_UP: return VK_UP; - case kKeyCodeDpadRight: + case AKEYCODE_DPAD_RIGHT: return VK_RIGHT; - case kKeyCodeDpadDown: + case AKEYCODE_DPAD_DOWN: return VK_DOWN; - case kKeyCode0: + case AKEYCODE_0: return VK_0; - case kKeyCode1: + case AKEYCODE_1: return VK_1; - case kKeyCode2: + case AKEYCODE_2: return VK_2; - case kKeyCode3: + case AKEYCODE_3: return VK_3; - case kKeyCode4: + case AKEYCODE_4: return VK_4; - case kKeyCode5: + case AKEYCODE_5: return VK_5; - case kKeyCode6: + case AKEYCODE_6: return VK_6; - case kKeyCode7: + case AKEYCODE_7: return VK_7; - case kKeyCode8: + case AKEYCODE_8: return VK_8; - case kKeyCode9: + case AKEYCODE_9: return VK_9; - case kKeyCodeA: + case AKEYCODE_A: return VK_A; - case kKeyCodeB: + case AKEYCODE_B: return VK_B; - case kKeyCodeC: + case AKEYCODE_C: return VK_C; - case kKeyCodeD: + case AKEYCODE_D: return VK_D; - case kKeyCodeE: + case AKEYCODE_E: return VK_E; - case kKeyCodeF: + case AKEYCODE_F: return VK_F; - case kKeyCodeG: + case AKEYCODE_G: return VK_G; - case kKeyCodeH: + case AKEYCODE_H: return VK_H; - case kKeyCodeI: + case AKEYCODE_I: return VK_I; - case kKeyCodeJ: + case AKEYCODE_J: return VK_J; - case kKeyCodeK: + case AKEYCODE_K: return VK_K; - case kKeyCodeL: + case AKEYCODE_L: return VK_L; - case kKeyCodeM: + case AKEYCODE_M: return VK_M; - case kKeyCodeN: + case AKEYCODE_N: return VK_N; - case kKeyCodeO: + case AKEYCODE_O: return VK_O; - case kKeyCodeP: + case AKEYCODE_P: return VK_P; - case kKeyCodeQ: + case AKEYCODE_Q: return VK_Q; - case kKeyCodeR: + case AKEYCODE_R: return VK_R; - case kKeyCodeS: + case AKEYCODE_S: return VK_S; - case kKeyCodeT: + case AKEYCODE_T: return VK_T; - case kKeyCodeU: + case AKEYCODE_U: return VK_U; - case kKeyCodeV: + case AKEYCODE_V: return VK_V; - case kKeyCodeW: + case AKEYCODE_W: return VK_W; - case kKeyCodeX: + case AKEYCODE_X: return VK_X; - case kKeyCodeY: + case AKEYCODE_Y: return VK_Y; - case kKeyCodeZ: + case AKEYCODE_Z: return VK_Z; // colon - case kKeyCodeSemicolon: + case AKEYCODE_SEMICOLON: return VK_OEM_1; - case kKeyCodeComma: + case AKEYCODE_COMMA: return VK_OEM_COMMA; - case kKeyCodeMinus: + case AKEYCODE_MINUS: return VK_OEM_MINUS; - case kKeyCodeEquals: + case AKEYCODE_EQUALS: return VK_OEM_PLUS; - case kKeyCodePeriod: + case AKEYCODE_PERIOD: return VK_OEM_PERIOD; - case kKeyCodeSlash: + case AKEYCODE_SLASH: return VK_OEM_2; // maybe not the right choice - case kKeyCodeLeftBracket: + case AKEYCODE_LEFT_BRACKET: return VK_OEM_4; - case kKeyCodeBackslash: + case AKEYCODE_BACKSLASH: return VK_OEM_5; - case kKeyCodeRightBracket: + case AKEYCODE_RIGHT_BRACKET: return VK_OEM_6; default: return 0; @@ -171,23 +171,23 @@ static String keyIdentifierForAndroidKeyCode(int keyCode) // Does not return all of the same key identifiers, and // does not handle all the keys. switch (keyCode) { - case kKeyCodeClear: + case AKEYCODE_CLEAR: return "Clear"; - case kKeyCodeNewline: - case kKeyCodeDpadCenter: + case AKEYCODE_ENTER: + case AKEYCODE_DPAD_CENTER: return "Enter"; - case kKeyCodeHome: + case AKEYCODE_HOME: return "Home"; - case kKeyCodeDpadDown: + case AKEYCODE_DPAD_DOWN: return "Down"; - case kKeyCodeDpadLeft: + case AKEYCODE_DPAD_LEFT: return "Left"; - case kKeyCodeDpadRight: + case AKEYCODE_DPAD_RIGHT: return "Right"; - case kKeyCodeDpadUp: + case AKEYCODE_DPAD_UP: return "Up"; // Standard says that DEL becomes U+00007F. - case kKeyCodeDel: + case AKEYCODE_DEL: return "U+00007F"; default: char upper[16]; diff --git a/WebCore/platform/graphics/android/FontAndroid.cpp b/WebCore/platform/graphics/android/FontAndroid.cpp index 36c6248..c783a0b 100644 --- a/WebCore/platform/graphics/android/FontAndroid.cpp +++ b/WebCore/platform/graphics/android/FontAndroid.cpp @@ -188,7 +188,7 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run, SkScalar spacing = paint.getFontMetrics(&metrics); return FloatRect(point.x(), - point.y() - floorf(SkScalarToFloat(-metrics.fAscent)), + point.y(), roundf(SkScalarToFloat(width)), roundf(SkScalarToFloat(spacing))); } diff --git a/WebCore/platform/text/TextBreakIteratorICU.cpp b/WebCore/platform/text/TextBreakIteratorICU.cpp index 44423c0..d4da26a 100644 --- a/WebCore/platform/text/TextBreakIteratorICU.cpp +++ b/WebCore/platform/text/TextBreakIteratorICU.cpp @@ -38,7 +38,7 @@ static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator if (!createdIterator) { UErrorCode openStatus = U_ZERO_ERROR; - iterator = static_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus)); + iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus)); createdIterator = true; ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); } @@ -46,7 +46,7 @@ static TextBreakIterator* setUpIterator(bool& createdIterator, TextBreakIterator return 0; UErrorCode setTextStatus = U_ZERO_ERROR; - ubrk_setText(iterator, string, length, &setTextStatus); + ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus); if (U_FAILURE(setTextStatus)) return 0; @@ -85,44 +85,44 @@ TextBreakIterator* sentenceBreakIterator(const UChar* string, int length) staticSentenceBreakIterator, UBRK_SENTENCE, string, length); } -int textBreakFirst(TextBreakIterator* bi) +int textBreakFirst(TextBreakIterator* iterator) { - return ubrk_first(bi); + return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator)); } -int textBreakLast(TextBreakIterator* bi) +int textBreakLast(TextBreakIterator* iterator) { - return ubrk_last(bi); + return ubrk_last(reinterpret_cast<UBreakIterator*>(iterator)); } -int textBreakNext(TextBreakIterator* bi) +int textBreakNext(TextBreakIterator* iterator) { - return ubrk_next(bi); + return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator)); } -int textBreakPrevious(TextBreakIterator* bi) +int textBreakPrevious(TextBreakIterator* iterator) { - return ubrk_previous(bi); + return ubrk_previous(reinterpret_cast<UBreakIterator*>(iterator)); } -int textBreakPreceding(TextBreakIterator* bi, int pos) +int textBreakPreceding(TextBreakIterator* iterator, int pos) { - return ubrk_preceding(bi, pos); + return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos); } -int textBreakFollowing(TextBreakIterator* bi, int pos) +int textBreakFollowing(TextBreakIterator* iterator, int pos) { - return ubrk_following(bi, pos); + return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos); } -int textBreakCurrent(TextBreakIterator* bi) +int textBreakCurrent(TextBreakIterator* iterator) { - return ubrk_current(bi); + return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator)); } -bool isTextBreak(TextBreakIterator* bi, int pos) +bool isTextBreak(TextBreakIterator* iterator, int pos) { - return ubrk_isBoundary(bi, pos); + return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), pos); } #ifndef BUILDING_ON_TIGER @@ -136,7 +136,7 @@ static TextBreakIterator* setUpIteratorWithRules(bool& createdIterator, TextBrea UParseError parseStatus; UErrorCode openStatus = U_ZERO_ERROR; String rules(breakRules); - iterator = static_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus)); + iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus)); createdIterator = true; ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); } @@ -144,7 +144,7 @@ static TextBreakIterator* setUpIteratorWithRules(bool& createdIterator, TextBrea return 0; UErrorCode setTextStatus = U_ZERO_ERROR; - ubrk_setText(iterator, string, length, &setTextStatus); + ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus); if (U_FAILURE(setTextStatus)) return 0; diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp index bffade7..eabb054 100644 --- a/WebCore/rendering/RenderBlock.cpp +++ b/WebCore/rendering/RenderBlock.cpp @@ -4225,11 +4225,7 @@ void RenderBlock::calcInlinePrefWidths() // check. bool hasBreakableChar, hasBreak; int beginMin, endMin; -#ifdef ANDROID_FIX // bug found by valgrind - bool beginWS = false, endWS = false; -#else bool beginWS, endWS; -#endif int beginMax, endMax; t->trimmedPrefWidths(inlineMax, beginMin, beginWS, endMin, endWS, hasBreakableChar, hasBreak, beginMax, endMax, diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp index 70e96cd..1562775 100644 --- a/WebKit/android/jni/WebViewCore.cpp +++ b/WebKit/android/jni/WebViewCore.cpp @@ -1688,8 +1688,8 @@ void WebViewCore::deleteSelection(int start, int end, int textGeneration) EditorClientAndroid* client = static_cast<EditorClientAndroid*>( m_mainFrame->editor()->client()); client->setUiGeneratedSelectionChange(true); - PlatformKeyboardEvent down(kKeyCodeDel, 0, 0, true, false, false, false); - PlatformKeyboardEvent up(kKeyCodeDel, 0, 0, false, false, false, false); + PlatformKeyboardEvent down(AKEYCODE_DEL, 0, 0, true, false, false, false); + PlatformKeyboardEvent up(AKEYCODE_DEL, 0, 0, false, false, false, false); key(down); key(up); client->setUiGeneratedSelectionChange(false); diff --git a/WebKit/android/nav/WebView.cpp b/WebKit/android/nav/WebView.cpp index 6c58852..2ed6148 100644 --- a/WebKit/android/nav/WebView.cpp +++ b/WebKit/android/nav/WebView.cpp @@ -637,19 +637,19 @@ void getVisibleRect(WebCore::IntRect* rect) checkException(env); } -static CachedFrame::Direction KeyToDirection(KeyCode keyCode) +static CachedFrame::Direction KeyToDirection(int32_t keyCode) { switch (keyCode) { - case kKeyCodeDpadRight: + case AKEYCODE_DPAD_RIGHT: DBG_NAV_LOGD("keyCode=%s", "right"); return CachedFrame::RIGHT; - case kKeyCodeDpadLeft: + case AKEYCODE_DPAD_LEFT: DBG_NAV_LOGD("keyCode=%s", "left"); return CachedFrame::LEFT; - case kKeyCodeDpadDown: + case AKEYCODE_DPAD_DOWN: DBG_NAV_LOGD("keyCode=%s", "down"); return CachedFrame::DOWN; - case kKeyCodeDpadUp: + case AKEYCODE_DPAD_UP: DBG_NAV_LOGD("keyCode=%s", "up"); return CachedFrame::UP; default: @@ -686,7 +686,7 @@ bool moveCursor(int keyCode, int count, bool ignoreScroll) } m_viewImpl->m_moveGeneration++; - CachedFrame::Direction direction = KeyToDirection((KeyCode) keyCode); + CachedFrame::Direction direction = KeyToDirection(keyCode); const CachedFrame* cachedFrame, * oldFrame = 0; const CachedNode* cursor = root->currentCursor(&oldFrame); WebCore::IntPoint cursorLocation = root->cursorLocation(); diff --git a/WebKit/android/plugins/ANPKeyCodes.h b/WebKit/android/plugins/ANPKeyCodes.h index 328eb56..edfe2b9 100644 --- a/WebKit/android/plugins/ANPKeyCodes.h +++ b/WebKit/android/plugins/ANPKeyCodes.h @@ -29,8 +29,7 @@ /* List the key codes that are set to a plugin in the ANPKeyEvent. These exactly match the values in android/view/KeyEvent.java and the - corresponding .h file include/ui/KeycodeLabels.h, which contains more than - I want to publish to plugin authors. + corresponding .h file android/keycodes.h. */ enum ANPKeyCodes { kUnknown_ANPKeyCode = 0, @@ -118,7 +117,36 @@ enum ANPKeyCodes { kPlus_ANPKeyCode = 81, kMenu_ANPKeyCode = 82, kNotification_ANPKeyCode = 83, - kSearch_ANPKeyCode = 84 + kSearch_ANPKeyCode = 84, + kMediaPlayPause_ANPKeyCode = 85, + kMediaStop_ANPKeyCode = 86, + kMediaNext_ANPKeyCode = 87, + kMediaPrevious_ANPKeyCode = 88, + kMediaRewind_ANPKeyCode = 89, + kMediaFastForward_ANPKeyCode = 90, + kMute_ANPKeyCode = 91, + kPageUp_ANPKeyCode = 92, + kPageDown_ANPKeyCode = 93, + kPictsymbols_ANPKeyCode = 94, + kSwitchCharset_ANPKeyCode = 95, + kButtonA_ANPKeyCode = 96, + kButtonB_ANPKeyCode = 97, + kButtonC_ANPKeyCode = 98, + kButtonX_ANPKeyCode = 99, + kButtonY_ANPKeyCode = 100, + kButtonZ_ANPKeyCode = 101, + kButtonL1_ANPKeyCode = 102, + kButtonR1_ANPKeyCode = 103, + kButtonL2_ANPKeyCode = 104, + kButtonR2_ANPKeyCode = 105, + kButtonThumbL_ANPKeyCode = 106, + kButtonThumbR_ANPKeyCode = 107, + kButtonStart_ANPKeyCode = 108, + kButtonSelect_ANPKeyCode = 109, + kButtonMode_ANPKeyCode = 110, + + // NOTE: If you add a new keycode here you must also add it to several other files. + // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list. }; #endif diff --git a/WebKit/android/plugins/ANPSurfaceInterface.cpp b/WebKit/android/plugins/ANPSurfaceInterface.cpp index 8830191..4b99b31 100644 --- a/WebKit/android/plugins/ANPSurfaceInterface.cpp +++ b/WebKit/android/plugins/ANPSurfaceInterface.cpp @@ -64,7 +64,7 @@ static inline sp<Surface> getSurface(JNIEnv* env, jobject view) { jclass surfaceClass = env->FindClass("android/view/Surface"); gSurfaceJavaGlue.surfacePointer = env->GetFieldID(surfaceClass, - "mSurface", "I"); + ANDROID_VIEW_SURFACE_JNI_ID, "I"); env->DeleteLocalRef(surfaceClass); env->DeleteLocalRef(surfaceViewClass); |