OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 void removeChild(InlineBox* child, MarkLineBoxes); | 202 void removeChild(InlineBox* child, MarkLineBoxes); |
203 | 203 |
204 virtual RenderObject::SelectionState selectionState() const OVERRIDE; | 204 virtual RenderObject::SelectionState selectionState() const OVERRIDE; |
205 | 205 |
206 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid
th) const OVERRIDE FINAL; | 206 virtual bool canAccommodateEllipsis(bool ltr, int blockEdge, int ellipsisWid
th) const OVERRIDE FINAL; |
207 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig
htEdge, float ellipsisWidth, float &truncatedWidth, bool&) OVERRIDE; | 207 virtual float placeEllipsisBox(bool ltr, float blockLeftEdge, float blockRig
htEdge, float ellipsisWidth, float &truncatedWidth, bool&) OVERRIDE; |
208 | 208 |
209 bool hasTextChildren() const { return m_hasTextChildren; } | 209 bool hasTextChildren() const { return m_hasTextChildren; } |
210 bool hasTextDescendants() const { return m_hasTextDescendants; } | 210 bool hasTextDescendants() const { return m_hasTextDescendants; } |
211 void setHasTextChildren() { m_hasTextChildren = true; setHasTextDescendants(
); } | |
212 void setHasTextDescendants() { m_hasTextDescendants = true; } | 211 void setHasTextDescendants() { m_hasTextDescendants = true; } |
213 | 212 |
214 void checkConsistency() const; | 213 void checkConsistency() const; |
215 void setHasBadChildList(); | 214 void setHasBadChildList(); |
216 | 215 |
217 // Line visual and layout overflow are in the coordinate space of the block.
This means that they aren't purely physical directions. | 216 // Line visual and layout overflow are in the coordinate space of the block.
This means that they aren't purely physical directions. |
218 // For horizontal-tb and vertical-lr they will match physical directions, bu
t for horizontal-bt and vertical-rl, the top/bottom and left/right | 217 // For horizontal-tb and vertical-lr they will match physical directions, bu
t for horizontal-bt and vertical-rl, the top/bottom and left/right |
219 // respectively are flipped when compared to their physical counterparts. F
or example minX is on the left in vertical-lr, but it is on the right in vertica
l-rl. | 218 // respectively are flipped when compared to their physical counterparts. F
or example minX is on the left in vertical-lr, but it is on the right in vertica
l-rl. |
220 LayoutRect layoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) con
st | 219 LayoutRect layoutOverflowRect(LayoutUnit lineTop, LayoutUnit lineBottom) con
st |
221 { | 220 { |
222 return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRe
ct(frameRectIncludingLineHeight(lineTop, lineBottom)); | 221 return m_overflow ? m_overflow->layoutOverflowRect() : enclosingLayoutRe
ct(frameRectIncludingLineHeight(lineTop, lineBottom)); |
223 } | 222 } |
224 LayoutUnit logicalLeftLayoutOverflow() const | |
225 { | |
226 return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().x
() : m_overflow->layoutOverflowRect().y()) : | |
227 static_cast<LayoutUnit>(logicalLeft()); | |
228 } | |
229 LayoutUnit logicalRightLayoutOverflow() const | |
230 { | |
231 return m_overflow ? (isHorizontal() ? m_overflow->layoutOverflowRect().m
axX() : m_overflow->layoutOverflowRect().maxY()) : | |
232 static_cast<LayoutUnit>(ceilf(logicalRight())); | |
233 } | |
234 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const | 223 LayoutUnit logicalTopLayoutOverflow(LayoutUnit lineTop) const |
235 { | 224 { |
236 if (m_overflow) | 225 if (m_overflow) |
237 return isHorizontal() ? m_overflow->layoutOverflowRect().y() : m_ove
rflow->layoutOverflowRect().x(); | 226 return isHorizontal() ? m_overflow->layoutOverflowRect().y() : m_ove
rflow->layoutOverflowRect().x(); |
238 return lineTop; | 227 return lineTop; |
239 } | 228 } |
240 LayoutUnit logicalBottomLayoutOverflow(LayoutUnit lineBottom) const | 229 LayoutUnit logicalBottomLayoutOverflow(LayoutUnit lineBottom) const |
241 { | 230 { |
242 if (m_overflow) | 231 if (m_overflow) |
243 return isHorizontal() ? m_overflow->layoutOverflowRect().maxY() : m_
overflow->layoutOverflowRect().maxX(); | 232 return isHorizontal() ? m_overflow->layoutOverflowRect().maxY() : m_
overflow->layoutOverflowRect().maxX(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) | 287 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) |
299 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); | 288 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); |
300 } | 289 } |
301 | 290 |
302 private: | 291 private: |
303 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); | 292 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); |
304 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); | 293 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); |
305 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); | 294 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); |
306 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM
ap&, LayoutRect& logicalVisualOverflow); | 295 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM
ap&, LayoutRect& logicalVisualOverflow); |
307 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve
rflow, LayoutRect& logicalVisualOverflow); | 296 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve
rflow, LayoutRect& logicalVisualOverflow); |
308 void constrainToLineTopAndBottomIfNeeded(LayoutRect&) const; | |
309 | 297 |
310 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); | 298 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); |
311 void setVisualOverflow(const LayoutRect&, const LayoutRect&); | 299 void setVisualOverflow(const LayoutRect&, const LayoutRect&); |
312 | 300 |
313 protected: | 301 protected: |
314 OwnPtr<RenderOverflow> m_overflow; | 302 OwnPtr<RenderOverflow> m_overflow; |
315 | 303 |
316 virtual bool isInlineFlowBox() const OVERRIDE FINAL { return true; } | 304 virtual bool isInlineFlowBox() const OVERRIDE FINAL { return true; } |
317 | 305 |
318 InlineBox* m_firstChild; | 306 InlineBox* m_firstChild; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 358 } |
371 | 359 |
372 } // namespace blink | 360 } // namespace blink |
373 | 361 |
374 #ifndef NDEBUG | 362 #ifndef NDEBUG |
375 // Outside the WebCore namespace for ease of invocation from gdb. | 363 // Outside the WebCore namespace for ease of invocation from gdb. |
376 void showTree(const blink::InlineFlowBox*); | 364 void showTree(const blink::InlineFlowBox*); |
377 #endif | 365 #endif |
378 | 366 |
379 #endif // InlineFlowBox_h | 367 #endif // InlineFlowBox_h |
OLD | NEW |