Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(672)

Side by Side Diff: Source/WebCore/editing/CompositeEditCommand.cpp

Issue 12286016: Merge 142642 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 , m_endingSelection(endingSelection) 86 , m_endingSelection(endingSelection)
87 , m_startingRootEditableElement(startingSelection.rootEditableElement()) 87 , m_startingRootEditableElement(startingSelection.rootEditableElement())
88 , m_endingRootEditableElement(endingSelection.rootEditableElement()) 88 , m_endingRootEditableElement(endingSelection.rootEditableElement())
89 , m_editAction(editAction) 89 , m_editAction(editAction)
90 { 90 {
91 } 91 }
92 92
93 void EditCommandComposition::unapply() 93 void EditCommandComposition::unapply()
94 { 94 {
95 ASSERT(m_document); 95 ASSERT(m_document);
96 Frame* frame = m_document->frame(); 96 RefPtr<Frame> frame = m_document->frame();
97 ASSERT(frame); 97 ASSERT(frame);
98 98
99 // Changes to the document may have been made since the last editing operati on that require a layout, as in <rdar://problem/5658603>. 99 // Changes to the document may have been made since the last editing operati on that require a layout, as in <rdar://problem/5658603>.
100 // Low level operations, like RemoveNodeCommand, don't require a layout beca use the high level operations that use them perform one 100 // Low level operations, like RemoveNodeCommand, don't require a layout beca use the high level operations that use them perform one
101 // if one is necessary (like for the creation of VisiblePositions). 101 // if one is necessary (like for the creation of VisiblePositions).
102 m_document->updateLayoutIgnorePendingStylesheets(); 102 m_document->updateLayoutIgnorePendingStylesheets();
103 103
104 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt onController(); 104 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt onController();
105 deleteButtonController->disable(); 105 deleteButtonController->disable();
106 size_t size = m_commands.size(); 106 size_t size = m_commands.size();
107 for (size_t i = size; i != 0; --i) 107 for (size_t i = size; i != 0; --i)
108 m_commands[i - 1]->doUnapply(); 108 m_commands[i - 1]->doUnapply();
109 deleteButtonController->enable(); 109 deleteButtonController->enable();
110 110
111 frame->editor()->unappliedEditing(this); 111 frame->editor()->unappliedEditing(this);
112 } 112 }
113 113
114 void EditCommandComposition::reapply() 114 void EditCommandComposition::reapply()
115 { 115 {
116 ASSERT(m_document); 116 ASSERT(m_document);
117 Frame* frame = m_document->frame(); 117 RefPtr<Frame> frame = m_document->frame();
118 ASSERT(frame); 118 ASSERT(frame);
119 119
120 // Changes to the document may have been made since the last editing operati on that require a layout, as in <rdar://problem/5658603>. 120 // Changes to the document may have been made since the last editing operati on that require a layout, as in <rdar://problem/5658603>.
121 // Low level operations, like RemoveNodeCommand, don't require a layout beca use the high level operations that use them perform one 121 // Low level operations, like RemoveNodeCommand, don't require a layout beca use the high level operations that use them perform one
122 // if one is necessary (like for the creation of VisiblePositions). 122 // if one is necessary (like for the creation of VisiblePositions).
123 m_document->updateLayoutIgnorePendingStylesheets(); 123 m_document->updateLayoutIgnorePendingStylesheets();
124 124
125 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt onController(); 125 DeleteButtonController* deleteButtonController = frame->editor()->deleteButt onController();
126 deleteButtonController->disable(); 126 deleteButtonController->disable();
127 size_t size = m_commands.size(); 127 size_t size = m_commands.size();
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698