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 18 matching lines...) Expand all Loading... |
29 #include "core/style/ComputedStyleConstants.h" | 29 #include "core/style/ComputedStyleConstants.h" |
30 #include "platform/Length.h" | 30 #include "platform/Length.h" |
31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
32 #include "wtf/RefCounted.h" | 32 #include "wtf/RefCounted.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 // TODO(sashab): Move this into a private class on ComputedStyle, and remove | 36 // TODO(sashab): Move this into a private class on ComputedStyle, and remove |
37 // all methods on it, merging them into copy/creation methods on ComputedStyle | 37 // all methods on it, merging them into copy/creation methods on ComputedStyle |
38 // instead. Keep the allocation logic, only allocating a new object if needed. | 38 // instead. Keep the allocation logic, only allocating a new object if needed. |
39 class CORE_EXPORT StyleBoxData : public RefCounted<StyleBoxData> { | 39 class CORE_EXPORT StyleBoxData : public RefCountedCopyable<StyleBoxData> { |
40 public: | 40 public: |
41 static PassRefPtr<StyleBoxData> create() { | 41 static PassRefPtr<StyleBoxData> create() { |
42 return adoptRef(new StyleBoxData); | 42 return adoptRef(new StyleBoxData); |
43 } | 43 } |
44 PassRefPtr<StyleBoxData> copy() const { | 44 PassRefPtr<StyleBoxData> copy() const { |
45 return adoptRef(new StyleBoxData(*this)); | 45 return adoptRef(new StyleBoxData(*this)); |
46 } | 46 } |
47 | 47 |
48 bool operator==(const StyleBoxData&) const; | 48 bool operator==(const StyleBoxData&) const; |
49 bool operator!=(const StyleBoxData& o) const { return !(*this == o); } | 49 bool operator!=(const StyleBoxData& o) const { return !(*this == o); } |
(...skipping 14 matching lines...) Expand all Loading... |
64 | 64 |
65 EBoxSizing boxSizing() const { return static_cast<EBoxSizing>(m_boxSizing); } | 65 EBoxSizing boxSizing() const { return static_cast<EBoxSizing>(m_boxSizing); } |
66 EBoxDecorationBreak boxDecorationBreak() const { | 66 EBoxDecorationBreak boxDecorationBreak() const { |
67 return static_cast<EBoxDecorationBreak>(m_boxDecorationBreak); | 67 return static_cast<EBoxDecorationBreak>(m_boxDecorationBreak); |
68 } | 68 } |
69 | 69 |
70 private: | 70 private: |
71 friend class ComputedStyle; | 71 friend class ComputedStyle; |
72 | 72 |
73 StyleBoxData(); | 73 StyleBoxData(); |
74 StyleBoxData(const StyleBoxData&); | 74 StyleBoxData(const StyleBoxData&) = default; |
75 | 75 |
76 Length m_width; | 76 Length m_width; |
77 Length m_height; | 77 Length m_height; |
78 | 78 |
79 Length m_minWidth; | 79 Length m_minWidth; |
80 Length m_maxWidth; | 80 Length m_maxWidth; |
81 | 81 |
82 Length m_minHeight; | 82 Length m_minHeight; |
83 Length m_maxHeight; | 83 Length m_maxHeight; |
84 | 84 |
85 Length m_verticalAlign; | 85 Length m_verticalAlign; |
86 | 86 |
87 int m_zIndex; | 87 int m_zIndex; |
88 unsigned m_hasAutoZIndex : 1; | 88 unsigned m_hasAutoZIndex : 1; |
89 unsigned m_boxSizing : 1; // EBoxSizing | 89 unsigned m_boxSizing : 1; // EBoxSizing |
90 unsigned m_boxDecorationBreak : 1; // EBoxDecorationBreak | 90 unsigned m_boxDecorationBreak : 1; // EBoxDecorationBreak |
91 }; | 91 }; |
92 | 92 |
93 } // namespace blink | 93 } // namespace blink |
94 | 94 |
95 #endif // StyleBoxData_h | 95 #endif // StyleBoxData_h |
OLD | NEW |