#ifndef HTMLViewSourceDocument_h
#define HTMLViewSourceDocument_h
#include "core/html/HTMLDocument.h"
namespace WebCore {
class HTMLTableCellElement;
class HTMLTableSectionElement;
class HTMLToken;
class HTMLViewSourceDocument FINAL : public HTMLDocument {
public:
static PassRefPtr<HTMLViewSourceDocument> create(const DocumentInit& initializer, const String& mimeType)
{
return adoptRef(new HTMLViewSourceDocument(initializer, mimeType));
}
void addSource(const String&, HTMLToken&);
private:
HTMLViewSourceDocument(const DocumentInit&, const String& mimeType);
virtual PassRefPtr<DocumentParser> createParser() OVERRIDE;
void processDoctypeToken(const String& source, HTMLToken&);
void processEndOfFileToken(const String& source, HTMLToken&);
void processTagToken(const String& source, HTMLToken&);
void processCommentToken(const String& source, HTMLToken&);
void processCharacterToken(const String& source, HTMLToken&);
void createContainingTable();
PassRefPtr<Element> addSpanWithClassName(const AtomicString&);
void addLine(const AtomicString& className);
void finishLine();
void addText(const String& text, const AtomicString& className);
int addRange(const String& source, int start, int end, const AtomicString& className, bool isLink = false, bool isAnchor = false, const AtomicString& link = nullAtom);
PassRefPtr<Element> addLink(const AtomicString& url, bool isAnchor);
PassRefPtr<Element> addBase(const AtomicString& href);
String m_type;
RefPtr<Element> m_current;
RefPtr<HTMLTableSectionElement> m_tbody;
RefPtr<HTMLTableCellElement> m_td;
int m_lineNumber;
};
}
#endif