| 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 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 if (l.isAuto()) { | 645 if (l.isAuto()) { |
| 646 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 646 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
| 647 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). | 647 // In other words if left is auto and right is not auto, then left's com
puted value is negative right(). |
| 648 // So we should get the opposite length unit and see if it is auto. | 648 // So we should get the opposite length unit and see if it is auto. |
| 649 return cssValuePool().createValue(l); | 649 return cssValuePool().createValue(l); |
| 650 } | 650 } |
| 651 | 651 |
| 652 return zoomAdjustedPixelValueForLength(l, style); | 652 return zoomAdjustedPixelValueForLength(l, style); |
| 653 } | 653 } |
| 654 | 654 |
| 655 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(RenderStyle* style, const StyleColor& color) const | 655 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(RenderStyle* style, const Color& color) const |
| 656 { | 656 { |
| 657 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. | 657 // This function does NOT look at visited information, so that computed styl
e doesn't expose that. |
| 658 if (!color.isValid()) | 658 if (!color.isValid()) |
| 659 return cssValuePool().createColorValue(style->color().rgb()); | 659 return cssValuePool().createColorValue(style->color().rgb()); |
| 660 return cssValuePool().createColorValue(color.rgb()); | 660 return cssValuePool().createColorValue(color.rgb()); |
| 661 } | 661 } |
| 662 | 662 |
| 663 PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
lor(const RenderObject* renderer, const RenderStyle* style, int colorProperty) c
onst | |
| 664 { | |
| 665 Color color; | |
| 666 if (renderer) { | |
| 667 if (m_allowVisitedStyle) | |
| 668 color = renderer->resolveColor(colorProperty); | |
| 669 else | |
| 670 color = renderer->resolveColor(style->colorIncludingFallback(colorPr
operty, false /* visited */)); | |
| 671 } else { | |
| 672 if (m_allowVisitedStyle) | |
| 673 color = style->visitedDependentColor(colorProperty).color(); | |
| 674 else | |
| 675 color = style->colorIncludingFallback(colorProperty, false /* visite
d */).color(); | |
| 676 } | |
| 677 return cssValuePool().createColorValue(color.rgb()); | |
| 678 } | |
| 679 | |
| 680 static PassRefPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, c
onst RenderStyle* style, RenderView* renderView) | 663 static PassRefPtr<CSSValueList> valuesForBorderRadiusCorner(LengthSize radius, c
onst RenderStyle* style, RenderView* renderView) |
| 681 { | 664 { |
| 682 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | 665 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); |
| 683 if (radius.width().type() == Percent) | 666 if (radius.width().type() == Percent) |
| 684 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::CSS_PERCENTAGE)); | 667 list->append(cssValuePool().createValue(radius.width().percent(), CSSPri
mitiveValue::CSS_PERCENTAGE)); |
| 685 else | 668 else |
| 686 list->append(zoomAdjustedPixelValue(valueForLength(radius.width(), 0, re
nderView), style)); | 669 list->append(zoomAdjustedPixelValue(valueForLength(radius.width(), 0, re
nderView), style)); |
| 687 if (radius.height().type() == Percent) | 670 if (radius.height().type() == Percent) |
| 688 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::CSS_PERCENTAGE)); | 671 list->append(cssValuePool().createValue(radius.height().percent(), CSSPr
imitiveValue::CSS_PERCENTAGE)); |
| 689 else | 672 else |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation
*>(filterOperation); | 909 BlurFilterOperation* blurOperation = static_cast<BlurFilterOperation
*>(filterOperation); |
| 927 filterValue = CSSFilterValue::create(CSSFilterValue::BlurFilterOpera
tion); | 910 filterValue = CSSFilterValue::create(CSSFilterValue::BlurFilterOpera
tion); |
| 928 filterValue->append(zoomAdjustedPixelValue(blurOperation->stdDeviati
on().value(), style)); | 911 filterValue->append(zoomAdjustedPixelValue(blurOperation->stdDeviati
on().value(), style)); |
| 929 break; | 912 break; |
| 930 } | 913 } |
| 931 case FilterOperation::DROP_SHADOW: { | 914 case FilterOperation::DROP_SHADOW: { |
| 932 DropShadowFilterOperation* dropShadowOperation = static_cast<DropSha
dowFilterOperation*>(filterOperation); | 915 DropShadowFilterOperation* dropShadowOperation = static_cast<DropSha
dowFilterOperation*>(filterOperation); |
| 933 filterValue = CSSFilterValue::create(CSSFilterValue::DropShadowFilte
rOperation); | 916 filterValue = CSSFilterValue::create(CSSFilterValue::DropShadowFilte
rOperation); |
| 934 // We want our computed style to look like that of a text shadow (ha
s neither spread nor inset style). | 917 // We want our computed style to look like that of a text shadow (ha
s neither spread nor inset style). |
| 935 OwnPtr<ShadowData> shadow = ShadowData::create(dropShadowOperation->
location(), dropShadowOperation->stdDeviation(), 0, Normal, dropShadowOperation-
>color()); | 918 OwnPtr<ShadowData> shadow = ShadowData::create(dropShadowOperation->
location(), dropShadowOperation->stdDeviation(), 0, Normal, dropShadowOperation-
>color()); |
| 936 filterValue->append(valueForShadow(renderer, shadow.get(), CSSProper
tyTextShadow, style)); | 919 filterValue->append(valueForShadow(shadow.get(), CSSPropertyTextShad
ow, style)); |
| 937 break; | 920 break; |
| 938 } | 921 } |
| 939 case FilterOperation::VALIDATED_CUSTOM: | 922 case FilterOperation::VALIDATED_CUSTOM: |
| 940 // ValidatedCustomFilterOperation is not supposed to end up in the R
enderStyle. | 923 // ValidatedCustomFilterOperation is not supposed to end up in the R
enderStyle. |
| 941 ASSERT_NOT_REACHED(); | 924 ASSERT_NOT_REACHED(); |
| 942 break; | 925 break; |
| 943 case FilterOperation::CUSTOM: { | 926 case FilterOperation::CUSTOM: { |
| 944 CustomFilterOperation* customOperation = static_cast<CustomFilterOpe
ration*>(filterOperation); | 927 CustomFilterOperation* customOperation = static_cast<CustomFilterOpe
ration*>(filterOperation); |
| 945 filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOpe
ration); | 928 filterValue = CSSFilterValue::create(CSSFilterValue::CustomFilterOpe
ration); |
| 946 | 929 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 if (!m_node) | 1299 if (!m_node) |
| 1317 return false; | 1300 return false; |
| 1318 | 1301 |
| 1319 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); | 1302 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); |
| 1320 if (!style) | 1303 if (!style) |
| 1321 return false; | 1304 return false; |
| 1322 | 1305 |
| 1323 return style->fontDescription().useFixedDefaultSize(); | 1306 return style->fontDescription().useFixedDefaultSize(); |
| 1324 } | 1307 } |
| 1325 | 1308 |
| 1326 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const RenderObj
ect* renderer, const ShadowData* shadow, CSSPropertyID propertyID, const RenderS
tyle* style) const | 1309 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForShadow(const ShadowDat
a* shadow, CSSPropertyID propertyID, const RenderStyle* style) const |
| 1327 { | 1310 { |
| 1328 if (!shadow) | 1311 if (!shadow) |
| 1329 return cssValuePool().createIdentifierValue(CSSValueNone); | 1312 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1330 | 1313 |
| 1331 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); | 1314 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); |
| 1332 for (const ShadowData* s = shadow; s; s = s->next()) { | 1315 for (const ShadowData* s = shadow; s; s = s->next()) { |
| 1333 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style); | 1316 RefPtr<CSSPrimitiveValue> x = zoomAdjustedPixelValue(s->x(), style); |
| 1334 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style); | 1317 RefPtr<CSSPrimitiveValue> y = zoomAdjustedPixelValue(s->y(), style); |
| 1335 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style
); | 1318 RefPtr<CSSPrimitiveValue> blur = zoomAdjustedPixelValue(s->blur(), style
); |
| 1336 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ?
PassRefPtr<CSSPrimitiveValue>() : zoomAdjustedPixelValue(s->spread(), style); | 1319 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ?
PassRefPtr<CSSPrimitiveValue>() : zoomAdjustedPixelValue(s->spread(), style); |
| 1337 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow ||
s->style() == Normal ? PassRefPtr<CSSPrimitiveValue>() : cssValuePool().createI
dentifierValue(CSSValueInset); | 1320 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow ||
s->style() == Normal ? PassRefPtr<CSSPrimitiveValue>() : cssValuePool().createI
dentifierValue(CSSValueInset); |
| 1338 RefPtr<CSSPrimitiveValue> color = cssValuePool().createColorValue(render
er ? renderer->resolveColor(s->color()).rgb() : s->color().rgb()); | 1321 RefPtr<CSSPrimitiveValue> color = cssValuePool().createColorValue(s->col
or().rgb()); |
| 1339 list->prepend(ShadowValue::create(x.release(), y.release(), blur.release
(), spread.release(), style.release(), color.release())); | 1322 list->prepend(ShadowValue::create(x.release(), y.release(), blur.release
(), spread.release(), style.release(), color.release())); |
| 1340 } | 1323 } |
| 1341 return list.release(); | 1324 return list.release(); |
| 1342 } | 1325 } |
| 1343 | 1326 |
| 1344 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
yID propertyID) const | 1327 PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
yID propertyID) const |
| 1345 { | 1328 { |
| 1346 return getPropertyCSSValue(propertyID, UpdateLayout); | 1329 return getPropertyCSSValue(propertyID, UpdateLayout); |
| 1347 } | 1330 } |
| 1348 | 1331 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1661 return 0; | 1644 return 0; |
| 1662 | 1645 |
| 1663 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); | 1646 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); |
| 1664 | 1647 |
| 1665 switch (propertyID) { | 1648 switch (propertyID) { |
| 1666 case CSSPropertyInvalid: | 1649 case CSSPropertyInvalid: |
| 1667 case CSSPropertyVariable: | 1650 case CSSPropertyVariable: |
| 1668 break; | 1651 break; |
| 1669 | 1652 |
| 1670 case CSSPropertyBackgroundColor: | 1653 case CSSPropertyBackgroundColor: |
| 1671 return cssValuePool().createColorValue(renderer->resolveColor(m_allo
wVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() :
style->backgroundColor()).rgb()); | 1654 return cssValuePool().createColorValue(m_allowVisitedStyle? style->v
isitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor(
).rgb()); |
| 1672 case CSSPropertyBackgroundImage: | 1655 case CSSPropertyBackgroundImage: |
| 1673 case CSSPropertyWebkitMaskImage: { | 1656 case CSSPropertyWebkitMaskImage: { |
| 1674 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskImage ?
style->maskLayers() : style->backgroundLayers(); | 1657 const FillLayer* layers = propertyID == CSSPropertyWebkitMaskImage ?
style->maskLayers() : style->backgroundLayers(); |
| 1675 if (!layers) | 1658 if (!layers) |
| 1676 return cssValuePool().createIdentifierValue(CSSValueNone); | 1659 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1677 | 1660 |
| 1678 if (!layers->next()) { | 1661 if (!layers->next()) { |
| 1679 if (layers->image()) | 1662 if (layers->image()) |
| 1680 return layers->image()->cssValue(); | 1663 return layers->image()->cssValue(); |
| 1681 | 1664 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 } | 1790 } |
| 1808 case CSSPropertyWebkitBorderHorizontalSpacing: | 1791 case CSSPropertyWebkitBorderHorizontalSpacing: |
| 1809 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), styl
e.get()); | 1792 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), styl
e.get()); |
| 1810 case CSSPropertyWebkitBorderVerticalSpacing: | 1793 case CSSPropertyWebkitBorderVerticalSpacing: |
| 1811 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.
get()); | 1794 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), style.
get()); |
| 1812 case CSSPropertyBorderImageSource: | 1795 case CSSPropertyBorderImageSource: |
| 1813 if (style->borderImageSource()) | 1796 if (style->borderImageSource()) |
| 1814 return style->borderImageSource()->cssValue(); | 1797 return style->borderImageSource()->cssValue(); |
| 1815 return cssValuePool().createIdentifierValue(CSSValueNone); | 1798 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 1816 case CSSPropertyBorderTopColor: | 1799 case CSSPropertyBorderTopColor: |
| 1817 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderTopColor); | 1800 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidCol
or(style.get(), style->borderTopColor()); |
| 1818 case CSSPropertyBorderRightColor: | 1801 case CSSPropertyBorderRightColor: |
| 1819 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderRightColor); | 1802 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidC
olor(style.get(), style->borderRightColor()); |
| 1820 case CSSPropertyBorderBottomColor: | 1803 case CSSPropertyBorderBottomColor: |
| 1821 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderBottomColor); | 1804 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValid
Color(style.get(), style->borderBottomColor()); |
| 1822 case CSSPropertyBorderLeftColor: | 1805 case CSSPropertyBorderLeftColor: |
| 1823 return currentColorOrValidColor(renderer, style.get(), CSSPropertyBo
rderLeftColor); | 1806 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidCo
lor(style.get(), style->borderLeftColor()); |
| 1824 case CSSPropertyBorderTopStyle: | 1807 case CSSPropertyBorderTopStyle: |
| 1825 return cssValuePool().createValue(style->borderTopStyle()); | 1808 return cssValuePool().createValue(style->borderTopStyle()); |
| 1826 case CSSPropertyBorderRightStyle: | 1809 case CSSPropertyBorderRightStyle: |
| 1827 return cssValuePool().createValue(style->borderRightStyle()); | 1810 return cssValuePool().createValue(style->borderRightStyle()); |
| 1828 case CSSPropertyBorderBottomStyle: | 1811 case CSSPropertyBorderBottomStyle: |
| 1829 return cssValuePool().createValue(style->borderBottomStyle()); | 1812 return cssValuePool().createValue(style->borderBottomStyle()); |
| 1830 case CSSPropertyBorderLeftStyle: | 1813 case CSSPropertyBorderLeftStyle: |
| 1831 return cssValuePool().createValue(style->borderLeftStyle()); | 1814 return cssValuePool().createValue(style->borderLeftStyle()); |
| 1832 case CSSPropertyBorderTopWidth: | 1815 case CSSPropertyBorderTopWidth: |
| 1833 return zoomAdjustedPixelValue(style->borderTopWidth(), style.get()); | 1816 return zoomAdjustedPixelValue(style->borderTopWidth(), style.get()); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1856 case CSSPropertyWebkitBoxOrdinalGroup: | 1839 case CSSPropertyWebkitBoxOrdinalGroup: |
| 1857 return cssValuePool().createValue(style->boxOrdinalGroup(), CSSPrimi
tiveValue::CSS_NUMBER); | 1840 return cssValuePool().createValue(style->boxOrdinalGroup(), CSSPrimi
tiveValue::CSS_NUMBER); |
| 1858 case CSSPropertyWebkitBoxOrient: | 1841 case CSSPropertyWebkitBoxOrient: |
| 1859 return cssValuePool().createValue(style->boxOrient()); | 1842 return cssValuePool().createValue(style->boxOrient()); |
| 1860 case CSSPropertyWebkitBoxPack: | 1843 case CSSPropertyWebkitBoxPack: |
| 1861 return cssValuePool().createValue(style->boxPack()); | 1844 return cssValuePool().createValue(style->boxPack()); |
| 1862 case CSSPropertyWebkitBoxReflect: | 1845 case CSSPropertyWebkitBoxReflect: |
| 1863 return valueForReflection(style->boxReflect(), style.get()); | 1846 return valueForReflection(style->boxReflect(), style.get()); |
| 1864 case CSSPropertyBoxShadow: | 1847 case CSSPropertyBoxShadow: |
| 1865 case CSSPropertyWebkitBoxShadow: | 1848 case CSSPropertyWebkitBoxShadow: |
| 1866 return valueForShadow(renderer, style->boxShadow(), propertyID, styl
e.get()); | 1849 return valueForShadow(style->boxShadow(), propertyID, style.get()); |
| 1867 case CSSPropertyCaptionSide: | 1850 case CSSPropertyCaptionSide: |
| 1868 return cssValuePool().createValue(style->captionSide()); | 1851 return cssValuePool().createValue(style->captionSide()); |
| 1869 case CSSPropertyClear: | 1852 case CSSPropertyClear: |
| 1870 return cssValuePool().createValue(style->clear()); | 1853 return cssValuePool().createValue(style->clear()); |
| 1871 case CSSPropertyColor: | 1854 case CSSPropertyColor: |
| 1872 return cssValuePool().createColorValue(m_allowVisitedStyle ? style->
visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); | 1855 return cssValuePool().createColorValue(m_allowVisitedStyle ? style->
visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); |
| 1873 case CSSPropertyWebkitPrintColorAdjust: | 1856 case CSSPropertyWebkitPrintColorAdjust: |
| 1874 return cssValuePool().createValue(style->printColorAdjust()); | 1857 return cssValuePool().createValue(style->printColorAdjust()); |
| 1875 case CSSPropertyWebkitColumnAxis: | 1858 case CSSPropertyWebkitColumnAxis: |
| 1876 return cssValuePool().createValue(style->columnAxis()); | 1859 return cssValuePool().createValue(style->columnAxis()); |
| 1877 case CSSPropertyWebkitColumnCount: | 1860 case CSSPropertyWebkitColumnCount: |
| 1878 if (style->hasAutoColumnCount()) | 1861 if (style->hasAutoColumnCount()) |
| 1879 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1862 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 1880 return cssValuePool().createValue(style->columnCount(), CSSPrimitive
Value::CSS_NUMBER); | 1863 return cssValuePool().createValue(style->columnCount(), CSSPrimitive
Value::CSS_NUMBER); |
| 1881 case CSSPropertyWebkitColumnGap: | 1864 case CSSPropertyWebkitColumnGap: |
| 1882 if (style->hasNormalColumnGap()) | 1865 if (style->hasNormalColumnGap()) |
| 1883 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1866 return cssValuePool().createIdentifierValue(CSSValueNormal); |
| 1884 return zoomAdjustedPixelValue(style->columnGap(), style.get()); | 1867 return zoomAdjustedPixelValue(style->columnGap(), style.get()); |
| 1885 case CSSPropertyWebkitColumnProgression: | 1868 case CSSPropertyWebkitColumnProgression: |
| 1886 return cssValuePool().createValue(style->columnProgression()); | 1869 return cssValuePool().createValue(style->columnProgression()); |
| 1887 case CSSPropertyWebkitColumnRuleColor: | 1870 case CSSPropertyWebkitColumnRuleColor: |
| 1888 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitColumnRuleColor); | 1871 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->columnRuleColor()); |
| 1889 case CSSPropertyWebkitColumnRuleStyle: | 1872 case CSSPropertyWebkitColumnRuleStyle: |
| 1890 return cssValuePool().createValue(style->columnRuleStyle()); | 1873 return cssValuePool().createValue(style->columnRuleStyle()); |
| 1891 case CSSPropertyWebkitColumnRuleWidth: | 1874 case CSSPropertyWebkitColumnRuleWidth: |
| 1892 return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get())
; | 1875 return zoomAdjustedPixelValue(style->columnRuleWidth(), style.get())
; |
| 1893 case CSSPropertyWebkitColumnSpan: | 1876 case CSSPropertyWebkitColumnSpan: |
| 1894 return cssValuePool().createIdentifierValue(style->columnSpan() ? CS
SValueAll : CSSValueNone); | 1877 return cssValuePool().createIdentifierValue(style->columnSpan() ? CS
SValueAll : CSSValueNone); |
| 1895 case CSSPropertyWebkitColumnBreakAfter: | 1878 case CSSPropertyWebkitColumnBreakAfter: |
| 1896 return cssValuePool().createValue(style->columnBreakAfter()); | 1879 return cssValuePool().createValue(style->columnBreakAfter()); |
| 1897 case CSSPropertyWebkitColumnBreakBefore: | 1880 case CSSPropertyWebkitColumnBreakBefore: |
| 1898 return cssValuePool().createValue(style->columnBreakBefore()); | 1881 return cssValuePool().createValue(style->columnBreakBefore()); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2152 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); | 2135 return zoomAdjustedPixelValueForLength(style->minWidth(), style.get(
)); |
| 2153 case CSSPropertyObjectFit: | 2136 case CSSPropertyObjectFit: |
| 2154 return cssValuePool().createValue(style->objectFit()); | 2137 return cssValuePool().createValue(style->objectFit()); |
| 2155 case CSSPropertyOpacity: | 2138 case CSSPropertyOpacity: |
| 2156 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); | 2139 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu
e::CSS_NUMBER); |
| 2157 case CSSPropertyOrphans: | 2140 case CSSPropertyOrphans: |
| 2158 if (style->hasAutoOrphans()) | 2141 if (style->hasAutoOrphans()) |
| 2159 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2142 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 2160 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); | 2143 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu
e::CSS_NUMBER); |
| 2161 case CSSPropertyOutlineColor: | 2144 case CSSPropertyOutlineColor: |
| 2162 return currentColorOrValidColor(renderer, style.get(), CSSPropertyOu
tlineColor); | 2145 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(style.get(), style->outlineColor()); |
| 2163 case CSSPropertyOutlineOffset: | 2146 case CSSPropertyOutlineOffset: |
| 2164 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); | 2147 return zoomAdjustedPixelValue(style->outlineOffset(), style.get()); |
| 2165 case CSSPropertyOutlineStyle: | 2148 case CSSPropertyOutlineStyle: |
| 2166 if (style->outlineStyleIsAuto()) | 2149 if (style->outlineStyleIsAuto()) |
| 2167 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2150 return cssValuePool().createIdentifierValue(CSSValueAuto); |
| 2168 return cssValuePool().createValue(style->outlineStyle()); | 2151 return cssValuePool().createValue(style->outlineStyle()); |
| 2169 case CSSPropertyOutlineWidth: | 2152 case CSSPropertyOutlineWidth: |
| 2170 return zoomAdjustedPixelValue(style->outlineWidth(), style.get()); | 2153 return zoomAdjustedPixelValue(style->outlineWidth(), style.get()); |
| 2171 case CSSPropertyOverflow: | 2154 case CSSPropertyOverflow: |
| 2172 return cssValuePool().createValue(max(style->overflowX(), style->ove
rflowY())); | 2155 return cssValuePool().createValue(max(style->overflowX(), style->ove
rflowY())); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2231 return valueForTextDecorationStyle(style->textDecorationStyle()); | 2214 return valueForTextDecorationStyle(style->textDecorationStyle()); |
| 2232 case CSSPropertyTextDecorationColor: | 2215 case CSSPropertyTextDecorationColor: |
| 2233 return currentColorOrValidColor(style.get(), style->textDecorationCo
lor()); | 2216 return currentColorOrValidColor(style.get(), style->textDecorationCo
lor()); |
| 2234 #if ENABLE(CSS3_TEXT) | 2217 #if ENABLE(CSS3_TEXT) |
| 2235 case CSSPropertyWebkitTextUnderlinePosition: | 2218 case CSSPropertyWebkitTextUnderlinePosition: |
| 2236 return cssValuePool().createValue(style->textUnderlinePosition()); | 2219 return cssValuePool().createValue(style->textUnderlinePosition()); |
| 2237 #endif // CSS3_TEXT | 2220 #endif // CSS3_TEXT |
| 2238 case CSSPropertyWebkitTextDecorationsInEffect: | 2221 case CSSPropertyWebkitTextDecorationsInEffect: |
| 2239 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE
ffect()); | 2222 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE
ffect()); |
| 2240 case CSSPropertyWebkitTextFillColor: | 2223 case CSSPropertyWebkitTextFillColor: |
| 2241 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTextFillColor); | 2224 return currentColorOrValidColor(style.get(), style->textFillColor())
; |
| 2242 case CSSPropertyWebkitTextEmphasisColor: | 2225 case CSSPropertyWebkitTextEmphasisColor: |
| 2243 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTextEmphasisColor); | 2226 return currentColorOrValidColor(style.get(), style->textEmphasisColo
r()); |
| 2244 case CSSPropertyWebkitTextEmphasisPosition: | 2227 case CSSPropertyWebkitTextEmphasisPosition: |
| 2245 return cssValuePool().createValue(style->textEmphasisPosition()); | 2228 return cssValuePool().createValue(style->textEmphasisPosition()); |
| 2246 case CSSPropertyWebkitTextEmphasisStyle: | 2229 case CSSPropertyWebkitTextEmphasisStyle: |
| 2247 switch (style->textEmphasisMark()) { | 2230 switch (style->textEmphasisMark()) { |
| 2248 case TextEmphasisMarkNone: | 2231 case TextEmphasisMarkNone: |
| 2249 return cssValuePool().createIdentifierValue(CSSValueNone); | 2232 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 2250 case TextEmphasisMarkCustom: | 2233 case TextEmphasisMarkCustom: |
| 2251 return cssValuePool().createValue(style->textEmphasisCustomMark(
), CSSPrimitiveValue::CSS_STRING); | 2234 return cssValuePool().createValue(style->textEmphasisCustomMark(
), CSSPrimitiveValue::CSS_STRING); |
| 2252 case TextEmphasisMarkAuto: | 2235 case TextEmphasisMarkAuto: |
| 2253 ASSERT_NOT_REACHED(); | 2236 ASSERT_NOT_REACHED(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2267 RefPtr<CSSValue> textIndent = zoomAdjustedPixelValueForLength(style-
>textIndent(), style.get()); | 2250 RefPtr<CSSValue> textIndent = zoomAdjustedPixelValueForLength(style-
>textIndent(), style.get()); |
| 2268 if (RuntimeEnabledFeatures::css3TextEnabled() && style->textIndentLi
ne() == TextIndentEachLine) { | 2251 if (RuntimeEnabledFeatures::css3TextEnabled() && style->textIndentLi
ne() == TextIndentEachLine) { |
| 2269 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 2252 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
| 2270 list->append(textIndent.release()); | 2253 list->append(textIndent.release()); |
| 2271 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); | 2254 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi
ne)); |
| 2272 return list.release(); | 2255 return list.release(); |
| 2273 } | 2256 } |
| 2274 return textIndent.release(); | 2257 return textIndent.release(); |
| 2275 } | 2258 } |
| 2276 case CSSPropertyTextShadow: | 2259 case CSSPropertyTextShadow: |
| 2277 return valueForShadow(renderer, style->textShadow(), propertyID, sty
le.get()); | 2260 return valueForShadow(style->textShadow(), propertyID, style.get()); |
| 2278 case CSSPropertyTextRendering: | 2261 case CSSPropertyTextRendering: |
| 2279 return cssValuePool().createValue(style->fontDescription().textRende
ringMode()); | 2262 return cssValuePool().createValue(style->fontDescription().textRende
ringMode()); |
| 2280 case CSSPropertyTextOverflow: | 2263 case CSSPropertyTextOverflow: |
| 2281 if (style->textOverflow()) | 2264 if (style->textOverflow()) |
| 2282 return cssValuePool().createIdentifierValue(CSSValueEllipsis); | 2265 return cssValuePool().createIdentifierValue(CSSValueEllipsis); |
| 2283 return cssValuePool().createIdentifierValue(CSSValueClip); | 2266 return cssValuePool().createIdentifierValue(CSSValueClip); |
| 2284 case CSSPropertyWebkitTextSecurity: | 2267 case CSSPropertyWebkitTextSecurity: |
| 2285 return cssValuePool().createValue(style->textSecurity()); | 2268 return cssValuePool().createValue(style->textSecurity()); |
| 2286 case CSSPropertyWebkitTextStrokeColor: | 2269 case CSSPropertyWebkitTextStrokeColor: |
| 2287 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTextStrokeColor); | 2270 return currentColorOrValidColor(style.get(), style->textStrokeColor(
)); |
| 2288 case CSSPropertyWebkitTextStrokeWidth: | 2271 case CSSPropertyWebkitTextStrokeWidth: |
| 2289 return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get())
; | 2272 return zoomAdjustedPixelValue(style->textStrokeWidth(), style.get())
; |
| 2290 case CSSPropertyTextTransform: | 2273 case CSSPropertyTextTransform: |
| 2291 return cssValuePool().createValue(style->textTransform()); | 2274 return cssValuePool().createValue(style->textTransform()); |
| 2292 case CSSPropertyTop: | 2275 case CSSPropertyTop: |
| 2293 return valueForPositionOffset(style.get(), CSSPropertyTop, renderer,
m_node->document().renderView()); | 2276 return valueForPositionOffset(style.get(), CSSPropertyTop, renderer,
m_node->document().renderView()); |
| 2294 case CSSPropertyTouchAction: | 2277 case CSSPropertyTouchAction: |
| 2295 return cssValuePool().createValue(style->touchAction()); | 2278 return cssValuePool().createValue(style->touchAction()); |
| 2296 case CSSPropertyUnicodeBidi: | 2279 case CSSPropertyUnicodeBidi: |
| 2297 return cssValuePool().createValue(style->unicodeBidi()); | 2280 return cssValuePool().createValue(style->unicodeBidi()); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2569 else { | 2552 else { |
| 2570 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginX(), style.get())); | 2553 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginX(), style.get())); |
| 2571 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginY(), style.get())); | 2554 list->append(zoomAdjustedPixelValueForLength(style->perspectiveO
riginY(), style.get())); |
| 2572 | 2555 |
| 2573 } | 2556 } |
| 2574 return list.release(); | 2557 return list.release(); |
| 2575 } | 2558 } |
| 2576 case CSSPropertyWebkitRtlOrdering: | 2559 case CSSPropertyWebkitRtlOrdering: |
| 2577 return cssValuePool().createIdentifierValue(style->rtlOrdering() ? C
SSValueVisual : CSSValueLogical); | 2560 return cssValuePool().createIdentifierValue(style->rtlOrdering() ? C
SSValueVisual : CSSValueLogical); |
| 2578 case CSSPropertyWebkitTapHighlightColor: | 2561 case CSSPropertyWebkitTapHighlightColor: |
| 2579 return currentColorOrValidColor(renderer, style.get(), CSSPropertyWe
bkitTapHighlightColor); | 2562 return currentColorOrValidColor(style.get(), style->tapHighlightColo
r()); |
| 2580 case CSSPropertyWebkitUserDrag: | 2563 case CSSPropertyWebkitUserDrag: |
| 2581 return cssValuePool().createValue(style->userDrag()); | 2564 return cssValuePool().createValue(style->userDrag()); |
| 2582 case CSSPropertyWebkitUserSelect: | 2565 case CSSPropertyWebkitUserSelect: |
| 2583 return cssValuePool().createValue(style->userSelect()); | 2566 return cssValuePool().createValue(style->userSelect()); |
| 2584 case CSSPropertyBorderBottomLeftRadius: | 2567 case CSSPropertyBorderBottomLeftRadius: |
| 2585 return valueForBorderRadiusCorner(style->borderBottomLeftRadius(), s
tyle.get(), m_node->document().renderView()); | 2568 return valueForBorderRadiusCorner(style->borderBottomLeftRadius(), s
tyle.get(), m_node->document().renderView()); |
| 2586 case CSSPropertyBorderBottomRightRadius: | 2569 case CSSPropertyBorderBottomRightRadius: |
| 2587 return valueForBorderRadiusCorner(style->borderBottomRightRadius(),
style.get(), m_node->document().renderView()); | 2570 return valueForBorderRadiusCorner(style->borderBottomRightRadius(),
style.get(), m_node->document().renderView()); |
| 2588 case CSSPropertyBorderTopLeftRadius: | 2571 case CSSPropertyBorderTopLeftRadius: |
| 2589 return valueForBorderRadiusCorner(style->borderTopLeftRadius(), styl
e.get(), m_node->document().renderView()); | 2572 return valueForBorderRadiusCorner(style->borderTopLeftRadius(), styl
e.get(), m_node->document().renderView()); |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3173 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3156 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
| 3174 CSSPropertyB
ackgroundClip }; | 3157 CSSPropertyB
ackgroundClip }; |
| 3175 | 3158 |
| 3176 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); | 3159 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); |
| 3177 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 3160 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
| 3178 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 3161 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
| 3179 return list.release(); | 3162 return list.release(); |
| 3180 } | 3163 } |
| 3181 | 3164 |
| 3182 } // namespace WebCore | 3165 } // namespace WebCore |
| OLD | NEW |