Bug 92364

Summary: [WK2] WebPage::handleEditingKeyboardEvent does not check whether the node allows editing.
Product: WebKit Reporter: Mikhail Pozdnyakov <mikhail.pozdnyakov>
Component: WebKit2Assignee: Mikhail Pozdnyakov <mikhail.pozdnyakov>
Status: RESOLVED FIXED    
Severity: Normal CC: kenneth, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 61838    
Attachments:
Description Flags
patch none

Description Mikhail Pozdnyakov 2012-07-26 04:08:37 PDT
WebPage::handleEditingKeyboardEvent does not check whether the node allows editing.
Affects the behavior of fast/events/key-events-in-input-button.html test.
Comment 1 Mikhail Pozdnyakov 2012-07-26 04:14:08 PDT
Created attachment 154607 [details]
patch
Comment 2 Kenneth Rohde Christiansen 2012-07-26 04:40:01 PDT
Comment on attachment 154607 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=154607&action=review

> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2149
> +    // Don't allow text insertion for nodes that cannot edit.
> +    if (!frame->editor()->canEdit())

You might not always have an editor() either.
Comment 3 Mikhail Pozdnyakov 2012-07-26 04:46:40 PDT
(In reply to comment #2)
> (From update of attachment 154607 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=154607&action=review
> 
> > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2149
> > +    // Don't allow text insertion for nodes that cannot edit.
> > +    if (!frame->editor()->canEdit())
> 
> You might not always have an editor() either.

this function ends already with following:
    return frame->editor()->insertText(evt->keyEvent()->text(), evt);

and here is from Frame.h

    inline Editor* Frame::editor() const
    {
        return &m_editor;
    }
Comment 4 Kenneth Rohde Christiansen 2012-07-26 04:48:38 PDT
Ah maybe that changed then
Comment 5 WebKit Review Bot 2012-07-26 05:10:42 PDT
Comment on attachment 154607 [details]
patch

Clearing flags on attachment: 154607

Committed r123732: <http://trac.webkit.org/changeset/123732>
Comment 6 WebKit Review Bot 2012-07-26 05:10:46 PDT
All reviewed patches have been landed.  Closing bug.