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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 bool useSingleWordShorthand = false; | 692 bool useSingleWordShorthand = false; |
693 bool foundPositionXCSSProperty = false; | 693 bool foundPositionXCSSProperty = false; |
694 bool foundPositionYCSSProperty = false; | 694 bool foundPositionYCSSProperty = false; |
695 | 695 |
696 for (unsigned propertyIndex = 0; propertyIndex < size; propertyIndex++)
{ | 696 for (unsigned propertyIndex = 0; propertyIndex < size; propertyIndex++)
{ |
697 const CSSValue* value = nullptr; | 697 const CSSValue* value = nullptr; |
698 CSSPropertyID property = shorthand.properties()[propertyIndex]; | 698 CSSPropertyID property = shorthand.properties()[propertyIndex]; |
699 | 699 |
700 // Get a CSSValue for this property and layer. | 700 // Get a CSSValue for this property and layer. |
701 if (values[propertyIndex]->isBaseValueList()) { | 701 if (values[propertyIndex]->isBaseValueList()) { |
702 // Might return 0 if there is not an item for this layer for thi
s property. | 702 const CSSValueList* propertyValues = toCSSValueList(values[prope
rtyIndex]); |
703 value = toCSSValueList(values[propertyIndex])->itemWithBoundsChe
ck(layer); | 703 // There might not be an item for this layer for this property. |
| 704 if (layer < propertyValues->length()) |
| 705 value = propertyValues->item(layer); |
704 } else if (layer == 0 || (layer != numLayers - 1 && property == CSSP
ropertyBackgroundColor)) { | 706 } else if (layer == 0 || (layer != numLayers - 1 && property == CSSP
ropertyBackgroundColor)) { |
705 // Singletons except background color belong in the 0th layer. | 707 // Singletons except background color belong in the 0th layer. |
706 // Background color belongs in the last layer. | 708 // Background color belongs in the last layer. |
707 value = values[propertyIndex]; | 709 value = values[propertyIndex]; |
708 } | 710 } |
709 // No point proceeding if there's not a value to look at. | 711 // No point proceeding if there's not a value to look at. |
710 if (!value) | 712 if (!value) |
711 continue; | 713 continue; |
712 | 714 |
713 // Special case for background-repeat. | 715 // Special case for background-repeat. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 builder.append(", "); | 881 builder.append(", "); |
880 | 882 |
881 const CSSValue* xValue = repeatXList ? repeatXList->item(i % repeatXList
->length()) : repeatX; | 883 const CSSValue* xValue = repeatXList ? repeatXList->item(i % repeatXList
->length()) : repeatX; |
882 const CSSValue* yValue = repeatYList ? repeatYList->item(i % repeatYList
->length()) : repeatY; | 884 const CSSValue* yValue = repeatYList ? repeatYList->item(i % repeatYList
->length()) : repeatY; |
883 appendBackgroundRepeatValue(builder, *xValue, *yValue); | 885 appendBackgroundRepeatValue(builder, *xValue, *yValue); |
884 } | 886 } |
885 return builder.toString(); | 887 return builder.toString(); |
886 } | 888 } |
887 | 889 |
888 } // namespace blink | 890 } // namespace blink |
OLD | NEW |