Bug 78136

Summary: Initial upstreaming of selection handling code for BlackBerry port
Product: WebKit Reporter: Nima Ghanavatian <nima.ghanavatian>
Component: New BugsAssignee: Nima Ghanavatian <nima.ghanavatian>
Status: RESOLVED FIXED    
Severity: Normal CC: rwlbuis, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 73144    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Nima Ghanavatian
Reported 2012-02-08 11:55:49 PST
Upstreaming SelectionHandler.cpp and SelectionHandler.h for the BlackBerry port
Attachments
Patch (46.10 KB, patch)
2012-02-09 07:42 PST, Nima Ghanavatian
no flags
Patch (46.50 KB, patch)
2012-02-13 09:46 PST, Nima Ghanavatian
no flags
Patch (45.62 KB, patch)
2012-02-13 12:48 PST, Nima Ghanavatian
no flags
Patch (45.86 KB, patch)
2012-02-13 13:40 PST, Nima Ghanavatian
no flags
Patch (45.80 KB, patch)
2012-02-13 14:06 PST, Nima Ghanavatian
no flags
Rob Buis
Comment 1 2012-02-08 12:17:13 PST
Assign to Nima.
Nima Ghanavatian
Comment 2 2012-02-09 07:42:46 PST
Rob Buis
Comment 3 2012-02-09 08:37:53 PST
Comment on attachment 126301 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126301&action=review Looks good, but can be cleaned up a bit more. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:131 > + IntPoint framePosition = m_webPage->frameOffset(m_webPage->focusedOrMainFrame()); The above can go into the if below, since if the if turns out to be false, these declarations are not needed. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:250 > + if (character) You can combine the above two statements > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:334 > + FrameSelection* controller = focusedFrame->selection(); controller can be moved until after the if. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:380 > + FrameSelection* controller = focusedFrame->selection(); Ditto. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:607 > + ASSERT(m_webPage && m_webPage->focusedOrMainFrame() && m_webPage->focusedOrMainFrame()->selection()); Should ASSERT be moved up? We could crash in debug mode if m_webPage is null without any help. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:678 > + (isStartCaret) ? return !isRTL : return isRTL; No need for parentheses. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:725 > + // Compare start and end and update. end and? > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h:2 > + * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. Once you change anything here better add 2012. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h:24 > +#include "TextGranularity.h" You probably can get away with doing a forward reference to TextGranularity, and including it in the cpp. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h:56 > + bool findNextString(const WTF::String&, bool); Would it be possible to use either WebString or WTF::String exclusively here? Could make the API more consistant. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h:70 > + bool lastUpdatedEndPointIsValid() const { return m_lastUpdatedEndPointIsValid; } Better do a new line here.
Nima Ghanavatian
Comment 4 2012-02-13 09:46:04 PST
Rob Buis
Comment 5 2012-02-13 11:33:43 PST
Comment on attachment 126786 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126786&action=review Looks good, some things still need fixing. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:58 > +using namespace WebCore; This means you can get rid of all the WebCore:: prefixes below. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:316 > + // Extend x to bottom without modifying x. Extend y? > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:646 > + if (renderer) You can do if (RenderObject* renderer = ... ) here > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h:68 > + void caretPositionChanged(); caretPositionChanged should be private, it is not used outside of SelectionHandler.
Nima Ghanavatian
Comment 6 2012-02-13 12:48:58 PST
Nima Ghanavatian
Comment 7 2012-02-13 12:58:26 PST
Comment on attachment 126808 [details] Patch submitted wrong patch =( correct one coming shortly
Nima Ghanavatian
Comment 8 2012-02-13 13:40:31 PST
Rob Buis
Comment 9 2012-02-13 13:57:11 PST
Comment on attachment 126821 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=126821&action=review Almost there, just a few things to fix. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:46 > +#include <BlackBerryPlatformIntRectRegion.h> already included in header. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:141 > + Maybe remove the empty line. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp:608 > + ASSERT(m_webPage && m_inputHandler); you probably mean m_webPage->m_inputHandler. > Source/WebKit/blackberry/WebKitSupport/SelectionHandler.h:34 > +class TextGranularity; Not needed.
Nima Ghanavatian
Comment 10 2012-02-13 14:06:04 PST
Rob Buis
Comment 11 2012-02-13 14:09:24 PST
Comment on attachment 126832 [details] Patch Looks good.
WebKit Review Bot
Comment 12 2012-02-13 23:31:36 PST
Comment on attachment 126832 [details] Patch Clearing flags on attachment: 126832 Committed r107674: <http://trac.webkit.org/changeset/107674>
WebKit Review Bot
Comment 13 2012-02-13 23:31:41 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.