summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/svg/SVGTextMetrics.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/svg/SVGTextMetrics.h')
-rw-r--r--Source/WebCore/rendering/svg/SVGTextMetrics.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/Source/WebCore/rendering/svg/SVGTextMetrics.h b/Source/WebCore/rendering/svg/SVGTextMetrics.h
index ba008c0ef..809629d0f 100644
--- a/Source/WebCore/rendering/svg/SVGTextMetrics.h
+++ b/Source/WebCore/rendering/svg/SVGTextMetrics.h
@@ -17,10 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef SVGTextMetrics_h
-#define SVGTextMetrics_h
+#pragma once
-#if ENABLE(SVG)
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -31,16 +29,14 @@ class TextRun;
class SVGTextMetrics {
public:
- enum MetricsType {
- SkippedSpaceMetrics
- };
+ enum MetricsType { SkippedSpaceMetrics };
SVGTextMetrics();
- SVGTextMetrics(MetricsType);
- SVGTextMetrics(RenderSVGInlineText*, unsigned position, unsigned length, float width, const String& glyphName);
+ explicit SVGTextMetrics(MetricsType);
+ SVGTextMetrics(RenderSVGInlineText&, unsigned length, float width);
- static SVGTextMetrics measureCharacterRange(RenderSVGInlineText*, unsigned position, unsigned length);
- static TextRun constructTextRun(RenderSVGInlineText*, const UChar* characters, unsigned position, unsigned length);
+ static SVGTextMetrics measureCharacterRange(RenderSVGInlineText&, unsigned position, unsigned length);
+ static TextRun constructTextRun(RenderSVGInlineText&, unsigned position = 0, unsigned length = std::numeric_limits<unsigned>::max());
bool isEmpty() const { return !m_width && !m_height && !m_glyph.isValid && m_length == 1; }
@@ -72,7 +68,7 @@ public:
const Glyph& glyph() const { return m_glyph; }
private:
- SVGTextMetrics(RenderSVGInlineText*, const TextRun&);
+ SVGTextMetrics(RenderSVGInlineText&, const TextRun&);
float m_width;
float m_height;
@@ -81,6 +77,3 @@ private:
};
} // namespace WebCore
-
-#endif // ENABLE(SVG)
-#endif