From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/rendering/RenderCombineText.h | 39 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'Source/WebCore/rendering/RenderCombineText.h') diff --git a/Source/WebCore/rendering/RenderCombineText.h b/Source/WebCore/rendering/RenderCombineText.h index 184190f09..072b81c61 100644 --- a/Source/WebCore/rendering/RenderCombineText.h +++ b/Source/WebCore/rendering/RenderCombineText.h @@ -18,10 +18,9 @@ * */ -#ifndef RenderCombineText_h -#define RenderCombineText_h +#pragma once -#include "Font.h" +#include "FontCascade.h" #include "RenderElement.h" #include "RenderText.h" #include "Text.h" @@ -30,35 +29,35 @@ namespace WebCore { class RenderCombineText final : public RenderText { public: - RenderCombineText(Text&, PassRefPtr); + RenderCombineText(Text&, const String&); - Text& textNode() const { return toText(nodeForNonAnonymous()); } + Text& textNode() const { return downcast(nodeForNonAnonymous()); } void combineText(); - void adjustTextOrigin(FloatPoint& textOrigin, const FloatRect& boxRect) const; - void getStringToRender(int, String& string, int& length) const; + std::optional computeTextOrigin(const FloatRect& boxRect) const; + String combinedStringForRendering() const; bool isCombined() const { return m_isCombined; } - float combinedTextWidth(const Font& font) const { return font.size(); } - const Font& originalFont() const { return parent()->style().font(); } - const Font& textCombineFont() const { return m_combineFontStyle->font(); } + float combinedTextWidth(const FontCascade& font) const { return font.size(); } + const FontCascade& originalFont() const { return parent()->style().fontCascade(); } + const FontCascade& textCombineFont() const { return m_combineFontStyle->fontCascade(); } private: void node() const = delete; - virtual bool isCombineText() const { return true; } - virtual float width(unsigned from, unsigned length, const Font&, float xPosition, HashSet* fallbackFonts = 0, GlyphOverflow* = 0) const; - virtual const char* renderName() const { return "RenderCombineText"; } - virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); - virtual void setTextInternal(const String&) override; + bool isCombineText() const override { return true; } + float width(unsigned from, unsigned length, const FontCascade&, float xPosition, HashSet* fallbackFonts = 0, GlyphOverflow* = 0) const override; + const char* renderName() const override { return "RenderCombineText"; } + void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; + void setRenderedText(const String&) override; - RefPtr m_combineFontStyle; - float m_combinedTextWidth; + std::unique_ptr m_combineFontStyle; + float m_combinedTextWidth { 0 }; + float m_combinedTextAscent { 0 }; + float m_combinedTextDescent { 0 }; bool m_isCombined : 1; bool m_needsFontUpdate : 1; }; -RENDER_OBJECT_TYPE_CASTS(RenderCombineText, isCombineText()); - } // namespace WebCore -#endif // RenderCombineText_h +SPECIALIZE_TYPE_TRAITS_RENDER_OBJECT(RenderCombineText, isCombineText()) -- cgit v1.2.1