| 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 "bindings/core/v8/V8Binding.h" |
| 8 #include "core/css/CSSStyleSheet.h" | 8 #include "core/css/CSSStyleSheet.h" |
| 9 #include "core/css/MediaQueryEvaluator.h" | 9 #include "core/css/MediaQueryEvaluator.h" |
| 10 #include "core/css/StyleSheetContents.h" | 10 #include "core/css/StyleSheetContents.h" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 ActiveStyleSheetVector old_sheets; | 414 ActiveStyleSheetVector old_sheets; |
| 415 ActiveStyleSheetVector new_sheets; | 415 ActiveStyleSheetVector new_sheets; |
| 416 HeapHashSet<Member<RuleSet>> changed_rule_sets; | 416 HeapHashSet<Member<RuleSet>> changed_rule_sets; |
| 417 | 417 |
| 418 EXPECT_EQ( | 418 EXPECT_EQ( |
| 419 kNoActiveSheetsChanged, | 419 kNoActiveSheetsChanged, |
| 420 CompareActiveStyleSheets(old_sheets, new_sheets, changed_rule_sets)); | 420 CompareActiveStyleSheets(old_sheets, new_sheets, changed_rule_sets)); |
| 421 EXPECT_EQ(0u, changed_rule_sets.size()); | 421 EXPECT_EQ(0u, changed_rule_sets.size()); |
| 422 | 422 |
| 423 CSSStyleSheet* sheet1 = CreateSheet(); | 423 CSSStyleSheet* sheet1 = CreateSheet(); |
| 424 MediaQuerySet* mq = | 424 RefPtr<MediaQuerySet> mq = |
| 425 MediaQueryParser::ParseMediaQuerySet("(min-width: 9000px)"); | 425 MediaQueryParser::ParseMediaQuerySet("(min-width: 9000px)"); |
| 426 sheet1->SetMediaQueries(mq); | 426 sheet1->SetMediaQueries(mq); |
| 427 sheet1->MatchesMediaQueries(MediaQueryEvaluator()); | 427 sheet1->MatchesMediaQueries(MediaQueryEvaluator()); |
| 428 | 428 |
| 429 new_sheets.push_back(std::make_pair(sheet1, nullptr)); | 429 new_sheets.push_back(std::make_pair(sheet1, nullptr)); |
| 430 | 430 |
| 431 EXPECT_EQ( | 431 EXPECT_EQ( |
| 432 kActiveSheetsAppended, | 432 kActiveSheetsAppended, |
| 433 CompareActiveStyleSheets(old_sheets, new_sheets, changed_rule_sets)); | 433 CompareActiveStyleSheets(old_sheets, new_sheets, changed_rule_sets)); |
| 434 EXPECT_EQ(0u, changed_rule_sets.size()); | 434 EXPECT_EQ(0u, changed_rule_sets.size()); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 ActiveStyleSheetVector old_style_sheets; | 571 ActiveStyleSheetVector old_style_sheets; |
| 572 old_style_sheets.push_back( | 572 old_style_sheets.push_back( |
| 573 std::make_pair(css_sheet, &css_sheet->Contents()->GetRuleSet())); | 573 std::make_pair(css_sheet, &css_sheet->Contents()->GetRuleSet())); |
| 574 GetStyleEngine().ApplyRuleSetChanges(shadow_root, old_style_sheets, | 574 GetStyleEngine().ApplyRuleSetChanges(shadow_root, old_style_sheets, |
| 575 ActiveStyleSheetVector()); | 575 ActiveStyleSheetVector()); |
| 576 | 576 |
| 577 EXPECT_TRUE(GetStyleEngine().TreeBoundaryCrossingScopes().IsEmpty()); | 577 EXPECT_TRUE(GetStyleEngine().TreeBoundaryCrossingScopes().IsEmpty()); |
| 578 } | 578 } |
| 579 | 579 |
| 580 } // namespace blink | 580 } // namespace blink |
| OLD | NEW |