OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 #include "platform/graphics/Color.h" | 30 #include "platform/graphics/Color.h" |
31 #include "wtf/Allocator.h" | 31 #include "wtf/Allocator.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class BorderValue { | 35 class BorderValue { |
36 DISALLOW_NEW(); | 36 DISALLOW_NEW(); |
37 friend class ComputedStyle; | 37 friend class ComputedStyle; |
38 public: | 38 public: |
39 BorderValue() | 39 BorderValue() |
40 : m_color(0) | 40 : m_width(3) |
| 41 , m_color(0) |
41 , m_colorIsCurrentColor(true) | 42 , m_colorIsCurrentColor(true) |
42 , m_width(3) | |
43 , m_style(BNONE) | 43 , m_style(BNONE) |
44 , m_isAuto(AUTO_OFF) | 44 , m_isAuto(AUTO_OFF) |
45 { | 45 { |
46 } | 46 } |
47 | 47 |
48 bool nonZero(bool checkStyle = true) const | 48 bool nonZero(bool checkStyle = true) const |
49 { | 49 { |
50 return width() && (!checkStyle || m_style != BNONE); | 50 return width() && (!checkStyle || m_style != BNONE); |
51 } | 51 } |
52 | 52 |
(...skipping 28 matching lines...) Expand all Loading... |
81 } | 81 } |
82 | 82 |
83 void setColor(const StyleColor& color) | 83 void setColor(const StyleColor& color) |
84 { | 84 { |
85 m_color = color.resolve(Color()); | 85 m_color = color.resolve(Color()); |
86 m_colorIsCurrentColor = color.isCurrentColor(); | 86 m_colorIsCurrentColor = color.isCurrentColor(); |
87 } | 87 } |
88 | 88 |
89 StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::curren
tColor() : StyleColor(m_color); } | 89 StyleColor color() const { return m_colorIsCurrentColor ? StyleColor::curren
tColor() : StyleColor(m_color); } |
90 | 90 |
91 int width() const { return m_width; } | 91 float width() const { return m_width; } |
92 | 92 |
93 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } | 93 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } |
94 void setStyle(EBorderStyle style) { m_style = style; } | 94 void setStyle(EBorderStyle style) { m_style = style; } |
95 | 95 |
96 protected: | 96 protected: |
| 97 float m_width; |
97 Color m_color; | 98 Color m_color; |
98 unsigned m_colorIsCurrentColor : 1; | 99 unsigned m_colorIsCurrentColor : 1; |
99 | 100 |
100 unsigned m_width : 26; | |
101 unsigned m_style : 4; // EBorderStyle | 101 unsigned m_style : 4; // EBorderStyle |
102 | 102 |
103 // This is only used by OutlineValue but moved here to keep the bits packed. | 103 // This is only used by OutlineValue but moved here to keep the bits packed. |
104 unsigned m_isAuto : 1; // OutlineIsAuto | 104 unsigned m_isAuto : 1; // OutlineIsAuto |
105 }; | 105 }; |
106 | 106 |
107 } // namespace blink | 107 } // namespace blink |
108 | 108 |
109 #endif // BorderValue_h | 109 #endif // BorderValue_h |
OLD | NEW |