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

Side by Side Diff: Source/core/rendering/style/CollapsedBorderValue.h

Issue 23581008: Revert r154797: "Move isValid/isCurrentColor from Color to StyleColor" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 16 matching lines...) Expand all
27 27
28 #include "core/rendering/style/BorderValue.h" 28 #include "core/rendering/style/BorderValue.h"
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 class CollapsedBorderValue { 32 class CollapsedBorderValue {
33 public: 33 public:
34 CollapsedBorderValue() 34 CollapsedBorderValue()
35 : m_color(0) 35 : m_color(0)
36 , m_colorIsValid(false) 36 , m_colorIsValid(false)
37 , m_currentColor(false)
38 , m_width(0) 37 , m_width(0)
39 , m_style(BNONE) 38 , m_style(BNONE)
40 , m_precedence(BOFF) 39 , m_precedence(BOFF)
41 , m_transparent(false) 40 , m_transparent(false)
42 { 41 {
43 } 42 }
44 43
45 CollapsedBorderValue(const BorderValue& border, const StyleColor& color, EBo rderPrecedence precedence) 44 CollapsedBorderValue(const BorderValue& border, const Color& color, EBorderP recedence precedence)
46 : m_color(color.color()) 45 : m_color(color.rgb())
47 , m_colorIsValid(color.isValid()) 46 , m_colorIsValid(color.isValid())
48 , m_currentColor(color.isCurrentColor())
49 , m_width(border.nonZero() ? border.width() : 0) 47 , m_width(border.nonZero() ? border.width() : 0)
50 , m_style(border.style()) 48 , m_style(border.style())
51 , m_precedence(precedence) 49 , m_precedence(precedence)
52 , m_transparent(border.isTransparent()) 50 , m_transparent(border.isTransparent())
53 { 51 {
54 } 52 }
55 53
56 unsigned width() const { return m_style > BHIDDEN ? m_width : 0; } 54 unsigned width() const { return m_style > BHIDDEN ? m_width : 0; }
57 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } 55 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
58 bool exists() const { return m_precedence != BOFF; } 56 bool exists() const { return m_precedence != BOFF; }
59 StyleColor color() const { return StyleColor(m_color, m_colorIsValid, m_curr entColor); } 57 Color color() const { return Color(m_color, m_colorIsValid); }
60 bool isTransparent() const { return m_transparent; } 58 bool isTransparent() const { return m_transparent; }
61 EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence> (m_precedence); } 59 EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence> (m_precedence); }
62 60
63 bool isSameIgnoringColor(const CollapsedBorderValue& o) const 61 bool isSameIgnoringColor(const CollapsedBorderValue& o) const
64 { 62 {
65 return width() == o.width() && style() == o.style() && precedence() == o .precedence(); 63 return width() == o.width() && style() == o.style() && precedence() == o .precedence();
66 } 64 }
67 65
68 private: 66 private:
69 Color m_color; 67 RGBA32 m_color;
70 unsigned m_colorIsValid : 1; 68 unsigned m_colorIsValid : 1;
71 unsigned m_currentColor : 1; 69 unsigned m_width : 23;
72 unsigned m_width : 22;
73 unsigned m_style : 4; // EBorderStyle 70 unsigned m_style : 4; // EBorderStyle
74 unsigned m_precedence : 3; // EBorderPrecedence 71 unsigned m_precedence : 3; // EBorderPrecedence
75 unsigned m_transparent : 1; 72 unsigned m_transparent : 1;
76 }; 73 };
77 74
78 } // namespace WebCore 75 } // namespace WebCore
79 76
80 #endif // CollapsedBorderValue_h 77 #endif // CollapsedBorderValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698