diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/rendering/RenderCombineText.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/rendering/RenderCombineText.h')
-rw-r--r-- | Source/WebCore/rendering/RenderCombineText.h | 39 |
1 files changed, 19 insertions, 20 deletions
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<StringImpl>); + RenderCombineText(Text&, const String&); - Text& textNode() const { return toText(nodeForNonAnonymous()); } + Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); } void combineText(); - void adjustTextOrigin(FloatPoint& textOrigin, const FloatRect& boxRect) const; - void getStringToRender(int, String& string, int& length) const; + std::optional<FloatPoint> 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<const SimpleFontData*>* 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<const Font*>* 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<RenderStyle> m_combineFontStyle; - float m_combinedTextWidth; + std::unique_ptr<RenderStyle> 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()) |