| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | |
| 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | |
| 7 * | |
| 8 * This library is free software; you can redistribute it and/or | |
| 9 * modify it under the terms of the GNU Library General Public | |
| 10 * License as published by the Free Software Foundation; either | |
| 11 * version 2 of the License, or (at your option) any later version. | |
| 12 * | |
| 13 * This library is distributed in the hope that it will be useful, | |
| 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 16 * Library General Public License for more details. | |
| 17 * | |
| 18 * You should have received a copy of the GNU Library General Public License | |
| 19 * along with this library; see the file COPYING.LIB. If not, write to | |
| 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
| 21 * Boston, MA 02110-1301, USA. | |
| 22 * | |
| 23 */ | |
| 24 | |
| 25 #ifndef BorderStyle_h | |
| 26 #define BorderStyle_h | |
| 27 | |
| 28 #include "core/css/StyleColor.h" | |
| 29 #include "core/style/ComputedStyleConstants.h" | |
| 30 #include "platform/graphics/Color.h" | |
| 31 #include "platform/wtf/Allocator.h" | |
| 32 | |
| 33 namespace blink { | |
| 34 | |
| 35 class BorderStyle { | |
| 36 DISALLOW_NEW(); | |
| 37 friend class ComputedStyle; | |
| 38 | |
| 39 public: | |
| 40 BorderStyle() : style_(kBorderStyleNone), is_auto_(kOutlineIsAutoOff) {} | |
| 41 | |
| 42 bool NonZero() const { return (style_ != kBorderStyleNone); } | |
| 43 | |
| 44 bool operator==(const BorderStyle& o) const { return style_ == o.style_; } | |
| 45 | |
| 46 // The default width is 3px, but if the style is none we compute a value of 0 | |
| 47 // (in ComputedStyle itself) | |
| 48 bool VisuallyEqual(const BorderStyle& o) const { | |
| 49 if (style_ == kBorderStyleNone && o.style_ == kBorderStyleNone) | |
| 50 return true; | |
| 51 if (style_ == kBorderStyleHidden && o.style_ == kBorderStyleHidden) | |
| 52 return true; | |
| 53 return *this == o; | |
| 54 } | |
| 55 | |
| 56 bool operator!=(const BorderStyle& o) const { return !(*this == o); } | |
| 57 | |
| 58 EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); } | |
| 59 void SetStyle(EBorderStyle style) { style_ = style; } | |
| 60 | |
| 61 OutlineIsAuto IsAuto() const { return static_cast<OutlineIsAuto>(is_auto_); } | |
| 62 void SetIsAuto(OutlineIsAuto is_auto) { is_auto_ = is_auto; } | |
| 63 | |
| 64 protected: | |
| 65 unsigned style_ : 4; // EBorderStyle | |
| 66 | |
| 67 // This is only used by OutlineValue but moved here to keep the bits packed. | |
| 68 unsigned is_auto_ : 1; // OutlineIsAuto | |
| 69 }; | |
| 70 | |
| 71 } // namespace blink | |
| 72 | |
| 73 #endif // BorderStyle_h | |
| OLD | NEW |