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

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

Issue 2574793002: [Editing] Store |CommandSource| in |CompositeEditCommand| (Closed)
Patch Set: Created 4 years 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 16 matching lines...) Expand all
27 27
28 #include "core/dom/Element.h" 28 #include "core/dom/Element.h"
29 #include "core/dom/Text.h" 29 #include "core/dom/Text.h"
30 #include "core/editing/EditingUtilities.h" 30 #include "core/editing/EditingUtilities.h"
31 #include "core/layout/LayoutObject.h" 31 #include "core/layout/LayoutObject.h"
32 #include "wtf/Assertions.h" 32 #include "wtf/Assertions.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand( 36 SplitTextNodeContainingElementCommand::SplitTextNodeContainingElementCommand(
37 CommandSource source,
37 Text* text, 38 Text* text,
38 int offset) 39 int offset)
39 : CompositeEditCommand(text->document()), m_text(text), m_offset(offset) { 40 : CompositeEditCommand(text->document(), source),
41 m_text(text),
42 m_offset(offset) {
40 DCHECK(m_text); 43 DCHECK(m_text);
41 DCHECK_GT(m_text->length(), 0u); 44 DCHECK_GT(m_text->length(), 0u);
42 } 45 }
43 46
44 void SplitTextNodeContainingElementCommand::doApply(EditingState*) { 47 void SplitTextNodeContainingElementCommand::doApply(EditingState*) {
45 DCHECK(m_text); 48 DCHECK(m_text);
46 DCHECK_GT(m_offset, 0); 49 DCHECK_GT(m_offset, 0);
47 50
48 splitTextNode(m_text.get(), m_offset); 51 splitTextNode(m_text.get(), m_offset);
49 52
(...skipping 13 matching lines...) Expand all
63 66
64 splitElement(parent, m_text.get()); 67 splitElement(parent, m_text.get());
65 } 68 }
66 69
67 DEFINE_TRACE(SplitTextNodeContainingElementCommand) { 70 DEFINE_TRACE(SplitTextNodeContainingElementCommand) {
68 visitor->trace(m_text); 71 visitor->trace(m_text);
69 CompositeEditCommand::trace(visitor); 72 CompositeEditCommand::trace(visitor);
70 } 73 }
71 74
72 } // namespace blink 75 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698