#ifndef Text_h
#define Text_h
#include "core/dom/CharacterData.h"
namespace WebCore {
class ExceptionState;
class RenderText;
class ExecutionContext;
class Text : public CharacterData {
public:
static const unsigned defaultLengthLimit = 1 << 16;
static PassRefPtr<Text> create(Document&, const String&);
static PassRefPtr<Text> createEditingText(Document&, const String&);
PassRefPtr<Node> mergeNextSiblingNodesIfPossible();
PassRefPtr<Text> splitText(unsigned offset, ExceptionState&);
String wholeText() const;
PassRefPtr<Text> replaceWholeText(const String&);
void recalcTextStyle(StyleRecalcChange, Text* nextTextSibling);
bool textRendererIsNeeded(const RenderStyle&, const RenderObject& parent);
RenderText* createTextRenderer(RenderStyle*);
void updateTextRenderer(unsigned offsetOfReplacedData, unsigned lengthOfReplacedData, RecalcStyleBehavior = DoNotRecalcStyle);
virtual void attach(const AttachContext& = AttachContext()) OVERRIDE FINAL;
virtual bool canContainRangeEndPoint() const OVERRIDE FINAL { return true; }
virtual NodeType nodeType() const OVERRIDE;
protected:
Text(TreeScope& treeScope, const String& data, ConstructionType type)
: CharacterData(treeScope, data, type)
{
ScriptWrappable::init(this);
}
private:
virtual String nodeName() const OVERRIDE;
virtual PassRefPtr<Node> cloneNode(bool deep = true) OVERRIDE FINAL;
bool needsWhitespaceRenderer();
virtual PassRefPtr<Text> cloneWithData(const String&);
#ifndef NDEBUG
virtual void formatForDebugger(char* buffer, unsigned length) const OVERRIDE;
#endif
};
DEFINE_NODE_TYPE_CASTS(Text, isTextNode());
}
#endif