summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/svg/SVGTextChunk.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/rendering/svg/SVGTextChunk.h
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/rendering/svg/SVGTextChunk.h')
-rw-r--r--Source/WebCore/rendering/svg/SVGTextChunk.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/svg/SVGTextChunk.h b/Source/WebCore/rendering/svg/SVGTextChunk.h
index a0a4c4f9d..9618d9fb6 100644
--- a/Source/WebCore/rendering/svg/SVGTextChunk.h
+++ b/Source/WebCore/rendering/svg/SVGTextChunk.h
@@ -1,6 +1,5 @@
/*
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
- * Copyright (C) 2015 Apple Inc. 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
@@ -21,6 +20,7 @@
#ifndef SVGTextChunk_h
#define SVGTextChunk_h
+#if ENABLE(SVG)
#include "SVGRenderStyleDefs.h"
#include "SVGTextContentElement.h"
@@ -41,36 +41,31 @@ public:
LengthAdjustSpacingAndGlyphs = 1 << 6
};
- SVGTextChunk(const Vector<SVGInlineTextBox*>&, unsigned first, unsigned limit);
+ SVGTextChunk(unsigned chunkStyle, float desiredTextLength);
- unsigned totalCharacters() const;
- float totalLength() const;
- float totalAnchorShift() const;
- void layout(HashMap<SVGInlineTextBox*, AffineTransform>&) const;
-
-private:
- void processTextAnchorCorrection() const;
- void buildBoxTransformations(HashMap<SVGInlineTextBox*, AffineTransform>&) const;
- void processTextLengthSpacingCorrection() const;
+ void calculateLength(float& length, unsigned& characters) const;
+ float calculateTextAnchorShift(float length) const;
bool isVerticalText() const { return m_chunkStyle & VerticalText; }
float desiredTextLength() const { return m_desiredTextLength; }
+ Vector<SVGInlineTextBox*>& boxes() { return m_boxes; }
+ const Vector<SVGInlineTextBox*>& boxes() const { return m_boxes; }
+
bool hasDesiredTextLength() const { return m_desiredTextLength > 0 && ((m_chunkStyle & LengthAdjustSpacing) || (m_chunkStyle & LengthAdjustSpacingAndGlyphs)); }
- bool hasTextAnchor() const { return m_chunkStyle & RightToLeftText ? !(m_chunkStyle & EndAnchor) : (m_chunkStyle & (MiddleAnchor | EndAnchor)); }
+ bool hasTextAnchor() const { return m_chunkStyle & RightToLeftText ? !(m_chunkStyle & EndAnchor) : (m_chunkStyle & MiddleAnchor) || (m_chunkStyle & EndAnchor); }
bool hasLengthAdjustSpacing() const { return m_chunkStyle & LengthAdjustSpacing; }
bool hasLengthAdjustSpacingAndGlyphs() const { return m_chunkStyle & LengthAdjustSpacingAndGlyphs; }
- bool boxSpacingAndGlyphsTransform(const SVGInlineTextBox*, AffineTransform&) const;
-
private:
// Contains all SVGInlineTextBoxes this chunk spans.
Vector<SVGInlineTextBox*> m_boxes;
- unsigned m_chunkStyle { DefaultStyle };
- float m_desiredTextLength { 0 };
+ unsigned m_chunkStyle;
+ float m_desiredTextLength;
};
} // namespace WebCore
+#endif // ENABLE(SVG)
#endif