Changeset 148894 in webkit


Ignore:
Timestamp:
Apr 22, 2013 10:56:22 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Crash on OS X when shift clicking outside of input
https://bugs.webkit.org/show_bug.cgi?id=104058

Patch by Yi Shen <max.hong.shen@gmail.com> on 2013-04-22
Reviewed by Chang Shu.

Source/WebCore:

Shift clicking outside of a focused div while removing the focused div from
the dom tree at the same time may hit a null visible position, which should
not be used to calculate the text distance with the new selection's start and
end position. Otherwise, the browser may crash.

Test: editing/selection/crash-on-shift-click.html

  • page/EventHandler.cpp:

(WebCore::EventHandler::handleMousePressEventSingleClick):

LayoutTests:

Add test for shift click crash issue.

  • editing/selection/crash-on-shift-click-expected.txt: Added.
  • editing/selection/crash-on-shift-click.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148889 r148894  
     12013-04-22  Yi Shen  <max.hong.shen@gmail.com>
     2
     3        Crash on OS X when shift clicking outside of input
     4        https://bugs.webkit.org/show_bug.cgi?id=104058
     5
     6        Reviewed by Chang Shu.
     7
     8        Add test for shift click crash issue.
     9
     10        * editing/selection/crash-on-shift-click-expected.txt: Added.
     11        * editing/selection/crash-on-shift-click.html: Added.
     12
    1132013-04-22  Jessie Berlin  <jberlin@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r148892 r148894  
     12013-04-22  Yi Shen  <max.hong.shen@gmail.com>
     2
     3        Crash on OS X when shift clicking outside of input
     4        https://bugs.webkit.org/show_bug.cgi?id=104058
     5
     6        Reviewed by Chang Shu.
     7
     8        Shift clicking outside of a focused div while removing the focused div from
     9        the dom tree at the same time may hit a null visible position, which should
     10        not be used to calculate the text distance with the new selection's start and
     11        end position. Otherwise, the browser may crash.
     12
     13        Test: editing/selection/crash-on-shift-click.html
     14
     15        * page/EventHandler.cpp:
     16        (WebCore::EventHandler::handleMousePressEventSingleClick):
     17
    1182013-04-22  Carlos Garcia Campos  <cgarcia@igalia.com>
    219
  • trunk/Source/WebCore/page/EventHandler.cpp

    r148672 r148894  
    606606        }
    607607
    608         if (!m_frame->editor()->behavior().shouldConsiderSelectionAsDirectional()) {
     608        if (!m_frame->editor()->behavior().shouldConsiderSelectionAsDirectional() && pos.isNotNull()) {
    609609            // See <rdar://problem/3668157> REGRESSION (Mail): shift-click deselects when selection
    610610            // was created right-to-left
Note: See TracChangeset for help on using the changeset viewer.