Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / css / CSSNamespaceRule.cpp
blob6525371e93de8920879c0406a2133e7ecd215b32
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "config.h"
6 #include "core/css/CSSNamespaceRule.h"
8 #include "core/css/CSSMarkup.h"
9 #include "core/css/StyleRuleNamespace.h"
10 #include "wtf/text/StringBuilder.h"
12 namespace blink {
14 CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace* namespaceRule, CSSStyleSheet* parent)
15 : CSSRule(parent)
16 , m_namespaceRule(namespaceRule)
20 CSSNamespaceRule::~CSSNamespaceRule()
24 String CSSNamespaceRule::cssText() const
26 StringBuilder result;
27 result.appendLiteral("@namespace ");
28 serializeIdentifier(prefix(), result);
29 if (!prefix().isEmpty())
30 result.appendLiteral(" ");
31 result.appendLiteral("url(");
32 result.append(serializeString(namespaceURI()));
33 result.appendLiteral(");");
34 return result.toString();
37 AtomicString CSSNamespaceRule::namespaceURI() const
39 return m_namespaceRule->uri();
42 AtomicString CSSNamespaceRule::prefix() const
44 return m_namespaceRule->prefix();
47 DEFINE_TRACE(CSSNamespaceRule)
49 visitor->trace(m_namespaceRule);
50 CSSRule::trace(visitor);
53 } // namespace blink