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

Unified Diff: third_party/WebKit/Source/core/editing/EditingStyleTest.cpp

Issue 2103043004: Fix EditingStyle::mergeStyle()'s handling of custom properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gtest instead of layout test Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/EditingStyleTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingStyleTest.cpp b/third_party/WebKit/Source/core/editing/EditingStyleTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1e08e2e99346c3423c61f829921887c4ce545bfa
--- /dev/null
+++ b/third_party/WebKit/Source/core/editing/EditingStyleTest.cpp
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/editing/EditingStyle.h"
+
+#include "core/css/StylePropertySet.h"
+#include "core/dom/Document.h"
+#include "core/editing/EditingTestBase.h"
+#include "core/html/HTMLBodyElement.h"
+#include "core/html/HTMLDivElement.h"
+#include "core/html/HTMLHeadElement.h"
+#include "core/html/HTMLHtmlElement.h"
+
+namespace blink {
+
+class EditingStyleTest : public EditingTestBase {
+};
+
+TEST_F(EditingStyleTest, mergeInlineStyleOfElement)
+{
+ setBodyContent(
+ "<span id=s1 style='--A:var(---B)'>1</span>"
+ "<span id=s2 style='float:var(--C)'>2</span>");
+ updateAllLifecyclePhases();
+
+ EditingStyle* editingStyle = EditingStyle::create(
+ toHTMLElement(document().getElementById("s2")));
+ editingStyle->mergeInlineStyleOfElement(
+ toHTMLElement(document().getElementById("s1")),
+ EditingStyle::OverrideValues);
+
+ EXPECT_FALSE(editingStyle->style()->hasProperty(CSSPropertyFloat))
+ << "Don't merge a property with unresolved value";
+ EXPECT_EQ(
+ "var(---B)",
+ editingStyle->style()->getPropertyValue(AtomicString("--A")))
+ << "Keep unresolved value on merging style";
+}
+
+} // namespace blink
« 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