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..ceb975cb2d0ffab67d0bbf68145bb548f14cf72f |
--- /dev/null |
+++ b/Source/core/css/CSSNamespaceRule.cpp |
@@ -0,0 +1,50 @@ |
+// 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/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 "); |
+ result.append(m_namespaceRule->prefix()); |
Timothy Loh
2015/09/02 04:45:14
Should call serializeIdentifier and just use prefi
ramya.v
2015/09/02 09:20:54
As per the spec https://drafts.csswg.org/cssom/#do
ramya.v
2015/09/03 04:03:21
In the spec as well it was mentioned as below (pre
Timothy Loh
2015/09/04 01:35:50
For the default namespace (no prefix value), this
|
+ result.appendLiteral(" url(\""); |
+ result.append(m_namespaceRule->uri()); |
Timothy Loh
2015/09/02 04:45:14
serializeString(prefix())
ramya.v
2015/09/02 09:20:54
Done.
|
+ 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 |