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

Side by Side Diff: third_party/WebKit/Source/core/css/StyleColor.h

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: All windows error are Resolved now. 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 29 matching lines...) Expand all
40 class StyleColor { 40 class StyleColor {
41 DISALLOW_NEW(); 41 DISALLOW_NEW();
42 42
43 public: 43 public:
44 StyleColor() : m_currentColor(true) {} 44 StyleColor() : m_currentColor(true) {}
45 StyleColor(Color color) : m_color(color), m_currentColor(false) {} 45 StyleColor(Color color) : m_color(color), m_currentColor(false) {}
46 static StyleColor currentColor() { return StyleColor(); } 46 static StyleColor currentColor() { return StyleColor(); }
47 47
48 bool isCurrentColor() const { return m_currentColor; } 48 bool isCurrentColor() const { return m_currentColor; }
49 Color getColor() const { 49 Color getColor() const {
50 ASSERT(!isCurrentColor()); 50 DCHECK(!isCurrentColor());
51 return m_color; 51 return m_color;
52 } 52 }
53 53
54 Color resolve(Color currentColor) const { 54 Color resolve(Color currentColor) const {
55 return m_currentColor ? currentColor : m_color; 55 return m_currentColor ? currentColor : m_color;
56 } 56 }
57 57
58 static Color colorFromKeyword(CSSValueID); 58 static Color colorFromKeyword(CSSValueID);
59 static bool isColorKeyword(CSSValueID); 59 static bool isColorKeyword(CSSValueID);
60 static bool isSystemColor(CSSValueID); 60 static bool isSystemColor(CSSValueID);
61 61
62 private: 62 private:
63 Color m_color; 63 Color m_color;
64 bool m_currentColor; 64 bool m_currentColor;
65 }; 65 };
66 66
67 inline bool operator==(const StyleColor& a, const StyleColor& b) { 67 inline bool operator==(const StyleColor& a, const StyleColor& b) {
68 if (a.isCurrentColor() || b.isCurrentColor()) 68 if (a.isCurrentColor() || b.isCurrentColor())
69 return a.isCurrentColor() && b.isCurrentColor(); 69 return a.isCurrentColor() && b.isCurrentColor();
70 return a.getColor() == b.getColor(); 70 return a.getColor() == b.getColor();
71 } 71 }
72 72
73 inline bool operator!=(const StyleColor& a, const StyleColor& b) { 73 inline bool operator!=(const StyleColor& a, const StyleColor& b) {
74 return !(a == b); 74 return !(a == b);
75 } 75 }
76 76
77 } // namespace blink 77 } // namespace blink
78 78
79 #endif // StyleColor_h 79 #endif // StyleColor_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/SelectorFilter.cpp ('k') | third_party/WebKit/Source/core/css/StyleMedia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698