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

Unified Diff: Source/core/css/CSSNamespaceRule.cpp

Issue 1321943002: Support for CSSOM CSSNamespaceRule interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating testcases Created 5 years, 4 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
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

Powered by Google App Engine
This is Rietveld 408576698