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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSViewportRule.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 * Copyright (C) 2012 Intel Corporation. All rights reserved. 2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
3 * Copyright (C) 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above 9 * 1. Redistributions of source code must retain the above
10 * copyright notice, this list of conditions and the following 10 * copyright notice, this list of conditions and the following
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 { 51 {
52 if (!m_propertiesCSSOMWrapper) 52 if (!m_propertiesCSSOMWrapper)
53 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_viewpo rtRule->mutableProperties(), const_cast<CSSViewportRule*>(this)); 53 m_propertiesCSSOMWrapper = StyleRuleCSSStyleDeclaration::create(m_viewpo rtRule->mutableProperties(), const_cast<CSSViewportRule*>(this));
54 54
55 return m_propertiesCSSOMWrapper.get(); 55 return m_propertiesCSSOMWrapper.get();
56 } 56 }
57 57
58 String CSSViewportRule::cssText() const 58 String CSSViewportRule::cssText() const
59 { 59 {
60 StringBuilder result; 60 StringBuilder result;
61 result.appendLiteral("@viewport { "); 61 result.append("@viewport { ");
62 62
63 String decls = m_viewportRule->properties().asText(); 63 String decls = m_viewportRule->properties().asText();
64 result.append(decls); 64 result.append(decls);
65 if (!decls.isEmpty()) 65 if (!decls.isEmpty())
66 result.append(' '); 66 result.append(' ');
67 67
68 result.append('}'); 68 result.append('}');
69 69
70 return result.toString(); 70 return result.toString();
71 } 71 }
72 72
73 void CSSViewportRule::reattach(StyleRuleBase* rule) 73 void CSSViewportRule::reattach(StyleRuleBase* rule)
74 { 74 {
75 ASSERT(rule); 75 ASSERT(rule);
76 m_viewportRule = toStyleRuleViewport(rule); 76 m_viewportRule = toStyleRuleViewport(rule);
77 if (m_propertiesCSSOMWrapper) 77 if (m_propertiesCSSOMWrapper)
78 m_propertiesCSSOMWrapper->reattach(m_viewportRule->mutableProperties()); 78 m_propertiesCSSOMWrapper->reattach(m_viewportRule->mutableProperties());
79 } 79 }
80 80
81 DEFINE_TRACE(CSSViewportRule) 81 DEFINE_TRACE(CSSViewportRule)
82 { 82 {
83 visitor->trace(m_viewportRule); 83 visitor->trace(m_viewportRule);
84 visitor->trace(m_propertiesCSSOMWrapper); 84 visitor->trace(m_propertiesCSSOMWrapper);
85 CSSRule::trace(visitor); 85 CSSRule::trace(visitor);
86 } 86 }
87 87
88 } // namespace blink 88 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSSupportsRule.cpp ('k') | third_party/WebKit/Source/core/css/MediaList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698