| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 EBorderPrecedence precedence) | 56 EBorderPrecedence precedence) |
| 57 : color_(color), | 57 : color_(color), |
| 58 width_(ComputedStyle::BorderStyleIsVisible(border.Style()) | 58 width_(ComputedStyle::BorderStyleIsVisible(border.Style()) |
| 59 ? border.Width() | 59 ? border.Width() |
| 60 : 0), | 60 : 0), |
| 61 style_(static_cast<unsigned>(border.Style())), | 61 style_(static_cast<unsigned>(border.Style())), |
| 62 precedence_(precedence) { | 62 precedence_(precedence) { |
| 63 DCHECK(precedence != kBorderPrecedenceOff); | 63 DCHECK(precedence != kBorderPrecedenceOff); |
| 64 } | 64 } |
| 65 | 65 |
| 66 CollapsedBorderValue(EBorderStyle style, |
| 67 const float width, |
| 68 const Color& color, |
| 69 EBorderPrecedence precedence) |
| 70 : color_(color), |
| 71 width_(ComputedStyle::BorderStyleIsVisible(style) ? width : 0), |
| 72 style_(static_cast<unsigned>(style)), |
| 73 precedence_(precedence) { |
| 74 DCHECK(precedence != kBorderPrecedenceOff); |
| 75 } |
| 76 |
| 66 unsigned Width() const { return width_; } | 77 unsigned Width() const { return width_; } |
| 67 EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); } | 78 EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); } |
| 68 bool Exists() const { return precedence_ != kBorderPrecedenceOff; } | 79 bool Exists() const { return precedence_ != kBorderPrecedenceOff; } |
| 69 Color GetColor() const { return color_; } | 80 Color GetColor() const { return color_; } |
| 70 bool IsTransparent() const { return !color_.Alpha(); } | 81 bool IsTransparent() const { return !color_.Alpha(); } |
| 71 EBorderPrecedence Precedence() const { | 82 EBorderPrecedence Precedence() const { |
| 72 return static_cast<EBorderPrecedence>(precedence_); | 83 return static_cast<EBorderPrecedence>(precedence_); |
| 73 } | 84 } |
| 74 | 85 |
| 75 bool IsSameIgnoringColor(const CollapsedBorderValue& o) const { | 86 bool IsSameIgnoringColor(const CollapsedBorderValue& o) const { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 94 private: | 105 private: |
| 95 Color color_; | 106 Color color_; |
| 96 unsigned width_ : 25; | 107 unsigned width_ : 25; |
| 97 unsigned style_ : 4; // EBorderStyle | 108 unsigned style_ : 4; // EBorderStyle |
| 98 unsigned precedence_ : 3; // EBorderPrecedence | 109 unsigned precedence_ : 3; // EBorderPrecedence |
| 99 }; | 110 }; |
| 100 | 111 |
| 101 } // namespace blink | 112 } // namespace blink |
| 102 | 113 |
| 103 #endif // CollapsedBorderValue_h | 114 #endif // CollapsedBorderValue_h |
| OLD | NEW |