Changeset 142120 in webkit
- Timestamp:
- Feb 7, 2013 7:24:28 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r142118 r142120 1 2013-02-07 Xiaobo Wang <xbwang@torchmobile.com.cn> 2 3 [BlackBerry] CHHW - Characters that are using 32 bits encoding get trunked to 16bits 4 https://bugs.webkit.org/show_bug.cgi?id=109126 5 PR 292540 6 7 Reviewed by Yong Li. 8 9 Change char code to 4 bytes. 10 Need to convert UTF32 key char to UTF16 before constructing a WTF::String. 11 12 * platform/PlatformKeyboardEvent.h: 13 (WebCore::PlatformKeyboardEvent::unmodifiedCharacter): 14 (PlatformKeyboardEvent): 15 * platform/blackberry/PlatformKeyboardEventBlackBerry.cpp: 16 (WebCore::keyIdentifierForBlackBerryCharacter): 17 (WebCore::windowsKeyCodeForBlackBerryCharacter): 18 (WebCore::adjustCharacterFromOS): 19 (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): 20 1 21 2013-02-07 Mike West <mkwst@chromium.org> 2 22 -
trunk/Source/WebCore/platform/PlatformKeyboardEvent.h
r128572 r142120 139 139 140 140 #if PLATFORM(BLACKBERRY) 141 unsigned shortunmodifiedCharacter() const { return m_unmodifiedCharacter; }141 unsigned unmodifiedCharacter() const { return m_unmodifiedCharacter; } 142 142 #endif 143 143 … … 193 193 194 194 #if PLATFORM(BLACKBERRY) 195 unsigned shortm_unmodifiedCharacter;195 unsigned m_unmodifiedCharacter; 196 196 #endif 197 197 -
trunk/Source/WebCore/platform/blackberry/PlatformKeyboardEventBlackBerry.cpp
r137817 r142120 31 31 namespace WebCore { 32 32 33 static String keyIdentifierForBlackBerryCharacter(unsigned shortcharacter)33 static String keyIdentifierForBlackBerryCharacter(unsigned character) 34 34 { 35 35 switch (character) { … … 112 112 } 113 113 114 static int windowsKeyCodeForBlackBerryCharacter(unsigned shortcharacter)114 static int windowsKeyCodeForBlackBerryCharacter(unsigned character) 115 115 { 116 116 switch (character) { … … 358 358 } 359 359 360 unsigned short adjustCharacterFromOS(unsigned shortcharacter)360 unsigned adjustCharacterFromOS(unsigned character) 361 361 { 362 362 // Use windows key character as ASCII value when possible to enhance readability. … … 447 447 , m_unmodifiedCharacter(event.character()) 448 448 { 449 unsigned short character = adjustCharacterFromOS(event.character()); 450 m_text = String(&character, 1); 449 unsigned character = adjustCharacterFromOS(event.character()); 450 UChar utf16[3] = {0}; 451 int destLength = 0; 452 UErrorCode ec = U_ZERO_ERROR; 453 u_strFromUTF32(utf16, 3, &destLength, reinterpret_cast<UChar32*>(&character), 1, &ec); 454 if (ec) { 455 BBLOG(BlackBerry::Platform::LogLevelCritical, "PlatformKeyboardEvent::PlatformKeyboardEvent Error converting 0x%x to string ec (%d).", character, ec); 456 return; 457 } 458 m_text = String(utf16, destLength); 451 459 m_unmodifiedText = m_text; 452 460 -
trunk/Source/WebKit/blackberry/Api/WebPage.cpp
r141797 r142120 4273 4273 } 4274 4274 4275 static void handleScrolling(unsigned shortcharacter, WebPagePrivate* scroller)4275 static void handleScrolling(unsigned character, WebPagePrivate* scroller) 4276 4276 { 4277 4277 const int scrollFactor = 20; -
trunk/Source/WebKit/blackberry/ChangeLog
r142117 r142120 1 2013-02-07 Xiaobo Wang <xbwang@torchmobile.com.cn> 2 3 [BlackBerry] CHHW - Characters that are using 32 bits encoding get trunked to 16bits 4 https://bugs.webkit.org/show_bug.cgi?id=109126 5 PR 292540 6 7 Reviewed by Yong Li. 8 Internally reviewed by Mike Fenton. 9 10 Key char is UTF32 encoded, should be 4 bytes. 11 12 * Api/WebPage.cpp: 13 (BlackBerry::WebKit::handleScrolling): 14 * WebKitSupport/InputHandler.cpp: 15 (BlackBerry::WebKit::InputHandler::handleKeyboardInput): 16 * WebKitSupport/InputHandler.h: 17 (InputHandler): 18 * WebKitSupport/SelectionHandler.cpp: 19 (BlackBerry::WebKit::directionOfPointRelativeToRect): 20 (BlackBerry::WebKit::SelectionHandler::setCaretPosition): 21 (BlackBerry::WebKit::shouldExtendSelectionInDirection): 22 (BlackBerry::WebKit::directionalVisiblePositionAtExtentOfBox): 23 (BlackBerry::WebKit::SelectionHandler::extendSelectionToFieldBoundary): 24 (BlackBerry::WebKit::SelectionHandler::updateOrHandleInputSelection): 25 * WebKitSupport/SelectionHandler.h: 26 (SelectionHandler): 27 1 28 2013-02-07 Sean Wang <Xuewen.Wang@torchmobile.com.cn> 2 29 -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp
r142116 r142120 1554 1554 { 1555 1555 InputLog(Platform::LogLevelInfo, 1556 "InputHandler::handleKeyboardInput received character='% c', type=%d",1556 "InputHandler::handleKeyboardInput received character='%lc', type=%d", 1557 1557 keyboardEvent.character(), keyboardEvent.type()); 1558 1558 -
trunk/Source/WebKit/blackberry/WebKitSupport/InputHandler.h
r141623 r142120 239 239 240 240 bool m_shouldNotifyWebView; 241 unsigned shortm_expectedKeyUpChar;241 unsigned m_expectedKeyUpChar; 242 242 243 243 imf_sp_text_t m_spellCheckingOptionsRequest; -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
r140043 r142120 185 185 } 186 186 187 static unsigned shortdirectionOfPointRelativeToRect(const WebCore::IntPoint& point, const WebCore::IntRect& rect, const bool useTopPadding = true, const bool useBottomPadding = true)187 static unsigned directionOfPointRelativeToRect(const WebCore::IntPoint& point, const WebCore::IntRect& rect, const bool useTopPadding = true, const bool useBottomPadding = true) 188 188 { 189 189 ASSERT(!rect.contains(point)); … … 266 266 WebCore::IntRect nodeOutlineBounds(focusedRenderer->absoluteOutlineBounds()); 267 267 if (!nodeOutlineBounds.contains(relativePoint)) { 268 if (unsigned shortcharacter = directionOfPointRelativeToRect(relativePoint, currentCaretRect))268 if (unsigned character = directionOfPointRelativeToRect(relativePoint, currentCaretRect)) 269 269 m_webPage->m_inputHandler->handleKeyboardInput(Platform::KeyboardEvent(character)); 270 270 … … 294 294 295 295 // This function makes sure we are not reducing the selection to a caret selection. 296 static bool shouldExtendSelectionInDirection(const VisibleSelection& selection, unsigned shortcharacter)296 static bool shouldExtendSelectionInDirection(const VisibleSelection& selection, unsigned character) 297 297 { 298 298 FrameSelection tempSelection; … … 328 328 } 329 329 330 static VisiblePosition directionalVisiblePositionAtExtentOfBox(Frame* frame, const WebCore::IntRect& boundingBox, unsigned shortdirection, const WebCore::IntPoint& basePoint)330 static VisiblePosition directionalVisiblePositionAtExtentOfBox(Frame* frame, const WebCore::IntRect& boundingBox, unsigned direction, const WebCore::IntPoint& basePoint) 331 331 { 332 332 ASSERT(frame); … … 366 366 } 367 367 368 unsigned shortSelectionHandler::extendSelectionToFieldBoundary(bool isStartHandle, const WebCore::IntPoint& selectionPoint, VisibleSelection& newSelection)368 unsigned SelectionHandler::extendSelectionToFieldBoundary(bool isStartHandle, const WebCore::IntPoint& selectionPoint, VisibleSelection& newSelection) 369 369 { 370 370 Frame* focusedFrame = m_webPage->focusedOrMainFrame(); … … 382 382 // Start handle is outside of the field. Treat it as the changed handle and move 383 383 // relative to the start caret rect. 384 unsigned shortcharacter = directionOfPointRelativeToRect(selectionPoint, caretRect, isStartHandle /* useTopPadding */, !isStartHandle /* useBottomPadding */);384 unsigned character = directionOfPointRelativeToRect(selectionPoint, caretRect, isStartHandle /* useTopPadding */, !isStartHandle /* useBottomPadding */); 385 385 386 386 // Prevent incorrect movement, handles can only extend the selection this way … … 440 440 return false; 441 441 442 unsigned shortcharacter = 0;442 unsigned character = 0; 443 443 if (startIsOutsideOfField) { 444 444 character = extendSelectionToFieldBoundary(true /* isStartHandle */, relativeStart, newSelection); -
trunk/Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h
r138905 r142120 86 86 WebCore::Node* DOMContainerNodeForVisiblePosition(const WebCore::VisiblePosition&) const; 87 87 bool shouldUpdateSelectionOrCaretForPoint(const WebCore::IntPoint&, const WebCore::IntRect&, bool startCaret = true) const; 88 unsigned shortextendSelectionToFieldBoundary(bool isStartHandle, const WebCore::IntPoint& selectionPoint, WebCore::VisibleSelection& newSelection);88 unsigned extendSelectionToFieldBoundary(bool isStartHandle, const WebCore::IntPoint& selectionPoint, WebCore::VisibleSelection& newSelection); 89 89 WebCore::IntPoint clipPointToVisibleContainer(const WebCore::IntPoint&) const; 90 90 -
trunk/Tools/ChangeLog
r142109 r142120 1 2013-02-07 Xiaobo Wang <xbwang@torchmobile.com.cn> 2 3 [BlackBerry] CHHW - Characters that are using 32 bits encoding get trunked to 16bits 4 https://bugs.webkit.org/show_bug.cgi?id=109126 5 PR 292540 6 7 Reviewed by Yong Li. 8 9 Change char code to 4 bytes. 10 11 * DumpRenderTree/blackberry/EventSender.cpp: 12 (keyDownCallback): 13 1 14 2013-02-07 Gavin Peters <gavinp@chromium.org> 2 15 -
trunk/Tools/DumpRenderTree/blackberry/EventSender.cpp
r137880 r142120 122 122 JSStringRef character = JSValueToStringCopy(context, arguments[0], exception); 123 123 ASSERT(!*exception); 124 shortcharCode = 0;124 unsigned charCode = 0; 125 125 bool needsShiftKeyModifier = false; 126 126 if (JSStringIsEqualToUTF8CString(character, "leftArrow"))
Note: See TracChangeset
for help on using the changeset viewer.