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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyleTest.cpp

Issue 2836143003: Invalidate border/outline on color change only if they use current color (Closed)
Patch Set: rebaselined Created 3 years, 8 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/style/ComputedStyle.h ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/style/ComputedStyle.h" 5 #include "core/style/ComputedStyle.h"
6 6
7 #include "core/style/ClipPathOperation.h" 7 #include "core/style/ClipPathOperation.h"
8 #include "core/style/ShapeValue.h" 8 #include "core/style/ShapeValue.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 TEST(ComputedStyleTest, 95 TEST(ComputedStyleTest,
96 UpdatePropertySpecificDifferencesRespectsTransformAnimation) { 96 UpdatePropertySpecificDifferencesRespectsTransformAnimation) {
97 RefPtr<ComputedStyle> style = ComputedStyle::Create(); 97 RefPtr<ComputedStyle> style = ComputedStyle::Create();
98 RefPtr<ComputedStyle> other = ComputedStyle::Clone(*style); 98 RefPtr<ComputedStyle> other = ComputedStyle::Clone(*style);
99 other->SetHasCurrentTransformAnimation(); 99 other->SetHasCurrentTransformAnimation();
100 StyleDifference diff; 100 StyleDifference diff;
101 style->UpdatePropertySpecificDifferences(*other, diff); 101 style->UpdatePropertySpecificDifferences(*other, diff);
102 EXPECT_TRUE(diff.TransformChanged()); 102 EXPECT_TRUE(diff.TransformChanged());
103 } 103 }
104 104
105 TEST(CompuetedStyleTest, HasOutlineWithCurrentColor) {
106 RefPtr<ComputedStyle> style = ComputedStyle::Create();
107 EXPECT_FALSE(style->HasOutline());
108 EXPECT_FALSE(style->HasOutlineWithCurrentColor());
109 style->SetOutlineColor(StyleColor::CurrentColor());
110 EXPECT_FALSE(style->HasOutlineWithCurrentColor());
111 style->SetOutlineWidth(5);
112 EXPECT_FALSE(style->HasOutlineWithCurrentColor());
113 style->SetOutlineStyle(kBorderStyleSolid);
114 EXPECT_TRUE(style->HasOutlineWithCurrentColor());
115 }
116
117 TEST(CompuetedStyleTest, HasBorderColorReferencingCurrentColor) {
118 RefPtr<ComputedStyle> style = ComputedStyle::Create();
119 EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor());
120 style->SetBorderBottomColor(StyleColor::CurrentColor());
121 EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor());
122 style->SetBorderBottomWidth(5);
123 EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor());
124 style->SetBorderBottomStyle(kBorderStyleSolid);
125 EXPECT_TRUE(style->HasBorderColorReferencingCurrentColor());
126 }
127
105 } // namespace blink 128 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698