| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 m_startingSelection = selection; | 135 m_startingSelection = selection; |
| 136 m_startingRootEditableElement = selection.rootEditableElement(); | 136 m_startingRootEditableElement = selection.rootEditableElement(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void EditCommandComposition::setEndingSelection(const VisibleSelection& selectio
n) | 139 void EditCommandComposition::setEndingSelection(const VisibleSelection& selectio
n) |
| 140 { | 140 { |
| 141 m_endingSelection = selection; | 141 m_endingSelection = selection; |
| 142 m_endingRootEditableElement = selection.rootEditableElement(); | 142 m_endingRootEditableElement = selection.rootEditableElement(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void EditCommandComposition::trace(Visitor* visitor) | |
| 146 { | |
| 147 visitor->trace(m_document); | |
| 148 visitor->trace(m_startingSelection); | |
| 149 visitor->trace(m_endingSelection); | |
| 150 visitor->trace(m_commands); | |
| 151 visitor->trace(m_startingRootEditableElement); | |
| 152 visitor->trace(m_endingRootEditableElement); | |
| 153 UndoStep::trace(visitor); | |
| 154 } | |
| 155 | |
| 156 CompositeEditCommand::CompositeEditCommand(Document& document) | 145 CompositeEditCommand::CompositeEditCommand(Document& document) |
| 157 : EditCommand(document) | 146 : EditCommand(document) |
| 158 { | 147 { |
| 159 } | 148 } |
| 160 | 149 |
| 161 CompositeEditCommand::~CompositeEditCommand() | 150 CompositeEditCommand::~CompositeEditCommand() |
| 162 { | 151 { |
| 163 ASSERT(isTopLevelCommand() || !m_composition); | 152 ASSERT(isTopLevelCommand() || !m_composition); |
| 164 } | 153 } |
| 165 | 154 |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 // Do not split a node when doing so introduces an empty node. | 1060 // Do not split a node when doing so introduces an empty node. |
| 1072 VisiblePosition positionInParent(firstPositionInNode(parentElement)); | 1061 VisiblePosition positionInParent(firstPositionInNode(parentElement)); |
| 1073 VisiblePosition positionInNode(firstPositionInOrBeforeNode(node.get())); | 1062 VisiblePosition positionInNode(firstPositionInOrBeforeNode(node.get())); |
| 1074 if (positionInParent != positionInNode) | 1063 if (positionInParent != positionInNode) |
| 1075 splitElement(parentElement, node); | 1064 splitElement(parentElement, node); |
| 1076 } | 1065 } |
| 1077 | 1066 |
| 1078 return node.release(); | 1067 return node.release(); |
| 1079 } | 1068 } |
| 1080 | 1069 |
| 1081 void CompositeEditCommand::trace(Visitor* visitor) | |
| 1082 { | |
| 1083 visitor->trace(m_commands); | |
| 1084 visitor->trace(m_composition); | |
| 1085 EditCommand::trace(visitor); | |
| 1086 } | |
| 1087 | |
| 1088 } // namespace blink | 1070 } // namespace blink |
| OLD | NEW |