diff options
author | Ben Murdoch <benm@google.com> | 2011-06-02 12:07:03 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-10 10:47:21 +0100 |
commit | 2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch) | |
tree | e4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h | |
parent | 87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff) | |
download | external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2 |
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h')
-rw-r--r-- | Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h index b368c51..a5995c0 100644 --- a/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h +++ b/Source/WebCore/rendering/svg/SVGTextLayoutAttributesBuilder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) Research In Motion Limited 2010. All rights reserved. + * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -28,6 +28,7 @@ namespace WebCore { class RenderObject; class RenderSVGText; +class SVGTextPositioningElement; // SVGTextLayoutAttributesBuilder performs the first layout phase for SVG text. // @@ -45,37 +46,27 @@ public: void buildLayoutAttributesForTextSubtree(RenderSVGText*); private: - struct LayoutScope { - LayoutScope() - : textContentStart(0) - , textContentLength(0) + struct TextPosition { + TextPosition(SVGTextPositioningElement* newElement = 0, unsigned newStart = 0, unsigned newLength = 0) + : element(newElement) + , start(newStart) + , length(newLength) { } - unsigned textContentStart; - unsigned textContentLength; - SVGTextLayoutAttributes attributes; + SVGTextPositioningElement* element; + unsigned start; + unsigned length; }; - void buildLayoutScope(LayoutScope&, RenderObject*, unsigned textContentStart, unsigned textContentLength) const; - void buildLayoutScopes(RenderObject*, unsigned& atCharacter, UChar& lastCharacter); - void buildOutermostLayoutScope(RenderSVGText*, unsigned textLength); + void collectTextPositioningElements(RenderObject*, unsigned& atCharacter, UChar& lastCharacter); + void buildLayoutAttributesForAllCharacters(RenderSVGText*, unsigned textLength); void propagateLayoutAttributes(RenderObject*, Vector<SVGTextLayoutAttributes>& allAttributes, unsigned& atCharacter, UChar& lastCharacter) const; - - enum LayoutValueType { - XValueAttribute, - YValueAttribute, - DxValueAttribute, - DyValueAttribute, - RotateValueAttribute - }; - - float nextLayoutValue(LayoutValueType, unsigned atCharacter) const; - void assignLayoutAttributesForCharacter(SVGTextLayoutAttributes&, SVGTextMetrics&, unsigned valueListPosition) const; - void assignEmptyLayoutAttributesForCharacter(SVGTextLayoutAttributes&) const; + void fillAttributesAtPosition(const TextPosition&); private: - Vector<LayoutScope> m_scopes; + Vector<TextPosition> m_textPositions; + SVGTextLayoutAttributes::PositioningLists m_positioningLists; }; } // namespace WebCore |