Changeset 19913 in webkit


Ignore:
Timestamp:
Feb 28, 2007 2:11:18 PM (17 years ago)
Author:
brmorris
Message:

yadavall, Reviewed by Sachin

DESC: Toolbar should be activated only on long keypress CR: 102-5945
http://bugs.webkit.org/show_bug.cgi?id=12816

Location:
S60/branches/3.1m/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • S60/branches/3.1m/WebKit/BrowserView/src/KeyEventHandler.cpp

    r19466 r19913  
    166166            // clear the last event key
    167167            iLastEventKey = KNullKeyEvent;
     168            iElType = iWebKitView->FocusedElementType();
    168169            return EKeyWasNotConsumed;
    169170            }
     
    195196                case EKeyDevice3:
    196197                    {
    197                     iElType = iWebKitView->FocusedElementType();
     198                    /*
     199                    Toolbar is activated on long key press only if the element type during keydown and element type
     200                    during EEventKey are EElementNone. This prevents toolbar from popping up in
     201                    DHTML pages. Also, toolbar is activated when the user is not in fast scroll mode or in page overview mode
     202                    */
     203                    if( iElType == TBrCtlDefs::EElementNone
     204                        && iWebKitView->FocusedElementType() == TBrCtlDefs::EElementNone
     205                        && aKeyEvent.iRepeats
     206                        && iWebKitView->WebKitControl().BrCtl().Capabilities() & TBrCtlDefs::ECapabilityToolBar
     207                        && !iJoystickTimer->IsActive()
     208                        && !iWebKitView->WebKitControl().InPageViewMode()
     209                        )
     210                        {
     211                        iWebKitView->LaunchToolBarL();
     212                        // and send the keyrelease event to webcore. otherwise, webcore gets
     213                        // stuck in keypressed state
     214                        CWebKitFrame* f = iWebKitView->MainFrame().FocusedFrame();
     215                        if( f == NULL )
     216                            {
     217                            f = &iWebKitView->MainFrame();
     218                            }
     219
     220                        //send the keypress event to webcore, so that it is not in keypress state
     221                        TPoint absCursorPos = iWebKitView->Cursor()->Position() + iWebKitView->MainFrame().ToViewCoords(iWebKitView->MainFrame().ContentPosition());
     222                        absCursorPos -= f->RectInGlobalCoords().iTl;
     223                        absCursorPos = iWebKitView->MainFrame().ToDocCoords(absCursorPos);
     224                        TPointerEvent event;
     225                        event.iPosition = absCursorPos;
     226                        event.iModifiers = 0;
     227                        event.iType = TPointerEvent::EButton1Up;
     228
     229                        f->WebKitBridge().WebCoreBridge().PointerEvent(event);
     230                        return EKeyWasConsumed;
     231                        }
    198232                    // fake key event down
    199233                    keyResponse = HandleActivateKeysL( aKeyEvent, EEventKeyDown );
     
    469503TKeyResponse
    470504CKeyEventHandler::HandleActivateKeysL(
    471     const TKeyEvent& aKeyEvent,
     505    const TKeyEvent& /*aKeyEvent*/,
    472506    TEventCode aEventCode )
    473507    {
     
    556590        else
    557591            {
    558             if( iElType == TBrCtlDefs::EElementNone
    559                 && iWebKitView->FocusedElementType() == TBrCtlDefs::EElementNone
    560                 && aEventCode == EEventKeyUp && aKeyEvent.iRepeats == 0
    561                 && iWebKitView->WebKitControl().BrCtl().Capabilities() & TBrCtlDefs::ECapabilityToolBar )
    562                 {
    563                 iWebKitView->LaunchToolBarL();
    564                 // and send the keyrelease event to webcore. otherwise, webcore gets
    565                 // stuck in keypressed state
    566                 TPointerEvent event;
    567                 event.iPosition = absCursorPos;
    568                 event.iModifiers = 0;
    569                 event.iType = TPointerEvent::EButton1Up;
    570                 focused->WebKitBridge().WebCoreBridge().PointerEvent(event);
    571                 return EKeyWasConsumed;
    572                 }
    573592
    574593            TPointerEvent event;
  • S60/branches/3.1m/WebKit/ChangeLog

    r19854 r19913  
     1yadavall, Reviewed by Sachin
     2        DESC: Toolbar should be activated only on long keypress CR: 102-5945
     3        http://bugs.webkit.org/show_bug.cgi?id=12816
     4
     5        * BrowserView/src/KeyEventHandler.cpp:
     6        (CKeyEventHandler::HandleOfferKeyEventL):
     7        (CKeyEventHandler::HandleActivateKeysL):
     8
    19spadma, reviewed by <Yongjun>
    210 DESC: Urls are doubly encoded. TSW ID: HIIN-6YMGYV
Note: See TracChangeset for help on using the changeset viewer.