| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } | 47 RootInlineBox* prevRootBox() const { return static_cast<RootInlineBox*>(m_pr
evLineBox); } |
| 48 | 48 |
| 49 virtual void adjustPosition(float dx, float dy) override final; | 49 virtual void adjustPosition(float dx, float dy) override final; |
| 50 | 50 |
| 51 LayoutUnit lineTop() const { return m_lineTop; } | 51 LayoutUnit lineTop() const { return m_lineTop; } |
| 52 LayoutUnit lineBottom() const { return m_lineBottom; } | 52 LayoutUnit lineBottom() const { return m_lineBottom; } |
| 53 | 53 |
| 54 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } | 54 LayoutUnit lineTopWithLeading() const { return m_lineTopWithLeading; } |
| 55 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } | 55 LayoutUnit lineBottomWithLeading() const { return m_lineBottomWithLeading; } |
| 56 | 56 |
| 57 LayoutUnit paginationStrut() const { return m_fragmentationData ? m_fragment
ationData->m_paginationStrut : LayoutUnit(0); } | 57 LayoutUnit paginationStrut() const { return m_paginationStrut; } |
| 58 void setPaginationStrut(LayoutUnit strut) { ensureLineFragmentationData()->m
_paginationStrut = strut; } | 58 void setPaginationStrut(LayoutUnit strut) { m_paginationStrut = strut; } |
| 59 | 59 |
| 60 bool isFirstAfterPageBreak() const { return m_fragmentationData ? m_fragment
ationData->m_isFirstAfterPageBreak : false; } | 60 void setPaginatedLineWidth(LayoutUnit width) { m_paginatedLineWidth = width;
} |
| 61 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { ensureLineFragme
ntationData()->m_isFirstAfterPageBreak = isFirstAfterPageBreak; } | |
| 62 | |
| 63 void setPaginatedLineWidth(LayoutUnit width) { ensureLineFragmentationData()
->m_paginatedLineWidth = width; } | |
| 64 | 61 |
| 65 LayoutUnit selectionTop() const; | 62 LayoutUnit selectionTop() const; |
| 66 LayoutUnit selectionBottom() const; | 63 LayoutUnit selectionBottom() const; |
| 67 LayoutUnit selectionHeight() const { return max<LayoutUnit>(0, selectionBott
om() - selectionTop()); } | 64 LayoutUnit selectionHeight() const { return max<LayoutUnit>(0, selectionBott
om() - selectionTop()); } |
| 68 | 65 |
| 69 LayoutUnit selectionTopAdjustedForPrecedingBlock() const; | 66 LayoutUnit selectionTopAdjustedForPrecedingBlock() const; |
| 70 LayoutUnit selectionHeightAdjustedForPrecedingBlock() const { return max<Lay
outUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock()); } | 67 LayoutUnit selectionHeightAdjustedForPrecedingBlock() const { return max<Lay
outUnit>(0, selectionBottom() - selectionTopAdjustedForPrecedingBlock()); } |
| 71 | 68 |
| 72 int blockDirectionPointInLine() const; | 69 int blockDirectionPointInLine() const; |
| 73 | 70 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 176 |
| 180 Node* getLogicalStartBoxWithNode(InlineBox*&) const; | 177 Node* getLogicalStartBoxWithNode(InlineBox*&) const; |
| 181 Node* getLogicalEndBoxWithNode(InlineBox*&) const; | 178 Node* getLogicalEndBoxWithNode(InlineBox*&) const; |
| 182 | 179 |
| 183 #ifndef NDEBUG | 180 #ifndef NDEBUG |
| 184 virtual const char* boxName() const override; | 181 virtual const char* boxName() const override; |
| 185 #endif | 182 #endif |
| 186 private: | 183 private: |
| 187 LayoutUnit beforeAnnotationsAdjustment() const; | 184 LayoutUnit beforeAnnotationsAdjustment() const; |
| 188 | 185 |
| 189 struct LineFragmentationData; | |
| 190 LineFragmentationData* ensureLineFragmentationData() | |
| 191 { | |
| 192 if (!m_fragmentationData) | |
| 193 m_fragmentationData = adoptPtr(new LineFragmentationData()); | |
| 194 | |
| 195 return m_fragmentationData.get(); | |
| 196 } | |
| 197 | |
| 198 // This folds into the padding at the end of InlineFlowBox on 64-bit. | 186 // This folds into the padding at the end of InlineFlowBox on 64-bit. |
| 199 unsigned m_lineBreakPos; | 187 unsigned m_lineBreakPos; |
| 200 | 188 |
| 201 // Where this line ended. The exact object and the position within that obj
ect are stored so that | 189 // Where this line ended. The exact object and the position within that obj
ect are stored so that |
| 202 // we can create an InlineIterator beginning just after the end of this line
. | 190 // we can create an InlineIterator beginning just after the end of this line
. |
| 203 RenderObject* m_lineBreakObj; | 191 RenderObject* m_lineBreakObj; |
| 204 RefPtr<BidiContext> m_lineBreakContext; | 192 RefPtr<BidiContext> m_lineBreakContext; |
| 205 | 193 |
| 206 struct LineFragmentationData { | |
| 207 WTF_MAKE_NONCOPYABLE(LineFragmentationData); WTF_MAKE_FAST_ALLOCATED; | |
| 208 public: | |
| 209 LineFragmentationData() | |
| 210 : m_paginationStrut(0) | |
| 211 , m_paginatedLineWidth(0) | |
| 212 , m_isFirstAfterPageBreak(false) | |
| 213 { | |
| 214 | |
| 215 } | |
| 216 | |
| 217 LayoutUnit m_paginationStrut; | |
| 218 LayoutUnit m_paginatedLineWidth; | |
| 219 bool m_isFirstAfterPageBreak; | |
| 220 }; | |
| 221 | |
| 222 OwnPtr<LineFragmentationData> m_fragmentationData; | |
| 223 | |
| 224 // Floats hanging off the line are pushed into this vector during layout. It
is only | 194 // Floats hanging off the line are pushed into this vector during layout. It
is only |
| 225 // good for as long as the line has not been marked dirty. | 195 // good for as long as the line has not been marked dirty. |
| 226 OwnPtr<Vector<RenderBox*> > m_floats; | 196 OwnPtr<Vector<RenderBox*> > m_floats; |
| 227 | 197 |
| 228 LayoutUnit m_lineTop; | 198 LayoutUnit m_lineTop; |
| 229 LayoutUnit m_lineBottom; | 199 LayoutUnit m_lineBottom; |
| 230 LayoutUnit m_lineTopWithLeading; | 200 LayoutUnit m_lineTopWithLeading; |
| 231 LayoutUnit m_lineBottomWithLeading; | 201 LayoutUnit m_lineBottomWithLeading; |
| 232 LayoutUnit m_selectionBottom; | 202 LayoutUnit m_selectionBottom; |
| 203 LayoutUnit m_paginationStrut; |
| 204 LayoutUnit m_paginatedLineWidth; |
| 233 }; | 205 }; |
| 234 | 206 |
| 235 } // namespace blink | 207 } // namespace blink |
| 236 | 208 |
| 237 #endif // RootInlineBox_h | 209 #endif // RootInlineBox_h |
| OLD | NEW |