Changeset 261126 in webkit


Ignore:
Timestamp:
May 4, 2020 4:55:06 PM (4 years ago)
Author:
Jack Lee
Message:

Nullptr crash in CompositeEditCommand::moveParagraphs when changing style on elements that are
user-select:none and dir:rtl.
https://bugs.webkit.org/show_bug.cgi?id=211206
<rdar://problem/61830589>

Reviewed by Geoffrey Garen.

Source/WebCore:

In function moveParagraphs check if the destination is an empty position and
bail out before moving the paragraphs.

Test: fast/editing/justify-user-select-none-dir-rtl-crash.html

  • editing/CompositeEditCommand.cpp:

(WebCore::CompositeEditCommand::moveParagraphs):

LayoutTests:

Added a regression test for the crash.

  • fast/editing/justify-user-select-none-dir-rtl-crash-expected.txt: Added.
  • fast/editing/justify-user-select-none-dir-rtl-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r261124 r261126  
     12020-05-04  Jack Lee  <shihchieh_lee@apple.com>
     2
     3        Nullptr crash in CompositeEditCommand::moveParagraphs when changing style on elements that are
     4        user-select:none and dir:rtl.
     5        https://bugs.webkit.org/show_bug.cgi?id=211206
     6        <rdar://problem/61830589>
     7
     8        Reviewed by Geoffrey Garen.
     9
     10        Added a regression test for the crash.
     11
     12        * fast/editing/justify-user-select-none-dir-rtl-crash-expected.txt: Added.
     13        * fast/editing/justify-user-select-none-dir-rtl-crash.html: Added.
     14
    1152020-05-04  Jason Lawrence  <lawrence.j@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r261118 r261126  
     12020-05-04  Jack Lee  <shihchieh_lee@apple.com>
     2
     3        Nullptr crash in CompositeEditCommand::moveParagraphs when changing style on elements that are
     4        user-select:none and dir:rtl.
     5        https://bugs.webkit.org/show_bug.cgi?id=211206
     6        <rdar://problem/61830589>
     7
     8        Reviewed by Geoffrey Garen.
     9
     10        In function moveParagraphs check if the destination is an empty position and
     11        bail out before moving the paragraphs.
     12
     13        Test: fast/editing/justify-user-select-none-dir-rtl-crash.html
     14
     15        * editing/CompositeEditCommand.cpp:
     16        (WebCore::CompositeEditCommand::moveParagraphs):
     17
    1182020-05-04  Jiewen Tan  <jiewen_tan@apple.com>
    219
  • trunk/Source/WebCore/editing/CompositeEditCommand.cpp

    r261019 r261126  
    13991399void CompositeEditCommand::moveParagraphs(const VisiblePosition& startOfParagraphToMove, const VisiblePosition& endOfParagraphToMove, const VisiblePosition& destination, bool preserveSelection, bool preserveStyle)
    14001400{
    1401     if (startOfParagraphToMove == destination)
     1401    if (destination.isNull() || startOfParagraphToMove == destination)
    14021402        return;
    14031403   
Note: See TracChangeset for help on using the changeset viewer.