| OLD | NEW |
| 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/dom/StyleEngine.h" | 5 #include "core/dom/StyleEngine.h" |
| 6 | 6 |
| 7 #include <memory> |
| 7 #include "core/css/CSSRuleList.h" | 8 #include "core/css/CSSRuleList.h" |
| 8 #include "core/css/CSSStyleRule.h" | 9 #include "core/css/CSSStyleRule.h" |
| 9 #include "core/css/CSSStyleSheet.h" | 10 #include "core/css/CSSStyleSheet.h" |
| 10 #include "core/css/StyleSheetContents.h" | 11 #include "core/css/StyleSheetContents.h" |
| 11 #include "core/css/parser/CSSParserContext.h" | 12 #include "core/css/parser/CSSParserContext.h" |
| 12 #include "core/dom/Document.h" | 13 #include "core/dom/Document.h" |
| 13 #include "core/dom/NodeComputedStyle.h" | 14 #include "core/dom/NodeComputedStyle.h" |
| 14 #include "core/dom/shadow/ShadowRootInit.h" | 15 #include "core/dom/shadow/ShadowRootInit.h" |
| 15 #include "core/frame/FrameView.h" | 16 #include "core/frame/FrameView.h" |
| 16 #include "core/html/HTMLElement.h" | 17 #include "core/html/HTMLElement.h" |
| 17 #include "core/html/HTMLStyleElement.h" | 18 #include "core/html/HTMLStyleElement.h" |
| 18 #include "core/testing/DummyPageHolder.h" | 19 #include "core/testing/DummyPageHolder.h" |
| 19 #include "platform/heap/Heap.h" | 20 #include "platform/heap/Heap.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include <memory> | |
| 22 | 22 |
| 23 namespace blink { | 23 namespace blink { |
| 24 | 24 |
| 25 class StyleEngineTest : public ::testing::Test { | 25 class StyleEngineTest : public ::testing::Test { |
| 26 protected: | 26 protected: |
| 27 void SetUp() override; | 27 void SetUp() override; |
| 28 | 28 |
| 29 Document& document() { return m_dummyPageHolder->document(); } | 29 Document& document() { return m_dummyPageHolder->document(); } |
| 30 StyleEngine& styleEngine() { return document().styleEngine(); } | 30 StyleEngine& styleEngine() { return document().styleEngine(); } |
| 31 | 31 |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 | 412 |
| 413 styleRule->style()->setProperty("color", "green", "", ASSERT_NO_EXCEPTION); | 413 styleRule->style()->setProperty("color", "green", "", ASSERT_NO_EXCEPTION); |
| 414 document().view()->updateAllLifecyclePhases(); | 414 document().view()->updateAllLifecyclePhases(); |
| 415 | 415 |
| 416 ASSERT_TRUE(t1->computedStyle()); | 416 ASSERT_TRUE(t1->computedStyle()); |
| 417 EXPECT_EQ(makeRGB(0, 128, 0), | 417 EXPECT_EQ(makeRGB(0, 128, 0), |
| 418 t1->computedStyle()->visitedDependentColor(CSSPropertyColor)); | 418 t1->computedStyle()->visitedDependentColor(CSSPropertyColor)); |
| 419 } | 419 } |
| 420 | 420 |
| 421 } // namespace blink | 421 } // namespace blink |
| OLD | NEW |