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

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

Issue 2126143002: Sample of EditingStyleTest Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-07T14:36:19 Created 4 years, 5 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/EditingStyle.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 2016 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/EditingStyle.h"
6
7 #include "core/css/StylePropertySet.h"
8 #include "core/dom/Document.h"
9 #include "core/editing/EditingTestBase.h"
10 #include "core/html/HTMLBodyElement.h"
11 #include "core/html/HTMLDivElement.h"
12 #include "core/html/HTMLHeadElement.h"
13 #include "core/html/HTMLHtmlElement.h"
14
15 namespace blink {
16
17 class EditingStyleTest : public EditingTestBase {
18 };
19
20 TEST_F(EditingStyleTest, mergeInlineStyleOfElement)
21 {
22 setBodyContent(
23 "<span id=s1 style='--A:var(---B)'>1</span>"
24 "<span id=s2 style='float:var(--C)'>2</span>");
25 updateAllLifecyclePhases();
26
27 EditingStyle* editingStyle = EditingStyle::create(
28 toHTMLElement(document().getElementById("s2")));
29 editingStyle->mergeInlineStyleOfElement(
30 toHTMLElement(document().getElementById("s1")),
31 EditingStyle::OverrideValues);
32
33 EXPECT_FALSE(editingStyle->style()->hasProperty(CSSPropertyFloat))
34 << "Don't merge a property with unresolved value";
35 EXPECT_EQ(
36 "var(---B)",
37 editingStyle->style()->getPropertyValue(AtomicString("--A")))
38 << "Keep unresolved value on merging style";
39 }
40
41 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698