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 14 matching lines...) Expand all Loading... |
25 #ifndef StyleSurroundData_h | 25 #ifndef StyleSurroundData_h |
26 #define StyleSurroundData_h | 26 #define StyleSurroundData_h |
27 | 27 |
28 #include "core/style/BorderData.h" | 28 #include "core/style/BorderData.h" |
29 #include "platform/LengthBox.h" | 29 #include "platform/LengthBox.h" |
30 #include "wtf/PassRefPtr.h" | 30 #include "wtf/PassRefPtr.h" |
31 #include "wtf/RefCounted.h" | 31 #include "wtf/RefCounted.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
| 35 // TODO(sashab): Move this into a private class on ComputedStyle, and remove |
| 36 // all methods on it, merging them into copy/creation methods on ComputedStyle |
| 37 // instead. Keep the allocation logic, only allocating a new object if needed. |
35 class StyleSurroundData : public RefCounted<StyleSurroundData> { | 38 class StyleSurroundData : public RefCounted<StyleSurroundData> { |
36 public: | 39 public: |
37 static PassRefPtr<StyleSurroundData> create() { return adoptRef(new StyleSur
roundData); } | 40 static PassRefPtr<StyleSurroundData> create() { return adoptRef(new StyleSur
roundData); } |
38 PassRefPtr<StyleSurroundData> copy() const { return adoptRef(new StyleSurrou
ndData(*this)); } | 41 PassRefPtr<StyleSurroundData> copy() const { return adoptRef(new StyleSurrou
ndData(*this)); } |
39 | 42 |
40 bool operator==(const StyleSurroundData&) const; | 43 bool operator==(const StyleSurroundData&) const; |
41 bool operator!=(const StyleSurroundData& o) const | 44 bool operator!=(const StyleSurroundData& o) const |
42 { | 45 { |
43 return !(*this == o); | 46 return !(*this == o); |
44 } | 47 } |
45 | 48 |
46 LengthBox offset; | 49 LengthBox offset; |
47 LengthBox margin; | 50 LengthBox margin; |
48 LengthBox padding; | 51 LengthBox padding; |
49 BorderData border; | 52 BorderData border; |
50 | 53 |
51 private: | 54 private: |
52 StyleSurroundData(); | 55 StyleSurroundData(); |
53 StyleSurroundData(const StyleSurroundData&); | 56 StyleSurroundData(const StyleSurroundData&); |
54 }; | 57 }; |
55 | 58 |
56 } // namespace blink | 59 } // namespace blink |
57 | 60 |
58 #endif // StyleSurroundData_h | 61 #endif // StyleSurroundData_h |
OLD | NEW |