Index: Source/core/css/CSSNamespaceRule.cpp |
diff --git a/Source/core/css/CSSNamespaceRule.cpp b/Source/core/css/CSSNamespaceRule.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6525371e93de8920879c0406a2133e7ecd215b32 |
--- /dev/null |
+++ b/Source/core/css/CSSNamespaceRule.cpp |
@@ -0,0 +1,53 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/css/CSSNamespaceRule.h" |
+ |
+#include "core/css/CSSMarkup.h" |
+#include "core/css/StyleRuleNamespace.h" |
+#include "wtf/text/StringBuilder.h" |
+ |
+namespace blink { |
+ |
+CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace* namespaceRule, CSSStyleSheet* parent) |
+ : CSSRule(parent) |
+ , m_namespaceRule(namespaceRule) |
+{ |
+} |
+ |
+CSSNamespaceRule::~CSSNamespaceRule() |
+{ |
+} |
+ |
+String CSSNamespaceRule::cssText() const |
+{ |
+ StringBuilder result; |
+ result.appendLiteral("@namespace "); |
+ serializeIdentifier(prefix(), result); |
+ if (!prefix().isEmpty()) |
+ result.appendLiteral(" "); |
+ result.appendLiteral("url("); |
+ result.append(serializeString(namespaceURI())); |
+ result.appendLiteral(");"); |
+ return result.toString(); |
+} |
+ |
+AtomicString CSSNamespaceRule::namespaceURI() const |
+{ |
+ return m_namespaceRule->uri(); |
+} |
+ |
+AtomicString CSSNamespaceRule::prefix() const |
+{ |
+ return m_namespaceRule->prefix(); |
+} |
+ |
+DEFINE_TRACE(CSSNamespaceRule) |
+{ |
+ visitor->trace(m_namespaceRule); |
+ CSSRule::trace(visitor); |
+} |
+ |
+} // namespace blink |