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

Side by Side Diff: Source/core/inspector/DOMEditor.cpp

Issue 23453033: Have DOMPatchSupport and DocumentFragment deal with Document references (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/html/track/WebVTTParser.cpp ('k') | Source/core/inspector/DOMPatchSupport.h » ('j') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 , m_html(html) 214 , m_html(html)
215 , m_newNode(0) 215 , m_newNode(0)
216 , m_history(adoptPtr(new InspectorHistory())) 216 , m_history(adoptPtr(new InspectorHistory()))
217 , m_domEditor(adoptPtr(new DOMEditor(m_history.get()))) 217 , m_domEditor(adoptPtr(new DOMEditor(m_history.get())))
218 { 218 {
219 } 219 }
220 220
221 virtual bool perform(ExceptionState& es) 221 virtual bool perform(ExceptionState& es)
222 { 222 {
223 m_oldHTML = createMarkup(m_node.get()); 223 m_oldHTML = createMarkup(m_node.get());
224 DOMPatchSupport domPatchSupport(m_domEditor.get(), m_node->ownerDocument ()); 224 ASSERT(m_node->ownerDocument());
225 DOMPatchSupport domPatchSupport(m_domEditor.get(), *m_node->ownerDocumen t());
225 m_newNode = domPatchSupport.patchNode(m_node.get(), m_html, es); 226 m_newNode = domPatchSupport.patchNode(m_node.get(), m_html, es);
226 return !es.hadException(); 227 return !es.hadException();
227 } 228 }
228 229
229 virtual bool undo(ExceptionState& es) 230 virtual bool undo(ExceptionState& es)
230 { 231 {
231 return m_history->undo(es); 232 return m_history->undo(es);
232 } 233 }
233 234
234 virtual bool redo(ExceptionState& es) 235 virtual bool redo(ExceptionState& es)
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ErrorString * errorString) 452 bool DOMEditor::replaceWholeText(Text* textNode, const String& text, ErrorString * errorString)
452 { 453 {
453 TrackExceptionState es; 454 TrackExceptionState es;
454 bool result = replaceWholeText(textNode, text, es); 455 bool result = replaceWholeText(textNode, text, es);
455 populateErrorString(es, errorString); 456 populateErrorString(es, errorString);
456 return result; 457 return result;
457 } 458 }
458 459
459 } // namespace WebCore 460 } // namespace WebCore
460 461
OLDNEW
« no previous file with comments | « Source/core/html/track/WebVTTParser.cpp ('k') | Source/core/inspector/DOMPatchSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698