Skip to content
  • adele's avatar
    WebCore: · 1c204837
    adele authored
            Reviewed by Darin.
            
            WebCore part of fix for <rdar://problem/4946753>REGRESSION: Inserting tabs is broken in Mail
    
            In addition to this fix, I also reorganized some event handling code for keyPress events to
            prepare for another fix.  There's also just a little bit of unrelated cleanup.
            
            * dom/EventTargetNode.cpp: (WebCore::EventTargetNode::defaultEventHandler):
              Move tab focus behavior into new defaultKeyboardEventHandler method.
            
            * bridge/EditorClient.h: Added handleKeyPress.
            * editing/Editor.cpp:
            (WebCore::Editor::handleKeyPress): Added. Calls over to the client method.
            (WebCore::Editor::deleteRange): Removed unnecessary propogateDOMException.
            * editing/Editor.h: Added handleKeyPress.
            (WebCore::Editor::addToKillRing): Formatting cleanup.
            * editing/mac/EditorMac.mm: Removed unnecessary propogateDOMException.
            
            * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler): Added. Checks
              the tabKeyCyclesThroughElements setting before advancing focus for tab key events.  Calls handleKeyPress.
            * page/EventHandler.h: Added defaultKeyboardEventHandler.
            
            * page/Page.cpp: (WebCore::Page::Page): Initialize m_tabKeyCyclesThroughElements to true.
            * page/Page.h: Added m_tabKeyCyclesThroughElements.
            (WebCore::Page::setTabKeyCyclesThroughElements): Added.
            (WebCore::Page::tabKeyCyclesThroughElements): Added.
            
            * platform/PlatformKeyboardEvent.h: Added ability to get NSEvent from PlatformKeyboardEvent.
            * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
              Initialize m_macEvent to the NSEvent.
            
            * platform/graphics/svg/SVGImageEmptyClients.h: (WebCore::SVGEmptyEditorClient::handleKeyPress): Added.
    
    WebKit:
    
            Reviewed by Darin.
    
            WebKit part of fix for <rdar://problem/4946753>REGRESSION: Inserting tabs is broken in Mail
            
            In addition to this fix, I also reorganized some event handling code for keyPress events to
            prepare for another fix.
    
            * WebCoreSupport/WebEditorClient.h: Added handleKeyPress method.
            * WebCoreSupport/WebEditorClient.mm:
            (WebEditorClient::handleKeyPress): Added.  Code moved from WebHTMLView keyDown method.
             This is called from the defaultEventHandler so that in the future, we can make the right 
             decision about which selection the keyPress should apply to.
            * WebView/WebHTMLView.mm:
            (-[WebHTMLView keyDown:]): Moved _interceptEditingKeyEvent call to handleKeyPress.
            (-[WebHTMLView _interceptEditingKeyEvent:]): Prevents intercepting keys for cmd-modified events. Removed tabCycling checks
             since this is now handled in WebCore.
            * WebView/WebHTMLViewInternal.h: Made _interceptEditingKeyEvent SPI.
            * WebView/WebView.mm: Use new tabKeyCyclesThroughElements methods on the page.
            (-[WebViewPrivate init]): ditto.
            (-[WebView setTabKeyCyclesThroughElements:]): ditto.
            (-[WebView tabKeyCyclesThroughElements]): ditto.
            (-[WebView setEditable:]): ditto
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    1c204837