ProcessingInstruction.h [plain text]
#ifndef ProcessingInstruction_h
#define ProcessingInstruction_h
#include "CachedResourceHandle.h"
#include "CachedStyleSheetClient.h"
#include "CharacterData.h"
namespace WebCore {
class StyleSheet;
class CSSStyleSheet;
class ProcessingInstruction final : public CharacterData, private CachedStyleSheetClient {
public:
static Ref<ProcessingInstruction> create(Document&, const String& target, const String& data);
virtual ~ProcessingInstruction();
const String& target() const { return m_target; }
void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
virtual void finishParsingChildren() override;
const String& localHref() const { return m_localHref; }
StyleSheet* sheet() const { return m_sheet.get(); }
void setCSSStyleSheet(PassRefPtr<CSSStyleSheet>);
bool isCSS() const { return m_isCSS; }
#if ENABLE(XSLT)
bool isXSL() const { return m_isXSL; }
#endif
private:
friend class CharacterData;
ProcessingInstruction(Document&, const String& target, const String& data);
virtual String nodeName() const override;
virtual NodeType nodeType() const override;
virtual RefPtr<Node> cloneNodeInternal(Document&, CloningOperation) override;
virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
virtual void removedFrom(ContainerNode&) override;
void checkStyleSheet();
virtual void setCSSStyleSheet(const String& href, const URL& baseURL, const String& charset, const CachedCSSStyleSheet*) override;
#if ENABLE(XSLT)
virtual void setXSLStyleSheet(const String& href, const URL& baseURL, const String& sheet) override;
#endif
bool isLoading() const;
virtual bool sheetLoaded() override;
virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
void parseStyleSheet(const String& sheet);
String m_target;
String m_localHref;
String m_title;
String m_media;
CachedResourceHandle<CachedResource> m_cachedSheet;
RefPtr<StyleSheet> m_sheet;
bool m_loading;
bool m_alternate;
bool m_createdByParser;
bool m_isCSS;
#if ENABLE(XSLT)
bool m_isXSL;
#endif
};
}
SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ProcessingInstruction)
static bool isType(const WebCore::Node& node) { return node.nodeType() == WebCore::Node::PROCESSING_INSTRUCTION_NODE; }
SPECIALIZE_TYPE_TRAITS_END()
#endif