| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 CSSPropertyListStyleType, | 150 CSSPropertyListStyleType, |
| 151 CSSPropertyMarginBottom, | 151 CSSPropertyMarginBottom, |
| 152 CSSPropertyMarginLeft, | 152 CSSPropertyMarginLeft, |
| 153 CSSPropertyMarginRight, | 153 CSSPropertyMarginRight, |
| 154 CSSPropertyMarginTop, | 154 CSSPropertyMarginTop, |
| 155 CSSPropertyMaxHeight, | 155 CSSPropertyMaxHeight, |
| 156 CSSPropertyMaxWidth, | 156 CSSPropertyMaxWidth, |
| 157 CSSPropertyMinHeight, | 157 CSSPropertyMinHeight, |
| 158 CSSPropertyMinWidth, | 158 CSSPropertyMinWidth, |
| 159 CSSPropertyMixBlendMode, | 159 CSSPropertyMixBlendMode, |
| 160 CSSPropertyObjectFit, |
| 161 CSSPropertyObjectPosition, |
| 160 CSSPropertyOpacity, | 162 CSSPropertyOpacity, |
| 161 CSSPropertyOrphans, | 163 CSSPropertyOrphans, |
| 162 CSSPropertyOutlineColor, | 164 CSSPropertyOutlineColor, |
| 163 CSSPropertyOutlineOffset, | 165 CSSPropertyOutlineOffset, |
| 164 CSSPropertyOutlineStyle, | 166 CSSPropertyOutlineStyle, |
| 165 CSSPropertyOutlineWidth, | 167 CSSPropertyOutlineWidth, |
| 166 CSSPropertyOverflowWrap, | 168 CSSPropertyOverflowWrap, |
| 167 CSSPropertyOverflowX, | 169 CSSPropertyOverflowX, |
| 168 CSSPropertyOverflowY, | 170 CSSPropertyOverflowY, |
| 169 CSSPropertyPaddingBottom, | 171 CSSPropertyPaddingBottom, |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 static PassRefPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& i
mage) | 514 static PassRefPtr<CSSValue> valueForNinePieceImageRepeat(const NinePieceImage& i
mage) |
| 513 { | 515 { |
| 514 RefPtr<CSSPrimitiveValue> horizontalRepeat; | 516 RefPtr<CSSPrimitiveValue> horizontalRepeat; |
| 515 RefPtr<CSSPrimitiveValue> verticalRepeat; | 517 RefPtr<CSSPrimitiveValue> verticalRepeat; |
| 516 | 518 |
| 517 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); | 519 horizontalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule(i
mage.horizontalRule())); |
| 518 if (image.horizontalRule() == image.verticalRule()) | 520 if (image.horizontalRule() == image.verticalRule()) |
| 519 verticalRepeat = horizontalRepeat; | 521 verticalRepeat = horizontalRepeat; |
| 520 else | 522 else |
| 521 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); | 523 verticalRepeat = cssValuePool().createIdentifierValue(valueForRepeatRule
(image.verticalRule())); |
| 522 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v
erticalRepeat.release())); | 524 return cssValuePool().createValue(Pair::create(horizontalRepeat.release(), v
erticalRepeat.release(), Pair::DropIdenticalValues)); |
| 523 } | 525 } |
| 524 | 526 |
| 525 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image,
const RenderStyle* style) | 527 static PassRefPtr<CSSValue> valueForNinePieceImage(const NinePieceImage& image,
const RenderStyle* style) |
| 526 { | 528 { |
| 527 if (!image.hasImage()) | 529 if (!image.hasImage()) |
| 528 return cssValuePool().createIdentifierValue(CSSValueNone); | 530 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 529 | 531 |
| 530 // Image first. | 532 // Image first. |
| 531 RefPtr<CSSValue> imageValue; | 533 RefPtr<CSSValue> imageValue; |
| 532 if (image.image()) | 534 if (image.image()) |
| (...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2166 if (style->minHeight().isAuto()) | 2168 if (style->minHeight().isAuto()) |
| 2167 return zoomAdjustedPixelValue(0, style.get()); | 2169 return zoomAdjustedPixelValue(0, style.get()); |
| 2168 return zoomAdjustedPixelValueForLength(style->minHeight(), style.get
()); | 2170 return zoomAdjustedPixelValueForLength(style->minHeight(), style.get
()); |
| 2169 case CSSPropertyMinWidth: | 2171 case CSSPropertyMinWidth: |
| 2170 // FIXME: For flex-items, min-width:auto should compute to min-conte
nt. | 2172 // FIXME: For flex-items, min-width:auto should compute to min-conte
nt. |
| 2171 if (style->minWidth().isAuto()) | 2173 if (style->minWidth().isAuto()) |
| 2172 return zoomAdjustedPixelValue(0, style.get()); | 2174 return zoomAdjustedPixelValue(0, style.get()); |
| 2173 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); | 2175 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); |
| 2174 case CSSPropertyObjectFit: | 2176 case CSSPropertyObjectFit: |
| 2175 return cssValuePool().createValue(style->objectFit()); | 2177 return cssValuePool().createValue(style->objectFit()); |
| 2178 case CSSPropertyObjectPosition: |
| 2179 return cssValuePool().createValue( |
| 2180 Pair::create( |
| 2181 cssValuePool().createValue(style->objectPosition().x()), |
| 2182 cssValuePool().createValue(style->objectPosition().y()), |
| 2183 Pair::KeepIdenticalValues)); |
| 2176 case CSSPropertyOpacity: | 2184 case CSSPropertyOpacity: |
| 2177 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); | 2185 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); |
| 2178 case CSSPropertyOrphans: | 2186 case CSSPropertyOrphans: |
| 2179 if (style->hasAutoOrphans()) | 2187 if (style->hasAutoOrphans()) |
| 2180 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2188 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 2181 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); | 2189 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); |
| 2182 case CSSPropertyOutlineColor: | 2190 case CSSPropertyOutlineColor: |
| 2183 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->outlineColor()); | 2191 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->outlineColor()); |
| 2184 case CSSPropertyOutlineOffset: | 2192 case CSSPropertyOutlineOffset: |
| 2185 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); | 2193 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3195 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
| 3188 CSSPropertyB
ackgroundClip }; | 3196 CSSPropertyB
ackgroundClip }; |
| 3189 | 3197 |
| 3190 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3198 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 3191 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 3199 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
| 3192 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 3200 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
| 3193 return list.release(); | 3201 return list.release(); |
| 3194 } | 3202 } |
| 3195 | 3203 |
| 3196 } // namespace WebCore | 3204 } // namespace WebCore |
| OLD | NEW |