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

Side by Side Diff: Source/core/editing/EditorCommand.cpp

Issue 22880029: Make AttachBehavior a required argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2009 Igalia S.L. 4 * Copyright (C) 2009 Igalia S.L.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 static bool executeInsertFragment(Frame* frame, PassRefPtr<DocumentFragment> fra gment) 193 static bool executeInsertFragment(Frame* frame, PassRefPtr<DocumentFragment> fra gment)
194 { 194 {
195 applyCommand(ReplaceSelectionCommand::create(frame->document(), fragment, Re placeSelectionCommand::PreventNesting, EditActionUnspecified)); 195 applyCommand(ReplaceSelectionCommand::create(frame->document(), fragment, Re placeSelectionCommand::PreventNesting, EditActionUnspecified));
196 return true; 196 return true;
197 } 197 }
198 198
199 static bool executeInsertNode(Frame* frame, PassRefPtr<Node> content) 199 static bool executeInsertNode(Frame* frame, PassRefPtr<Node> content)
200 { 200 {
201 RefPtr<DocumentFragment> fragment = DocumentFragment::create(frame->document ()); 201 RefPtr<DocumentFragment> fragment = DocumentFragment::create(frame->document ());
202 TrackExceptionState es; 202 TrackExceptionState es;
203 fragment->appendChild(content, es); 203 fragment->appendChild(content, es, DeprecatedAttachNow);
204 if (es.hadException()) 204 if (es.hadException())
205 return false; 205 return false;
206 return executeInsertFragment(frame, fragment.release()); 206 return executeInsertFragment(frame, fragment.release());
207 } 207 }
208 208
209 static bool expandSelectionToGranularity(Frame* frame, TextGranularity granulari ty) 209 static bool expandSelectionToGranularity(Frame* frame, TextGranularity granulari ty)
210 { 210 {
211 VisibleSelection selection = frame->selection()->selection(); 211 VisibleSelection selection = frame->selection()->selection();
212 selection.expandUsingGranularity(granularity); 212 selection.expandUsingGranularity(granularity);
213 RefPtr<Range> newRange = selection.toNormalizedRange(); 213 RefPtr<Range> newRange = selection.toNormalizedRange();
(...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1738 return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false"; 1738 return m_command->state(m_frame.get(), triggeringEvent) == TrueTriState ? "true" : "false";
1739 return m_command->value(m_frame.get(), triggeringEvent); 1739 return m_command->value(m_frame.get(), triggeringEvent);
1740 } 1740 }
1741 1741
1742 bool Editor::Command::isTextInsertion() const 1742 bool Editor::Command::isTextInsertion() const
1743 { 1743 {
1744 return m_command && m_command->isTextInsertion; 1744 return m_command && m_command->isTextInsertion;
1745 } 1745 }
1746 1746
1747 } // namespace WebCore 1747 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/CompositeEditCommand.cpp ('k') | Source/core/editing/MergeIdenticalElementsCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698