| 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) 2014 Adobe Systems Inc. | 5 * Copyright (C) 2014 Adobe Systems Inc. |
| 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 11 matching lines...) Expand all Loading... |
| 22 */ | 22 */ |
| 23 | 23 |
| 24 #ifndef TrailingObjects_h | 24 #ifndef TrailingObjects_h |
| 25 #define TrailingObjects_h | 25 #define TrailingObjects_h |
| 26 | 26 |
| 27 #include "wtf/Vector.h" | 27 #include "wtf/Vector.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 class InlineIterator; | 31 class InlineIterator; |
| 32 class RenderObject; | 32 class LayoutObject; |
| 33 class RenderText; | 33 class RenderText; |
| 34 | 34 |
| 35 struct BidiRun; | 35 struct BidiRun; |
| 36 | 36 |
| 37 template <class Iterator, class Run> class BidiResolver; | 37 template <class Iterator, class Run> class BidiResolver; |
| 38 template <class Iterator> class MidpointState; | 38 template <class Iterator> class MidpointState; |
| 39 typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver; | 39 typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver; |
| 40 typedef MidpointState<InlineIterator> LineMidpointState; | 40 typedef MidpointState<InlineIterator> LineMidpointState; |
| 41 | 41 |
| 42 // This class allows us to ensure lineboxes are created in the right place on th
e line when | 42 // This class allows us to ensure lineboxes are created in the right place on th
e line when |
| (...skipping 24 matching lines...) Expand all Loading... |
| 67 | 67 |
| 68 void clear() | 68 void clear() |
| 69 { | 69 { |
| 70 m_whitespace = 0; | 70 m_whitespace = 0; |
| 71 // Using resize(0) rather than clear() here saves 2% on | 71 // Using resize(0) rather than clear() here saves 2% on |
| 72 // PerformanceTests/Layout/line-layout.html because we avoid freeing and | 72 // PerformanceTests/Layout/line-layout.html because we avoid freeing and |
| 73 // re-allocating the underlying buffer repeatedly. | 73 // re-allocating the underlying buffer repeatedly. |
| 74 m_objects.resize(0); | 74 m_objects.resize(0); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void appendObjectIfNeeded(RenderObject* object) | 77 void appendObjectIfNeeded(LayoutObject* object) |
| 78 { | 78 { |
| 79 if (m_whitespace) | 79 if (m_whitespace) |
| 80 m_objects.append(object); | 80 m_objects.append(object); |
| 81 } | 81 } |
| 82 | 82 |
| 83 enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }
; | 83 enum CollapseFirstSpaceOrNot { DoNotCollapseFirstSpace, CollapseFirstSpace }
; |
| 84 | 84 |
| 85 void updateMidpointsForTrailingObjects(LineMidpointState&, const InlineItera
tor& lBreak, CollapseFirstSpaceOrNot); | 85 void updateMidpointsForTrailingObjects(LineMidpointState&, const InlineItera
tor& lBreak, CollapseFirstSpaceOrNot); |
| 86 | 86 |
| 87 private: | 87 private: |
| 88 RenderText* m_whitespace; | 88 RenderText* m_whitespace; |
| 89 Vector<RenderObject*, 4> m_objects; | 89 Vector<LayoutObject*, 4> m_objects; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 } | 92 } |
| 93 | 93 |
| 94 #endif // TrailingObjects_h | 94 #endif // TrailingObjects_h |
| OLD | NEW |