CompactHTMLToken.h [plain text]
#ifndef CompactHTMLToken_h
#define CompactHTMLToken_h
#if ENABLE(THREADED_HTML_PARSER)
#include "HTMLIdentifier.h"
#include "HTMLToken.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/TextPosition.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class QualifiedName;
class CompactHTMLToken {
public:
struct Attribute {
Attribute(const HTMLIdentifier& name, const String& value)
: name(name)
, value(value)
{
}
HTMLIdentifier name;
String value;
};
CompactHTMLToken(const HTMLToken*, const TextPosition&);
bool isSafeToSendToAnotherThread() const;
HTMLToken::Type type() const { return static_cast<HTMLToken::Type>(m_type); }
const HTMLIdentifier& data() const { return m_data; }
bool selfClosing() const { return m_selfClosing; }
bool isAll8BitData() const { return m_isAll8BitData; }
const Vector<Attribute>& attributes() const { return m_attributes; }
const Attribute* getAttributeItem(const QualifiedName&) const;
const TextPosition& textPosition() const { return m_textPosition; }
const HTMLIdentifier& publicIdentifier() const { return m_attributes[0].name; }
const String& systemIdentifier() const { return m_attributes[0].value; }
bool doctypeForcesQuirks() const { return m_doctypeForcesQuirks; }
private:
unsigned m_type : 4;
unsigned m_selfClosing : 1;
unsigned m_isAll8BitData : 1;
unsigned m_doctypeForcesQuirks: 1;
HTMLIdentifier m_data; Vector<Attribute> m_attributes;
TextPosition m_textPosition;
};
typedef Vector<CompactHTMLToken> CompactHTMLTokenStream;
}
#endif // ENABLE(THREADED_HTML_PARSER)
#endif