Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: third_party/WebKit/Source/core/dom/StyleEngineTest.cpp

Issue 2879223002: Don't try to set the empty string as the preferred set. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698