| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void rebuildMetricsForTextLayoutObject(LayoutSVGInlineText*); | 52 void rebuildMetricsForTextLayoutObject(LayoutSVGInlineText*); |
| 53 | 53 |
| 54 // Invoked whenever the underlying DOM tree changes, so that m_textPositions
is rebuild. | 54 // Invoked whenever the underlying DOM tree changes, so that m_textPositions
is rebuild. |
| 55 void clearTextPositioningElements() { m_textPositions.clear(); } | 55 void clearTextPositioningElements() { m_textPositions.clear(); } |
| 56 unsigned numberOfTextPositioningElements() const { return m_textPositions.si
ze(); } | 56 unsigned numberOfTextPositioningElements() const { return m_textPositions.si
ze(); } |
| 57 | 57 |
| 58 struct TextPosition { | 58 struct TextPosition { |
| 59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 60 public: | 60 public: |
| 61 TextPosition(SVGTextPositioningElement* newElement = nullptr, unsigned n
ewStart = 0, unsigned newLength = 0) | 61 TextPosition(SVGTextPositioningElement* = nullptr, unsigned newStart = 0
, unsigned newLength = 0); |
| 62 : element(newElement) | |
| 63 , start(newStart) | |
| 64 , length(newLength) | |
| 65 { | |
| 66 } | |
| 67 | 62 |
| 68 DECLARE_TRACE(); | 63 DECLARE_TRACE(); |
| 69 | 64 |
| 70 RawPtrWillBeMember<SVGTextPositioningElement> element; | 65 RawPtrWillBeMember<SVGTextPositioningElement> element; |
| 71 unsigned start; | 66 unsigned start; |
| 72 unsigned length; | 67 unsigned length; |
| 73 }; | 68 }; |
| 74 | 69 |
| 75 private: | 70 private: |
| 76 void buildCharacterDataMap(LayoutSVGText&); | 71 void buildCharacterDataMap(LayoutSVGText&); |
| 77 void collectTextPositioningElements(LayoutBoxModelObject&, UChar& lastCharac
ter); | 72 void collectTextPositioningElements(LayoutBoxModelObject&, UChar& lastCharac
ter); |
| 78 void fillCharacterDataMap(const TextPosition&); | 73 void fillCharacterDataMap(const TextPosition&); |
| 79 | 74 |
| 80 private: | 75 private: |
| 81 unsigned m_textLength; | 76 unsigned m_textLength; |
| 82 WillBePersistentHeapVector<TextPosition> m_textPositions; | 77 WillBePersistentHeapVector<TextPosition> m_textPositions; |
| 83 SVGCharacterDataMap m_characterDataMap; | 78 SVGCharacterDataMap m_characterDataMap; |
| 84 }; | 79 }; |
| 85 | 80 |
| 86 } // namespace blink | 81 } // namespace blink |
| 87 | 82 |
| 88 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder
::TextPosition); | 83 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder
::TextPosition); |
| 89 | 84 |
| 90 #endif | 85 #endif |
| OLD | NEW |