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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 if (l.isAuto()) { | 640 if (l.isAuto()) { |
641 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 641 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
642 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). | 642 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). |
643 // So we should get the opposite length unit and see if it is auto. | 643 // So we should get the opposite length unit and see if it is auto. |
644 return cssValuePool().createValue(l); | 644 return cssValuePool().createValue(l); |
645 } | 645 } |
646 | 646 |
647 return zoomAdjustedPixelValueForLength(l, style); | 647 return zoomAdjustedPixelValueForLength(l, style); |
648 } | 648 } |
649 | 649 |
650 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(RenderStyle* style, const Color& color) const | 650 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(RenderStyle* style, const StyleColor& color) const |
651 { | 651 { |
652 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. | 652 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. |
653 if (!color.isValid()) | 653 if (!color.isValid()) |
654 return cssValuePool().createColorValue(style->color().rgb()); | 654 return cssValuePool().createColorValue(style->color().rgb()); |
655 return cssValuePool().createColorValue(color.rgb()); | 655 return cssValuePool().createColorValue(color.rgb()); |
656 } | 656 } |
657 | 657 |
| 658 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(const RenderObject* renderer, const RenderStyle* style, int colorProperty) c
onst |
| 659 { |
| 660 Color color; |
| 661 if (renderer) { |
| 662 if (m_allowVisitedStyle) |
| 663 color = renderer->resolveColor(colorProperty); |
| 664 else |
| 665 color = renderer->resolveColor(style->colorIncludingFallback(colorPr
operty, false /* visited */)); |
| 666 } else { |
| 667 if (m_allowVisitedStyle) |
| 668 color = style->visitedDependentColor(colorProperty).color(); |
| 669 else |
| 670 color = style->colorIncludingFallback(colorProperty, false /* visite
d */).color(); |
| 671 } |
| 672 return cssValuePool().createColorValue(color.rgb()); |
| 673 } |
| 674 |
658 static PassRefPtr<CSSValueList> getBorderRadiusCornerValues(LengthSize radius, c
onst RenderStyle* style, RenderView* renderView) | 675 static PassRefPtr<CSSValueList> getBorderRadiusCornerValues(LengthSize radius, c
onst RenderStyle* style, RenderView* renderView) |
659 { | 676 { |
660 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 677 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
661 if (radius.width().type() == Percent) | 678 if (radius.width().type() == Percent) |
662 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::CSS_PERCENTAGE)); | 679 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::CSS_PERCENTAGE)); |
663 else | 680 else |
664 list->append(zoomAdjustedPixelValue(valueForLength(radius.width(), 0, re
nderView), style)); | 681 list->append(zoomAdjustedPixelValue(valueForLength(radius.width(), 0, re
nderView), style)); |
665 if (radius.height().type() == Percent) | 682 if (radius.height().type() == Percent) |
666 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::CSS_PERCENTAGE)); | 683 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::CSS_PERCENTAGE)); |
667 else | 684 else |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation
*>(filterOperation); | 921 BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation
*>(filterOperation); |
905 filterValue = CSSFilterValue::create(CSSFilterValue::BlurFilterOpera
tion); | 922 filterValue = CSSFilterValue::create(CSSFilterValue::BlurFilterOpera
tion); |
906 filterValue->append(zoomAdjustedPixelValue(blurOperation->stdDeviati
on().value(), style)); | 923 filterValue->append(zoomAdjustedPixelValue(blurOperation->stdDeviati
on().value(), style)); |
907 break; | 924 break; |
908 } | 925 } |
909 case FilterOperation::DROP_SHADOW: { | 926 case FilterOperation::DROP_SHADOW: { |
910 DropShadowFilterOperation* dropShadowOperation = static_cast<DropSha
dowFilterOperation*>(filterOperation); | 927 DropShadowFilterOperation* dropShadowOperation = static_cast<DropSha
dowFilterOperation*>(filterOperation); |
911 filterValue = CSSFilterValue::create(CSSFilterValue::DropShadowFilte
rOperation); | 928 filterValue = CSSFilterValue::create(CSSFilterValue::DropShadowFilte
rOperation); |
912 // We want our computed style to look like that of a text shadow (ha
s neither spread nor inset style). | 929 // We want our computed style to look like that of a text shadow (ha
s neither spread nor inset style). |
913 OwnPtr<ShadowData> shadow = ShadowData::create(dropShadowOperation->
location(), dropShadowOperation->stdDeviation(), 0, Normal, dropShadowOperation-
>color()); | 930 OwnPtr<ShadowData> shadow = ShadowData::create(dropShadowOperation->
location(), dropShadowOperation->stdDeviation(), 0, Normal, dropShadowOperation-
>color()); |
914 filterValue->append(valueForShadow(shadow.get(), CSSPropertyTextShad
ow, style)); | 931 filterValue->append(valueForShadow(renderer, shadow.get(), CSSProper
tyTextShadow, style)); |
915 break; | 932 break; |
916 } | 933 } |
917 case FilterOperation::VALIDATED_CUSTOM: | 934 case FilterOperation::VALIDATED_CUSTOM: |
918 // ValidatedCustomFilterOperation is not supposed to end up in the R
enderStyle. | 935 // ValidatedCustomFilterOperation is not supposed to end up in the R
enderStyle. |
919 ASSERT_NOT_REACHED(); | 936 ASSERT_NOT_REACHED(); |
920 break; | 937 break; |
921 case FilterOperation::CUSTOM: { | 938 case FilterOperation::CUSTOM: { |
922 CustomFilterOperation* customOperation = static_cast<CustomFilterOpe
ration*>(filterOperation); | 939 CustomFilterOperation* customOperation = static_cast<CustomFilterOpe
ration*>(filterOperation); |
923 filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOpe
ration); | 940 filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOpe
ration); |
924 | 941 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 if (!m_node) | 1267 if (!m_node) |
1251 return false; | 1268 return false; |
1252 | 1269 |
1253 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); | 1270 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); |
1254 if (!style) | 1271 if (!style) |
1255 return false; | 1272 return false; |
1256 | 1273 |
1257 return style->fontDescription().useFixedDefaultSize(); | 1274 return style->fontDescription().useFixedDefaultSize(); |
1258 } | 1275 } |
1259 | 1276 |
1260 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowDat
a* shadow, CSSPropertyID propertyID, const RenderStyle* style) const | 1277 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const RenderObj
ect* renderer, const ShadowData* shadow, CSSPropertyID propertyID, const RenderS
tyle* style) const |
1261 { | 1278 { |
1262 if (!shadow) | 1279 if (!shadow) |
1263 return cssValuePool().createIdentifierValue(CSSValueNone); | 1280 return cssValuePool().createIdentifierValue(CSSValueNone); |
1264 | 1281 |
1265 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1282 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
1266 for (const ShadowData* s = shadow; s; s = s->next()) { | 1283 for (const ShadowData* s = shadow; s; s = s->next()) { |
1267 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style); | 1284 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style); |
1268 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style); | 1285 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style); |
1269 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style
); | 1286 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style
); |
1270 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ?
PassRefPtr<CSSPrimitiveValue>() : zoomAdjustedPixelValue(s->spread(), style); | 1287 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ?
PassRefPtr<CSSPrimitiveValue>() : zoomAdjustedPixelValue(s->spread(), style); |
1271 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow ||
s->style() == Normal ? PassRefPtr<CSSPrimitiveValue>() : cssValuePool().createI
dentifierValue(CSSValueInset); | 1288 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow ||
s->style() == Normal ? PassRefPtr<CSSPrimitiveValue>() : cssValuePool().createI
dentifierValue(CSSValueInset); |
1272 RefPtr<CSSPrimitiveValue> color = cssValuePool().createColorValue(s->col
or().rgb()); | 1289 RefPtr<CSSPrimitiveValue> color = cssValuePool().createColorValue(render
er ? renderer->resolveColor(s->color()).rgb() : s->color().rgb()); |
1273 list->prepend(ShadowValue::create(x.release(), y.release(), blur.release
(), spread.release(), style.release(), color.release())); | 1290 list->prepend(ShadowValue::create(x.release(), y.release(), blur.release
(), spread.release(), style.release(), color.release())); |
1274 } | 1291 } |
1275 return list.release(); | 1292 return list.release(); |
1276 } | 1293 } |
1277 | 1294 |
1278 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
yID propertyID) const | 1295 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
yID propertyID) const |
1279 { | 1296 { |
1280 return getPropertyCSSValue(propertyID, UpdateLayout); | 1297 return getPropertyCSSValue(propertyID, UpdateLayout); |
1281 } | 1298 } |
1282 | 1299 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 return 0; | 1612 return 0; |
1596 | 1613 |
1597 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); | 1614 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); |
1598 | 1615 |
1599 switch (propertyID) { | 1616 switch (propertyID) { |
1600 case CSSPropertyInvalid: | 1617 case CSSPropertyInvalid: |
1601 case CSSPropertyVariable: | 1618 case CSSPropertyVariable: |
1602 break; | 1619 break; |
1603 | 1620 |
1604 case CSSPropertyBackgroundColor: | 1621 case CSSPropertyBackgroundColor: |
1605 return cssValuePool().createColorValue(m_allowVisitedStyle? style->v
isitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor(
).rgb()); | 1622 return cssValuePool().createColorValue(renderer->resolveColor(m_allo
wVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() :
style->backgroundColor()).rgb()); |
1606 case CSSPropertyBackgroundImage: | 1623 case CSSPropertyBackgroundImage: |
1607 case CSSPropertyWebkitMaskImage: { | 1624 case CSSPropertyWebkitMaskImage: { |
1608 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskImage ?
style->maskLayers() : style->backgroundLayers(); | 1625 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskImage ?
style->maskLayers() : style->backgroundLayers(); |
1609 if (!layers) | 1626 if (!layers) |
1610 return cssValuePool().createIdentifierValue(CSSValueNone); | 1627 return cssValuePool().createIdentifierValue(CSSValueNone); |
1611 | 1628 |
1612 if (!layers->next()) { | 1629 if (!layers->next()) { |
1613 if (layers->image()) | 1630 if (layers->image()) |
1614 return layers->image()->cssValue(); | 1631 return layers->image()->cssValue(); |
1615 | 1632 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 } | 1758 } |
1742 case CSSPropertyWebkitBorderHorizontalSpacing: | 1759 case CSSPropertyWebkitBorderHorizontalSpacing: |
1743 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), styl
e.get()); | 1760 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), styl
e.get()); |
1744 case CSSPropertyWebkitBorderVerticalSpacing: | 1761 case CSSPropertyWebkitBorderVerticalSpacing: |
1745 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.
get()); | 1762 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.
get()); |
1746 case CSSPropertyBorderImageSource: | 1763 case CSSPropertyBorderImageSource: |
1747 if (style->borderImageSource()) | 1764 if (style->borderImageSource()) |
1748 return style->borderImageSource()->cssValue(); | 1765 return style->borderImageSource()->cssValue(); |
1749 return cssValuePool().createIdentifierValue(CSSValueNone); | 1766 return cssValuePool().createIdentifierValue(CSSValueNone); |
1750 case CSSPropertyBorderTopColor: | 1767 case CSSPropertyBorderTopColor: |
1751 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidCol
or(style.get(), style->borderTopColor()); | 1768 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderTopColor); |
1752 case CSSPropertyBorderRightColor: | 1769 case CSSPropertyBorderRightColor: |
1753 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidC
olor(style.get(), style->borderRightColor()); | 1770 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderRightColor); |
1754 case CSSPropertyBorderBottomColor: | 1771 case CSSPropertyBorderBottomColor: |
1755 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValid
Color(style.get(), style->borderBottomColor()); | 1772 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderBottomColor); |
1756 case CSSPropertyBorderLeftColor: | 1773 case CSSPropertyBorderLeftColor: |
1757 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidCo
lor(style.get(), style->borderLeftColor()); | 1774 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderLeftColor); |
1758 case CSSPropertyBorderTopStyle: | 1775 case CSSPropertyBorderTopStyle: |
1759 return cssValuePool().createValue(style->borderTopStyle()); | 1776 return cssValuePool().createValue(style->borderTopStyle()); |
1760 case CSSPropertyBorderRightStyle: | 1777 case CSSPropertyBorderRightStyle: |
1761 return cssValuePool().createValue(style->borderRightStyle()); | 1778 return cssValuePool().createValue(style->borderRightStyle()); |
1762 case CSSPropertyBorderBottomStyle: | 1779 case CSSPropertyBorderBottomStyle: |
1763 return cssValuePool().createValue(style->borderBottomStyle()); | 1780 return cssValuePool().createValue(style->borderBottomStyle()); |
1764 case CSSPropertyBorderLeftStyle: | 1781 case CSSPropertyBorderLeftStyle: |
1765 return cssValuePool().createValue(style->borderLeftStyle()); | 1782 return cssValuePool().createValue(style->borderLeftStyle()); |
1766 case CSSPropertyBorderTopWidth: | 1783 case CSSPropertyBorderTopWidth: |
1767 return zoomAdjustedPixelValue(style->borderTopWidth(), style.get()); | 1784 return zoomAdjustedPixelValue(style->borderTopWidth(), style.get()); |
(...skipping 22 matching lines...) Expand all Loading... |
1790 case CSSPropertyWebkitBoxOrdinalGroup: | 1807 case CSSPropertyWebkitBoxOrdinalGroup: |
1791 return cssValuePool().createValue(style->boxOrdinalGroup(), CSSPrimi
tiveValue::CSS_NUMBER); | 1808 return cssValuePool().createValue(style->boxOrdinalGroup(), CSSPrimi
tiveValue::CSS_NUMBER); |
1792 case CSSPropertyWebkitBoxOrient: | 1809 case CSSPropertyWebkitBoxOrient: |
1793 return cssValuePool().createValue(style->boxOrient()); | 1810 return cssValuePool().createValue(style->boxOrient()); |
1794 case CSSPropertyWebkitBoxPack: | 1811 case CSSPropertyWebkitBoxPack: |
1795 return cssValuePool().createValue(style->boxPack()); | 1812 return cssValuePool().createValue(style->boxPack()); |
1796 case CSSPropertyWebkitBoxReflect: | 1813 case CSSPropertyWebkitBoxReflect: |
1797 return valueForReflection(style->boxReflect(), style.get()); | 1814 return valueForReflection(style->boxReflect(), style.get()); |
1798 case CSSPropertyBoxShadow: | 1815 case CSSPropertyBoxShadow: |
1799 case CSSPropertyWebkitBoxShadow: | 1816 case CSSPropertyWebkitBoxShadow: |
1800 return valueForShadow(style->boxShadow(), propertyID, style.get()); | 1817 return valueForShadow(renderer, style->boxShadow(), propertyID, styl
e.get()); |
1801 case CSSPropertyCaptionSide: | 1818 case CSSPropertyCaptionSide: |
1802 return cssValuePool().createValue(style->captionSide()); | 1819 return cssValuePool().createValue(style->captionSide()); |
1803 case CSSPropertyClear: | 1820 case CSSPropertyClear: |
1804 return cssValuePool().createValue(style->clear()); | 1821 return cssValuePool().createValue(style->clear()); |
1805 case CSSPropertyColor: | 1822 case CSSPropertyColor: |
1806 return cssValuePool().createColorValue(m_allowVisitedStyle ? style->
visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); | 1823 return cssValuePool().createColorValue(m_allowVisitedStyle ? style->
visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); |
1807 case CSSPropertyWebkitPrintColorAdjust: | 1824 case CSSPropertyWebkitPrintColorAdjust: |
1808 return cssValuePool().createValue(style->printColorAdjust()); | 1825 return cssValuePool().createValue(style->printColorAdjust()); |
1809 case CSSPropertyWebkitColumnAxis: | 1826 case CSSPropertyWebkitColumnAxis: |
1810 return cssValuePool().createValue(style->columnAxis()); | 1827 return cssValuePool().createValue(style->columnAxis()); |
1811 case CSSPropertyWebkitColumnCount: | 1828 case CSSPropertyWebkitColumnCount: |
1812 if (style->hasAutoColumnCount()) | 1829 if (style->hasAutoColumnCount()) |
1813 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1830 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1814 return cssValuePool().createValue(style->columnCount(), CSSPrimitive
Value::CSS_NUMBER); | 1831 return cssValuePool().createValue(style->columnCount(), CSSPrimitive
Value::CSS_NUMBER); |
1815 case CSSPropertyWebkitColumnGap: | 1832 case CSSPropertyWebkitColumnGap: |
1816 if (style->hasNormalColumnGap()) | 1833 if (style->hasNormalColumnGap()) |
1817 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1834 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1818 return zoomAdjustedPixelValue(style->columnGap(), style.get()); | 1835 return zoomAdjustedPixelValue(style->columnGap(), style.get()); |
1819 case CSSPropertyWebkitColumnProgression: | 1836 case CSSPropertyWebkitColumnProgression: |
1820 return cssValuePool().createValue(style->columnProgression()); | 1837 return cssValuePool().createValue(style->columnProgression()); |
1821 case CSSPropertyWebkitColumnRuleColor: | 1838 case CSSPropertyWebkitColumnRuleColor: |
1822 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->columnRuleColor()); | 1839 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitColumnRuleColor); |
1823 case CSSPropertyWebkitColumnRuleStyle: | 1840 case CSSPropertyWebkitColumnRuleStyle: |
1824 return cssValuePool().createValue(style->columnRuleStyle()); | 1841 return cssValuePool().createValue(style->columnRuleStyle()); |
1825 case CSSPropertyWebkitColumnRuleWidth: | 1842 case CSSPropertyWebkitColumnRuleWidth: |
1826 return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get())
; | 1843 return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get())
; |
1827 case CSSPropertyWebkitColumnSpan: | 1844 case CSSPropertyWebkitColumnSpan: |
1828 return cssValuePool().createIdentifierValue(style->columnSpan() ? CS
SValueAll : CSSValueNone); | 1845 return cssValuePool().createIdentifierValue(style->columnSpan() ? CS
SValueAll : CSSValueNone); |
1829 case CSSPropertyWebkitColumnBreakAfter: | 1846 case CSSPropertyWebkitColumnBreakAfter: |
1830 return cssValuePool().createValue(style->columnBreakAfter()); | 1847 return cssValuePool().createValue(style->columnBreakAfter()); |
1831 case CSSPropertyWebkitColumnBreakBefore: | 1848 case CSSPropertyWebkitColumnBreakBefore: |
1832 return cssValuePool().createValue(style->columnBreakBefore()); | 1849 return cssValuePool().createValue(style->columnBreakBefore()); |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2091 if (style->minWidth().isAuto()) | 2108 if (style->minWidth().isAuto()) |
2092 return zoomAdjustedPixelValue(0, style.get()); | 2109 return zoomAdjustedPixelValue(0, style.get()); |
2093 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); | 2110 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); |
2094 case CSSPropertyOpacity: | 2111 case CSSPropertyOpacity: |
2095 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); | 2112 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); |
2096 case CSSPropertyOrphans: | 2113 case CSSPropertyOrphans: |
2097 if (style->hasAutoOrphans()) | 2114 if (style->hasAutoOrphans()) |
2098 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2115 return cssValuePool().createIdentifierValue(CSSValueAuto); |
2099 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); | 2116 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); |
2100 case CSSPropertyOutlineColor: | 2117 case CSSPropertyOutlineColor: |
2101 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->outlineColor()); | 2118 return currentColorOrValidColor(renderer, style.get(), CSSPropertyOu
tlineColor); |
2102 case CSSPropertyOutlineOffset: | 2119 case CSSPropertyOutlineOffset: |
2103 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); | 2120 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); |
2104 case CSSPropertyOutlineStyle: | 2121 case CSSPropertyOutlineStyle: |
2105 if (style->outlineStyleIsAuto()) | 2122 if (style->outlineStyleIsAuto()) |
2106 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2123 return cssValuePool().createIdentifierValue(CSSValueAuto); |
2107 return cssValuePool().createValue(style->outlineStyle()); | 2124 return cssValuePool().createValue(style->outlineStyle()); |
2108 case CSSPropertyOutlineWidth: | 2125 case CSSPropertyOutlineWidth: |
2109 return zoomAdjustedPixelValue(style->outlineWidth(), style.get()); | 2126 return zoomAdjustedPixelValue(style->outlineWidth(), style.get()); |
2110 case CSSPropertyOverflow: | 2127 case CSSPropertyOverflow: |
2111 return cssValuePool().createValue(max(style->overflowX(), style->ove
rflowY())); | 2128 return cssValuePool().createValue(max(style->overflowX(), style->ove
rflowY())); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2169 return renderTextDecorationStyleFlagsToCSSValue(style->textDecoratio
nStyle()); | 2186 return renderTextDecorationStyleFlagsToCSSValue(style->textDecoratio
nStyle()); |
2170 case CSSPropertyTextDecorationColor: | 2187 case CSSPropertyTextDecorationColor: |
2171 return currentColorOrValidColor(style.get(), style->textDecorationCo
lor()); | 2188 return currentColorOrValidColor(style.get(), style->textDecorationCo
lor()); |
2172 #if ENABLE(CSS3_TEXT) | 2189 #if ENABLE(CSS3_TEXT) |
2173 case CSSPropertyWebkitTextUnderlinePosition: | 2190 case CSSPropertyWebkitTextUnderlinePosition: |
2174 return cssValuePool().createValue(style->textUnderlinePosition()); | 2191 return cssValuePool().createValue(style->textUnderlinePosition()); |
2175 #endif // CSS3_TEXT | 2192 #endif // CSS3_TEXT |
2176 case CSSPropertyWebkitTextDecorationsInEffect: | 2193 case CSSPropertyWebkitTextDecorationsInEffect: |
2177 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE
ffect()); | 2194 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE
ffect()); |
2178 case CSSPropertyWebkitTextFillColor: | 2195 case CSSPropertyWebkitTextFillColor: |
2179 return currentColorOrValidColor(style.get(), style->textFillColor())
; | 2196 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTextFillColor); |
2180 case CSSPropertyWebkitTextEmphasisColor: | 2197 case CSSPropertyWebkitTextEmphasisColor: |
2181 return currentColorOrValidColor(style.get(), style->textEmphasisColo
r()); | 2198 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTextEmphasisColor); |
2182 case CSSPropertyWebkitTextEmphasisPosition: | 2199 case CSSPropertyWebkitTextEmphasisPosition: |
2183 return cssValuePool().createValue(style->textEmphasisPosition()); | 2200 return cssValuePool().createValue(style->textEmphasisPosition()); |
2184 case CSSPropertyWebkitTextEmphasisStyle: | 2201 case CSSPropertyWebkitTextEmphasisStyle: |
2185 switch (style->textEmphasisMark()) { | 2202 switch (style->textEmphasisMark()) { |
2186 case TextEmphasisMarkNone: | 2203 case TextEmphasisMarkNone: |
2187 return cssValuePool().createIdentifierValue(CSSValueNone); | 2204 return cssValuePool().createIdentifierValue(CSSValueNone); |
2188 case TextEmphasisMarkCustom: | 2205 case TextEmphasisMarkCustom: |
2189 return cssValuePool().createValue(style->textEmphasisCustomMark(
), CSSPrimitiveValue::CSS_STRING); | 2206 return cssValuePool().createValue(style->textEmphasisCustomMark(
), CSSPrimitiveValue::CSS_STRING); |
2190 case TextEmphasisMarkAuto: | 2207 case TextEmphasisMarkAuto: |
2191 ASSERT_NOT_REACHED(); | 2208 ASSERT_NOT_REACHED(); |
(...skipping 15 matching lines...) Expand all Loading... |
2207 if (style->textIndentLine() == TextIndentEachLine) { | 2224 if (style->textIndentLine() == TextIndentEachLine) { |
2208 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 2225 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
2209 list->append(textIndent.release()); | 2226 list->append(textIndent.release()); |
2210 list->append(cssValuePool().createIdentifierValue(CSSValueWebkit
EachLine)); | 2227 list->append(cssValuePool().createIdentifierValue(CSSValueWebkit
EachLine)); |
2211 return list.release(); | 2228 return list.release(); |
2212 } | 2229 } |
2213 #endif | 2230 #endif |
2214 return textIndent.release(); | 2231 return textIndent.release(); |
2215 } | 2232 } |
2216 case CSSPropertyTextShadow: | 2233 case CSSPropertyTextShadow: |
2217 return valueForShadow(style->textShadow(), propertyID, style.get()); | 2234 return valueForShadow(renderer, style->textShadow(), propertyID, sty
le.get()); |
2218 case CSSPropertyTextRendering: | 2235 case CSSPropertyTextRendering: |
2219 return cssValuePool().createValue(style->fontDescription().textRende
ringMode()); | 2236 return cssValuePool().createValue(style->fontDescription().textRende
ringMode()); |
2220 case CSSPropertyTextOverflow: | 2237 case CSSPropertyTextOverflow: |
2221 if (style->textOverflow()) | 2238 if (style->textOverflow()) |
2222 return cssValuePool().createIdentifierValue(CSSValueEllipsis); | 2239 return cssValuePool().createIdentifierValue(CSSValueEllipsis); |
2223 return cssValuePool().createIdentifierValue(CSSValueClip); | 2240 return cssValuePool().createIdentifierValue(CSSValueClip); |
2224 case CSSPropertyWebkitTextSecurity: | 2241 case CSSPropertyWebkitTextSecurity: |
2225 return cssValuePool().createValue(style->textSecurity()); | 2242 return cssValuePool().createValue(style->textSecurity()); |
2226 case CSSPropertyWebkitTextStrokeColor: | 2243 case CSSPropertyWebkitTextStrokeColor: |
2227 return currentColorOrValidColor(style.get(), style->textStrokeColor(
)); | 2244 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTextStrokeColor); |
2228 case CSSPropertyWebkitTextStrokeWidth: | 2245 case CSSPropertyWebkitTextStrokeWidth: |
2229 return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get())
; | 2246 return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get())
; |
2230 case CSSPropertyTextTransform: | 2247 case CSSPropertyTextTransform: |
2231 return cssValuePool().createValue(style->textTransform()); | 2248 return cssValuePool().createValue(style->textTransform()); |
2232 case CSSPropertyTop: | 2249 case CSSPropertyTop: |
2233 return getPositionOffsetValue(style.get(), CSSPropertyTop, renderer,
m_node->document()->renderView()); | 2250 return getPositionOffsetValue(style.get(), CSSPropertyTop, renderer,
m_node->document()->renderView()); |
2234 case CSSPropertyTouchAction: | 2251 case CSSPropertyTouchAction: |
2235 return cssValuePool().createValue(style->touchAction()); | 2252 return cssValuePool().createValue(style->touchAction()); |
2236 case CSSPropertyUnicodeBidi: | 2253 case CSSPropertyUnicodeBidi: |
2237 return cssValuePool().createValue(style->unicodeBidi()); | 2254 return cssValuePool().createValue(style->unicodeBidi()); |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2463 else { | 2480 else { |
2464 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginX(), style.get())); | 2481 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginX(), style.get())); |
2465 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginY(), style.get())); | 2482 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginY(), style.get())); |
2466 | 2483 |
2467 } | 2484 } |
2468 return list.release(); | 2485 return list.release(); |
2469 } | 2486 } |
2470 case CSSPropertyWebkitRtlOrdering: | 2487 case CSSPropertyWebkitRtlOrdering: |
2471 return cssValuePool().createIdentifierValue(style->rtlOrdering() ? C
SSValueVisual : CSSValueLogical); | 2488 return cssValuePool().createIdentifierValue(style->rtlOrdering() ? C
SSValueVisual : CSSValueLogical); |
2472 case CSSPropertyWebkitTapHighlightColor: | 2489 case CSSPropertyWebkitTapHighlightColor: |
2473 return currentColorOrValidColor(style.get(), style->tapHighlightColo
r()); | 2490 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTapHighlightColor); |
2474 case CSSPropertyWebkitUserDrag: | 2491 case CSSPropertyWebkitUserDrag: |
2475 return cssValuePool().createValue(style->userDrag()); | 2492 return cssValuePool().createValue(style->userDrag()); |
2476 case CSSPropertyWebkitUserSelect: | 2493 case CSSPropertyWebkitUserSelect: |
2477 return cssValuePool().createValue(style->userSelect()); | 2494 return cssValuePool().createValue(style->userSelect()); |
2478 case CSSPropertyBorderBottomLeftRadius: | 2495 case CSSPropertyBorderBottomLeftRadius: |
2479 return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), s
tyle.get(), m_node->document()->renderView()); | 2496 return getBorderRadiusCornerValue(style->borderBottomLeftRadius(), s
tyle.get(), m_node->document()->renderView()); |
2480 case CSSPropertyBorderBottomRightRadius: | 2497 case CSSPropertyBorderBottomRightRadius: |
2481 return getBorderRadiusCornerValue(style->borderBottomRightRadius(),
style.get(), m_node->document()->renderView()); | 2498 return getBorderRadiusCornerValue(style->borderBottomRightRadius(),
style.get(), m_node->document()->renderView()); |
2482 case CSSPropertyBorderTopLeftRadius: | 2499 case CSSPropertyBorderTopLeftRadius: |
2483 return getBorderRadiusCornerValue(style->borderTopLeftRadius(), styl
e.get(), m_node->document()->renderView()); | 2500 return getBorderRadiusCornerValue(style->borderTopLeftRadius(), styl
e.get(), m_node->document()->renderView()); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3062 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3079 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
3063 CSSPropertyB
ackgroundClip }; | 3080 CSSPropertyB
ackgroundClip }; |
3064 | 3081 |
3065 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3082 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
3066 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha
nd(CSSPropertyBackground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(prope
rtiesBeforeSlashSeperator)))); | 3083 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha
nd(CSSPropertyBackground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(prope
rtiesBeforeSlashSeperator)))); |
3067 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha
nd(CSSPropertyBackground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(proper
tiesAfterSlashSeperator)))); | 3084 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha
nd(CSSPropertyBackground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(proper
tiesAfterSlashSeperator)))); |
3068 return list.release(); | 3085 return list.release(); |
3069 } | 3086 } |
3070 | 3087 |
3071 } // namespace WebCore | 3088 } // namespace WebCore |
OLD | NEW |