OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/CSSNamespaceRule.h" | 5 #include "core/css/CSSNamespaceRule.h" |
6 | 6 |
7 #include "core/css/CSSMarkup.h" | 7 #include "core/css/CSSMarkup.h" |
8 #include "core/css/StyleRuleNamespace.h" | 8 #include "core/css/StyleRuleNamespace.h" |
9 #include "wtf/text/StringBuilder.h" | 9 #include "wtf/text/StringBuilder.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace* namespaceRule, CSSStyleSh
eet* parent) | 13 CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace* namespaceRule, CSSStyleSh
eet* parent) |
14 : CSSRule(parent) | 14 : CSSRule(parent) |
15 , m_namespaceRule(namespaceRule) | 15 , m_namespaceRule(namespaceRule) |
16 { | 16 { |
17 } | 17 } |
18 | 18 |
19 CSSNamespaceRule::~CSSNamespaceRule() | 19 CSSNamespaceRule::~CSSNamespaceRule() |
20 { | 20 { |
21 } | 21 } |
22 | 22 |
23 String CSSNamespaceRule::cssText() const | 23 String CSSNamespaceRule::cssText() const |
24 { | 24 { |
25 StringBuilder result; | 25 StringBuilder result; |
26 result.append("@namespace "); | 26 result.appendLiteral("@namespace "); |
27 serializeIdentifier(prefix(), result); | 27 serializeIdentifier(prefix(), result); |
28 if (!prefix().isEmpty()) | 28 if (!prefix().isEmpty()) |
29 result.append(" "); | 29 result.appendLiteral(" "); |
30 result.append("url("); | 30 result.appendLiteral("url("); |
31 result.append(serializeString(namespaceURI())); | 31 result.append(serializeString(namespaceURI())); |
32 result.append(");"); | 32 result.appendLiteral(");"); |
33 return result.toString(); | 33 return result.toString(); |
34 } | 34 } |
35 | 35 |
36 AtomicString CSSNamespaceRule::namespaceURI() const | 36 AtomicString CSSNamespaceRule::namespaceURI() const |
37 { | 37 { |
38 return m_namespaceRule->uri(); | 38 return m_namespaceRule->uri(); |
39 } | 39 } |
40 | 40 |
41 AtomicString CSSNamespaceRule::prefix() const | 41 AtomicString CSSNamespaceRule::prefix() const |
42 { | 42 { |
43 return m_namespaceRule->prefix(); | 43 return m_namespaceRule->prefix(); |
44 } | 44 } |
45 | 45 |
46 DEFINE_TRACE(CSSNamespaceRule) | 46 DEFINE_TRACE(CSSNamespaceRule) |
47 { | 47 { |
48 visitor->trace(m_namespaceRule); | 48 visitor->trace(m_namespaceRule); |
49 CSSRule::trace(visitor); | 49 CSSRule::trace(visitor); |
50 } | 50 } |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
OLD | NEW |