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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 return lineBottom; | 248 return lineBottom; |
249 } | 249 } |
250 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott om) const | 250 LayoutRect logicalVisualOverflowRect(LayoutUnit lineTop, LayoutUnit lineBott om) const |
251 { | 251 { |
252 LayoutRect result = visualOverflowRect(lineTop, lineBottom); | 252 LayoutRect result = visualOverflowRect(lineTop, lineBottom); |
253 if (!lineLayoutItem().isHorizontalWritingMode()) | 253 if (!lineLayoutItem().isHorizontalWritingMode()) |
254 result = result.transposedRect(); | 254 result = result.transposedRect(); |
255 return result; | 255 return result; |
256 } | 256 } |
257 | 257 |
258 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, co nst LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom ); | |
259 | |
260 LayoutRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineB ottom) const | 258 LayoutRect frameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUnit lineB ottom) const |
261 { | 259 { |
262 if (isHorizontal()) | 260 if (isHorizontal()) |
263 return LayoutRect(m_topLeft.x(), lineTop, width(), lineBottom - line Top); | 261 return LayoutRect(m_topLeft.x(), lineTop, width(), lineBottom - line Top); |
264 return LayoutRect(lineTop, m_topLeft.y(), lineBottom - lineTop, height() ); | 262 return LayoutRect(lineTop, m_topLeft.y(), lineBottom - lineTop, height() ); |
265 } | 263 } |
266 | 264 |
267 LayoutRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUni t lineBottom) const | 265 LayoutRect logicalFrameRectIncludingLineHeight(LayoutUnit lineTop, LayoutUni t lineBottom) const |
268 { | 266 { |
269 return LayoutRect(logicalLeft(), lineTop, logicalWidth(), lineBottom - l ineTop); | 267 return LayoutRect(logicalLeft(), lineTop, logicalWidth(), lineBottom - l ineTop); |
270 } | 268 } |
271 | 269 |
272 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants HaveSameLineHeightAndBaseline; } | 270 bool descendantsHaveSameLineHeightAndBaseline() const { return m_descendants HaveSameLineHeightAndBaseline; } |
273 void clearDescendantsHaveSameLineHeightAndBaseline() | 271 void clearDescendantsHaveSameLineHeightAndBaseline() |
274 { | 272 { |
275 m_descendantsHaveSameLineHeightAndBaseline = false; | 273 m_descendantsHaveSameLineHeightAndBaseline = false; |
276 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) | 274 if (parent() && parent()->descendantsHaveSameLineHeightAndBaseline()) |
277 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); | 275 parent()->clearDescendantsHaveSameLineHeightAndBaseline(); |
278 } | 276 } |
279 | 277 |
280 bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; } | 278 bool isFirstAfterPageBreak() const { return m_isFirstAfterPageBreak; } |
281 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { m_isFirstAfterPa geBreak = isFirstAfterPageBreak; } | 279 void setIsFirstAfterPageBreak(bool isFirstAfterPageBreak) { m_isFirstAfterPa geBreak = isFirstAfterPageBreak; } |
282 | 280 |
281 // Some callers (LayoutListItem) needs to set extra overflow on their line b ox. | |
282 // This is the public API to do so. | |
leviw_travelin_and_unemployed
2015/11/10 20:23:22
I'm not sure we need the 2nd line of this comment.
Julien - ping for review
2015/11/10 23:52:47
Fair, I won't fight for it, removed!
| |
283 void overrideOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflo w, const LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineB ottom) | |
leviw_travelin_and_unemployed
2015/11/10 20:23:22
This seems like a good change to the API :)
| |
284 { | |
285 // If we are setting an overflow, then we can't pretend not to have an o verflow. | |
286 clearKnownToHaveNoOverflow(); | |
287 setOverflowFromLogicalRects(logicalLayoutOverflow, logicalVisualOverflow , lineTop, lineBottom); | |
288 } | |
289 | |
283 private: | 290 private: |
284 void placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastCh ild, | 291 void placeBoxRangeInInlineDirection(InlineBox* firstChild, InlineBox* lastCh ild, |
285 LayoutUnit& logicalLeft, LayoutUnit& minLogicalLeft, LayoutUnit& maxLogi calRight, bool& needsWordSpacing); | 292 LayoutUnit& logicalLeft, LayoutUnit& minLogicalLeft, LayoutUnit& maxLogi calRight, bool& needsWordSpacing); |
286 void beginPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft) { setLog icalLeft(logicalLeft); } | 293 void beginPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft) { setLog icalLeft(logicalLeft); } |
287 void endPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft, LayoutUnit logicalRight, LayoutUnit minLogicalLeft, LayoutUnit maxLogicalRight) | 294 void endPlacingBoxRangesInInlineDirection(LayoutUnit logicalLeft, LayoutUnit logicalRight, LayoutUnit minLogicalLeft, LayoutUnit maxLogicalRight) |
288 { | 295 { |
289 setLogicalWidth(logicalRight - logicalLeft); | 296 setLogicalWidth(logicalRight - logicalLeft); |
290 if (knownToHaveNoOverflow() && (minLogicalLeft < logicalLeft || maxLogic alRight > logicalRight)) | 297 if (knownToHaveNoOverflow() && (minLogicalLeft < logicalLeft || maxLogic alRight > logicalRight)) |
291 clearKnownToHaveNoOverflow(); | 298 clearKnownToHaveNoOverflow(); |
292 } | 299 } |
293 | 300 |
294 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); | 301 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); |
295 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); | 302 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); |
296 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); | 303 void addOutlineVisualOverflow(LayoutRect& logicalVisualOverflow); |
297 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM ap&, LayoutRect& logicalVisualOverflow); | 304 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsM ap&, LayoutRect& logicalVisualOverflow); |
298 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve rflow, LayoutRect& logicalVisualOverflow); | 305 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOve rflow, LayoutRect& logicalVisualOverflow); |
299 | 306 |
300 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); | 307 void setLayoutOverflow(const LayoutRect&, const LayoutRect&); |
301 void setVisualOverflow(const LayoutRect&, const LayoutRect&); | 308 void setVisualOverflow(const LayoutRect&, const LayoutRect&); |
302 | 309 |
310 void setOverflowFromLogicalRects(const LayoutRect& logicalLayoutOverflow, co nst LayoutRect& logicalVisualOverflow, LayoutUnit lineTop, LayoutUnit lineBottom ); | |
311 | |
303 protected: | 312 protected: |
304 OwnPtr<OverflowModel> m_overflow; | 313 OwnPtr<OverflowModel> m_overflow; |
305 | 314 |
306 bool isInlineFlowBox() const final { return true; } | 315 bool isInlineFlowBox() const final { return true; } |
307 | 316 |
308 InlineBox* m_firstChild; | 317 InlineBox* m_firstChild; |
309 InlineBox* m_lastChild; | 318 InlineBox* m_lastChild; |
310 | 319 |
311 InlineFlowBox* m_prevLineBox; // The previous box that also uses our LayoutO bject | 320 InlineFlowBox* m_prevLineBox; // The previous box that also uses our LayoutO bject |
312 InlineFlowBox* m_nextLineBox; // The next box that also uses our LayoutObjec t | 321 InlineFlowBox* m_nextLineBox; // The next box that also uses our LayoutObjec t |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
362 } | 371 } |
363 | 372 |
364 } // namespace blink | 373 } // namespace blink |
365 | 374 |
366 #ifndef NDEBUG | 375 #ifndef NDEBUG |
367 // Outside the WebCore namespace for ease of invocation from gdb. | 376 // Outside the WebCore namespace for ease of invocation from gdb. |
368 void showTree(const blink::InlineFlowBox*); | 377 void showTree(const blink::InlineFlowBox*); |
369 #endif | 378 #endif |
370 | 379 |
371 #endif // InlineFlowBox_h | 380 #endif // InlineFlowBox_h |
OLD | NEW |