Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Unified Diff: Source/core/dom/StyleSheetCandidate.h

Issue 139273002: Refactoring: Extract StyleSheetCandidate from DocumentStyleSheetCollection (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to ToT Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/dom/StyleSheetCandidate.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
+
« no previous file with comments | « Source/core/dom/StyleEngine.h ('k') | Source/core/dom/StyleSheetCandidate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698