Changeset 83026 in webkit


Ignore:
Timestamp:
Apr 6, 2011 12:22:26 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-06 Naoki Takano <takano.naoki@gmail.com>

Reviewed by Ryosuke Niwa.

REGRESSION(r81328): Null pointer crash in canAppendNewLineFeed when selection isn't inside an editable element
https://bugs.webkit.org/show_bug.cgi?id=57755

  • editing/execCommand/insert-line-break-onload-expected.txt: Added.
  • editing/execCommand/insert-line-break-onload.html: Added to check calling InsertLineBreak without any crash.

2011-04-06 Naoki Takano <takano.naoki@gmail.com>

Reviewed by Ryosuke Niwa.

REGRESSION(r81328): Null pointer crash in canAppendNewLineFeed when selection isn't inside an editable element
https://bugs.webkit.org/show_bug.cgi?id=57755

Test: editing/execCommand/insert-line-break-onload.html

  • editing/TypingCommand.cpp: (WebCore::canAppendNewLineFeed): Added null pointer check for rootEditableElement().
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r83025 r83026  
     12011-04-06  Naoki Takano  <takano.naoki@gmail.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        REGRESSION(r81328): Null pointer crash in canAppendNewLineFeed when selection isn't inside an editable element
     6        https://bugs.webkit.org/show_bug.cgi?id=57755
     7
     8        * editing/execCommand/insert-line-break-onload-expected.txt: Added.
     9        * editing/execCommand/insert-line-break-onload.html: Added to check calling InsertLineBreak without any crash.
     10
    1112011-04-05  James Kozianski  <koz@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r83022 r83026  
     12011-04-06  Naoki Takano  <takano.naoki@gmail.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        REGRESSION(r81328): Null pointer crash in canAppendNewLineFeed when selection isn't inside an editable element
     6        https://bugs.webkit.org/show_bug.cgi?id=57755
     7
     8        Test: editing/execCommand/insert-line-break-onload.html
     9
     10        * editing/TypingCommand.cpp:
     11        (WebCore::canAppendNewLineFeed): Added null pointer check for rootEditableElement().
     12
    1132011-04-05  Antti Koivisto  <antti@apple.com>
    214
  • trunk/Source/WebCore/editing/TypingCommand.cpp

    r82233 r83026  
    5050static bool canAppendNewLineFeed(const VisibleSelection& selection)
    5151{
     52    Node* node = selection.rootEditableElement();
     53    if (!node)
     54        return false;
     55
     56    RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
    5257    ExceptionCode ec = 0;
    53     RefPtr<BeforeTextInsertedEvent> event = BeforeTextInsertedEvent::create(String("\n"));
    54     selection.rootEditableElement()->dispatchEvent(event, ec);
     58    node->dispatchEvent(event, ec);
    5559    return event->text().length();
    5660}
Note: See TracChangeset for help on using the changeset viewer.