| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // SVGTextLayoutAttributesBuilder performs the first layout phase for SVG text. | 36 // SVGTextLayoutAttributesBuilder performs the first layout phase for SVG text. |
| 37 // | 37 // |
| 38 // It extracts the x/y/dx/dy/rotate values from the SVGTextPositioningElements i
n the DOM. | 38 // It extracts the x/y/dx/dy/rotate values from the SVGTextPositioningElements i
n the DOM. |
| 39 // These values are propagated to the corresponding LayoutSVGInlineText layoutOb
jects. | 39 // These values are propagated to the corresponding LayoutSVGInlineText layoutOb
jects. |
| 40 // The first layout phase only extracts the relevant information needed in Layou
tBlockFlowLine | 40 // The first layout phase only extracts the relevant information needed in Layou
tBlockFlowLine |
| 41 // to create the InlineBox tree based on text chunk boundaries & BiDi informatio
n. | 41 // to create the InlineBox tree based on text chunk boundaries & BiDi informatio
n. |
| 42 // The second layout phase is carried out by SVGTextLayoutEngine. | 42 // The second layout phase is carried out by SVGTextLayoutEngine. |
| 43 | 43 |
| 44 class SVGTextLayoutAttributesBuilder { | 44 class SVGTextLayoutAttributesBuilder { |
| 45 DISALLOW_ALLOCATION(); | 45 DISALLOW_NEW(); |
| 46 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder); | 46 WTF_MAKE_NONCOPYABLE(SVGTextLayoutAttributesBuilder); |
| 47 public: | 47 public: |
| 48 SVGTextLayoutAttributesBuilder(); | 48 SVGTextLayoutAttributesBuilder(); |
| 49 bool buildLayoutAttributesForForSubtree(LayoutSVGText&); | 49 bool buildLayoutAttributesForForSubtree(LayoutSVGText&); |
| 50 void buildLayoutAttributesForText(LayoutSVGInlineText*); | 50 void buildLayoutAttributesForText(LayoutSVGInlineText*); |
| 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 ALLOW_ONLY_INLINE_ALLOCATION(); | 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* newElement = nullptr, unsigned n
ewStart = 0, unsigned newLength = 0) |
| 62 : element(newElement) | 62 : element(newElement) |
| 63 , start(newStart) | 63 , start(newStart) |
| 64 , length(newLength) | 64 , length(newLength) |
| 65 { | 65 { |
| 66 } | 66 } |
| 67 | 67 |
| 68 DECLARE_TRACE(); | 68 DECLARE_TRACE(); |
| 69 | 69 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 81 unsigned m_textLength; | 81 unsigned m_textLength; |
| 82 WillBePersistentHeapVector<TextPosition> m_textPositions; | 82 WillBePersistentHeapVector<TextPosition> m_textPositions; |
| 83 SVGCharacterDataMap m_characterDataMap; | 83 SVGCharacterDataMap m_characterDataMap; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| 87 | 87 |
| 88 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder
::TextPosition); | 88 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SVGTextLayoutAttributesBuilder
::TextPosition); |
| 89 | 89 |
| 90 #endif | 90 #endif |
| OLD | NEW |