| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 bool EditCommandComposition::belongsTo(const LocalFrame& frame) const | 97 bool EditCommandComposition::belongsTo(const LocalFrame& frame) const |
| 98 { | 98 { |
| 99 ASSERT(m_document); | 99 ASSERT(m_document); |
| 100 return m_document->frame() == &frame; | 100 return m_document->frame() == &frame; |
| 101 } | 101 } |
| 102 | 102 |
| 103 void EditCommandComposition::unapply() | 103 void EditCommandComposition::unapply() |
| 104 { | 104 { |
| 105 ASSERT(m_document); | 105 ASSERT(m_document); |
| 106 RefPtr<LocalFrame> frame = m_document->frame(); | 106 RefPtrWillBeRawPtr<LocalFrame> frame = m_document->frame(); |
| 107 ASSERT(frame); | 107 ASSERT(frame); |
| 108 | 108 |
| 109 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. | 109 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. |
| 110 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one | 110 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one |
| 111 // if one is necessary (like for the creation of VisiblePositions). | 111 // if one is necessary (like for the creation of VisiblePositions). |
| 112 m_document->updateLayoutIgnorePendingStylesheets(); | 112 m_document->updateLayoutIgnorePendingStylesheets(); |
| 113 | 113 |
| 114 { | 114 { |
| 115 size_t size = m_commands.size(); | 115 size_t size = m_commands.size(); |
| 116 for (size_t i = size; i; --i) | 116 for (size_t i = size; i; --i) |
| 117 m_commands[i - 1]->doUnapply(); | 117 m_commands[i - 1]->doUnapply(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 frame->editor().unappliedEditing(this); | 120 frame->editor().unappliedEditing(this); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void EditCommandComposition::reapply() | 123 void EditCommandComposition::reapply() |
| 124 { | 124 { |
| 125 ASSERT(m_document); | 125 ASSERT(m_document); |
| 126 RefPtr<LocalFrame> frame = m_document->frame(); | 126 RefPtrWillBeRawPtr<LocalFrame> frame = m_document->frame(); |
| 127 ASSERT(frame); | 127 ASSERT(frame); |
| 128 | 128 |
| 129 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. | 129 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. |
| 130 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one | 130 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one |
| 131 // if one is necessary (like for the creation of VisiblePositions). | 131 // if one is necessary (like for the creation of VisiblePositions). |
| 132 m_document->updateLayoutIgnorePendingStylesheets(); | 132 m_document->updateLayoutIgnorePendingStylesheets(); |
| 133 | 133 |
| 134 { | 134 { |
| 135 size_t size = m_commands.size(); | 135 size_t size = m_commands.size(); |
| 136 for (size_t i = 0; i != size; ++i) | 136 for (size_t i = 0; i != size; ++i) |
| (...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 void CompositeEditCommand::trace(Visitor* visitor) | 1501 void CompositeEditCommand::trace(Visitor* visitor) |
| 1502 { | 1502 { |
| 1503 visitor->trace(m_commands); | 1503 visitor->trace(m_commands); |
| 1504 visitor->trace(m_composition); | 1504 visitor->trace(m_composition); |
| 1505 EditCommand::trace(visitor); | 1505 EditCommand::trace(visitor); |
| 1506 } | 1506 } |
| 1507 | 1507 |
| 1508 } // namespace blink | 1508 } // namespace blink |
| OLD | NEW |