OLD | NEW |
(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 |
OLD | NEW |