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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 } | 879 } |
880 | 880 |
881 String StylePropertySerializer::backgroundRepeatPropertyValue() const | 881 String StylePropertySerializer::backgroundRepeatPropertyValue() const |
882 { | 882 { |
883 const CSSValue* repeatX = m_propertySet.getPropertyCSSValue(CSSPropertyBackg
roundRepeatX); | 883 const CSSValue* repeatX = m_propertySet.getPropertyCSSValue(CSSPropertyBackg
roundRepeatX); |
884 const CSSValue* repeatY = m_propertySet.getPropertyCSSValue(CSSPropertyBackg
roundRepeatY); | 884 const CSSValue* repeatY = m_propertySet.getPropertyCSSValue(CSSPropertyBackg
roundRepeatY); |
885 if (!repeatX || !repeatY) | 885 if (!repeatX || !repeatY) |
886 return String(); | 886 return String(); |
887 if (m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatX) != m_pro
pertySet.propertyIsImportant(CSSPropertyBackgroundRepeatY)) | 887 if (m_propertySet.propertyIsImportant(CSSPropertyBackgroundRepeatX) != m_pro
pertySet.propertyIsImportant(CSSPropertyBackgroundRepeatY)) |
888 return String(); | 888 return String(); |
889 if (repeatX->cssValueType() == repeatY->cssValueType() | 889 if ((repeatX->isInitialValue() && repeatY->isInitialValue()) || (repeatX->is
InheritedValue() && repeatY->isInheritedValue())) |
890 && (repeatX->cssValueType() == CSSValue::CSS_INITIAL || repeatX->cssValu
eType() == CSSValue::CSS_INHERIT)) { | |
891 return repeatX->cssText(); | 890 return repeatX->cssText(); |
892 } | |
893 | 891 |
894 const CSSValueList* repeatXList = 0; | 892 const CSSValueList* repeatXList = 0; |
895 int repeatXLength = 1; | 893 int repeatXLength = 1; |
896 if (repeatX->cssValueType() == CSSValue::CSS_VALUE_LIST) { | 894 if (repeatX->isValueList()) { |
897 repeatXList = toCSSValueList(repeatX); | 895 repeatXList = toCSSValueList(repeatX); |
898 repeatXLength = repeatXList->length(); | 896 repeatXLength = repeatXList->length(); |
899 } else if (repeatX->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) { | 897 } else if (!repeatX->isPrimitiveValue()) { |
900 return String(); | 898 return String(); |
901 } | 899 } |
902 | 900 |
903 const CSSValueList* repeatYList = 0; | 901 const CSSValueList* repeatYList = 0; |
904 int repeatYLength = 1; | 902 int repeatYLength = 1; |
905 if (repeatY->cssValueType() == CSSValue::CSS_VALUE_LIST) { | 903 if (repeatY->isValueList()) { |
906 repeatYList = toCSSValueList(repeatY); | 904 repeatYList = toCSSValueList(repeatY); |
907 repeatYLength = repeatYList->length(); | 905 repeatYLength = repeatYList->length(); |
908 } else if (repeatY->cssValueType() != CSSValue::CSS_PRIMITIVE_VALUE) { | 906 } else if (!repeatY->isPrimitiveValue()) { |
909 return String(); | 907 return String(); |
910 } | 908 } |
911 | 909 |
912 size_t shorthandLength = lowestCommonMultiple(repeatXLength, repeatYLength); | 910 size_t shorthandLength = lowestCommonMultiple(repeatXLength, repeatYLength); |
913 StringBuilder builder; | 911 StringBuilder builder; |
914 for (size_t i = 0; i < shorthandLength; ++i) { | 912 for (size_t i = 0; i < shorthandLength; ++i) { |
915 if (i) | 913 if (i) |
916 builder.appendLiteral(", "); | 914 builder.appendLiteral(", "); |
917 | 915 |
918 const CSSValue* xValue = repeatXList ? repeatXList->item(i % repeatXList
->length()) : repeatX; | 916 const CSSValue* xValue = repeatXList ? repeatXList->item(i % repeatXList
->length()) : repeatX; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 isInitialValue = false; | 1016 isInitialValue = false; |
1019 if (!value->isInheritedValue()) | 1017 if (!value->isInheritedValue()) |
1020 isInheritedValue = false; | 1018 isInheritedValue = false; |
1021 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) | 1019 if (isImportant != m_propertySet.propertyIsImportant(shorthand.propertie
s()[i])) |
1022 return false; | 1020 return false; |
1023 } | 1021 } |
1024 return isInitialValue || isInheritedValue; | 1022 return isInitialValue || isInheritedValue; |
1025 } | 1023 } |
1026 | 1024 |
1027 } | 1025 } |
OLD | NEW |