summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSRule.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/CSSRule.h')
-rw-r--r--Source/WebCore/css/CSSRule.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/Source/WebCore/css/CSSRule.h b/Source/WebCore/css/CSSRule.h
index a80399d16..e52c56319 100644
--- a/Source/WebCore/css/CSSRule.h
+++ b/Source/WebCore/css/CSSRule.h
@@ -20,18 +20,17 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef CSSRule_h
-#define CSSRule_h
+#pragma once
-#include <wtf/RefCounted.h>
-#include <wtf/text/WTFString.h>
+#include "ExceptionOr.h"
+#include <wtf/TypeCasts.h>
namespace WebCore {
class CSSStyleSheet;
class StyleRuleBase;
+
struct CSSParserContext;
-typedef int ExceptionCode;
class CSSRule : public RefCounted<CSSRule> {
public:
@@ -48,25 +47,26 @@ public:
// 7 was VARIABLES_RULE; we now match other browsers with 7 as
// KEYFRAMES_RULE:
// <https://bugs.webkit.org/show_bug.cgi?id=71293>.
- WEBKIT_KEYFRAMES_RULE,
- WEBKIT_KEYFRAME_RULE,
-#if ENABLE(CSS3_CONDITIONAL_RULES)
+ KEYFRAMES_RULE,
+ KEYFRAME_RULE,
+ NAMESPACE_RULE = 10, // Matches other browsers.
SUPPORTS_RULE = 12,
-#endif
#if ENABLE(CSS_DEVICE_ADAPTATION)
WEBKIT_VIEWPORT_RULE = 15,
#endif
#if ENABLE(CSS_REGIONS)
WEBKIT_REGION_RULE = 16,
#endif
-#if ENABLE(SHADOW_DOM)
- HOST_RULE = 1001,
-#endif
+ };
+
+ enum DeprecatedType {
+ WEBKIT_KEYFRAMES_RULE = 7,
+ WEBKIT_KEYFRAME_RULE = 8
};
virtual Type type() const = 0;
virtual String cssText() const = 0;
- virtual void reattach(StyleRuleBase*) = 0;
+ virtual void reattach(StyleRuleBase&) = 0;
void setParentStyleSheet(CSSStyleSheet* styleSheet)
{
@@ -89,8 +89,7 @@ public:
CSSRule* parentRule() const { return m_parentIsRule ? m_parentRule : 0; }
- // NOTE: Just calls notImplemented().
- void setCssText(const String&, ExceptionCode&);
+ WEBCORE_EXPORT ExceptionOr<void> setCssText(const String&);
protected:
CSSRule(CSSStyleSheet* parent)
@@ -117,4 +116,7 @@ private:
} // namespace WebCore
-#endif // CSSRule_h
+#define SPECIALIZE_TYPE_TRAITS_CSS_RULE(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+ static bool isType(const WebCore::CSSRule& rule) { return rule.type() == WebCore::predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()