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 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "Document.h" | 30 #include "Document.h" |
31 #include "Element.h" | 31 #include "Element.h" |
32 #include "FractionalLayoutUnit.h" | 32 #include "FractionalLayoutUnit.h" |
33 #include "FloatQuad.h" | 33 #include "FloatQuad.h" |
34 #include "LayoutTypes.h" | 34 #include "LayoutTypes.h" |
35 #include "PaintPhase.h" | 35 #include "PaintPhase.h" |
36 #include "RenderObjectChildList.h" | 36 #include "RenderObjectChildList.h" |
37 #include "RenderStyle.h" | 37 #include "RenderStyle.h" |
38 #include "TextAffinity.h" | 38 #include "TextAffinity.h" |
39 #include "TransformationMatrix.h" | 39 #include "TransformationMatrix.h" |
| 40 #include <wtf/HashSet.h> |
40 #include <wtf/UnusedParam.h> | 41 #include <wtf/UnusedParam.h> |
41 | 42 |
42 #if USE(CG) || USE(CAIRO) || USE(SKIA) || PLATFORM(QT) | 43 #if USE(CG) || USE(CAIRO) || USE(SKIA) || PLATFORM(QT) |
43 #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING 1 | 44 #define HAVE_PATH_BASED_BORDER_RADIUS_DRAWING 1 |
44 #endif | 45 #endif |
45 | 46 |
46 namespace WebCore { | 47 namespace WebCore { |
47 | 48 |
48 class AffineTransform; | 49 class AffineTransform; |
49 class AnimationController; | 50 class AnimationController; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 return !(*this == o); | 111 return !(*this == o); |
111 } | 112 } |
112 | 113 |
113 String label; | 114 String label; |
114 LayoutRect bounds; | 115 LayoutRect bounds; |
115 LayoutRect clip; | 116 LayoutRect clip; |
116 int type; | 117 int type; |
117 }; | 118 }; |
118 #endif | 119 #endif |
119 | 120 |
| 121 typedef WTF::HashSet<const RenderObject*> RenderObjectAncestorLineboxDirtySet; |
| 122 |
120 #ifndef NDEBUG | 123 #ifndef NDEBUG |
121 const int showTreeCharacterOffset = 39; | 124 const int showTreeCharacterOffset = 39; |
122 #endif | 125 #endif |
123 | 126 |
124 // Base class for all rendering tree objects. | 127 // Base class for all rendering tree objects. |
125 class RenderObject : public CachedImageClient { | 128 class RenderObject : public CachedImageClient { |
126 friend class LayoutRepainter; | 129 friend class LayoutRepainter; |
127 friend class RenderBlock; | 130 friend class RenderBlock; |
128 friend class RenderBox; | 131 friend class RenderBox; |
129 friend class RenderLayer; | 132 friend class RenderLayer; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 365 |
363 bool hasCounterNodeMap() const { return m_bitfields.hasCounterNodeMap(); } | 366 bool hasCounterNodeMap() const { return m_bitfields.hasCounterNodeMap(); } |
364 void setHasCounterNodeMap(bool hasCounterNodeMap) { m_bitfields.setHasCounte
rNodeMap(hasCounterNodeMap); } | 367 void setHasCounterNodeMap(bool hasCounterNodeMap) { m_bitfields.setHasCounte
rNodeMap(hasCounterNodeMap); } |
365 bool everHadLayout() const { return m_bitfields.everHadLayout(); } | 368 bool everHadLayout() const { return m_bitfields.everHadLayout(); } |
366 | 369 |
367 bool childrenInline() const { return m_bitfields.childrenInline(); } | 370 bool childrenInline() const { return m_bitfields.childrenInline(); } |
368 void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } | 371 void setChildrenInline(bool b) { m_bitfields.setChildrenInline(b); } |
369 bool hasColumns() const { return m_bitfields.hasColumns(); } | 372 bool hasColumns() const { return m_bitfields.hasColumns(); } |
370 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } | 373 void setHasColumns(bool b = true) { m_bitfields.setHasColumns(b); } |
371 | 374 |
| 375 bool ancestorLineBoxDirty() const { return s_ancestorLineboxDirtySet && s_an
cestorLineboxDirtySet->contains(this); } |
| 376 void setAncestorLineBoxDirty(bool b = true) |
| 377 { |
| 378 if (b) { |
| 379 if (!s_ancestorLineboxDirtySet) |
| 380 s_ancestorLineboxDirtySet = new RenderObjectAncestorLineboxDirty
Set; |
| 381 s_ancestorLineboxDirtySet->add(this); |
| 382 } else if (s_ancestorLineboxDirtySet) { |
| 383 s_ancestorLineboxDirtySet->remove(this); |
| 384 if (s_ancestorLineboxDirtySet->isEmpty()) { |
| 385 delete s_ancestorLineboxDirtySet; |
| 386 s_ancestorLineboxDirtySet = 0; |
| 387 } |
| 388 } |
| 389 } |
| 390 |
372 bool inRenderFlowThread() const { return m_bitfields.inRenderFlowThread(); } | 391 bool inRenderFlowThread() const { return m_bitfields.inRenderFlowThread(); } |
373 void setInRenderFlowThread(bool b = true) { m_bitfields.setInRenderFlowThrea
d(b); } | 392 void setInRenderFlowThread(bool b = true) { m_bitfields.setInRenderFlowThrea
d(b); } |
374 | 393 |
375 virtual bool requiresForcedStyleRecalcPropagation() const { return false; } | 394 virtual bool requiresForcedStyleRecalcPropagation() const { return false; } |
376 | 395 |
377 #if ENABLE(MATHML) | 396 #if ENABLE(MATHML) |
378 virtual bool isRenderMathMLBlock() const { return false; } | 397 virtual bool isRenderMathMLBlock() const { return false; } |
379 #endif // ENABLE(MATHML) | 398 #endif // ENABLE(MATHML) |
380 | 399 |
381 #if ENABLE(SVG) | 400 #if ENABLE(SVG) |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 Color selectionColor(int colorProperty) const; | 902 Color selectionColor(int colorProperty) const; |
884 | 903 |
885 RefPtr<RenderStyle> m_style; | 904 RefPtr<RenderStyle> m_style; |
886 | 905 |
887 Node* m_node; | 906 Node* m_node; |
888 | 907 |
889 RenderObject* m_parent; | 908 RenderObject* m_parent; |
890 RenderObject* m_previous; | 909 RenderObject* m_previous; |
891 RenderObject* m_next; | 910 RenderObject* m_next; |
892 | 911 |
| 912 static RenderObjectAncestorLineboxDirtySet* s_ancestorLineboxDirtySet; |
| 913 |
893 #ifndef NDEBUG | 914 #ifndef NDEBUG |
894 bool m_hasAXObject : 1; | 915 bool m_hasAXObject : 1; |
895 bool m_setNeedsLayoutForbidden : 1; | 916 bool m_setNeedsLayoutForbidden : 1; |
896 #endif | 917 #endif |
897 | 918 |
898 #define ADD_BOOLEAN_BITFIELD(name, Name) \ | 919 #define ADD_BOOLEAN_BITFIELD(name, Name) \ |
899 private:\ | 920 private:\ |
900 unsigned m_##name : 1;\ | 921 unsigned m_##name : 1;\ |
901 public:\ | 922 public:\ |
902 bool name() const { return m_##name; }\ | 923 bool name() const { return m_##name; }\ |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 markContainingBlocksForLayout(); | 1064 markContainingBlocksForLayout(); |
1044 if (hasLayer()) | 1065 if (hasLayer()) |
1045 setLayerNeedsFullRepaint(); | 1066 setLayerNeedsFullRepaint(); |
1046 } | 1067 } |
1047 } else { | 1068 } else { |
1048 setEverHadLayout(true); | 1069 setEverHadLayout(true); |
1049 setPosChildNeedsLayout(false); | 1070 setPosChildNeedsLayout(false); |
1050 setNeedsSimplifiedNormalFlowLayout(false); | 1071 setNeedsSimplifiedNormalFlowLayout(false); |
1051 setNormalChildNeedsLayout(false); | 1072 setNormalChildNeedsLayout(false); |
1052 setNeedsPositionedMovementLayout(false); | 1073 setNeedsPositionedMovementLayout(false); |
| 1074 setAncestorLineBoxDirty(false); |
1053 } | 1075 } |
1054 } | 1076 } |
1055 | 1077 |
1056 inline void RenderObject::setChildNeedsLayout(bool b, bool markParents) | 1078 inline void RenderObject::setChildNeedsLayout(bool b, bool markParents) |
1057 { | 1079 { |
1058 bool alreadyNeededLayout = normalChildNeedsLayout(); | 1080 bool alreadyNeededLayout = normalChildNeedsLayout(); |
1059 setNormalChildNeedsLayout(b); | 1081 setNormalChildNeedsLayout(b); |
1060 if (b) { | 1082 if (b) { |
1061 ASSERT(!isSetNeedsLayoutForbidden()); | 1083 ASSERT(!isSetNeedsLayoutForbidden()); |
1062 if (!alreadyNeededLayout && markParents) | 1084 if (!alreadyNeededLayout && markParents) |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 // Outside the WebCore namespace for ease of invocation from gdb. | 1200 // Outside the WebCore namespace for ease of invocation from gdb. |
1179 void showTree(const WebCore::RenderObject*); | 1201 void showTree(const WebCore::RenderObject*); |
1180 void showLineTree(const WebCore::RenderObject*); | 1202 void showLineTree(const WebCore::RenderObject*); |
1181 void showRenderTree(const WebCore::RenderObject* object1); | 1203 void showRenderTree(const WebCore::RenderObject* object1); |
1182 // We don't make object2 an optional parameter so that showRenderTree | 1204 // We don't make object2 an optional parameter so that showRenderTree |
1183 // can be called from gdb easily. | 1205 // can be called from gdb easily. |
1184 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO
bject* object2); | 1206 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO
bject* object2); |
1185 #endif | 1207 #endif |
1186 | 1208 |
1187 #endif // RenderObject_h | 1209 #endif // RenderObject_h |
OLD | NEW |