OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |