OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. | 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 CSSPropertyListStyleType, | 149 CSSPropertyListStyleType, |
150 CSSPropertyMarginBottom, | 150 CSSPropertyMarginBottom, |
151 CSSPropertyMarginLeft, | 151 CSSPropertyMarginLeft, |
152 CSSPropertyMarginRight, | 152 CSSPropertyMarginRight, |
153 CSSPropertyMarginTop, | 153 CSSPropertyMarginTop, |
154 CSSPropertyMaxHeight, | 154 CSSPropertyMaxHeight, |
155 CSSPropertyMaxWidth, | 155 CSSPropertyMaxWidth, |
156 CSSPropertyMinHeight, | 156 CSSPropertyMinHeight, |
157 CSSPropertyMinWidth, | 157 CSSPropertyMinWidth, |
158 CSSPropertyMixBlendMode, | 158 CSSPropertyMixBlendMode, |
159 CSSPropertyObjectFit, | |
160 CSSPropertyObjectPosition, | |
161 CSSPropertyOpacity, | 159 CSSPropertyOpacity, |
162 CSSPropertyOrphans, | 160 CSSPropertyOrphans, |
163 CSSPropertyOutlineColor, | 161 CSSPropertyOutlineColor, |
164 CSSPropertyOutlineOffset, | 162 CSSPropertyOutlineOffset, |
165 CSSPropertyOutlineStyle, | 163 CSSPropertyOutlineStyle, |
166 CSSPropertyOutlineWidth, | 164 CSSPropertyOutlineWidth, |
167 CSSPropertyOverflowWrap, | 165 CSSPropertyOverflowWrap, |
168 CSSPropertyOverflowX, | 166 CSSPropertyOverflowX, |
169 CSSPropertyOverflowY, | 167 CSSPropertyOverflowY, |
170 CSSPropertyPaddingBottom, | 168 CSSPropertyPaddingBottom, |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 static PassRefPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& i
mage) | 514 static PassRefPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& i
mage) |
517 { | 515 { |
518 RefPtr<CSSPrimitiveValue> horizontalRepeat; | 516 RefPtr<CSSPrimitiveValue> horizontalRepeat; |
519 RefPtr<CSSPrimitiveValue> verticalRepeat; | 517 RefPtr<CSSPrimitiveValue> verticalRepeat; |
520 | 518 |
521 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); | 519 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); |
522 if (image.horizontalRule() == image.verticalRule()) | 520 if (image.horizontalRule() == image.verticalRule()) |
523 verticalRepeat = horizontalRepeat; | 521 verticalRepeat = horizontalRepeat; |
524 else | 522 else |
525 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); | 523 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); |
526 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v
erticalRepeat.release(), Pair::DropIdenticalValues)); | 524 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v
erticalRepeat.release())); |
527 } | 525 } |
528 | 526 |
529 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image,
const RenderStyle* style) | 527 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image,
const RenderStyle* style) |
530 { | 528 { |
531 if (!image.hasImage()) | 529 if (!image.hasImage()) |
532 return cssValuePool().createIdentifierValue(CSSValueNone); | 530 return cssValuePool().createIdentifierValue(CSSValueNone); |
533 | 531 |
534 // Image first. | 532 // Image first. |
535 RefPtr<CSSValue> imageValue; | 533 RefPtr<CSSValue> imageValue; |
536 if (image.image()) | 534 if (image.image()) |
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2178 if (style->minHeight().isAuto()) | 2176 if (style->minHeight().isAuto()) |
2179 return zoomAdjustedPixelValue(0, style.get()); | 2177 return zoomAdjustedPixelValue(0, style.get()); |
2180 return zoomAdjustedPixelValueForLength(style->minHeight(), style.get
()); | 2178 return zoomAdjustedPixelValueForLength(style->minHeight(), style.get
()); |
2181 case CSSPropertyMinWidth: | 2179 case CSSPropertyMinWidth: |
2182 // FIXME: For flex-items, min-width:auto should compute to min-conte
nt. | 2180 // FIXME: For flex-items, min-width:auto should compute to min-conte
nt. |
2183 if (style->minWidth().isAuto()) | 2181 if (style->minWidth().isAuto()) |
2184 return zoomAdjustedPixelValue(0, style.get()); | 2182 return zoomAdjustedPixelValue(0, style.get()); |
2185 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); | 2183 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); |
2186 case CSSPropertyObjectFit: | 2184 case CSSPropertyObjectFit: |
2187 return cssValuePool().createValue(style->objectFit()); | 2185 return cssValuePool().createValue(style->objectFit()); |
2188 case CSSPropertyObjectPosition: | |
2189 return cssValuePool().createValue( | |
2190 Pair::create( | |
2191 cssValuePool().createValue(style->objectPosition().x()), | |
2192 cssValuePool().createValue(style->objectPosition().y()), | |
2193 Pair::KeepIdenticalValues)); | |
2194 case CSSPropertyOpacity: | 2186 case CSSPropertyOpacity: |
2195 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); | 2187 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); |
2196 case CSSPropertyOrphans: | 2188 case CSSPropertyOrphans: |
2197 if (style->hasAutoOrphans()) | 2189 if (style->hasAutoOrphans()) |
2198 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2190 return cssValuePool().createIdentifierValue(CSSValueAuto); |
2199 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); | 2191 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); |
2200 case CSSPropertyOutlineColor: | 2192 case CSSPropertyOutlineColor: |
2201 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->outlineColor()); | 2193 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->outlineColor()); |
2202 case CSSPropertyOutlineOffset: | 2194 case CSSPropertyOutlineOffset: |
2203 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); | 2195 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3202 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3194 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
3203 CSSPropertyB
ackgroundClip }; | 3195 CSSPropertyB
ackgroundClip }; |
3204 | 3196 |
3205 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3197 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
3206 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 3198 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
3207 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 3199 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
3208 return list.release(); | 3200 return list.release(); |
3209 } | 3201 } |
3210 | 3202 |
3211 } // namespace WebCore | 3203 } // namespace WebCore |
OLD | NEW |