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

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

Issue 2627103003: [EditCommandSource] Pass source through |CompositeEditCommand| ctor instead of |apply(source)| (Closed)
Patch Set: 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/commands/ApplyStyleCommand.h" 5 #include "core/editing/commands/ApplyStyleCommand.h"
6 6
7 #include "core/css/StylePropertySet.h" 7 #include "core/css/StylePropertySet.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/editing/EditingTestBase.h" 9 #include "core/editing/EditingTestBase.h"
10 #include "core/editing/FrameSelection.h" 10 #include "core/editing/FrameSelection.h"
(...skipping 23 matching lines...) Expand all
34 34
35 LocalFrame* frame = document().frame(); 35 LocalFrame* frame = document().frame();
36 frame->selection().setSelection( 36 frame->selection().setSelection(
37 SelectionInDOMTree::Builder() 37 SelectionInDOMTree::Builder()
38 .collapse(Position(li, PositionAnchorType::BeforeAnchor)) 38 .collapse(Position(li, PositionAnchorType::BeforeAnchor))
39 .build()); 39 .build());
40 40
41 MutableStylePropertySet* style = 41 MutableStylePropertySet* style =
42 MutableStylePropertySet::create(HTMLQuirksMode); 42 MutableStylePropertySet::create(HTMLQuirksMode);
43 style->setProperty(CSSPropertyTextAlign, "center"); 43 style->setProperty(CSSPropertyTextAlign, "center");
44 ApplyStyleCommand::create(document(), EditingStyle::create(style), 44 ApplyStyleCommand::create(document(), EditCommandSource::kDOM,
45 EditingStyle::create(style),
45 InputEvent::InputType::FormatJustifyCenter, 46 InputEvent::InputType::FormatJustifyCenter,
46 ApplyStyleCommand::ForceBlockProperties) 47 ApplyStyleCommand::ForceBlockProperties)
47 ->apply(EditCommandSource::kDOM); 48 ->apply();
48 // Shouldn't crash. 49 // Shouldn't crash.
49 } 50 }
50 51
51 } // namespace blink 52 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698