RenderTextFragment.h [plain text]
#ifndef RenderTextFragment_h
#define RenderTextFragment_h
#include "RenderText.h"
namespace WebCore {
class RenderTextFragment final : public RenderText {
public:
RenderTextFragment(Text&, const String&, int startOffset, int length);
RenderTextFragment(Document&, const String&, int startOffset, int length);
RenderTextFragment(Document&, const String&);
virtual ~RenderTextFragment();
virtual bool canBeSelectionLeaf() const override;
unsigned start() const { return m_start; }
unsigned end() const { return m_end; }
RenderBoxModelObject* firstLetter() const { return m_firstLetter; }
void setFirstLetter(RenderBoxModelObject& firstLetter) { m_firstLetter = &firstLetter; }
RenderBlock* blockForAccompanyingFirstLetter();
void setContentString(const String& text);
StringImpl* contentString() const { return m_contentString.impl(); }
virtual void setText(const String&, bool force = false) override;
const String& altText() const { return m_altText; }
void setAltText(const String& altText) { m_altText = altText; }
private:
virtual bool isTextFragment() const override { return true; }
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override;
virtual void willBeDestroyed() override;
virtual UChar previousCharacter() const override;
unsigned m_start;
unsigned m_end;
String m_altText;
String m_contentString;
RenderBoxModelObject* m_firstLetter;
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::RenderTextFragment)
static bool isType(const WebCore::RenderText& renderer) { return renderer.isTextFragment(); }
static bool isType(const WebCore::RenderObject& renderer) { return is<WebCore::RenderText>(renderer) && isType(downcast<WebCore::RenderText>(renderer)); }
SPECIALIZE_TYPE_TRAITS_END()
#endif // RenderTextFragment_h