Changeset 96628 in webkit


Ignore:
Timestamp:
Oct 4, 2011 12:02:44 PM (13 years ago)
Author:
rniwa@webkit.org
Message:

REGRESSION(r94274): setting input.value erroneously triggers focus event
https://bugs.webkit.org/show_bug.cgi?id=69315

Reviewed by Kent Tamura.

Fixed the bug by adding a new flag to setSelection to avoid calling setFocusedNodeIfNeeded
when called by nodeWillBeRemoved and textWillBeReplaced.

Added a manual test. Unfortunately, the test always passes in DRT.

  • editing/FrameSelection.cpp:

(WebCore::FrameSelection::setSelection):
(WebCore::FrameSelection::respondToNodeModification):
(WebCore::FrameSelection::textWillBeReplaced):

  • editing/FrameSelection.h:
  • manual-tests/mutate-unfocused-text-with-selection.html: Added.
Location:
trunk/Source/WebCore
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96626 r96628  
     12011-10-04  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        REGRESSION(r94274): setting input.value erroneously triggers focus event
     4        https://bugs.webkit.org/show_bug.cgi?id=69315
     5
     6        Reviewed by Kent Tamura.
     7
     8        Fixed the bug by adding a new flag to setSelection to avoid calling setFocusedNodeIfNeeded
     9        when called by nodeWillBeRemoved and textWillBeReplaced.
     10
     11        Added a manual test. Unfortunately, the test always passes in DRT.
     12
     13        * editing/FrameSelection.cpp:
     14        (WebCore::FrameSelection::setSelection):
     15        (WebCore::FrameSelection::respondToNodeModification):
     16        (WebCore::FrameSelection::textWillBeReplaced):
     17        * editing/FrameSelection.h:
     18        * manual-tests/mutate-unfocused-text-with-selection.html: Added.
     19
    1202011-10-04  Young Han Lee  <joybro201@gmail.com>
    221
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r96257 r96628  
    275275    setCaretRectNeedsUpdate();
    276276   
    277     if (!s.isNone())
     277    if (!s.isNone() && !(options & DoNotSetFocus))
    278278        setFocusedNodeIfNeeded();
    279279   
     
    394394
    395395    if (clearDOMTreeSelection)
    396         setSelection(VisibleSelection(), 0);
     396        setSelection(VisibleSelection(), DoNotSetFocus);
    397397}
    398398
     
    434434        newSelection.setWithoutValidation(base, extent);
    435435        m_frame->document()->updateLayout();
    436         setSelection(newSelection, 0);
     436        setSelection(newSelection, DoNotSetFocus);
    437437    }
    438438}
  • trunk/Source/WebCore/editing/FrameSelection.h

    r95964 r96628  
    116116        ClearTypingStyle = 1 << 2,
    117117        SpellCorrectionTriggered = 1 << 3,
     118        DoNotSetFocus = 1 << 4,
    118119    };
    119120    typedef unsigned SetSelectionOptions; // Union of values in SetSelectionOption and EUserTriggered
Note: See TracChangeset for help on using the changeset viewer.