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

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
« no previous file with comments | « Source/core/css/CSSNamespaceRule.h ('k') | Source/core/css/CSSNamespaceRule.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
OLDNEW
« 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