| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2007 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/Document.h" | 29 #include "core/dom/Document.h" |
| 30 #include "core/dom/NodeTraversal.h" | 30 #include "core/dom/NodeTraversal.h" |
| 31 #include "core/editing/CompositeEditCommand.h" | 31 #include "core/editing/CompositeEditCommand.h" |
| 32 #include "core/editing/FrameSelection.h" | 32 #include "core/editing/FrameSelection.h" |
| 33 #include "core/frame/LocalFrame.h" | 33 #include "core/frame/LocalFrame.h" |
| 34 | 34 |
| 35 namespace WebCore { | 35 namespace WebCore { |
| 36 | 36 |
| 37 EditCommand::EditCommand(Document& document) | 37 EditCommand::EditCommand(Document& document) |
| 38 : m_document(&document) | 38 : m_document(&document) |
| 39 , m_parent(0) | 39 , m_parent(nullptr) |
| 40 { | 40 { |
| 41 ASSERT(m_document); | 41 ASSERT(m_document); |
| 42 ASSERT(m_document->frame()); | 42 ASSERT(m_document->frame()); |
| 43 setStartingSelection(m_document->frame()->selection().selection()); | 43 setStartingSelection(m_document->frame()->selection().selection()); |
| 44 setEndingSelection(m_startingSelection); | 44 setEndingSelection(m_startingSelection); |
| 45 } | 45 } |
| 46 | 46 |
| 47 EditCommand::EditCommand(Document* document, const VisibleSelection& startingSel
ection, const VisibleSelection& endingSelection) | 47 EditCommand::EditCommand(Document* document, const VisibleSelection& startingSel
ection, const VisibleSelection& endingSelection) |
| 48 : m_document(document) | 48 : m_document(document) |
| 49 , m_parent(0) | 49 , m_parent(nullptr) |
| 50 { | 50 { |
| 51 ASSERT(m_document); | 51 ASSERT(m_document); |
| 52 ASSERT(m_document->frame()); | 52 ASSERT(m_document->frame()); |
| 53 setStartingSelection(startingSelection); | 53 setStartingSelection(startingSelection); |
| 54 setEndingSelection(endingSelection); | 54 setEndingSelection(endingSelection); |
| 55 } | 55 } |
| 56 | 56 |
| 57 EditCommand::~EditCommand() | 57 EditCommand::~EditCommand() |
| 58 { | 58 { |
| 59 } | 59 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 m_startingSelection = parent->m_endingSelection; | 113 m_startingSelection = parent->m_endingSelection; |
| 114 m_endingSelection = parent->m_endingSelection; | 114 m_endingSelection = parent->m_endingSelection; |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 | 117 |
| 118 void SimpleEditCommand::doReapply() | 118 void SimpleEditCommand::doReapply() |
| 119 { | 119 { |
| 120 doApply(); | 120 doApply(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void EditCommand::trace(Visitor* visitor) |
| 124 { |
| 125 visitor->trace(m_document); |
| 126 visitor->trace(m_startingSelection); |
| 127 visitor->trace(m_endingSelection); |
| 128 visitor->trace(m_parent); |
| 129 } |
| 130 |
| 123 } // namespace WebCore | 131 } // namespace WebCore |
| OLD | NEW |