| 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/css/ActiveStyleSheets.h" | 5 #include "core/css/ActiveStyleSheets.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/V8Binding.h" |
| 7 #include "core/css/CSSStyleSheet.h" | 8 #include "core/css/CSSStyleSheet.h" |
| 8 #include "core/css/MediaQueryEvaluator.h" | 9 #include "core/css/MediaQueryEvaluator.h" |
| 9 #include "core/css/StyleSheetContents.h" | 10 #include "core/css/StyleSheetContents.h" |
| 10 #include "core/css/StyleSheetList.h" | 11 #include "core/css/StyleSheetList.h" |
| 11 #include "core/css/parser/CSSParserContext.h" | 12 #include "core/css/parser/CSSParserContext.h" |
| 12 #include "core/dom/StyleEngine.h" | 13 #include "core/dom/StyleEngine.h" |
| 13 #include "core/dom/shadow/ShadowRoot.h" | 14 #include "core/dom/shadow/ShadowRoot.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" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 42 ShadowRoot& attachShadow(Element& host); | 43 ShadowRoot& attachShadow(Element& host); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; | 46 std::unique_ptr<DummyPageHolder> m_dummyPageHolder; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 ShadowRoot& ApplyRulesetsTest::attachShadow(Element& host) { | 49 ShadowRoot& ApplyRulesetsTest::attachShadow(Element& host) { |
| 49 ShadowRootInit init; | 50 ShadowRootInit init; |
| 50 init.setMode("open"); | 51 init.setMode("open"); |
| 51 ShadowRoot* shadowRoot = host.attachShadow( | 52 ShadowRoot* shadowRoot = host.attachShadow( |
| 52 ScriptState::forMainWorld(document().frame()), init, ASSERT_NO_EXCEPTION); | 53 toScriptStateForMainWorld(document().frame()), init, ASSERT_NO_EXCEPTION); |
| 53 EXPECT_TRUE(shadowRoot); | 54 EXPECT_TRUE(shadowRoot); |
| 54 return *shadowRoot; | 55 return *shadowRoot; |
| 55 } | 56 } |
| 56 | 57 |
| 57 TEST_F(ActiveStyleSheetsTest, CompareActiveStyleSheets_NoChange) { | 58 TEST_F(ActiveStyleSheetsTest, CompareActiveStyleSheets_NoChange) { |
| 58 ActiveStyleSheetVector oldSheets; | 59 ActiveStyleSheetVector oldSheets; |
| 59 ActiveStyleSheetVector newSheets; | 60 ActiveStyleSheetVector newSheets; |
| 60 HeapHashSet<Member<RuleSet>> changedRuleSets; | 61 HeapHashSet<Member<RuleSet>> changedRuleSets; |
| 61 | 62 |
| 62 EXPECT_EQ(NoActiveSheetsChanged, | 63 EXPECT_EQ(NoActiveSheetsChanged, |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 ActiveStyleSheetVector oldStyleSheets; | 478 ActiveStyleSheetVector oldStyleSheets; |
| 478 oldStyleSheets.push_back( | 479 oldStyleSheets.push_back( |
| 479 std::make_pair(cssSheet, &cssSheet->contents()->ruleSet())); | 480 std::make_pair(cssSheet, &cssSheet->contents()->ruleSet())); |
| 480 styleEngine().applyRuleSetChanges(shadowRoot, oldStyleSheets, | 481 styleEngine().applyRuleSetChanges(shadowRoot, oldStyleSheets, |
| 481 ActiveStyleSheetVector()); | 482 ActiveStyleSheetVector()); |
| 482 | 483 |
| 483 EXPECT_TRUE(styleEngine().treeBoundaryCrossingScopes().isEmpty()); | 484 EXPECT_TRUE(styleEngine().treeBoundaryCrossingScopes().isEmpty()); |
| 484 } | 485 } |
| 485 | 486 |
| 486 } // namespace blink | 487 } // namespace blink |
| OLD | NEW |