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 27 matching lines...) Expand all Loading... |
38 public: | 38 public: |
39 BorderValue() | 39 BorderValue() |
40 : m_color(0) | 40 : m_color(0) |
41 , m_colorIsCurrentColor(true) | 41 , m_colorIsCurrentColor(true) |
42 , m_width(3) | 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() const |
49 { | 49 { |
50 return width() && (!checkStyle || m_style != BNONE); | 50 return width() && (m_style != BNONE); |
51 } | 51 } |
52 | 52 |
53 bool isTransparent() const | 53 bool isTransparent() const |
54 { | 54 { |
55 return !m_colorIsCurrentColor && !m_color.alpha(); | 55 return !m_colorIsCurrentColor && !m_color.alpha(); |
56 } | 56 } |
57 | 57 |
58 bool isVisible(bool checkStyle = true) const | 58 bool isVisible() const |
59 { | 59 { |
60 return nonZero(checkStyle) && !isTransparent() && (!checkStyle || m_styl
e != BHIDDEN); | 60 return nonZero() && !isTransparent() && (m_style != BHIDDEN); |
61 } | 61 } |
62 | 62 |
63 bool operator==(const BorderValue& o) const | 63 bool operator==(const BorderValue& o) const |
64 { | 64 { |
65 return m_width == o.m_width && m_style == o.m_style && m_color == o.m_co
lor && m_colorIsCurrentColor == o.m_colorIsCurrentColor; | 65 return m_width == o.m_width && m_style == o.m_style && m_color == o.m_co
lor && m_colorIsCurrentColor == o.m_colorIsCurrentColor; |
66 } | 66 } |
67 | 67 |
68 // The default width is 3px, but if the style is none we compute a value of
0 (in ComputedStyle itself) | 68 // The default width is 3px, but if the style is none we compute a value of
0 (in ComputedStyle itself) |
69 bool visuallyEqual(const BorderValue& o) const | 69 bool visuallyEqual(const BorderValue& o) const |
70 { | 70 { |
(...skipping 29 matching lines...) Expand all Loading... |
100 unsigned m_width : 26; | 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 |