OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void setY(LayoutUnit y) { ASSERT(!isInPlacedTree()); m_frameRect.setY(y); } | 72 void setY(LayoutUnit y) { ASSERT(!isInPlacedTree()); m_frameRect.setY(y); } |
73 void setWidth(LayoutUnit width) { ASSERT(!isInPlacedTree()); m_frameRect.set
Width(width); } | 73 void setWidth(LayoutUnit width) { ASSERT(!isInPlacedTree()); m_frameRect.set
Width(width); } |
74 void setHeight(LayoutUnit height) { ASSERT(!isInPlacedTree()); m_frameRect.s
etHeight(height); } | 74 void setHeight(LayoutUnit height) { ASSERT(!isInPlacedTree()); m_frameRect.s
etHeight(height); } |
75 | 75 |
76 const LayoutRect& frameRect() const { ASSERT(isPlaced()); return m_frameRect
; } | 76 const LayoutRect& frameRect() const { ASSERT(isPlaced()); return m_frameRect
; } |
77 void setFrameRect(const LayoutRect& frameRect) { ASSERT(!isInPlacedTree());
m_frameRect = frameRect; } | 77 void setFrameRect(const LayoutRect& frameRect) { ASSERT(!isInPlacedTree());
m_frameRect = frameRect; } |
78 | 78 |
79 int paginationStrut() const { return m_paginationStrut; } | 79 int paginationStrut() const { return m_paginationStrut; } |
80 void setPaginationStrut(int strut) { m_paginationStrut = strut; } | 80 void setPaginationStrut(int strut) { m_paginationStrut = strut; } |
81 | 81 |
82 #ifndef NDEBUG | 82 #if ENABLE(ASSERT) |
83 bool isInPlacedTree() const { return m_isInPlacedTree; } | 83 bool isInPlacedTree() const { return m_isInPlacedTree; } |
84 void setIsInPlacedTree(bool value) { m_isInPlacedTree = value; } | 84 void setIsInPlacedTree(bool value) { m_isInPlacedTree = value; } |
85 #endif | 85 #endif |
86 | 86 |
87 bool shouldPaint() const { return m_shouldPaint; } | 87 bool shouldPaint() const { return m_shouldPaint; } |
88 void setShouldPaint(bool shouldPaint) { m_shouldPaint = shouldPaint; } | 88 void setShouldPaint(bool shouldPaint) { m_shouldPaint = shouldPaint; } |
89 bool isDescendant() const { return m_isDescendant; } | 89 bool isDescendant() const { return m_isDescendant; } |
90 void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; } | 90 void setIsDescendant(bool isDescendant) { m_isDescendant = isDescendant; } |
91 | 91 |
92 // FIXME: Callers of these methods are dangerous and should be whitelisted e
xplicitly or removed. | 92 // FIXME: Callers of these methods are dangerous and should be whitelisted e
xplicitly or removed. |
93 RootInlineBox* originatingLine() const { return m_originatingLine; } | 93 RootInlineBox* originatingLine() const { return m_originatingLine; } |
94 void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; } | 94 void setOriginatingLine(RootInlineBox* line) { m_originatingLine = line; } |
95 | 95 |
96 private: | 96 private: |
97 explicit FloatingObject(RenderBox*); | 97 explicit FloatingObject(RenderBox*); |
98 FloatingObject(RenderBox*, Type, const LayoutRect&, bool shouldPaint, bool i
sDescendant); | 98 FloatingObject(RenderBox*, Type, const LayoutRect&, bool shouldPaint, bool i
sDescendant); |
99 | 99 |
100 RenderBox* m_renderer; | 100 RenderBox* m_renderer; |
101 RootInlineBox* m_originatingLine; | 101 RootInlineBox* m_originatingLine; |
102 LayoutRect m_frameRect; | 102 LayoutRect m_frameRect; |
103 int m_paginationStrut; // FIXME: Is this class size-sensitive? Does this nee
d 32-bits? | 103 int m_paginationStrut; // FIXME: Is this class size-sensitive? Does this nee
d 32-bits? |
104 | 104 |
105 unsigned m_type : 2; // Type (left or right aligned) | 105 unsigned m_type : 2; // Type (left or right aligned) |
106 unsigned m_shouldPaint : 1; | 106 unsigned m_shouldPaint : 1; |
107 unsigned m_isDescendant : 1; | 107 unsigned m_isDescendant : 1; |
108 unsigned m_isPlaced : 1; | 108 unsigned m_isPlaced : 1; |
109 #ifndef NDEBUG | 109 #if ENABLE(ASSERT) |
110 unsigned m_isInPlacedTree : 1; | 110 unsigned m_isInPlacedTree : 1; |
111 #endif | 111 #endif |
112 }; | 112 }; |
113 | 113 |
114 struct FloatingObjectHashFunctions { | 114 struct FloatingObjectHashFunctions { |
115 static unsigned hash(FloatingObject* key) { return DefaultHash<RenderBox*>::
Hash::hash(key->renderer()); } | 115 static unsigned hash(FloatingObject* key) { return DefaultHash<RenderBox*>::
Hash::hash(key->renderer()); } |
116 static unsigned hash(const OwnPtr<FloatingObject>& key) { return hash(key.ge
t()); } | 116 static unsigned hash(const OwnPtr<FloatingObject>& key) { return hash(key.ge
t()); } |
117 static unsigned hash(const PassOwnPtr<FloatingObject>& key) { return hash(ke
y.get()); } | 117 static unsigned hash(const PassOwnPtr<FloatingObject>& key) { return hash(ke
y.get()); } |
118 static bool equal(OwnPtr<FloatingObject>& a, FloatingObject* b) { return a->
renderer() == b->renderer(); } | 118 static bool equal(OwnPtr<FloatingObject>& a, FloatingObject* b) { return a->
renderer() == b->renderer(); } |
119 static bool equal(OwnPtr<FloatingObject>& a, const OwnPtr<FloatingObject>& b
) { return equal(a, b.get()); } | 119 static bool equal(OwnPtr<FloatingObject>& a, const OwnPtr<FloatingObject>& b
) { return equal(a, b.get()); } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 static String string(const int value); | 199 static String string(const int value); |
200 }; | 200 }; |
201 template<> struct ValueToString<FloatingObject*> { | 201 template<> struct ValueToString<FloatingObject*> { |
202 static String string(const FloatingObject*); | 202 static String string(const FloatingObject*); |
203 }; | 203 }; |
204 #endif | 204 #endif |
205 | 205 |
206 } // namespace WebCore | 206 } // namespace WebCore |
207 | 207 |
208 #endif // FloatingObjects_h | 208 #endif // FloatingObjects_h |
OLD | NEW |