⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 278593 in webkit


Ignore:
Timestamp:
Jun 8, 2021, 12:35:58 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in InsertParagraphSeparatorCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=226527

Patch by Frédéric Wang <fwang@igalia.com> on 2021-06-08
Reviewed by Ryosuke Niwa.

Source/WebCore:

After r273375 and r278002, it is possible that InsertParagraphSeparatorCommand::doApply is
confused by a display: table start block, leading to nullptr crash in the rest of the
function. This patch just excludes that case in order to work around that kind of issue.

Test: fast/editing/insert-paragraph-with-img-in-table-crash.html

  • editing/InsertParagraphSeparatorCommand.cpp:

(WebCore::InsertParagraphSeparatorCommand::doApply):

LayoutTests:

Add regression test.

  • fast/editing/insert-paragraph-with-img-in-table-crash-expected.txt: Added.
  • fast/editing/insert-paragraph-with-img-in-table-crash.html: Added. Note that not having a

new line at the end of the HTML file is required to make the test crash without the patch.

  • fast/editing/insert-paragraph-with-text-in-table-crash-expected.txt: Added.
  • fast/editing/insert-paragraph-with-text-in-table-crash.html: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r278589 r278593  
     12021-06-08  Frédéric Wang  <fwang@igalia.com>
     2
     3        Crash in InsertParagraphSeparatorCommand::doApply
     4        https://bugs.webkit.org/show_bug.cgi?id=226527
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Add regression test.
     9
     10        * fast/editing/insert-paragraph-with-img-in-table-crash-expected.txt: Added.
     11        * fast/editing/insert-paragraph-with-img-in-table-crash.html: Added. Note that not having a
     12        new line at the end of the HTML file is required to make the test crash without the patch.
     13        * fast/editing/insert-paragraph-with-text-in-table-crash-expected.txt: Added.
     14        * fast/editing/insert-paragraph-with-text-in-table-crash.html: Added.
     15
     16
    1172021-06-07  Alexey Shvayka  <shvaikalesh@gmail.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r278590 r278593  
     12021-06-08  Frédéric Wang  <fwang@igalia.com>
     2
     3        Crash in InsertParagraphSeparatorCommand::doApply
     4        https://bugs.webkit.org/show_bug.cgi?id=226527
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        After r273375 and r278002, it is possible that InsertParagraphSeparatorCommand::doApply is
     9        confused by a display: table start block, leading to nullptr crash in the rest of the
     10        function. This patch just excludes that case in order to work around that kind of issue.
     11
     12        Test: fast/editing/insert-paragraph-with-img-in-table-crash.html
     13
     14        * editing/InsertParagraphSeparatorCommand.cpp:
     15        (WebCore::InsertParagraphSeparatorCommand::doApply):
     16
    1172021-06-07  Alex Christensen  <achristensen@webkit.org>
    218
  • trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp

    r274849 r278593  
    167167    if (!startBlock
    168168        || !startBlock->nonShadowBoundaryParentNode()
     169        || isRenderedTable(startBlock.get())
    169170        || isTableCell(startBlock.get())
    170171        || is<HTMLFormElement>(*startBlock)
Note: See TracChangeset for help on using the changeset viewer.