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 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 struct BidiRun; | 47 struct BidiRun; |
48 struct PaintInfo; | 48 struct PaintInfo; |
49 class LineInfo; | 49 class LineInfo; |
50 class RenderRubyRun; | 50 class RenderRubyRun; |
51 | 51 |
52 template <class Iterator, class Run> class BidiResolver; | 52 template <class Iterator, class Run> class BidiResolver; |
53 template <class Run> class BidiRunList; | 53 template <class Run> class BidiRunList; |
54 template <class Iterator> struct MidpointState; | 54 template <class Iterator> struct MidpointState; |
55 typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver; | 55 typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver; |
56 typedef MidpointState<InlineIterator> LineMidpointState; | 56 typedef MidpointState<InlineIterator> LineMidpointState; |
| 57 typedef WTF::ListHashSet<RenderBox*> TrackedRendererListHashSet; |
| 58 typedef WTF::HashMap<const RenderBlock*, TrackedRendererListHashSet*> TrackedDes
cendantsMap; |
| 59 typedef WTF::HashMap<const RenderBox*, HashSet<RenderBlock*>*> TrackedContainerM
ap; |
57 | 60 |
58 enum CaretType { CursorCaret, DragCaret }; | 61 enum CaretType { CursorCaret, DragCaret }; |
59 | 62 |
60 enum TextRunFlag { | 63 enum TextRunFlag { |
61 DefaultTextRunFlags = 0, | 64 DefaultTextRunFlags = 0, |
62 RespectDirection = 1 << 0, | 65 RespectDirection = 1 << 0, |
63 RespectDirectionOverride = 1 << 1 | 66 RespectDirectionOverride = 1 << 1 |
64 }; | 67 }; |
65 | 68 |
66 typedef unsigned TextRunFlags; | 69 typedef unsigned TextRunFlags; |
(...skipping 25 matching lines...) Expand all Loading... |
92 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } | 95 InlineFlowBox* lastLineBox() const { return m_lineBoxes.lastLineBox(); } |
93 | 96 |
94 void deleteLineBoxTree(); | 97 void deleteLineBoxTree(); |
95 | 98 |
96 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; | 99 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
; |
97 virtual void removeChild(RenderObject*); | 100 virtual void removeChild(RenderObject*); |
98 | 101 |
99 virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight
= 0); | 102 virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight
= 0); |
100 | 103 |
101 void insertPositionedObject(RenderBox*); | 104 void insertPositionedObject(RenderBox*); |
102 void removePositionedObject(RenderBox*); | 105 static void removePositionedObject(RenderBox*); |
103 void removePositionedObjects(RenderBlock*); | 106 void removePositionedObjects(RenderBlock*); |
104 | 107 |
105 typedef ListHashSet<RenderBox*, 4> PositionedObjectsListHashSet; | 108 TrackedRendererListHashSet* positionedObjects() const; |
106 PositionedObjectsListHashSet* positionedObjects() const { return m_positione
dObjects.get(); } | 109 bool hasPositionedObjects() const |
107 bool hasPositionedObjects() const { return m_positionedObjects && !m_positio
nedObjects->isEmpty(); } | 110 { |
| 111 TrackedRendererListHashSet* objects = positionedObjects(); |
| 112 return objects && !objects->isEmpty(); |
| 113 } |
108 | 114 |
109 void addPercentHeightDescendant(RenderBox*); | 115 void addPercentHeightDescendant(RenderBox*); |
110 static void removePercentHeightDescendant(RenderBox*); | 116 static void removePercentHeightDescendant(RenderBox*); |
111 HashSet<RenderBox*>* percentHeightDescendants() const; | 117 TrackedRendererListHashSet* percentHeightDescendants() const; |
112 static bool hasPercentHeightContainerMap(); | 118 static bool hasPercentHeightContainerMap(); |
113 static bool hasPercentHeightDescendant(RenderBox*); | 119 static bool hasPercentHeightDescendant(RenderBox*); |
114 static void clearPercentHeightDescendantsFrom(RenderBox*); | 120 static void clearPercentHeightDescendantsFrom(RenderBox*); |
115 static void removePercentHeightDescendantIfNeeded(RenderBox*); | 121 static void removePercentHeightDescendantIfNeeded(RenderBox*); |
116 | 122 |
117 void setHasMarkupTruncation(bool b) { m_hasMarkupTruncation = b; } | 123 void setHasMarkupTruncation(bool b) { m_hasMarkupTruncation = b; } |
118 bool hasMarkupTruncation() const { return m_hasMarkupTruncation; } | 124 bool hasMarkupTruncation() const { return m_hasMarkupTruncation; } |
119 | 125 |
120 RootInlineBox* createAndAppendRootInlineBox(); | 126 RootInlineBox* createAndAppendRootInlineBox(); |
121 | 127 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 | 509 |
504 virtual LayoutUnit collapsedMarginBefore() const { return maxPositiveMarginB
efore() - maxNegativeMarginBefore(); } | 510 virtual LayoutUnit collapsedMarginBefore() const { return maxPositiveMarginB
efore() - maxNegativeMarginBefore(); } |
505 virtual LayoutUnit collapsedMarginAfter() const { return maxPositiveMarginAf
ter() - maxNegativeMarginAfter(); } | 511 virtual LayoutUnit collapsedMarginAfter() const { return maxPositiveMarginAf
ter() - maxNegativeMarginAfter(); } |
506 | 512 |
507 virtual void repaintOverhangingFloats(bool paintAllDescendants); | 513 virtual void repaintOverhangingFloats(bool paintAllDescendants); |
508 | 514 |
509 void layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalB
ottom); | 515 void layoutBlockChildren(bool relayoutChildren, LayoutUnit& maxFloatLogicalB
ottom); |
510 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& repaintLogicalT
op, LayoutUnit& repaintLogicalBottom); | 516 void layoutInlineChildren(bool relayoutChildren, LayoutUnit& repaintLogicalT
op, LayoutUnit& repaintLogicalBottom); |
511 BidiRun* handleTrailingSpaces(BidiRunList<BidiRun>&, BidiContext*); | 517 BidiRun* handleTrailingSpaces(BidiRunList<BidiRun>&, BidiContext*); |
512 | 518 |
| 519 void insertIntoTrackedRendererMaps(RenderBox* descendant, TrackedDescendants
Map*&, TrackedContainerMap*&); |
| 520 static void removeFromTrackedRendererMaps(RenderBox* descendant, TrackedDesc
endantsMap*&, TrackedContainerMap*&); |
| 521 |
513 virtual void borderFitAdjust(LayoutRect&) const; // Shrink the box in which
the border paints if border-fit is set. | 522 virtual void borderFitAdjust(LayoutRect&) const; // Shrink the box in which
the border paints if border-fit is set. |
514 | 523 |
515 virtual void updateBeforeAfterContent(PseudoId); | 524 virtual void updateBeforeAfterContent(PseudoId); |
516 | 525 |
517 virtual RootInlineBox* createRootInlineBox(); // Subclassed by SVG and Ruby. | 526 virtual RootInlineBox* createRootInlineBox(); // Subclassed by SVG and Ruby. |
518 | 527 |
519 // Called to lay out the legend for a fieldset or the ruby text of a ruby ru
n. | 528 // Called to lay out the legend for a fieldset or the ruby text of a ruby ru
n. |
520 virtual RenderObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/)
{ return 0; } | 529 virtual RenderObject* layoutSpecialExcludedChild(bool /*relayoutChildren*/)
{ return 0; } |
521 | 530 |
522 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject*
currentChild); | 531 void createFirstLetterRenderer(RenderObject* firstLetterBlock, RenderObject*
currentChild); |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 FloatingObjectInterval intervalForFloatingObject(FloatingObject*); | 1070 FloatingObjectInterval intervalForFloatingObject(FloatingObject*); |
1062 | 1071 |
1063 FloatingObjectSet m_set; | 1072 FloatingObjectSet m_set; |
1064 FloatingObjectTree m_placedFloatsTree; | 1073 FloatingObjectTree m_placedFloatsTree; |
1065 unsigned m_leftObjectsCount; | 1074 unsigned m_leftObjectsCount; |
1066 unsigned m_rightObjectsCount; | 1075 unsigned m_rightObjectsCount; |
1067 bool m_horizontalWritingMode; | 1076 bool m_horizontalWritingMode; |
1068 const RenderBlock* m_renderer; | 1077 const RenderBlock* m_renderer; |
1069 }; | 1078 }; |
1070 OwnPtr<FloatingObjects> m_floatingObjects; | 1079 OwnPtr<FloatingObjects> m_floatingObjects; |
1071 | |
1072 typedef PositionedObjectsListHashSet::const_iterator Iterator; | |
1073 OwnPtr<PositionedObjectsListHashSet> m_positionedObjects; | |
1074 | 1080 |
1075 // Allocated only when some of these fields have non-default values | 1081 // Allocated only when some of these fields have non-default values |
1076 struct RenderBlockRareData { | 1082 struct RenderBlockRareData { |
1077 WTF_MAKE_NONCOPYABLE(RenderBlockRareData); WTF_MAKE_FAST_ALLOCATED; | 1083 WTF_MAKE_NONCOPYABLE(RenderBlockRareData); WTF_MAKE_FAST_ALLOCATED; |
1078 public: | 1084 public: |
1079 RenderBlockRareData(const RenderBlock* block) | 1085 RenderBlockRareData(const RenderBlock* block) |
1080 : m_margins(positiveMarginBeforeDefault(block), negativeMarginBefore
Default(block), positiveMarginAfterDefault(block), negativeMarginAfterDefault(bl
ock)) | 1086 : m_margins(positiveMarginBeforeDefault(block), negativeMarginBefore
Default(block), positiveMarginAfterDefault(block), negativeMarginAfterDefault(bl
ock)) |
1081 , m_paginationStrut(0) | 1087 , m_paginationStrut(0) |
1082 , m_pageLogicalOffset(0) | 1088 , m_pageLogicalOffset(0) |
1083 , m_lineGridBox(0) | 1089 , m_lineGridBox(0) |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1149 static String string(const int value); | 1155 static String string(const int value); |
1150 }; | 1156 }; |
1151 template<> struct ValueToString<RenderBlock::FloatingObject*> { | 1157 template<> struct ValueToString<RenderBlock::FloatingObject*> { |
1152 static String string(const RenderBlock::FloatingObject*); | 1158 static String string(const RenderBlock::FloatingObject*); |
1153 }; | 1159 }; |
1154 #endif | 1160 #endif |
1155 | 1161 |
1156 } // namespace WebCore | 1162 } // namespace WebCore |
1157 | 1163 |
1158 #endif // RenderBlock_h | 1164 #endif // RenderBlock_h |
OLD | NEW |