| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #include "core/editing/commands/SplitTextNodeContainingElementCommand.h" | 26 #include "core/editing/commands/SplitTextNodeContainingElementCommand.h" |
| 27 | 27 |
| 28 #include "core/dom/Element.h" | 28 #include "core/dom/Element.h" |
| 29 #include "core/dom/Text.h" | 29 #include "core/dom/Text.h" |
| 30 #include "core/layout/LayoutObject.h" | 30 #include "core/layout/LayoutObject.h" |
| 31 #include "wtf/Assertions.h" | 31 #include "wtf/Assertions.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand(Pas
sRefPtrWillBeRawPtr<Text> text, int offset) | 35 SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand(Raw
Ptr<Text> text, int offset) |
| 36 : CompositeEditCommand(text->document()), m_text(text), m_offset(offset) | 36 : CompositeEditCommand(text->document()), m_text(text), m_offset(offset) |
| 37 { | 37 { |
| 38 ASSERT(m_text); | 38 ASSERT(m_text); |
| 39 ASSERT(m_text->length() > 0); | 39 ASSERT(m_text->length() > 0); |
| 40 } | 40 } |
| 41 | 41 |
| 42 void SplitTextNodeContainingElementCommand::doApply(EditingState*) | 42 void SplitTextNodeContainingElementCommand::doApply(EditingState*) |
| 43 { | 43 { |
| 44 ASSERT(m_text); | 44 ASSERT(m_text); |
| 45 ASSERT(m_offset > 0); | 45 ASSERT(m_offset > 0); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 62 splitElement(parent, m_text.get()); | 62 splitElement(parent, m_text.get()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 DEFINE_TRACE(SplitTextNodeContainingElementCommand) | 65 DEFINE_TRACE(SplitTextNodeContainingElementCommand) |
| 66 { | 66 { |
| 67 visitor->trace(m_text); | 67 visitor->trace(m_text); |
| 68 CompositeEditCommand::trace(visitor); | 68 CompositeEditCommand::trace(visitor); |
| 69 } | 69 } |
| 70 | 70 |
| 71 } // namespace blink | 71 } // namespace blink |
| OLD | NEW |