OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "config.h" |
| 6 #include "core/css/CSSNamespaceRule.h" |
| 7 |
| 8 #include "core/css/CSSMarkup.h" |
| 9 #include "core/css/StyleRuleNamespace.h" |
| 10 #include "wtf/text/StringBuilder.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 CSSNamespaceRule::CSSNamespaceRule(StyleRuleNamespace* namespaceRule, CSSStyleSh
eet* parent) |
| 15 : CSSRule(parent) |
| 16 , m_namespaceRule(namespaceRule) |
| 17 { |
| 18 } |
| 19 |
| 20 CSSNamespaceRule::~CSSNamespaceRule() |
| 21 { |
| 22 } |
| 23 |
| 24 String CSSNamespaceRule::cssText() const |
| 25 { |
| 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(); |
| 35 } |
| 36 |
| 37 AtomicString CSSNamespaceRule::namespaceURI() const |
| 38 { |
| 39 return m_namespaceRule->uri(); |
| 40 } |
| 41 |
| 42 AtomicString CSSNamespaceRule::prefix() const |
| 43 { |
| 44 return m_namespaceRule->prefix(); |
| 45 } |
| 46 |
| 47 DEFINE_TRACE(CSSNamespaceRule) |
| 48 { |
| 49 visitor->trace(m_namespaceRule); |
| 50 CSSRule::trace(visitor); |
| 51 } |
| 52 |
| 53 } // namespace blink |
OLD | NEW |