diff options
Diffstat (limited to 'Source/WebCore/rendering/svg/SVGInlineTextBox.h')
-rw-r--r-- | Source/WebCore/rendering/svg/SVGInlineTextBox.h | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/Source/WebCore/rendering/svg/SVGInlineTextBox.h b/Source/WebCore/rendering/svg/SVGInlineTextBox.h index 97df4d698..217bac12e 100644 --- a/Source/WebCore/rendering/svg/SVGInlineTextBox.h +++ b/Source/WebCore/rendering/svg/SVGInlineTextBox.h @@ -19,10 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef SVGInlineTextBox_h -#define SVGInlineTextBox_h +#pragma once -#if ENABLE(SVG) #include "InlineTextBox.h" #include "SVGTextLayoutEngine.h" #include "RenderSVGInlineText.h" @@ -36,54 +34,54 @@ class SVGInlineTextBox final : public InlineTextBox { public: explicit SVGInlineTextBox(RenderSVGInlineText&); - RenderSVGInlineText& renderer() const { return toRenderSVGInlineText(InlineTextBox::renderer()); } + RenderSVGInlineText& renderer() const { return downcast<RenderSVGInlineText>(InlineTextBox::renderer()); } - virtual float virtualLogicalHeight() const { return m_logicalHeight; } + float virtualLogicalHeight() const override { return m_logicalHeight; } void setLogicalHeight(float height) { m_logicalHeight = height; } - virtual int selectionTop() { return top(); } - virtual int selectionHeight() { return static_cast<int>(ceilf(m_logicalHeight)); } - virtual int offsetForPosition(float x, bool includePartialGlyphs = true) const; - virtual float positionForOffset(int offset) const; + int selectionTop() { return top(); } + int selectionHeight() { return static_cast<int>(ceilf(m_logicalHeight)); } + int offsetForPosition(float x, bool includePartialGlyphs = true) const override; + float positionForOffset(unsigned offset) const override; void paintSelectionBackground(PaintInfo&); - virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom); - virtual LayoutRect localSelectionRect(int startPosition, int endPosition) const override; + void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, LayoutUnit lineBottom) override; + LayoutRect localSelectionRect(unsigned startPosition, unsigned endPosition) const override; - bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int& startPosition, int& endPosition) const; + bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, unsigned& startPosition, unsigned& endPosition) const; - virtual FloatRect calculateBoundaries() const; + FloatRect calculateBoundaries() const override; void clearTextFragments() { m_textFragments.clear(); } Vector<SVGTextFragment>& textFragments() { return m_textFragments; } const Vector<SVGTextFragment>& textFragments() const { return m_textFragments; } - virtual void dirtyOwnLineBoxes() override final; - virtual void dirtyLineBoxes() override final; + void dirtyOwnLineBoxes() override; + void dirtyLineBoxes() override; bool startsNewTextChunk() const { return m_startsNewTextChunk; } void setStartsNewTextChunk(bool newTextChunk) { m_startsNewTextChunk = newTextChunk; } int offsetForPositionInFragment(const SVGTextFragment&, float position, bool includePartialGlyphs) const; - FloatRect selectionRectForTextFragment(const SVGTextFragment&, int fragmentStartPosition, int fragmentEndPosition, RenderStyle*) const; + FloatRect selectionRectForTextFragment(const SVGTextFragment&, unsigned fragmentStartPosition, unsigned fragmentEndPosition, const RenderStyle&) const; private: - virtual bool isSVGInlineTextBox() const override { return true; } + bool isSVGInlineTextBox() const override { return true; } - TextRun constructTextRun(RenderStyle*, const SVGTextFragment&) const; + TextRun constructTextRun(const RenderStyle&, const SVGTextFragment&) const; - bool acquirePaintingResource(GraphicsContext*&, float scalingFactor, RenderBoxModelObject&, RenderStyle*); + bool acquirePaintingResource(GraphicsContext*&, float scalingFactor, RenderBoxModelObject&, const RenderStyle&); void releasePaintingResource(GraphicsContext*&, const Path*); - bool prepareGraphicsContextForTextPainting(GraphicsContext*&, float scalingFactor, TextRun&, RenderStyle*); - void restoreGraphicsContextAfterTextPainting(GraphicsContext*&, TextRun&); + bool prepareGraphicsContextForTextPainting(GraphicsContext*&, float scalingFactor, const RenderStyle&); + void restoreGraphicsContextAfterTextPainting(GraphicsContext*&); - void paintDecoration(GraphicsContext*, TextDecoration, const SVGTextFragment&); - void paintDecorationWithStyle(GraphicsContext*, TextDecoration, const SVGTextFragment&, RenderBoxModelObject& decorationRenderer); - void paintTextWithShadows(GraphicsContext*, RenderStyle*, TextRun&, const SVGTextFragment&, int startPosition, int endPosition); - void paintText(GraphicsContext*, RenderStyle*, RenderStyle* selectionStyle, const SVGTextFragment&, bool hasSelection, bool paintSelectedTextOnly); + void paintDecoration(GraphicsContext&, TextDecoration, const SVGTextFragment&); + void paintDecorationWithStyle(GraphicsContext&, TextDecoration, const SVGTextFragment&, RenderBoxModelObject& decorationRenderer); + void paintTextWithShadows(GraphicsContext&, const RenderStyle&, TextRun&, const SVGTextFragment&, unsigned startPosition, unsigned endPosition); + void paintText(GraphicsContext&, const RenderStyle&, const RenderStyle& selectionStyle, const SVGTextFragment&, bool hasSelection, bool paintSelectedTextOnly); - virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom) override; + bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit lineTop, LayoutUnit lineBottom, HitTestAction) override; private: float m_logicalHeight; @@ -93,9 +91,6 @@ private: Vector<SVGTextFragment> m_textFragments; }; -INLINE_BOX_OBJECT_TYPE_CASTS(SVGInlineTextBox, isSVGInlineTextBox()) - } // namespace WebCore -#endif -#endif // SVGInlineTextBox_h +SPECIALIZE_TYPE_TRAITS_INLINE_BOX(SVGInlineTextBox, isSVGInlineTextBox()) |