| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 class RenderBlockFlow; | 41 class RenderBlockFlow; |
| 42 | 42 |
| 43 struct LineSegment; | 43 struct LineSegment; |
| 44 | 44 |
| 45 enum IndentTextOrNot { DoNotIndentText, IndentText }; | 45 enum IndentTextOrNot { DoNotIndentText, IndentText }; |
| 46 | 46 |
| 47 class LineWidth { | 47 class LineWidth { |
| 48 public: | 48 public: |
| 49 LineWidth(RenderBlockFlow&, bool isFirstLine, IndentTextOrNot shouldIndentTe
xt); | 49 LineWidth(RenderBlockFlow&, bool isFirstLine, IndentTextOrNot shouldIndentTe
xt); |
| 50 | 50 |
| 51 bool fitsOnLine() const { return currentWidth() <= m_availableWidth; } | 51 bool fitsOnLine() const { return currentWidth() <= (m_availableWidth + Layou
tUnit::epsilon()); } |
| 52 bool fitsOnLine(float extra) const { return currentWidth() + extra <= m_avai
lableWidth; } | 52 bool fitsOnLine(float extra) const { return currentWidth() + extra <= (m_ava
ilableWidth + LayoutUnit::epsilon()); } |
| 53 | 53 |
| 54 float currentWidth() const { return m_committedWidth + m_uncommittedWidth; } | 54 float currentWidth() const { return m_committedWidth + m_uncommittedWidth; } |
| 55 // FIXME: We should eventually replace these three functions by ones that wo
rk on a higher abstraction. | 55 // FIXME: We should eventually replace these three functions by ones that wo
rk on a higher abstraction. |
| 56 float uncommittedWidth() const { return m_uncommittedWidth; } | 56 float uncommittedWidth() const { return m_uncommittedWidth; } |
| 57 float committedWidth() const { return m_committedWidth; } | 57 float committedWidth() const { return m_committedWidth; } |
| 58 float availableWidth() const { return m_availableWidth; } | 58 float availableWidth() const { return m_availableWidth; } |
| 59 | 59 |
| 60 void updateAvailableWidth(LayoutUnit minimumHeight = 0); | 60 void updateAvailableWidth(LayoutUnit minimumHeight = 0); |
| 61 void shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject*); | 61 void shrinkAvailableWidthForNewFloatIfNeeded(FloatingObject*); |
| 62 void addUncommittedWidth(float delta) { m_uncommittedWidth += delta; } | 62 void addUncommittedWidth(float delta) { m_uncommittedWidth += delta; } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 79 float m_right; | 79 float m_right; |
| 80 float m_availableWidth; | 80 float m_availableWidth; |
| 81 const LineSegment* m_segment; | 81 const LineSegment* m_segment; |
| 82 bool m_isFirstLine; | 82 bool m_isFirstLine; |
| 83 IndentTextOrNot m_shouldIndentText; | 83 IndentTextOrNot m_shouldIndentText; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } | 86 } |
| 87 | 87 |
| 88 #endif // LineWidth_h | 88 #endif // LineWidth_h |
| OLD | NEW |