| 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, 2008, 2012 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv
ed. |
| 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 | 853 |
| 854 return String::adopt(buffer); | 854 return String::adopt(buffer); |
| 855 } | 855 } |
| 856 | 856 |
| 857 template <unsigned characterCount> | 857 template <unsigned characterCount> |
| 858 ALWAYS_INLINE static String formatNumber(double number, const char (&characters)
[characterCount]) | 858 ALWAYS_INLINE static String formatNumber(double number, const char (&characters)
[characterCount]) |
| 859 { | 859 { |
| 860 return formatNumber(number, characters, characterCount - 1); | 860 return formatNumber(number, characters, characterCount - 1); |
| 861 } | 861 } |
| 862 | 862 |
| 863 String CSSPrimitiveValue::customCssText() const | 863 String CSSPrimitiveValue::customCssText(CssTextFormattingFlags formattingFlag) c
onst |
| 864 { | 864 { |
| 865 // FIXME: return the original value instead of a generated one (e.g. color | 865 // FIXME: return the original value instead of a generated one (e.g. color |
| 866 // name if it was specified) - check what spec says about this | 866 // name if it was specified) - check what spec says about this |
| 867 | 867 |
| 868 if (m_hasCachedCSSText) { | 868 if (m_hasCachedCSSText) { |
| 869 ASSERT(cssTextCache().contains(this)); | 869 ASSERT(cssTextCache().contains(this)); |
| 870 return cssTextCache().get(this); | 870 return cssTextCache().get(this); |
| 871 } | 871 } |
| 872 | 872 |
| 873 String text; | 873 String text; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 case CSS_KHZ: | 942 case CSS_KHZ: |
| 943 text = formatNumber(m_value.num, "khz"); | 943 text = formatNumber(m_value.num, "khz"); |
| 944 break; | 944 break; |
| 945 case CSS_TURN: | 945 case CSS_TURN: |
| 946 text = formatNumber(m_value.num, "turn"); | 946 text = formatNumber(m_value.num, "turn"); |
| 947 break; | 947 break; |
| 948 case CSS_DIMENSION: | 948 case CSS_DIMENSION: |
| 949 text = m_value.string; | 949 text = m_value.string; |
| 950 break; | 950 break; |
| 951 case CSS_STRING: | 951 case CSS_STRING: |
| 952 text = quoteCSSStringIfNeeded(m_value.string); | 952 text = formattingFlag == AlwaysQuoteCSSString ? quoteCSSString(m_val
ue.string) : quoteCSSStringIfNeeded(m_value.string); |
| 953 break; | 953 break; |
| 954 case CSS_URI: | 954 case CSS_URI: |
| 955 text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")"; | 955 text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")"; |
| 956 break; | 956 break; |
| 957 case CSS_VALUE_ID: | 957 case CSS_VALUE_ID: |
| 958 text = valueName(m_value.valueID); | 958 text = valueName(m_value.valueID); |
| 959 break; | 959 break; |
| 960 case CSS_PROPERTY_ID: | 960 case CSS_PROPERTY_ID: |
| 961 text = propertyName(m_value.propertyID); | 961 text = propertyName(m_value.propertyID); |
| 962 break; | 962 break; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 break; | 1322 break; |
| 1323 case CSS_CALC: | 1323 case CSS_CALC: |
| 1324 info.addMember(m_value.calc, "value.calc"); | 1324 info.addMember(m_value.calc, "value.calc"); |
| 1325 break; | 1325 break; |
| 1326 default: | 1326 default: |
| 1327 break; | 1327 break; |
| 1328 } | 1328 } |
| 1329 } | 1329 } |
| 1330 | 1330 |
| 1331 } // namespace WebCore | 1331 } // namespace WebCore |
| OLD | NEW |