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 15 matching lines...) Expand all Loading... |
26 #define StyleVisualData_h | 26 #define StyleVisualData_h |
27 | 27 |
28 #include "core/CoreExport.h" | 28 #include "core/CoreExport.h" |
29 #include "core/style/ComputedStyleConstants.h" | 29 #include "core/style/ComputedStyleConstants.h" |
30 #include "platform/LengthBox.h" | 30 #include "platform/LengthBox.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 |
| 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. |
36 class CORE_EXPORT StyleVisualData : public RefCounted<StyleVisualData> { | 39 class CORE_EXPORT StyleVisualData : public RefCounted<StyleVisualData> { |
37 public: | 40 public: |
38 static PassRefPtr<StyleVisualData> create() { return adoptRef(new StyleVisua
lData); } | 41 static PassRefPtr<StyleVisualData> create() { return adoptRef(new StyleVisua
lData); } |
39 PassRefPtr<StyleVisualData> copy() const { return adoptRef(new StyleVisualDa
ta(*this)); } | 42 PassRefPtr<StyleVisualData> copy() const { return adoptRef(new StyleVisualDa
ta(*this)); } |
40 ~StyleVisualData(); | 43 ~StyleVisualData(); |
41 | 44 |
42 bool operator==(const StyleVisualData& o) const | 45 bool operator==(const StyleVisualData& o) const |
43 { | 46 { |
44 return clip == o.clip | 47 return clip == o.clip |
45 && hasAutoClip == o.hasAutoClip | 48 && hasAutoClip == o.hasAutoClip |
46 && textDecoration == o.textDecoration | 49 && textDecoration == o.textDecoration |
47 && m_zoom == o.m_zoom; | 50 && m_zoom == o.m_zoom; |
48 } | 51 } |
49 bool operator!=(const StyleVisualData& o) const { return !(*this == o); } | 52 bool operator!=(const StyleVisualData& o) const { return !(*this == o); } |
50 | 53 |
51 LengthBox clip; | 54 LengthBox clip; |
52 bool hasAutoClip : 1; | 55 bool hasAutoClip : 1; |
53 unsigned textDecoration : TextDecorationBits; // Text decorations defined *o
nly* by this element. | 56 unsigned textDecoration : TextDecorationBits; // Text decorations defined *o
nly* by this element. |
54 | 57 |
55 float m_zoom; | 58 float m_zoom; |
56 | 59 |
57 private: | 60 private: |
58 StyleVisualData(); | 61 StyleVisualData(); |
59 StyleVisualData(const StyleVisualData&); | 62 StyleVisualData(const StyleVisualData&); |
60 }; | 63 }; |
61 | 64 |
62 } // namespace blink | 65 } // namespace blink |
63 | 66 |
64 #endif // StyleVisualData_h | 67 #endif // StyleVisualData_h |
OLD | NEW |