OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/CSSQuadValue.h" | 5 #include "core/css/CSSQuadValue.h" |
6 | 6 |
7 #include "wtf/text/StringBuilder.h" | 7 #include "wtf/text/StringBuilder.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 String CSSQuadValue::customCSSText() const | 11 String CSSQuadValue::customCSSText() const |
12 { | 12 { |
13 String top = m_top->cssText(); | 13 String top = m_top->cssText(); |
14 String right = m_right->cssText(); | 14 String right = m_right->cssText(); |
15 String bottom = m_bottom->cssText(); | 15 String bottom = m_bottom->cssText(); |
16 String left = m_left->cssText(); | 16 String left = m_left->cssText(); |
17 | 17 |
18 if (m_serializationType == SerializationType::SerializeAsRect) | 18 if (m_serializationType == TypeForSerialization::SerializeAsRect) |
19 return "rect(" + top + ' ' + right + ' ' + bottom + ' ' + left + ')'; | 19 return "rect(" + top + ' ' + right + ' ' + bottom + ' ' + left + ')'; |
20 | 20 |
21 StringBuilder result; | 21 StringBuilder result; |
22 // reserve space for the four strings, plus three space separator characters
. | 22 // reserve space for the four strings, plus three space separator characters
. |
23 result.reserveCapacity(top.length() + right.length() + bottom.length() + lef
t.length() + 3); | 23 result.reserveCapacity(top.length() + right.length() + bottom.length() + lef
t.length() + 3); |
24 result.append(top); | 24 result.append(top); |
25 if (right != top || bottom != top || left != top) { | 25 if (right != top || bottom != top || left != top) { |
26 result.append(' '); | 26 result.append(' '); |
27 result.append(right); | 27 result.append(right); |
28 if (bottom != top || right != left) { | 28 if (bottom != top || right != left) { |
(...skipping 11 matching lines...) Expand all Loading... |
40 DEFINE_TRACE_AFTER_DISPATCH(CSSQuadValue) | 40 DEFINE_TRACE_AFTER_DISPATCH(CSSQuadValue) |
41 { | 41 { |
42 visitor->trace(m_top); | 42 visitor->trace(m_top); |
43 visitor->trace(m_right); | 43 visitor->trace(m_right); |
44 visitor->trace(m_bottom); | 44 visitor->trace(m_bottom); |
45 visitor->trace(m_left); | 45 visitor->trace(m_left); |
46 CSSValue::traceAfterDispatch(visitor); | 46 CSSValue::traceAfterDispatch(visitor); |
47 } | 47 } |
48 | 48 |
49 } // namespace blink | 49 } // namespace blink |
OLD | NEW |