| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 return currentWidth() - (whitespaceTreatment == ExcludeWhitespace ? trai
lingWhitespaceWidth() : 0) + extra <= (m_availableWidth + LayoutUnit::epsilon())
; | 52 return currentWidth() - (whitespaceTreatment == ExcludeWhitespace ? trai
lingWhitespaceWidth() : 0) + extra <= (m_availableWidth + LayoutUnit::epsilon())
; |
| 53 } | 53 } |
| 54 | 54 |
| 55 float currentWidth() const { return m_committedWidth + m_uncommittedWidth; } | 55 float currentWidth() const { return m_committedWidth + m_uncommittedWidth; } |
| 56 // FIXME: We should eventually replace these three functions by ones that wo
rk on a higher abstraction. | 56 // FIXME: We should eventually replace these three functions by ones that wo
rk on a higher abstraction. |
| 57 float uncommittedWidth() const { return m_uncommittedWidth; } | 57 float uncommittedWidth() const { return m_uncommittedWidth; } |
| 58 float committedWidth() const { return m_committedWidth; } | 58 float committedWidth() const { return m_committedWidth; } |
| 59 float availableWidth() const { return m_availableWidth; } | 59 float availableWidth() const { return m_availableWidth; } |
| 60 float trailingWhitespaceWidth() const { return m_trailingWhitespaceWidth; } | 60 float trailingWhitespaceWidth() const { return m_trailingWhitespaceWidth; } |
| 61 | 61 |
| 62 void updateAvailableWidth(LayoutUnit minimumHeight = 0); | 62 void updateAvailableWidth(); |
| 63 void addUncommittedWidth(float delta) { m_uncommittedWidth += delta; } | 63 void addUncommittedWidth(float delta) { m_uncommittedWidth += delta; } |
| 64 void commit(); | 64 void commit(); |
| 65 void fitBelowFloats(bool isFirstLine = false); | 65 void fitBelowFloats(bool isFirstLine = false); |
| 66 void setTrailingWhitespaceWidth(float width) { m_trailingWhitespaceWidth = w
idth; } | 66 void setTrailingWhitespaceWidth(float width) { m_trailingWhitespaceWidth = w
idth; } |
| 67 | 67 |
| 68 bool shouldIndentText() const { return m_shouldIndentText == IndentText; } | 68 bool shouldIndentText() const { return m_shouldIndentText == IndentText; } |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 void computeAvailableWidthFromLeftAndRight(); | 71 void computeAvailableWidthFromLeftAndRight(); |
| 72 void updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, con
st float& newLineLeft, const float& newLineRight); | 72 void updateLineDimension(LayoutUnit newLineTop, LayoutUnit newLineWidth, con
st float& newLineLeft, const float& newLineRight); |
| 73 | 73 |
| 74 RenderBlockFlow& m_block; | 74 RenderBlockFlow& m_block; |
| 75 float m_uncommittedWidth; | 75 float m_uncommittedWidth; |
| 76 float m_committedWidth; | 76 float m_committedWidth; |
| 77 float m_trailingWhitespaceWidth; | 77 float m_trailingWhitespaceWidth; |
| 78 float m_left; | 78 float m_left; |
| 79 float m_right; | 79 float m_right; |
| 80 float m_availableWidth; | 80 float m_availableWidth; |
| 81 bool m_isFirstLine; | |
| 82 IndentTextOrNot m_shouldIndentText; | 81 IndentTextOrNot m_shouldIndentText; |
| 83 }; | 82 }; |
| 84 | 83 |
| 85 } | 84 } |
| 86 | 85 |
| 87 #endif // LineWidth_h | 86 #endif // LineWidth_h |
| OLD | NEW |