| 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, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
| 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. | 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. |
| 5 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 5 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 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 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 #include "config.h" | 23 #include "config.h" |
| 24 #include "core/css/StylePropertySerializer.h" | 24 #include "core/css/StylePropertySerializer.h" |
| 25 | 25 |
| 26 #include "core/CSSValueKeywords.h" | 26 #include "core/CSSValueKeywords.h" |
| 27 #include "core/StylePropertyShorthand.h" | 27 #include "core/StylePropertyShorthand.h" |
| 28 #include "core/css/CSSCustomPropertyDeclaration.h" | 28 #include "core/css/CSSCustomPropertyDeclaration.h" |
| 29 #include "core/css/CSSPropertyMetadata.h" | 29 #include "core/css/CSSPropertyMetadata.h" |
| 30 #include "core/css/CSSValuePool.h" | 30 #include "core/css/CSSValuePool.h" |
| 31 #include "wtf/BitArray.h" | 31 #include "wtf/BitArray.h" |
| 32 #include "wtf/LeakAnnotations.h" |
| 32 #include "wtf/text/StringBuilder.h" | 33 #include "wtf/text/StringBuilder.h" |
| 33 | 34 |
| 34 namespace blink { | 35 namespace blink { |
| 35 | 36 |
| 36 static bool isInitialOrInherit(const String& value) | 37 static bool isInitialOrInherit(const String& value) |
| 37 { | 38 { |
| 38 DEFINE_STATIC_LOCAL(String, initial, ("initial")); | 39 DEFINE_STATIC_LOCAL(String, initial, ("initial")); |
| 39 DEFINE_STATIC_LOCAL(String, inherit, ("inherit")); | 40 DEFINE_STATIC_LOCAL(String, inherit, ("inherit")); |
| 40 return value.length() == 7 && (value == initial || value == inherit); | 41 return value.length() == 7 && (value == initial || value == inherit); |
| 41 } | 42 } |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 result.append(' '); | 828 result.append(' '); |
| 828 result.append(value); | 829 result.append(value); |
| 829 } | 830 } |
| 830 if (isInitialOrInherit(commonValue)) | 831 if (isInitialOrInherit(commonValue)) |
| 831 return commonValue; | 832 return commonValue; |
| 832 return result.isEmpty() ? String() : result.toString(); | 833 return result.isEmpty() ? String() : result.toString(); |
| 833 } | 834 } |
| 834 | 835 |
| 835 static void appendBackgroundRepeatValue(StringBuilder& builder, const CSSValue&
repeatXCSSValue, const CSSValue& repeatYCSSValue) | 836 static void appendBackgroundRepeatValue(StringBuilder& builder, const CSSValue&
repeatXCSSValue, const CSSValue& repeatYCSSValue) |
| 836 { | 837 { |
| 838 WTF_ANNOTATE_SCOPED_MEMORY_LEAK; |
| 837 // FIXME: Ensure initial values do not appear in CSS_VALUE_LISTS. | 839 // FIXME: Ensure initial values do not appear in CSS_VALUE_LISTS. |
| 838 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, initialRepeatValue,
(CSSPrimitiveValue::createIdentifier(CSSValueRepeat))); | 840 DEFINE_STATIC_REF_WILL_BE_PERSISTENT(CSSPrimitiveValue, initialRepeatValue,
(CSSPrimitiveValue::createIdentifier(CSSValueRepeat))); |
| 839 const CSSPrimitiveValue& repeatX = repeatXCSSValue.isInitialValue() ? *initi
alRepeatValue : toCSSPrimitiveValue(repeatXCSSValue); | 841 const CSSPrimitiveValue& repeatX = repeatXCSSValue.isInitialValue() ? *initi
alRepeatValue : toCSSPrimitiveValue(repeatXCSSValue); |
| 840 const CSSPrimitiveValue& repeatY = repeatYCSSValue.isInitialValue() ? *initi
alRepeatValue : toCSSPrimitiveValue(repeatYCSSValue); | 842 const CSSPrimitiveValue& repeatY = repeatYCSSValue.isInitialValue() ? *initi
alRepeatValue : toCSSPrimitiveValue(repeatYCSSValue); |
| 841 CSSValueID repeatXValueId = repeatX.getValueID(); | 843 CSSValueID repeatXValueId = repeatX.getValueID(); |
| 842 CSSValueID repeatYValueId = repeatY.getValueID(); | 844 CSSValueID repeatYValueId = repeatY.getValueID(); |
| 843 if (repeatXValueId == repeatYValueId) { | 845 if (repeatXValueId == repeatYValueId) { |
| 844 builder.append(repeatX.cssText()); | 846 builder.append(repeatX.cssText()); |
| 845 } else if (repeatXValueId == CSSValueNoRepeat && repeatYValueId == CSSValueR
epeat) { | 847 } else if (repeatXValueId == CSSValueNoRepeat && repeatYValueId == CSSValueR
epeat) { |
| 846 builder.appendLiteral("repeat-y"); | 848 builder.appendLiteral("repeat-y"); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 991 isInitialValue = false; | 993 isInitialValue = false; |
| 992 if (!value->isInheritedValue()) | 994 if (!value->isInheritedValue()) |
| 993 isInheritedValue = false; | 995 isInheritedValue = false; |
| 994 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 996 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
| 995 return false; | 997 return false; |
| 996 } | 998 } |
| 997 return isInitialValue || isInheritedValue; | 999 return isInitialValue || isInheritedValue; |
| 998 } | 1000 } |
| 999 | 1001 |
| 1000 } | 1002 } |
| OLD | NEW |