Changeset 259571 in webkit


Ignore:
Timestamp:
Apr 6, 2020 8:33:34 AM (4 years ago)
Author:
Antti Koivisto
Message:

Remove instance fields and methods from StyleColor
https://bugs.webkit.org/show_bug.cgi?id=210045

Reviewed by Zalan Bujtas.

They are unused. The type itself remains as a namespace for static functions.
We might want bring it back later but there is no need to leave dead code around now.

  • css/StyleColor.h:

(WebCore::StyleColor::StyleColor): Deleted.
(WebCore::StyleColor::currentColor): Deleted.
(WebCore::StyleColor::isCurrentColor const): Deleted.
(WebCore::StyleColor::getColor const): Deleted.
(WebCore::StyleColor::resolve const): Deleted.
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r259567 r259571  
     12020-04-06  Antti Koivisto  <antti@apple.com>
     2
     3        Remove instance fields and methods from StyleColor
     4        https://bugs.webkit.org/show_bug.cgi?id=210045
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        They are unused. The type itself remains as a namespace for static functions.
     9        We might want bring it back later but there is no need to leave dead code around now.
     10
     11        * css/StyleColor.h:
     12        (WebCore::StyleColor::StyleColor): Deleted.
     13        (WebCore::StyleColor::currentColor): Deleted.
     14        (WebCore::StyleColor::isCurrentColor const): Deleted.
     15        (WebCore::StyleColor::getColor const): Deleted.
     16        (WebCore::StyleColor::resolve const): Deleted.
     17        (WebCore::operator==): Deleted.
     18        (WebCore::operator!=): Deleted.
     19
    1202020-04-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
    221
  • trunk/Source/WebCore/css/StyleColor.h

    r254373 r259571  
    3838namespace WebCore {
    3939
    40 class StyleColor {
    41 public:
    42     StyleColor()
    43         : m_currentColor(true) { }
    44     StyleColor(Color color)
    45         : m_color(color)
    46         , m_currentColor(false) { }
    47     static StyleColor currentColor() { return StyleColor(); }
    48 
    49     bool isCurrentColor() const { return m_currentColor; }
    50     const Color& getColor() const { ASSERT(!isCurrentColor()); return m_color; }
    51 
    52     const Color& resolve(const Color& currentColor) const { return m_currentColor ? currentColor : m_color; }
    53 
     40struct StyleColor {
    5441    enum class Options : uint8_t {
    5542        ForVisitedLink = 1 << 0,
     
    6249    static bool isColorKeyword(CSSValueID);
    6350    WEBCORE_EXPORT static bool isSystemColor(CSSValueID);
    64 
    65 private:
    66     Color m_color;
    67     bool m_currentColor;
    6851};
    6952
    70 inline bool operator==(const StyleColor& a, const StyleColor& b)
    71 {
    72     if (a.isCurrentColor() || b.isCurrentColor())
    73         return a.isCurrentColor() && b.isCurrentColor();
    74     return a.getColor() == b.getColor();
    75 }
    76 
    77 inline bool operator!=(const StyleColor& a, const StyleColor& b)
    78 {
    79     return !(a == b);
    80 }
    81 
    82 
    8353} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.