| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 #include "core/editing/iterators/TextIterator.h" | 62 #include "core/editing/iterators/TextIterator.h" |
| 63 #include "core/editing/markup.h" | 63 #include "core/editing/markup.h" |
| 64 #include "core/events/ScopedEventQueue.h" | 64 #include "core/events/ScopedEventQueue.h" |
| 65 #include "core/frame/LocalFrame.h" | 65 #include "core/frame/LocalFrame.h" |
| 66 #include "core/html/HTMLBRElement.h" | 66 #include "core/html/HTMLBRElement.h" |
| 67 #include "core/html/HTMLDivElement.h" | 67 #include "core/html/HTMLDivElement.h" |
| 68 #include "core/html/HTMLElement.h" | 68 #include "core/html/HTMLElement.h" |
| 69 #include "core/html/HTMLLIElement.h" | 69 #include "core/html/HTMLLIElement.h" |
| 70 #include "core/html/HTMLQuoteElement.h" | 70 #include "core/html/HTMLQuoteElement.h" |
| 71 #include "core/html/HTMLSpanElement.h" | 71 #include "core/html/HTMLSpanElement.h" |
| 72 #include "core/layout/LayoutListItem.h" |
| 72 #include "core/layout/line/InlineTextBox.h" | 73 #include "core/layout/line/InlineTextBox.h" |
| 73 #include "core/rendering/RenderBlock.h" | 74 #include "core/rendering/RenderBlock.h" |
| 74 #include "core/rendering/RenderListItem.h" | |
| 75 #include "core/rendering/RenderText.h" | 75 #include "core/rendering/RenderText.h" |
| 76 | 76 |
| 77 namespace blink { | 77 namespace blink { |
| 78 | 78 |
| 79 using namespace HTMLNames; | 79 using namespace HTMLNames; |
| 80 | 80 |
| 81 PassRefPtrWillBeRawPtr<EditCommandComposition> EditCommandComposition::create(Do
cument* document, | 81 PassRefPtrWillBeRawPtr<EditCommandComposition> EditCommandComposition::create(Do
cument* document, |
| 82 const VisibleSelection& startingSelection, const VisibleSelection& endingSel
ection, EditAction editAction) | 82 const VisibleSelection& startingSelection, const VisibleSelection& endingSel
ection, EditAction editAction) |
| 83 { | 83 { |
| 84 return adoptRefWillBeNoop(new EditCommandComposition(document, startingSelec
tion, endingSelection, editAction)); | 84 return adoptRefWillBeNoop(new EditCommandComposition(document, startingSelec
tion, endingSelection, editAction)); |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 | 871 |
| 872 document().updateLayoutIgnorePendingStylesheets(); | 872 document().updateLayoutIgnorePendingStylesheets(); |
| 873 | 873 |
| 874 LayoutObject* renderer = container->renderer(); | 874 LayoutObject* renderer = container->renderer(); |
| 875 if (!renderer || !renderer->isRenderBlockFlow()) | 875 if (!renderer || !renderer->isRenderBlockFlow()) |
| 876 return nullptr; | 876 return nullptr; |
| 877 | 877 |
| 878 // append the placeholder to make sure it follows | 878 // append the placeholder to make sure it follows |
| 879 // any unrendered blocks | 879 // any unrendered blocks |
| 880 RenderBlockFlow* block = toRenderBlockFlow(renderer); | 880 RenderBlockFlow* block = toRenderBlockFlow(renderer); |
| 881 if (block->size().height() == 0 || (block->isListItem() && toRenderListItem(
block)->isEmpty())) | 881 if (block->size().height() == 0 || (block->isListItem() && toLayoutListItem(
block)->isEmpty())) |
| 882 return appendBlockPlaceholder(container); | 882 return appendBlockPlaceholder(container); |
| 883 | 883 |
| 884 return nullptr; | 884 return nullptr; |
| 885 } | 885 } |
| 886 | 886 |
| 887 // Assumes that the position is at a placeholder and does the removal without mu
ch checking. | 887 // Assumes that the position is at a placeholder and does the removal without mu
ch checking. |
| 888 void CompositeEditCommand::removePlaceholderAt(const Position& p) | 888 void CompositeEditCommand::removePlaceholderAt(const Position& p) |
| 889 { | 889 { |
| 890 ASSERT(lineBreakExistsAtPosition(p)); | 890 ASSERT(lineBreakExistsAtPosition(p)); |
| 891 | 891 |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 } | 1498 } |
| 1499 | 1499 |
| 1500 DEFINE_TRACE(CompositeEditCommand) | 1500 DEFINE_TRACE(CompositeEditCommand) |
| 1501 { | 1501 { |
| 1502 visitor->trace(m_commands); | 1502 visitor->trace(m_commands); |
| 1503 visitor->trace(m_composition); | 1503 visitor->trace(m_composition); |
| 1504 EditCommand::trace(visitor); | 1504 EditCommand::trace(visitor); |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 } // namespace blink | 1507 } // namespace blink |
| OLD | NEW |