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

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: Updated as per review comments Created 5 years, 3 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
« no previous file with comments | « Source/core/css/CSSNamespaceRule.h ('k') | Source/core/css/CSSNamespaceRule.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/css/CSSNamespaceRule.h ('k') | Source/core/css/CSSNamespaceRule.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698