| 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 <memory> |
| 8 #include "bindings/core/v8/V8BindingForCore.h" | 8 #include "bindings/core/v8/V8BindingForCore.h" |
| 9 #include "core/css/CSSRuleList.h" | 9 #include "core/css/CSSRuleList.h" |
| 10 #include "core/css/CSSStyleRule.h" | 10 #include "core/css/CSSStyleRule.h" |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 " t1 { color: green }" | 550 " t1 { color: green }" |
| 551 "</style>" | 551 "</style>" |
| 552 "<div id='t1'></div>" | 552 "<div id='t1'></div>" |
| 553 "<span></span>"); | 553 "<span></span>"); |
| 554 | 554 |
| 555 GetStyleEngine().UpdateActiveStyle(); | 555 GetStyleEngine().UpdateActiveStyle(); |
| 556 EXPECT_FALSE(GetDocument().ChildNeedsStyleInvalidation()); | 556 EXPECT_FALSE(GetDocument().ChildNeedsStyleInvalidation()); |
| 557 EXPECT_FALSE(GetDocument().NeedsStyleInvalidation()); | 557 EXPECT_FALSE(GetDocument().NeedsStyleInvalidation()); |
| 558 } | 558 } |
| 559 | 559 |
| 560 TEST_F(StyleEngineTest, EmptyHttpEquivDefaultStyle) { |
| 561 GetDocument().body()->setInnerHTML( |
| 562 "<style>div { color:pink }</style><div id=container></div>"); |
| 563 GetDocument().View()->UpdateAllLifecyclePhases(); |
| 564 |
| 565 EXPECT_FALSE(GetStyleEngine().NeedsActiveStyleUpdate()); |
| 566 |
| 567 Element* container = GetDocument().getElementById("container"); |
| 568 ASSERT_TRUE(container); |
| 569 container->setInnerHTML("<meta http-equiv='default-style' content=''>"); |
| 570 EXPECT_FALSE(GetStyleEngine().NeedsActiveStyleUpdate()); |
| 571 |
| 572 container->setInnerHTML( |
| 573 "<meta http-equiv='default-style' content='preferred'>"); |
| 574 EXPECT_TRUE(GetStyleEngine().NeedsActiveStyleUpdate()); |
| 575 } |
| 576 |
| 560 } // namespace blink | 577 } // namespace blink |
| OLD | NEW |