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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 result.appendLiteral(" url(");
30 result.append(serializeString(namespaceURI()));
31 result.appendLiteral(");");
32 return result.toString();
33 }
34
35 AtomicString CSSNamespaceRule::namespaceURI() const
36 {
37 return m_namespaceRule->uri();
38 }
39
40 AtomicString CSSNamespaceRule::prefix() const
41 {
42 return m_namespaceRule->prefix();
43 }
44
45 DEFINE_TRACE(CSSNamespaceRule)
46 {
47 visitor->trace(m_namespaceRule);
48 CSSRule::trace(visitor);
49 }
50
51 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698