summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/ProcessingInstruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/ProcessingInstruction.h')
-rw-r--r--Source/WebCore/dom/ProcessingInstruction.h54
1 files changed, 24 insertions, 30 deletions
diff --git a/Source/WebCore/dom/ProcessingInstruction.h b/Source/WebCore/dom/ProcessingInstruction.h
index 7d4558530..d15443328 100644
--- a/Source/WebCore/dom/ProcessingInstruction.h
+++ b/Source/WebCore/dom/ProcessingInstruction.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000 Peter Kelly (pmk@post.com)
- * Copyright (C) 2006 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
* Copyright (C) 2013 Samsung Electronics. All rights reserved.
*
* This library is free software; you can redistribute it and/or
@@ -20,8 +20,7 @@
*
*/
-#ifndef ProcessingInstruction_h
-#define ProcessingInstruction_h
+#pragma once
#include "CachedResourceHandle.h"
#include "CachedStyleSheetClient.h"
@@ -34,18 +33,17 @@ class CSSStyleSheet;
class ProcessingInstruction final : public CharacterData, private CachedStyleSheetClient {
public:
- static PassRefPtr<ProcessingInstruction> create(Document&, const String& target, const String& data);
+ 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;
+ 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)
@@ -56,23 +54,23 @@ private:
friend class CharacterData;
ProcessingInstruction(Document&, const String& target, const String& data);
- virtual String nodeName() const override;
- virtual NodeType nodeType() const override;
- virtual PassRefPtr<Node> cloneNode(bool deep) override;
+ String nodeName() const override;
+ NodeType nodeType() const override;
+ Ref<Node> cloneNodeInternal(Document&, CloningOperation) override;
- virtual InsertionNotificationRequest insertedInto(ContainerNode&) override;
- virtual void removedFrom(ContainerNode&) override;
+ InsertionNotificationRequest insertedInto(ContainerNode&) override;
+ void removedFrom(ContainerNode&) override;
void checkStyleSheet();
- virtual void setCSSStyleSheet(const String& href, const URL& baseURL, const String& charset, const CachedCSSStyleSheet*) override;
+ 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;
+ void setXSLStyleSheet(const String& href, const URL& baseURL, const String& sheet) override;
#endif
bool isLoading() const;
- virtual bool sheetLoaded() override;
+ bool sheetLoaded() override;
- virtual void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
+ void addSubresourceAttributeURLs(ListHashSet<URL>&) const override;
void parseStyleSheet(const String& sheet);
@@ -80,24 +78,20 @@ private:
String m_localHref;
String m_title;
String m_media;
- CachedResourceHandle<CachedResource> m_cachedSheet;
+ CachedResourceHandle<CachedResource> m_cachedSheet { nullptr };
RefPtr<StyleSheet> m_sheet;
- bool m_loading;
- bool m_alternate;
- bool m_createdByParser;
- bool m_isCSS;
+ bool m_loading { false };
+ bool m_alternate { false };
+ bool m_createdByParser { false };
+ bool m_isCSS { false };
#if ENABLE(XSLT)
- bool m_isXSL;
+ bool m_isXSL { false };
#endif
+ bool m_isHandlingBeforeLoad { false };
};
-inline bool isProcessingInstruction(const Node& node)
-{
- return node.nodeType() == Node::PROCESSING_INSTRUCTION_NODE;
-}
+} // namespace WebCore
-NODE_TYPE_CASTS(ProcessingInstruction)
-
-} //namespace
-
-#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()