| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // updateMidpointsForTrailingObjects() to put them in the right place when we | 61 // updateMidpointsForTrailingObjects() to put them in the right place when we |
| 62 // start ignoring surplus whitespace. | 62 // start ignoring surplus whitespace. |
| 63 | 63 |
| 64 class TrailingObjects { | 64 class TrailingObjects { |
| 65 STACK_ALLOCATED(); | 65 STACK_ALLOCATED(); |
| 66 | 66 |
| 67 public: | 67 public: |
| 68 TrailingObjects() : m_whitespace(nullptr) {} | 68 TrailingObjects() : m_whitespace(nullptr) {} |
| 69 | 69 |
| 70 void setTrailingWhitespace(LineLayoutText whitespace) { | 70 void setTrailingWhitespace(LineLayoutText whitespace) { |
| 71 ASSERT(whitespace); | 71 DCHECK(whitespace); |
| 72 m_whitespace = whitespace; | 72 m_whitespace = whitespace; |
| 73 } | 73 } |
| 74 | 74 |
| 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 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 |