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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSMediaRule.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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
1 /** 1 /**
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006, 2012 Apple Computer, Inc. 4 * Copyright (C) 2002, 2005, 2006, 2012 Apple Computer, Inc.
5 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) 5 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org)
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 MediaQuerySet* CSSMediaRule::mediaQueries() const 39 MediaQuerySet* CSSMediaRule::mediaQueries() const
40 { 40 {
41 return toStyleRuleMedia(m_groupRule.get())->mediaQueries(); 41 return toStyleRuleMedia(m_groupRule.get())->mediaQueries();
42 } 42 }
43 43
44 String CSSMediaRule::cssText() const 44 String CSSMediaRule::cssText() const
45 { 45 {
46 StringBuilder result; 46 StringBuilder result;
47 result.appendLiteral("@media "); 47 result.append("@media ");
48 if (mediaQueries()) { 48 if (mediaQueries()) {
49 result.append(mediaQueries()->mediaText()); 49 result.append(mediaQueries()->mediaText());
50 result.append(' '); 50 result.append(' ');
51 } 51 }
52 result.appendLiteral("{ \n"); 52 result.append("{ \n");
53 appendCSSTextForItems(result); 53 appendCSSTextForItems(result);
54 result.append('}'); 54 result.append('}');
55 return result.toString(); 55 return result.toString();
56 } 56 }
57 57
58 MediaList* CSSMediaRule::media() const 58 MediaList* CSSMediaRule::media() const
59 { 59 {
60 if (!mediaQueries()) 60 if (!mediaQueries())
61 return nullptr; 61 return nullptr;
62 if (!m_mediaCSSOMWrapper) 62 if (!m_mediaCSSOMWrapper)
63 m_mediaCSSOMWrapper = MediaList::create(mediaQueries(), const_cast<CSSMe diaRule*>(this)); 63 m_mediaCSSOMWrapper = MediaList::create(mediaQueries(), const_cast<CSSMe diaRule*>(this));
64 return m_mediaCSSOMWrapper.get(); 64 return m_mediaCSSOMWrapper.get();
65 } 65 }
66 66
67 void CSSMediaRule::reattach(StyleRuleBase* rule) 67 void CSSMediaRule::reattach(StyleRuleBase* rule)
68 { 68 {
69 CSSGroupingRule::reattach(rule); 69 CSSGroupingRule::reattach(rule);
70 if (m_mediaCSSOMWrapper && mediaQueries()) 70 if (m_mediaCSSOMWrapper && mediaQueries())
71 m_mediaCSSOMWrapper->reattach(mediaQueries()); 71 m_mediaCSSOMWrapper->reattach(mediaQueries());
72 } 72 }
73 73
74 DEFINE_TRACE(CSSMediaRule) 74 DEFINE_TRACE(CSSMediaRule)
75 { 75 {
76 visitor->trace(m_mediaCSSOMWrapper); 76 visitor->trace(m_mediaCSSOMWrapper);
77 CSSGroupingRule::trace(visitor); 77 CSSGroupingRule::trace(visitor);
78 } 78 }
79 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp ('k') | third_party/WebKit/Source/core/css/CSSNamespaceRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698