OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "core/rendering/RenderView.h" | 33 #include "core/rendering/RenderView.h" |
34 #include "core/rendering/VerticalPositionCache.h" | 34 #include "core/rendering/VerticalPositionCache.h" |
35 #include "platform/text/BidiResolver.h" | 35 #include "platform/text/BidiResolver.h" |
36 #include "wtf/unicode/Unicode.h" | 36 #include "wtf/unicode/Unicode.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 struct SameSizeAsRootInlineBox : public InlineFlowBox { | 40 struct SameSizeAsRootInlineBox : public InlineFlowBox { |
41 unsigned unsignedVariable; | 41 unsigned unsignedVariable; |
42 void* pointers[3]; | 42 void* pointers[3]; |
43 LayoutUnit layoutVariables[7]; | 43 LayoutUnit layoutVariables[6]; |
44 }; | 44 }; |
45 | 45 |
46 COMPILE_ASSERT(sizeof(RootInlineBox) == sizeof(SameSizeAsRootInlineBox), RootInl
ineBox_should_stay_small); | 46 COMPILE_ASSERT(sizeof(RootInlineBox) == sizeof(SameSizeAsRootInlineBox), RootInl
ineBox_should_stay_small); |
47 | 47 |
48 typedef WTF::HashMap<const RootInlineBox*, EllipsisBox*> EllipsisBoxMap; | 48 typedef WTF::HashMap<const RootInlineBox*, EllipsisBox*> EllipsisBoxMap; |
49 static EllipsisBoxMap* gEllipsisBoxMap = 0; | 49 static EllipsisBoxMap* gEllipsisBoxMap = 0; |
50 | 50 |
51 RootInlineBox::RootInlineBox(RenderBlockFlow& block) | 51 RootInlineBox::RootInlineBox(RenderBlockFlow& block) |
52 : InlineFlowBox(block) | 52 : InlineFlowBox(block) |
53 , m_lineBreakPos(0) | 53 , m_lineBreakPos(0) |
54 , m_lineBreakObj(0) | 54 , m_lineBreakObj(0) |
55 , m_lineTop(0) | 55 , m_lineTop(0) |
56 , m_lineBottom(0) | 56 , m_lineBottom(0) |
57 , m_lineTopWithLeading(0) | 57 , m_lineTopWithLeading(0) |
58 , m_lineBottomWithLeading(0) | 58 , m_lineBottomWithLeading(0) |
59 , m_selectionBottom(0) | 59 , m_selectionBottom(0) |
60 , m_paginationStrut(0) | 60 , m_paginationStrut(0) |
61 , m_paginatedLineWidth(0) | |
62 { | 61 { |
63 setIsHorizontal(block.isHorizontalWritingMode()); | 62 setIsHorizontal(block.isHorizontalWritingMode()); |
64 } | 63 } |
65 | 64 |
66 | 65 |
67 void RootInlineBox::destroy() | 66 void RootInlineBox::destroy() |
68 { | 67 { |
69 detachEllipsisBox(); | 68 detachEllipsisBox(); |
70 InlineFlowBox::destroy(); | 69 InlineFlowBox::destroy(); |
71 } | 70 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 bool hasAnnotationsBefore = false; | 227 bool hasAnnotationsBefore = false; |
229 bool hasAnnotationsAfter = false; | 228 bool hasAnnotationsAfter = false; |
230 placeBoxesInBlockDirection(heightOfBlock, maxHeight, maxAscent, noQuirksMode
, lineTop, lineBottom, selectionBottom, setLineTop, | 229 placeBoxesInBlockDirection(heightOfBlock, maxHeight, maxAscent, noQuirksMode
, lineTop, lineBottom, selectionBottom, setLineTop, |
231 lineTopIncludingMargins, lineBottomIncludingMargi
ns, hasAnnotationsBefore, hasAnnotationsAfter, baselineType()); | 230 lineTopIncludingMargins, lineBottomIncludingMargi
ns, hasAnnotationsBefore, hasAnnotationsAfter, baselineType()); |
232 m_hasAnnotationsBefore = hasAnnotationsBefore; | 231 m_hasAnnotationsBefore = hasAnnotationsBefore; |
233 m_hasAnnotationsAfter = hasAnnotationsAfter; | 232 m_hasAnnotationsAfter = hasAnnotationsAfter; |
234 | 233 |
235 maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really nec
essary? | 234 maxHeight = std::max<LayoutUnit>(0, maxHeight); // FIXME: Is this really nec
essary? |
236 | 235 |
237 setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock
+ maxHeight, selectionBottom); | 236 setLineTopBottomPositions(lineTop, lineBottom, heightOfBlock, heightOfBlock
+ maxHeight, selectionBottom); |
238 if (block().view()->layoutState()->isPaginated()) | |
239 setPaginatedLineWidth(block().availableLogicalWidthForContent()); | |
240 | 237 |
241 LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment(); | 238 LayoutUnit annotationsAdjustment = beforeAnnotationsAdjustment(); |
242 if (annotationsAdjustment) { | 239 if (annotationsAdjustment) { |
243 // FIXME: Need to handle pagination here. We might have to move to the n
ext page/column as a result of the | 240 // FIXME: Need to handle pagination here. We might have to move to the n
ext page/column as a result of the |
244 // ruby expansion. | 241 // ruby expansion. |
245 adjustBlockDirectionPosition(annotationsAdjustment.toFloat()); | 242 adjustBlockDirectionPosition(annotationsAdjustment.toFloat()); |
246 heightOfBlock += annotationsAdjustment; | 243 heightOfBlock += annotationsAdjustment; |
247 } | 244 } |
248 | 245 |
249 return heightOfBlock + maxHeight; | 246 return heightOfBlock + maxHeight; |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 } | 857 } |
861 | 858 |
862 #ifndef NDEBUG | 859 #ifndef NDEBUG |
863 const char* RootInlineBox::boxName() const | 860 const char* RootInlineBox::boxName() const |
864 { | 861 { |
865 return "RootInlineBox"; | 862 return "RootInlineBox"; |
866 } | 863 } |
867 #endif | 864 #endif |
868 | 865 |
869 } // namespace blink | 866 } // namespace blink |
OLD | NEW |