Changeset 105050 in webkit


Ignore:
Timestamp:
Jan 16, 2012 3:31:38 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[crash] Renderer crashes when spell checking a disabled input field.
https://bugs.webkit.org/show_bug.cgi?id=75941

Patch by Shinya Kawanaka <shinyak@google.com> on 2012-01-16
Reviewed by Hajime Morita.

.:

  • ManualTests/editing-disabled-node-replace-crash.html: Added.

Source/WebCore:

We confirm the selection is editable before replacing text.

Tests: ManualTests/editing-disabled-node-replace-crash.html

  • editing/Editor.cpp:

(WebCore::Editor::replaceSelectionWithFragment):

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::ReplaceSelectionCommand::doApply):

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r105019 r105050  
     12012-01-16  Shinya Kawanaka  <shinyak@google.com>
     2
     3        [crash] Renderer crashes when spell checking a disabled input field.
     4        https://bugs.webkit.org/show_bug.cgi?id=75941
     5
     6        Reviewed by Hajime Morita.
     7
     8        * ManualTests/editing-disabled-node-replace-crash.html: Added.
     9
    1102012-01-13  Simon Fraser  <simon.fraser@apple.com>
    211
  • trunk/Source/WebCore/ChangeLog

    r105049 r105050  
     12012-01-16  Shinya Kawanaka  <shinyak@google.com>
     2
     3        [crash] Renderer crashes when spell checking a disabled input field.
     4        https://bugs.webkit.org/show_bug.cgi?id=75941
     5
     6        Reviewed by Hajime Morita.
     7
     8        We confirm the selection is editable before replacing text.
     9
     10        Tests: ManualTests/editing-disabled-node-replace-crash.html
     11
     12        * editing/Editor.cpp:
     13        (WebCore::Editor::replaceSelectionWithFragment):
     14        * editing/ReplaceSelectionCommand.cpp:
     15        (WebCore::ReplaceSelectionCommand::doApply):
     16
    1172012-01-16  Pablo Flouret  <pablof@motorola.com>
    218
  • trunk/Source/WebCore/editing/Editor.cpp

    r103119 r105050  
    401401void Editor::replaceSelectionWithFragment(PassRefPtr<DocumentFragment> fragment, bool selectReplacement, bool smartReplace, bool matchStyle)
    402402{
    403     if (m_frame->selection()->isNone() || !fragment)
     403    if (m_frame->selection()->isNone() || !m_frame->selection()->isContentEditable() || !fragment)
    404404        return;
    405405
  • trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp

    r102864 r105050  
    818818        return;
    819819
     820    if (!selection.rootEditableElement())
     821        return;
     822
    820823    ReplacementFragment fragment(document(), m_documentFragment.get(), m_matchStyle, selection);
    821824    if (performTrivialReplace(fragment))
Note: See TracChangeset for help on using the changeset viewer.