Index: Source/core/dom/StyleSheetCandidate.h |
diff --git a/Source/core/dom/AddConsoleMessageTask.h b/Source/core/dom/StyleSheetCandidate.h |
similarity index 62% |
copy from Source/core/dom/AddConsoleMessageTask.h |
copy to Source/core/dom/StyleSheetCandidate.h |
index deb1e06206b3307afae35d94bf1cc690c310bd49..f1b64956697f057b97919fd1dc295ed0d244307b 100644 |
--- a/Source/core/dom/AddConsoleMessageTask.h |
+++ b/Source/core/dom/StyleSheetCandidate.h |
@@ -24,36 +24,52 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef AddConsoleMessageTask_h |
-#define AddConsoleMessageTask_h |
+#ifndef StyleSheetCandidate_h |
+#define StyleSheetCandidate_h |
-#include "core/dom/ExecutionContextTask.h" |
-#include "core/frame/ConsoleTypes.h" |
-#include "wtf/OwnPtr.h" |
-#include "wtf/PassOwnPtr.h" |
+#include "wtf/text/AtomicString.h" |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-class AddConsoleMessageTask : public ExecutionContextTask { |
+class Node; |
+class StyleSheet; |
+ |
+class StyleSheetCandidate { |
public: |
- static PassOwnPtr<AddConsoleMessageTask> create(MessageSource source, MessageLevel level, const String& message) |
- { |
- return adoptPtr(new AddConsoleMessageTask(source, level, message)); |
- } |
- virtual void performTask(ExecutionContext*); |
+ enum Type { |
+ HTMLLink, |
+ HTMLStyle, |
+ SVGStyle, |
+ Pi |
+ }; |
+ |
+ StyleSheetCandidate(Node& node) |
+ : m_node(node) |
+ , m_type(typeOf(node)) |
+ { } |
+ |
+ bool isXSL() const; |
+ bool isAlternate() const; |
+ bool isEnabledViaScript() const; |
+ bool isEnabledAndLoading() const; |
+ bool hasPreferrableName(const String& currentPreferrableName) const; |
+ bool canBeActivated(const String& currentPreferrableName) const; |
+ |
+ StyleSheet* sheet() const; |
+ AtomicString title() const; |
+ |
private: |
- AddConsoleMessageTask(MessageSource source, MessageLevel level, const String& message) |
- : m_source(source) |
- , m_level(level) |
- , m_message(message.isolatedCopy()) |
- { |
- } |
- MessageSource m_source; |
- MessageLevel m_level; |
- String m_message; |
+ bool isElement() const { return m_type != Pi; } |
+ bool isHTMLLink() const { return m_type == HTMLLink; } |
+ |
+ static Type typeOf(Node&); |
+ |
+ Node& m_node; |
+ Type m_type; |
}; |
-} // namespace |
+} |
#endif |
+ |