#ifndef StyleBase_H
#define StyleBase_H
#include "Shared.h"
namespace WebCore {
class String;
class StyleSheet;
class StyleBase : public Shared<StyleBase> {
public:
StyleBase(StyleBase* parent)
: m_parent(parent)
, m_strictParsing(!parent || parent->useStrictParsing())
{ }
virtual ~StyleBase() { }
StyleBase* parent() const { return m_parent; }
void setParent(StyleBase* parent) { m_parent = parent; }
String baseURL();
virtual bool isStyleSheet() const { return false; }
virtual bool isCSSStyleSheet() const { return false; }
virtual bool isXSLStyleSheet() const { return false; }
virtual bool isStyleSheetList() const { return false; }
virtual bool isMediaList() { return false; }
virtual bool isRuleList() { return false; }
virtual bool isRule() { return false; }
virtual bool isStyleRule() { return false; }
virtual bool isCharetRule() { return false; }
virtual bool isImportRule() { return false; }
virtual bool isMediaRule() { return false; }
virtual bool isFontFaceRule() { return false; }
virtual bool isPageRule() { return false; }
virtual bool isUnknownRule() { return false; }
virtual bool isStyleDeclaration() { return false; }
virtual bool isValue() { return false; }
virtual bool isPrimitiveValue() const { return false; }
virtual bool isValueList() { return false; }
virtual bool isValueCustom() { return false; }
virtual bool parseString(const String&, bool = false) { return false; }
virtual void checkLoaded();
void setStrictParsing(bool b) { m_strictParsing = b; }
bool useStrictParsing() const { return m_strictParsing; }
virtual void insertedIntoParent() { }
StyleSheet* stylesheet();
private:
StyleBase* m_parent;
bool m_strictParsing;
};
}
#endif