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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 , m_endingSelection(endingSelection) | 85 , m_endingSelection(endingSelection) |
86 , m_startingRootEditableElement(startingSelection.rootEditableElement()) | 86 , m_startingRootEditableElement(startingSelection.rootEditableElement()) |
87 , m_endingRootEditableElement(endingSelection.rootEditableElement()) | 87 , m_endingRootEditableElement(endingSelection.rootEditableElement()) |
88 , m_editAction(editAction) | 88 , m_editAction(editAction) |
89 { | 89 { |
90 } | 90 } |
91 | 91 |
92 void EditCommandComposition::unapply() | 92 void EditCommandComposition::unapply() |
93 { | 93 { |
94 ASSERT(m_document); | 94 ASSERT(m_document); |
95 Frame* frame = m_document->frame(); | 95 RefPtr<Frame> frame = m_document->frame(); |
96 ASSERT(frame); | 96 ASSERT(frame); |
97 | 97 |
98 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. | 98 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. |
99 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one | 99 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one |
100 // if one is necessary (like for the creation of VisiblePositions). | 100 // if one is necessary (like for the creation of VisiblePositions). |
101 m_document->updateLayoutIgnorePendingStylesheets(); | 101 m_document->updateLayoutIgnorePendingStylesheets(); |
102 | 102 |
103 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt
onController(); | 103 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt
onController(); |
104 deleteButtonController->disable(); | 104 deleteButtonController->disable(); |
105 size_t size = m_commands.size(); | 105 size_t size = m_commands.size(); |
106 for (size_t i = size; i != 0; --i) | 106 for (size_t i = size; i != 0; --i) |
107 m_commands[i - 1]->doUnapply(); | 107 m_commands[i - 1]->doUnapply(); |
108 deleteButtonController->enable(); | 108 deleteButtonController->enable(); |
109 | 109 |
110 frame->editor()->unappliedEditing(this); | 110 frame->editor()->unappliedEditing(this); |
111 } | 111 } |
112 | 112 |
113 void EditCommandComposition::reapply() | 113 void EditCommandComposition::reapply() |
114 { | 114 { |
115 ASSERT(m_document); | 115 ASSERT(m_document); |
116 Frame* frame = m_document->frame(); | 116 RefPtr<Frame> frame = m_document->frame(); |
117 ASSERT(frame); | 117 ASSERT(frame); |
118 | 118 |
119 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. | 119 // Changes to the document may have been made since the last editing operati
on that require a layout, as in <rdar://problem/5658603>. |
120 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one | 120 // Low level operations, like RemoveNodeCommand, don't require a layout beca
use the high level operations that use them perform one |
121 // if one is necessary (like for the creation of VisiblePositions). | 121 // if one is necessary (like for the creation of VisiblePositions). |
122 m_document->updateLayoutIgnorePendingStylesheets(); | 122 m_document->updateLayoutIgnorePendingStylesheets(); |
123 | 123 |
124 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt
onController(); | 124 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt
onController(); |
125 deleteButtonController->disable(); | 125 deleteButtonController->disable(); |
126 size_t size = m_commands.size(); | 126 size_t size = m_commands.size(); |
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 return node.release(); | 1467 return node.release(); |
1468 } | 1468 } |
1469 | 1469 |
1470 PassRefPtr<Element> createBlockPlaceholderElement(Document* document) | 1470 PassRefPtr<Element> createBlockPlaceholderElement(Document* document) |
1471 { | 1471 { |
1472 RefPtr<Element> breakNode = document->createElement(brTag, false); | 1472 RefPtr<Element> breakNode = document->createElement(brTag, false); |
1473 return breakNode.release(); | 1473 return breakNode.release(); |
1474 } | 1474 } |
1475 | 1475 |
1476 } // namespace WebCore | 1476 } // namespace WebCore |
OLD | NEW |