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

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

Issue 2854123002: Reland of Make InsertTextCommand not to apply style for empty selection (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/editing/commands/InsertTextCommand.h"
6
7 #include "core/editing/EditingTestBase.h"
8 #include "core/editing/FrameSelection.h"
9
10 namespace blink {
11
12 class InsertTextCommandTest : public EditingTestBase {};
13
14 // http://crbug.com/714311
15 TEST_F(InsertTextCommandTest, WithTypingStyle) {
16 SetBodyContent("<div contenteditable=true><option id=sample></option></div>");
17 Element* const sample = GetDocument().getElementById("sample");
18 Selection().SetSelection(
19 SelectionInDOMTree::Builder().Collapse(Position(sample, 0)).Build());
20 // Register typing style to make |InsertTextCommand| to attempt to apply
21 // style to inserted text.
22 GetDocument().execCommand("fontSizeDelta", false, "+3", ASSERT_NO_EXCEPTION);
23 CompositeEditCommand* const command =
24 InsertTextCommand::Create(GetDocument(), "x");
25 command->Apply();
26
27 EXPECT_EQ(
28 "<div contenteditable=\"true\"><option id=\"sample\">x</option></div>",
29 GetDocument().body()->innerHTML())
30 << "Content of OPTION is distributed into shadow node as text"
31 "without applying typing style.";
32 }
33
34 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698