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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/RemoveNodeCommand.cpp

Issue 2615953003: Rename IGNORE_EXCEPTION to IGNORE_EXCEPTION_FOR_TESTING (Closed)
Patch Set: temp Created 3 years, 11 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 document().updateStyleAndLayoutTree(); 49 document().updateStyleAndLayoutTree();
50 if (!parent || (m_shouldAssumeContentIsAlwaysEditable == 50 if (!parent || (m_shouldAssumeContentIsAlwaysEditable ==
51 DoNotAssumeContentIsAlwaysEditable && 51 DoNotAssumeContentIsAlwaysEditable &&
52 !hasEditableStyle(*parent) && parent->inActiveDocument())) 52 !hasEditableStyle(*parent) && parent->inActiveDocument()))
53 return; 53 return;
54 DCHECK(hasEditableStyle(*parent) || !parent->inActiveDocument()) << parent; 54 DCHECK(hasEditableStyle(*parent) || !parent->inActiveDocument()) << parent;
55 55
56 m_parent = parent; 56 m_parent = parent;
57 m_refChild = m_node->nextSibling(); 57 m_refChild = m_node->nextSibling();
58 58
59 m_node->remove(IGNORE_EXCEPTION); 59 m_node->remove(IGNORE_EXCEPTION_FOR_TESTING);
60 // Node::remove dispatch synchronous events such as IFRAME unload events, 60 // Node::remove dispatch synchronous events such as IFRAME unload events,
61 // and event handlers may break the document. We check the document state 61 // and event handlers may break the document. We check the document state
62 // here in order to prevent further processing in bad situation. 62 // here in order to prevent further processing in bad situation.
63 ABORT_EDITING_COMMAND_IF(!m_node->document().frame()); 63 ABORT_EDITING_COMMAND_IF(!m_node->document().frame());
64 ABORT_EDITING_COMMAND_IF(!m_node->document().documentElement()); 64 ABORT_EDITING_COMMAND_IF(!m_node->document().documentElement());
65 } 65 }
66 66
67 void RemoveNodeCommand::doUnapply() { 67 void RemoveNodeCommand::doUnapply() {
68 ContainerNode* parent = m_parent.release(); 68 ContainerNode* parent = m_parent.release();
69 Node* refChild = m_refChild.release(); 69 Node* refChild = m_refChild.release();
70 if (!parent || !hasEditableStyle(*parent)) 70 if (!parent || !hasEditableStyle(*parent))
71 return; 71 return;
72 72
73 parent->insertBefore(m_node.get(), refChild, IGNORE_EXCEPTION); 73 parent->insertBefore(m_node.get(), refChild, IGNORE_EXCEPTION_FOR_TESTING);
74 } 74 }
75 75
76 DEFINE_TRACE(RemoveNodeCommand) { 76 DEFINE_TRACE(RemoveNodeCommand) {
77 visitor->trace(m_node); 77 visitor->trace(m_node);
78 visitor->trace(m_parent); 78 visitor->trace(m_parent);
79 visitor->trace(m_refChild); 79 visitor->trace(m_refChild);
80 SimpleEditCommand::trace(visitor); 80 SimpleEditCommand::trace(visitor);
81 } 81 }
82 82
83 } // namespace blink 83 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698