Changeset 94840 in webkit


Ignore:
Timestamp:
Sep 9, 2011 2:02:36 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Crashes in WebCore::ApplyStyleCommand.doApply()
https://bugs.webkit.org/show_bug.cgi?id=67765

Patch by Shinya Kawanaka <shinyak@google.com> on 2011-09-09
Reviewed by Ryosuke Niwa.

WebCore::enclosingBlock may return null, but ApplyStyleCommand::applyBlockStyle did not check it. This patch make it to be checked.

Source/WebCore:

Test: editing/style/remove-format-without-enclosing-block.html

  • editing/ApplyStyleCommand.cpp:

(WebCore::ApplyStyleCommand::applyBlockStyle): Added null check.

LayoutTests:

  • editing/style/remove-format-without-enclosing-block-expected.txt: Added.
  • editing/style/remove-format-without-enclosing-block.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r94839 r94840  
     12011-09-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::ApplyStyleCommand.doApply()
     4        https://bugs.webkit.org/show_bug.cgi?id=67765
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        WebCore::enclosingBlock may return null, but ApplyStyleCommand::applyBlockStyle did not check it. This patch make it to be checked.
     9
     10        * editing/style/remove-format-without-enclosing-block-expected.txt: Added.
     11        * editing/style/remove-format-without-enclosing-block.html: Added.
     12
    1132011-09-09  Ilya Tikhonovsky  <loislo@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r94838 r94840  
     12011-09-09  Shinya Kawanaka  <shinyak@google.com>
     2
     3        Crashes in WebCore::ApplyStyleCommand.doApply()
     4        https://bugs.webkit.org/show_bug.cgi?id=67765
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        WebCore::enclosingBlock may return null, but ApplyStyleCommand::applyBlockStyle did not check it. This patch make it to be checked.
     9
     10        Test: editing/style/remove-format-without-enclosing-block.html
     11
     12        * editing/ApplyStyleCommand.cpp:
     13        (WebCore::ApplyStyleCommand::applyBlockStyle): Added null check.
     14
    1152011-09-09  James Simonsen  <simonjam@chromium.org>
    216
  • trunk/Source/WebCore/editing/ApplyStyleCommand.cpp

    r94427 r94840  
    282282                    block = newBlock;
    283283            }
    284             ASSERT(block->isHTMLElement());
    285             if (block->isHTMLElement()) {
     284            ASSERT(!block || block->isHTMLElement());
     285            if (block && block->isHTMLElement()) {
    286286                removeCSSStyle(style, toHTMLElement(block.get()));
    287287                if (!m_removeOnly)
Note: See TracChangeset for help on using the changeset viewer.