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

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

Issue 23822003: Have EditCommand classes deal with Document references, not pointers (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
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 15 matching lines...) Expand all
26 #include "config.h" 26 #include "config.h"
27 #include "core/editing/MergeIdenticalElementsCommand.h" 27 #include "core/editing/MergeIdenticalElementsCommand.h"
28 28
29 #include "bindings/v8/ExceptionState.h" 29 #include "bindings/v8/ExceptionState.h"
30 #include "bindings/v8/ExceptionStatePlaceholder.h" 30 #include "bindings/v8/ExceptionStatePlaceholder.h"
31 #include "core/dom/Element.h" 31 #include "core/dom/Element.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtr<Element> first, PassRefPtr<Element> second) 35 MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtr<Element> first, PassRefPtr<Element> second)
36 : SimpleEditCommand(&first->document()) 36 : SimpleEditCommand(first->document())
37 , m_element1(first) 37 , m_element1(first)
38 , m_element2(second) 38 , m_element2(second)
39 { 39 {
40 ASSERT(m_element1); 40 ASSERT(m_element1);
41 ASSERT(m_element2); 41 ASSERT(m_element2);
42 ASSERT(m_element1->nextSibling() == m_element2); 42 ASSERT(m_element1->nextSibling() == m_element2);
43 } 43 }
44 44
45 void MergeIdenticalElementsCommand::doApply() 45 void MergeIdenticalElementsCommand::doApply()
46 { 46 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 #ifndef NDEBUG 89 #ifndef NDEBUG
90 void MergeIdenticalElementsCommand::getNodesInCommand(HashSet<Node*>& nodes) 90 void MergeIdenticalElementsCommand::getNodesInCommand(HashSet<Node*>& nodes)
91 { 91 {
92 addNodeAndDescendants(m_element1.get(), nodes); 92 addNodeAndDescendants(m_element1.get(), nodes);
93 addNodeAndDescendants(m_element2.get(), nodes); 93 addNodeAndDescendants(m_element2.get(), nodes);
94 } 94 }
95 #endif 95 #endif
96 96
97 } // namespace WebCore 97 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/InsertTextCommand.cpp ('k') | Source/core/editing/ModifySelectionListLevel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698