OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 return; | 379 return; |
380 } | 380 } |
381 | 381 |
382 applyCommandToComposite(BreakBlockquoteCommand::create(document())); | 382 applyCommandToComposite(BreakBlockquoteCommand::create(document())); |
383 typingAddedToOpenCommand(InsertParagraphSeparatorInQuotedContent); | 383 typingAddedToOpenCommand(InsertParagraphSeparatorInQuotedContent); |
384 } | 384 } |
385 | 385 |
386 bool TypingCommand::makeEditableRootEmpty() | 386 bool TypingCommand::makeEditableRootEmpty() |
387 { | 387 { |
388 Element* root = endingSelection().rootEditableElement(); | 388 Element* root = endingSelection().rootEditableElement(); |
389 if (!root || !root->firstChild()) | 389 if (!root || !root->hasChildren()) |
390 return false; | 390 return false; |
391 | 391 |
392 if (root->firstChild() == root->lastChild()) { | 392 if (root->firstChild() == root->lastChild()) { |
393 Element* firstElementChild = ElementTraversal::firstWithin(*root); | 393 Element* firstElementChild = ElementTraversal::firstWithin(*root); |
394 if (isHTMLBRElement(firstElementChild)) { | 394 if (isHTMLBRElement(firstElementChild)) { |
395 // If there is a single child and it could be a placeholder, leave i
t alone. | 395 // If there is a single child and it could be a placeholder, leave i
t alone. |
396 if (root->renderer() && root->renderer()->isRenderBlockFlow()) | 396 if (root->renderer() && root->renderer()->isRenderBlockFlow()) |
397 return false; | 397 return false; |
398 } | 398 } |
399 } | 399 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 ASSERT_NOT_REACHED(); | 625 ASSERT_NOT_REACHED(); |
626 m_preservesTypingStyle = false; | 626 m_preservesTypingStyle = false; |
627 } | 627 } |
628 | 628 |
629 bool TypingCommand::isTypingCommand() const | 629 bool TypingCommand::isTypingCommand() const |
630 { | 630 { |
631 return true; | 631 return true; |
632 } | 632 } |
633 | 633 |
634 } // namespace blink | 634 } // namespace blink |
OLD | NEW |