| 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. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All right reserved. | 4 * All right reserved. |
| 5 * Copyright (C) 2010 Google Inc. All rights reserved. | 5 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2014 Adobe Systems Inc. | 6 * Copyright (C) 2014 Adobe Systems Inc. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void clear() { | 75 void clear() { |
| 76 m_whitespace = LineLayoutText(); | 76 m_whitespace = LineLayoutText(); |
| 77 // Using resize(0) rather than clear() here saves 2% on | 77 // Using resize(0) rather than clear() here saves 2% on |
| 78 // PerformanceTests/Layout/line-layout.html because we avoid freeing and | 78 // PerformanceTests/Layout/line-layout.html because we avoid freeing and |
| 79 // re-allocating the underlying buffer repeatedly. | 79 // re-allocating the underlying buffer repeatedly. |
| 80 m_objects.resize(0); | 80 m_objects.resize(0); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void appendObjectIfNeeded(LineLayoutItem object) { | 83 void appendObjectIfNeeded(LineLayoutItem object) { |
| 84 if (m_whitespace) | 84 if (m_whitespace) |
| 85 m_objects.append(object); | 85 m_objects.push_back(object); |
| 86 } | 86 } |
| 87 | 87 |
| 88 enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }; | 88 enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }; |
| 89 | 89 |
| 90 void updateMidpointsForTrailingObjects(LineMidpointState&, | 90 void updateMidpointsForTrailingObjects(LineMidpointState&, |
| 91 const InlineIterator& lBreak, | 91 const InlineIterator& lBreak, |
| 92 CollapseFirstSpaceOrNot); | 92 CollapseFirstSpaceOrNot); |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 LineLayoutText m_whitespace; | 95 LineLayoutText m_whitespace; |
| 96 Vector<LineLayoutItem, 4> m_objects; | 96 Vector<LineLayoutItem, 4> m_objects; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| 100 | 100 |
| 101 #endif // TrailingObjects_h | 101 #endif // TrailingObjects_h |
| OLD | NEW |