| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 newList = createSlashSeparated(); | 90 newList = createSlashSeparated(); |
| 91 break; | 91 break; |
| 92 default: | 92 default: |
| 93 ASSERT_NOT_REACHED(); | 93 ASSERT_NOT_REACHED(); |
| 94 } | 94 } |
| 95 for (size_t index = 0; index < m_values.size(); index++) | 95 for (size_t index = 0; index < m_values.size(); index++) |
| 96 newList->append(m_values[index]); | 96 newList->append(m_values[index]); |
| 97 return newList.release(); | 97 return newList.release(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 String CSSValueList::customCssText() const | 100 String CSSValueList::customCssText(CssTextFormattingFlags formattingFlag) const |
| 101 { | 101 { |
| 102 StringBuilder result; | 102 StringBuilder result; |
| 103 String separator; | 103 String separator; |
| 104 switch (m_valueListSeparator) { | 104 switch (m_valueListSeparator) { |
| 105 case SpaceSeparator: | 105 case SpaceSeparator: |
| 106 separator = " "; | 106 separator = " "; |
| 107 break; | 107 break; |
| 108 case CommaSeparator: | 108 case CommaSeparator: |
| 109 separator = ", "; | 109 separator = ", "; |
| 110 break; | 110 break; |
| 111 case SlashSeparator: | 111 case SlashSeparator: |
| 112 separator = " / "; | 112 separator = " / "; |
| 113 break; | 113 break; |
| 114 default: | 114 default: |
| 115 ASSERT_NOT_REACHED(); | 115 ASSERT_NOT_REACHED(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 unsigned size = m_values.size(); | 118 unsigned size = m_values.size(); |
| 119 for (unsigned i = 0; i < size; i++) { | 119 for (unsigned i = 0; i < size; i++) { |
| 120 if (!result.isEmpty()) | 120 if (!result.isEmpty()) |
| 121 result.append(separator); | 121 result.append(separator); |
| 122 result.append(m_values[i]->cssText()); | 122 if (formattingFlag == AlwaysQuoteCSSString && m_values[i]->isPrimitiveVa
lue()) |
| 123 result.append(toCSSPrimitiveValue(m_values[i].get())->customCssText(
AlwaysQuoteCSSString)); |
| 124 else |
| 125 result.append(m_values[i]->cssText()); |
| 123 } | 126 } |
| 124 | 127 |
| 125 return result.toString(); | 128 return result.toString(); |
| 126 } | 129 } |
| 127 | 130 |
| 128 bool CSSValueList::equals(const CSSValueList& other) const | 131 bool CSSValueList::equals(const CSSValueList& other) const |
| 129 { | 132 { |
| 130 return m_valueListSeparator == other.m_valueListSeparator && compareCSSValue
Vector<CSSValue>(m_values, other.m_values); | 133 return m_valueListSeparator == other.m_valueListSeparator && compareCSSValue
Vector<CSSValue>(m_values, other.m_values); |
| 131 } | 134 } |
| 132 | 135 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 return adoptRef(new CSSValueList(*this)); | 200 return adoptRef(new CSSValueList(*this)); |
| 198 } | 201 } |
| 199 | 202 |
| 200 void CSSValueList::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInf
o) const | 203 void CSSValueList::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInf
o) const |
| 201 { | 204 { |
| 202 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 205 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
| 203 info.addMember(m_values, "values"); | 206 info.addMember(m_values, "values"); |
| 204 } | 207 } |
| 205 | 208 |
| 206 } // namespace WebCore | 209 } // namespace WebCore |
| OLD | NEW |