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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
index 5d615bd9a17a3c34c41d247f324c840a84569e55..10e0975641ae1f20c9788db0daf98c480fa4e760 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp
@@ -102,4 +102,27 @@ TEST(ComputedStyleTest,
EXPECT_TRUE(diff.TransformChanged());
}
+TEST(CompuetedStyleTest, HasOutlineWithCurrentColor) {
+ RefPtr<ComputedStyle> style = ComputedStyle::Create();
+ EXPECT_FALSE(style->HasOutline());
+ EXPECT_FALSE(style->HasOutlineWithCurrentColor());
+ style->SetOutlineColor(StyleColor::CurrentColor());
+ EXPECT_FALSE(style->HasOutlineWithCurrentColor());
+ style->SetOutlineWidth(5);
+ EXPECT_FALSE(style->HasOutlineWithCurrentColor());
+ style->SetOutlineStyle(kBorderStyleSolid);
+ EXPECT_TRUE(style->HasOutlineWithCurrentColor());
+}
+
+TEST(CompuetedStyleTest, HasBorderColorReferencingCurrentColor) {
+ RefPtr<ComputedStyle> style = ComputedStyle::Create();
+ EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor());
+ style->SetBorderBottomColor(StyleColor::CurrentColor());
+ EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor());
+ style->SetBorderBottomWidth(5);
+ EXPECT_FALSE(style->HasBorderColorReferencingCurrentColor());
+ style->SetBorderBottomStyle(kBorderStyleSolid);
+ EXPECT_TRUE(style->HasBorderColorReferencingCurrentColor());
+}
+
} // namespace blink
« 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