| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
| 4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 5 * Copyright (C) 2013 Adobe Systems Incorporated. | 5 * Copyright (C) 2013 Adobe Systems Incorporated. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 namespace blink { | 31 namespace blink { |
| 32 | 32 |
| 33 class LineInfo { | 33 class LineInfo { |
| 34 STACK_ALLOCATED(); | 34 STACK_ALLOCATED(); |
| 35 public: | 35 public: |
| 36 LineInfo() | 36 LineInfo() |
| 37 : m_isFirstLine(true) | 37 : m_isFirstLine(true) |
| 38 , m_isLastLine(false) | 38 , m_isLastLine(false) |
| 39 , m_isEmpty(true) | 39 , m_isEmpty(true) |
| 40 , m_previousLineBrokeCleanly(true) | 40 , m_previousLineBrokeCleanly(true) |
| 41 , m_floatPaginationStrut(0) | |
| 42 , m_runsFromLeadingWhitespace(0) | 41 , m_runsFromLeadingWhitespace(0) |
| 43 { } | 42 { } |
| 44 | 43 |
| 45 bool isFirstLine() const { return m_isFirstLine; } | 44 bool isFirstLine() const { return m_isFirstLine; } |
| 46 bool isLastLine() const { return m_isLastLine; } | 45 bool isLastLine() const { return m_isLastLine; } |
| 47 bool isEmpty() const { return m_isEmpty; } | 46 bool isEmpty() const { return m_isEmpty; } |
| 48 bool previousLineBrokeCleanly() const { return m_previousLineBrokeCleanly; } | 47 bool previousLineBrokeCleanly() const { return m_previousLineBrokeCleanly; } |
| 49 LayoutUnit floatPaginationStrut() const { return m_floatPaginationStrut; } | 48 LayoutUnit floatPaginationStrut() const { return m_floatPaginationStrut; } |
| 50 unsigned runsFromLeadingWhitespace() const { return m_runsFromLeadingWhitesp
ace; } | 49 unsigned runsFromLeadingWhitespace() const { return m_runsFromLeadingWhitesp
ace; } |
| 51 void resetRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace = 0; } | 50 void resetRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace = 0; } |
| 52 void incrementRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace++; } | 51 void incrementRunsFromLeadingWhitespace() { m_runsFromLeadingWhitespace++; } |
| 53 | 52 |
| 54 void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; } | 53 void setFirstLine(bool firstLine) { m_isFirstLine = firstLine; } |
| 55 void setLastLine(bool lastLine) { m_isLastLine = lastLine; } | 54 void setLastLine(bool lastLine) { m_isLastLine = lastLine; } |
| 56 void setEmpty(bool empty, LineLayoutBlockFlow block = LineLayoutBlockFlow(),
LineWidth* lineWidth = nullptr) | 55 void setEmpty(bool empty, LineLayoutBlockFlow block = LineLayoutBlockFlow(),
LineWidth* lineWidth = nullptr) |
| 57 { | 56 { |
| 58 if (m_isEmpty == empty) | 57 if (m_isEmpty == empty) |
| 59 return; | 58 return; |
| 60 m_isEmpty = empty; | 59 m_isEmpty = empty; |
| 61 if (!empty && block && floatPaginationStrut()) { | 60 if (!empty && block && floatPaginationStrut()) { |
| 62 block.setLogicalHeight(block.logicalHeight() + floatPaginationStrut(
)); | 61 block.setLogicalHeight(block.logicalHeight() + floatPaginationStrut(
)); |
| 63 setFloatPaginationStrut(0); | 62 setFloatPaginationStrut(LayoutUnit()); |
| 64 lineWidth->updateAvailableWidth(); | 63 lineWidth->updateAvailableWidth(); |
| 65 } | 64 } |
| 66 } | 65 } |
| 67 | 66 |
| 68 void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previous
LineBrokeCleanly = previousLineBrokeCleanly; } | 67 void setPreviousLineBrokeCleanly(bool previousLineBrokeCleanly) { m_previous
LineBrokeCleanly = previousLineBrokeCleanly; } |
| 69 void setFloatPaginationStrut(LayoutUnit strut) { m_floatPaginationStrut = st
rut; } | 68 void setFloatPaginationStrut(LayoutUnit strut) { m_floatPaginationStrut = st
rut; } |
| 70 | 69 |
| 71 private: | 70 private: |
| 72 bool m_isFirstLine; | 71 bool m_isFirstLine; |
| 73 bool m_isLastLine; | 72 bool m_isLastLine; |
| 74 bool m_isEmpty; | 73 bool m_isEmpty; |
| 75 bool m_previousLineBrokeCleanly; | 74 bool m_previousLineBrokeCleanly; |
| 76 LayoutUnit m_floatPaginationStrut; | 75 LayoutUnit m_floatPaginationStrut; |
| 77 unsigned m_runsFromLeadingWhitespace; | 76 unsigned m_runsFromLeadingWhitespace; |
| 78 }; | 77 }; |
| 79 | 78 |
| 80 } // namespace blink | 79 } // namespace blink |
| 81 | 80 |
| 82 #endif // LineInfo_h | 81 #endif // LineInfo_h |
| OLD | NEW |