summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/svg/RenderSVGInlineText.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/svg/RenderSVGInlineText.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/rendering/svg/RenderSVGInlineText.h')
-rw-r--r--Source/WebCore/rendering/svg/RenderSVGInlineText.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/Source/WebCore/rendering/svg/RenderSVGInlineText.h b/Source/WebCore/rendering/svg/RenderSVGInlineText.h
index c07228e21..1973d589e 100644
--- a/Source/WebCore/rendering/svg/RenderSVGInlineText.h
+++ b/Source/WebCore/rendering/svg/RenderSVGInlineText.h
@@ -19,11 +19,9 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef RenderSVGInlineText_h
-#define RenderSVGInlineText_h
+#pragma once
-#if ENABLE(SVG)
-#include "Font.h"
+#include "FontCascade.h"
#include "RenderText.h"
#include "SVGTextLayoutAttributes.h"
#include "Text.h"
@@ -36,43 +34,40 @@ class RenderSVGInlineText final : public RenderText {
public:
RenderSVGInlineText(Text&, const String&);
- Text& textNode() const { return toText(nodeForNonAnonymous()); }
+ Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); }
bool characterStartsNewTextChunk(int position) const;
SVGTextLayoutAttributes* layoutAttributes() { return &m_layoutAttributes; }
float scalingFactor() const { return m_scalingFactor; }
- const Font& scaledFont() const { return m_scaledFont; }
+ const FontCascade& scaledFont() const { return m_scaledFont; }
void updateScaledFont();
- static void computeNewScaledFontForStyle(RenderObject*, const RenderStyle*, float& scalingFactor, Font& scaledFont);
+ static void computeNewScaledFontForStyle(const RenderObject&, const RenderStyle&, float& scalingFactor, FontCascade& scaledFont);
// Preserves floating point precision for the use in DRT. It knows how to round and does a better job than enclosingIntRect.
FloatRect floatLinesBoundingBox() const;
private:
- virtual const char* renderName() const override { return "RenderSVGInlineText"; }
+ const char* renderName() const override { return "RenderSVGInlineText"; }
- virtual String originalText() const override;
- virtual void setTextInternal(const String&) override;
- virtual void styleDidChange(StyleDifference, const RenderStyle*) override;
+ String originalText() const override;
+ void setRenderedText(const String&) override;
+ void styleDidChange(StyleDifference, const RenderStyle*) override;
- virtual FloatRect objectBoundingBox() const override { return floatLinesBoundingBox(); }
+ FloatRect objectBoundingBox() const override { return floatLinesBoundingBox(); }
- virtual bool isSVGInlineText() const override { return true; }
+ bool isSVGInlineText() const override { return true; }
- virtual VisiblePosition positionForPoint(const LayoutPoint&) override;
- virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0) override;
- virtual IntRect linesBoundingBox() const override;
- virtual std::unique_ptr<InlineTextBox> createTextBox() override;
+ VisiblePosition positionForPoint(const LayoutPoint&, const RenderRegion*) override;
+ LayoutRect localCaretRect(InlineBox*, unsigned caretOffset, LayoutUnit* extraWidthToEndOfLine = 0) override;
+ IntRect linesBoundingBox() const override;
+ std::unique_ptr<InlineTextBox> createTextBox() override;
float m_scalingFactor;
- Font m_scaledFont;
+ FontCascade m_scaledFont;
SVGTextLayoutAttributes m_layoutAttributes;
};
-RENDER_OBJECT_TYPE_CASTS(RenderSVGInlineText, isSVGInlineText())
+} // namespace WebCore
-}
-
-#endif // ENABLE(SVG)
-#endif // RenderSVGInlineText_h
+SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderSVGInlineText, isSVGInlineText())