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

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

Issue 1679253002: Editing: Add EditingState* argument to EditCommand::doApply. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 23 matching lines...) Expand all
34 MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtrWillBeRaw Ptr<Element> first, PassRefPtrWillBeRawPtr<Element> second) 34 MergeIdenticalElementsCommand::MergeIdenticalElementsCommand(PassRefPtrWillBeRaw Ptr<Element> first, PassRefPtrWillBeRawPtr<Element> second)
35 : SimpleEditCommand(first->document()) 35 : SimpleEditCommand(first->document())
36 , m_element1(first) 36 , m_element1(first)
37 , m_element2(second) 37 , m_element2(second)
38 { 38 {
39 ASSERT(m_element1); 39 ASSERT(m_element1);
40 ASSERT(m_element2); 40 ASSERT(m_element2);
41 ASSERT(m_element1->nextSibling() == m_element2); 41 ASSERT(m_element1->nextSibling() == m_element2);
42 } 42 }
43 43
44 void MergeIdenticalElementsCommand::doApply() 44 void MergeIdenticalElementsCommand::doApply(EditingState*)
45 { 45 {
46 if (m_element1->nextSibling() != m_element2 || !m_element1->hasEditableStyle () || !m_element2->hasEditableStyle()) 46 if (m_element1->nextSibling() != m_element2 || !m_element1->hasEditableStyle () || !m_element2->hasEditableStyle())
47 return; 47 return;
48 48
49 m_atChild = m_element2->firstChild(); 49 m_atChild = m_element2->firstChild();
50 50
51 NodeVector children; 51 NodeVector children;
52 getChildNodes(*m_element1, children); 52 getChildNodes(*m_element1, children);
53 53
54 for (auto& child : children) 54 for (auto& child : children)
(...skipping 29 matching lines...) Expand all
84 84
85 DEFINE_TRACE(MergeIdenticalElementsCommand) 85 DEFINE_TRACE(MergeIdenticalElementsCommand)
86 { 86 {
87 visitor->trace(m_element1); 87 visitor->trace(m_element1);
88 visitor->trace(m_element2); 88 visitor->trace(m_element2);
89 visitor->trace(m_atChild); 89 visitor->trace(m_atChild);
90 SimpleEditCommand::trace(visitor); 90 SimpleEditCommand::trace(visitor);
91 } 91 }
92 92
93 } // namespace blink 93 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698