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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 case CSSPropertyRight: | 610 case CSSPropertyRight: |
611 l = style.right(); | 611 l = style.right(); |
612 break; | 612 break; |
613 case CSSPropertyTop: | 613 case CSSPropertyTop: |
614 l = style.top(); | 614 l = style.top(); |
615 break; | 615 break; |
616 case CSSPropertyBottom: | 616 case CSSPropertyBottom: |
617 l = style.bottom(); | 617 l = style.bottom(); |
618 break; | 618 break; |
619 default: | 619 default: |
620 return 0; | 620 return nullptr; |
621 } | 621 } |
622 | 622 |
623 if (l.isPercent() && renderer && renderer->isBox()) { | 623 if (l.isPercent() && renderer && renderer->isBox()) { |
624 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope
rtyID == CSSPropertyRight) ? | 624 LayoutUnit containingBlockSize = (propertyID == CSSPropertyLeft || prope
rtyID == CSSPropertyRight) ? |
625 toRenderBox(renderer)->containingBlockLogicalWidthForContent() : | 625 toRenderBox(renderer)->containingBlockLogicalWidthForContent() : |
626 toRenderBox(renderer)->containingBlockLogicalHeightForContent(Exclud
eMarginBorderPadding); | 626 toRenderBox(renderer)->containingBlockLogicalHeightForContent(Exclud
eMarginBorderPadding); |
627 return zoomAdjustedPixelValue(valueForLength(l, containingBlockSize), st
yle); | 627 return zoomAdjustedPixelValue(valueForLength(l, containingBlockSize), st
yle); |
628 } | 628 } |
629 if (l.isAuto()) { | 629 if (l.isAuto()) { |
630 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. | 630 // FIXME: It's not enough to simply return "auto" values for one offset
if the other side is defined. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 switch (trackSize.type()) { | 861 switch (trackSize.type()) { |
862 case LengthTrackSizing: | 862 case LengthTrackSizing: |
863 return specifiedValueForGridTrackBreadth(trackSize.length(), style); | 863 return specifiedValueForGridTrackBreadth(trackSize.length(), style); |
864 case MinMaxTrackSizing: | 864 case MinMaxTrackSizing: |
865 RefPtrWillBeRawPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::cre
ateCommaSeparated(); | 865 RefPtrWillBeRawPtr<CSSValueList> minMaxTrackBreadths = CSSValueList::cre
ateCommaSeparated(); |
866 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
minTrackBreadth(), style)); | 866 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
minTrackBreadth(), style)); |
867 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
maxTrackBreadth(), style)); | 867 minMaxTrackBreadths->append(specifiedValueForGridTrackBreadth(trackSize.
maxTrackBreadth(), style)); |
868 return CSSFunctionValue::create("minmax(", minMaxTrackBreadths); | 868 return CSSFunctionValue::create("minmax(", minMaxTrackBreadths); |
869 } | 869 } |
870 ASSERT_NOT_REACHED(); | 870 ASSERT_NOT_REACHED(); |
871 return 0; | 871 return nullptr; |
872 } | 872 } |
873 | 873 |
874 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) | 874 static void addValuesForNamedGridLinesAtIndex(const OrderedNamedGridLines& order
edNamedGridLines, size_t i, CSSValueList& list) |
875 { | 875 { |
876 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); | 876 const Vector<String>& namedGridLines = orderedNamedGridLines.get(i); |
877 if (namedGridLines.isEmpty()) | 877 if (namedGridLines.isEmpty()) |
878 return; | 878 return; |
879 | 879 |
880 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); | 880 RefPtrWillBeRawPtr<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue:
:create(); |
881 for (size_t j = 0; j < namedGridLines.size(); ++j) | 881 for (size_t j = 0; j < namedGridLines.size(); ++j) |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 valueId = CSSValueEaseIn; | 999 valueId = CSSValueEaseIn; |
1000 break; | 1000 break; |
1001 case CubicBezierTimingFunction::EaseOut: | 1001 case CubicBezierTimingFunction::EaseOut: |
1002 valueId = CSSValueEaseOut; | 1002 valueId = CSSValueEaseOut; |
1003 break; | 1003 break; |
1004 case CubicBezierTimingFunction::EaseInOut: | 1004 case CubicBezierTimingFunction::EaseInOut: |
1005 valueId = CSSValueEaseInOut; | 1005 valueId = CSSValueEaseInOut; |
1006 break; | 1006 break; |
1007 default: | 1007 default: |
1008 ASSERT_NOT_REACHED(); | 1008 ASSERT_NOT_REACHED(); |
1009 return 0; | 1009 return nullptr; |
1010 } | 1010 } |
1011 return cssValuePool().createIdentifierValue(valueId); | 1011 return cssValuePool().createIdentifierValue(valueId); |
1012 } | 1012 } |
1013 return CSSCubicBezierTimingFunctionValue::create(bezierTimingFunctio
n->x1(), bezierTimingFunction->y1(), bezierTimingFunction->x2(), bezierTimingFun
ction->y2()); | 1013 return CSSCubicBezierTimingFunctionValue::create(bezierTimingFunctio
n->x1(), bezierTimingFunction->y1(), bezierTimingFunction->x2(), bezierTimingFun
ction->y2()); |
1014 } | 1014 } |
1015 | 1015 |
1016 case TimingFunction::StepsFunction: | 1016 case TimingFunction::StepsFunction: |
1017 { | 1017 { |
1018 const StepsTimingFunction* stepsTimingFunction = toStepsTimingFuncti
on(timingFunction); | 1018 const StepsTimingFunction* stepsTimingFunction = toStepsTimingFuncti
on(timingFunction); |
1019 if (stepsTimingFunction->subType() == StepsTimingFunction::Custom) | 1019 if (stepsTimingFunction->subType() == StepsTimingFunction::Custom) |
1020 return CSSStepsTimingFunctionValue::create(stepsTimingFunction->
numberOfSteps(), stepsTimingFunction->stepAtStart()); | 1020 return CSSStepsTimingFunctionValue::create(stepsTimingFunction->
numberOfSteps(), stepsTimingFunction->stepAtStart()); |
1021 CSSValueID valueId; | 1021 CSSValueID valueId; |
1022 switch (stepsTimingFunction->subType()) { | 1022 switch (stepsTimingFunction->subType()) { |
1023 case StepsTimingFunction::Start: | 1023 case StepsTimingFunction::Start: |
1024 valueId = CSSValueStepStart; | 1024 valueId = CSSValueStepStart; |
1025 break; | 1025 break; |
1026 case StepsTimingFunction::End: | 1026 case StepsTimingFunction::End: |
1027 valueId = CSSValueStepEnd; | 1027 valueId = CSSValueStepEnd; |
1028 break; | 1028 break; |
1029 default: | 1029 default: |
1030 ASSERT_NOT_REACHED(); | 1030 ASSERT_NOT_REACHED(); |
1031 return 0; | 1031 return nullptr; |
1032 } | 1032 } |
1033 return cssValuePool().createIdentifierValue(valueId); | 1033 return cssValuePool().createIdentifierValue(valueId); |
1034 } | 1034 } |
1035 | 1035 |
1036 default: | 1036 default: |
1037 return cssValuePool().createIdentifierValue(CSSValueLinear); | 1037 return cssValuePool().createIdentifierValue(CSSValueLinear); |
1038 } | 1038 } |
1039 } | 1039 } |
1040 | 1040 |
1041 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationTimingFunction(const CS
SAnimationDataList* animList) | 1041 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationTimingFunction(const CS
SAnimationDataList* animList) |
(...skipping 14 matching lines...) Expand all Loading... |
1056 case AnimationFillModeNone: | 1056 case AnimationFillModeNone: |
1057 return cssValuePool().createIdentifierValue(CSSValueNone); | 1057 return cssValuePool().createIdentifierValue(CSSValueNone); |
1058 case AnimationFillModeForwards: | 1058 case AnimationFillModeForwards: |
1059 return cssValuePool().createIdentifierValue(CSSValueForwards); | 1059 return cssValuePool().createIdentifierValue(CSSValueForwards); |
1060 case AnimationFillModeBackwards: | 1060 case AnimationFillModeBackwards: |
1061 return cssValuePool().createIdentifierValue(CSSValueBackwards); | 1061 return cssValuePool().createIdentifierValue(CSSValueBackwards); |
1062 case AnimationFillModeBoth: | 1062 case AnimationFillModeBoth: |
1063 return cssValuePool().createIdentifierValue(CSSValueBoth); | 1063 return cssValuePool().createIdentifierValue(CSSValueBoth); |
1064 default: | 1064 default: |
1065 ASSERT_NOT_REACHED(); | 1065 ASSERT_NOT_REACHED(); |
1066 return 0; | 1066 return nullptr; |
1067 } | 1067 } |
1068 } | 1068 } |
1069 | 1069 |
1070 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDirection(CSSAnimationD
ata::AnimationDirection direction) | 1070 static PassRefPtrWillBeRawPtr<CSSValue> valueForAnimationDirection(CSSAnimationD
ata::AnimationDirection direction) |
1071 { | 1071 { |
1072 switch (direction) { | 1072 switch (direction) { |
1073 case CSSAnimationData::AnimationDirectionNormal: | 1073 case CSSAnimationData::AnimationDirectionNormal: |
1074 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1074 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1075 case CSSAnimationData::AnimationDirectionAlternate: | 1075 case CSSAnimationData::AnimationDirectionAlternate: |
1076 return cssValuePool().createIdentifierValue(CSSValueAlternate); | 1076 return cssValuePool().createIdentifierValue(CSSValueAlternate); |
1077 case CSSAnimationData::AnimationDirectionReverse: | 1077 case CSSAnimationData::AnimationDirectionReverse: |
1078 return cssValuePool().createIdentifierValue(CSSValueReverse); | 1078 return cssValuePool().createIdentifierValue(CSSValueReverse); |
1079 case CSSAnimationData::AnimationDirectionAlternateReverse: | 1079 case CSSAnimationData::AnimationDirectionAlternateReverse: |
1080 return cssValuePool().createIdentifierValue(CSSValueAlternateReverse); | 1080 return cssValuePool().createIdentifierValue(CSSValueAlternateReverse); |
1081 default: | 1081 default: |
1082 ASSERT_NOT_REACHED(); | 1082 ASSERT_NOT_REACHED(); |
1083 return 0; | 1083 return nullptr; |
1084 } | 1084 } |
1085 } | 1085 } |
1086 | 1086 |
1087 static PassRefPtrWillBeRawPtr<CSSValue> valueForWillChange(const Vector<CSSPrope
rtyID>& willChangeProperties, bool willChangeContents, bool willChangeScrollPosi
tion) | 1087 static PassRefPtrWillBeRawPtr<CSSValue> valueForWillChange(const Vector<CSSPrope
rtyID>& willChangeProperties, bool willChangeContents, bool willChangeScrollPosi
tion) |
1088 { | 1088 { |
1089 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; | 1089 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated()
; |
1090 if (willChangeContents) | 1090 if (willChangeContents) |
1091 list->append(cssValuePool().createIdentifierValue(CSSValueContents)); | 1091 list->append(cssValuePool().createIdentifierValue(CSSValueContents)); |
1092 if (willChangeScrollPosition) | 1092 if (willChangeScrollPosition) |
1093 list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition
)); | 1093 list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition
)); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) | 1156 static CSSValueID cssIdentifierForFontSizeKeyword(int keywordSize) |
1157 { | 1157 { |
1158 ASSERT_ARG(keywordSize, keywordSize); | 1158 ASSERT_ARG(keywordSize, keywordSize); |
1159 ASSERT_ARG(keywordSize, keywordSize <= 8); | 1159 ASSERT_ARG(keywordSize, keywordSize <= 8); |
1160 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); | 1160 return static_cast<CSSValueID>(CSSValueXxSmall + keywordSize - 1); |
1161 } | 1161 } |
1162 | 1162 |
1163 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValu
ePreferringKeyword() const | 1163 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getFontSizeCSSValu
ePreferringKeyword() const |
1164 { | 1164 { |
1165 if (!m_node) | 1165 if (!m_node) |
1166 return 0; | 1166 return nullptr; |
1167 | 1167 |
1168 m_node->document().updateLayoutIgnorePendingStylesheets(); | 1168 m_node->document().updateLayoutIgnorePendingStylesheets(); |
1169 | 1169 |
1170 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); | 1170 RefPtr<RenderStyle> style = m_node->computedStyle(m_pseudoElementSpecifier); |
1171 if (!style) | 1171 if (!style) |
1172 return 0; | 1172 return nullptr; |
1173 | 1173 |
1174 if (int keywordSize = style->fontDescription().keywordSize()) | 1174 if (int keywordSize = style->fontDescription().keywordSize()) |
1175 return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyw
ord(keywordSize)); | 1175 return cssValuePool().createIdentifierValue(cssIdentifierForFontSizeKeyw
ord(keywordSize)); |
1176 | 1176 |
1177 | 1177 |
1178 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(),
*style); | 1178 return zoomAdjustedPixelValue(style->fontDescription().computedPixelSize(),
*style); |
1179 } | 1179 } |
1180 | 1180 |
1181 bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const | 1181 bool CSSComputedStyleDeclaration::useFixedFontDefaultSize() const |
1182 { | 1182 { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 { | 1298 { |
1299 switch (type) { | 1299 switch (type) { |
1300 case MaskAlpha: | 1300 case MaskAlpha: |
1301 return cssValuePool().createValue(CSSValueAlpha); | 1301 return cssValuePool().createValue(CSSValueAlpha); |
1302 case MaskLuminance: | 1302 case MaskLuminance: |
1303 return cssValuePool().createValue(CSSValueLuminance); | 1303 return cssValuePool().createValue(CSSValueLuminance); |
1304 } | 1304 } |
1305 | 1305 |
1306 ASSERT_NOT_REACHED(); | 1306 ASSERT_NOT_REACHED(); |
1307 | 1307 |
1308 return 0; | 1308 return nullptr; |
1309 } | 1309 } |
1310 | 1310 |
1311 static PassRefPtrWillBeRawPtr<CSSValue> valueForFillSize(const FillSize& fillSiz
e, const RenderStyle& style) | 1311 static PassRefPtrWillBeRawPtr<CSSValue> valueForFillSize(const FillSize& fillSiz
e, const RenderStyle& style) |
1312 { | 1312 { |
1313 if (fillSize.type == Contain) | 1313 if (fillSize.type == Contain) |
1314 return cssValuePool().createIdentifierValue(CSSValueContain); | 1314 return cssValuePool().createIdentifierValue(CSSValueContain); |
1315 | 1315 |
1316 if (fillSize.type == Cover) | 1316 if (fillSize.type == Cover) |
1317 return cssValuePool().createIdentifierValue(CSSValueCover); | 1317 return cssValuePool().createIdentifierValue(CSSValueCover); |
1318 | 1318 |
(...skipping 21 matching lines...) Expand all Loading... |
1340 } else if (contentData->isText()) | 1340 } else if (contentData->isText()) |
1341 list->append(cssValuePool().createValue(static_cast<const TextConten
tData*>(contentData)->text(), CSSPrimitiveValue::CSS_STRING)); | 1341 list->append(cssValuePool().createValue(static_cast<const TextConten
tData*>(contentData)->text(), CSSPrimitiveValue::CSS_STRING)); |
1342 } | 1342 } |
1343 return list.release(); | 1343 return list.release(); |
1344 } | 1344 } |
1345 | 1345 |
1346 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const RenderSt
yle& style, CSSPropertyID propertyID) | 1346 static PassRefPtrWillBeRawPtr<CSSValue> valueForCounterDirectives(const RenderSt
yle& style, CSSPropertyID propertyID) |
1347 { | 1347 { |
1348 const CounterDirectiveMap* map = style.counterDirectives(); | 1348 const CounterDirectiveMap* map = style.counterDirectives(); |
1349 if (!map) | 1349 if (!map) |
1350 return 0; | 1350 return nullptr; |
1351 | 1351 |
1352 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 1352 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
1353 for (CounterDirectiveMap::const_iterator it = map->begin(); it != map->end()
; ++it) { | 1353 for (CounterDirectiveMap::const_iterator it = map->begin(); it != map->end()
; ++it) { |
1354 list->append(cssValuePool().createValue(it->key, CSSPrimitiveValue::CSS_
STRING)); | 1354 list->append(cssValuePool().createValue(it->key, CSSPrimitiveValue::CSS_
STRING)); |
1355 short number = propertyID == CSSPropertyCounterIncrement ? it->value.inc
rementValue() : it->value.resetValue(); | 1355 short number = propertyID == CSSPropertyCounterIncrement ? it->value.inc
rementValue() : it->value.resetValue(); |
1356 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::CSS_NUMBER)); | 1356 list->append(cssValuePool().createValue((double)number, CSSPrimitiveValu
e::CSS_NUMBER)); |
1357 } | 1357 } |
1358 return list.release(); | 1358 return list.release(); |
1359 } | 1359 } |
1360 | 1360 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1518 result->append(CSSPrimitiveValue::create(itemPosition)); | 1518 result->append(CSSPrimitiveValue::create(itemPosition)); |
1519 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) | 1519 if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlign
mentDefault) |
1520 result->append(CSSPrimitiveValue::create(overflowAlignment)); | 1520 result->append(CSSPrimitiveValue::create(overflowAlignment)); |
1521 return result.release(); | 1521 return result.release(); |
1522 } | 1522 } |
1523 | 1523 |
1524 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(CSSPropertyID propertyID, EUpdateLayout updateLayout) const | 1524 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(CSSPropertyID propertyID, EUpdateLayout updateLayout) const |
1525 { | 1525 { |
1526 Node* styledNode = this->styledNode(); | 1526 Node* styledNode = this->styledNode(); |
1527 if (!styledNode) | 1527 if (!styledNode) |
1528 return 0; | 1528 return nullptr; |
1529 RenderObject* renderer = styledNode->renderer(); | 1529 RenderObject* renderer = styledNode->renderer(); |
1530 RefPtr<RenderStyle> style; | 1530 RefPtr<RenderStyle> style; |
1531 | 1531 |
1532 if (updateLayout) { | 1532 if (updateLayout) { |
1533 Document& document = styledNode->document(); | 1533 Document& document = styledNode->document(); |
1534 | 1534 |
1535 // If a compositor animation is running or animations have been updated | 1535 // If a compositor animation is running or animations have been updated |
1536 // via the api we may need to service animations in order to generate | 1536 // via the api we may need to service animations in order to generate |
1537 // an up to date value. | 1537 // an up to date value. |
1538 DocumentAnimations::serviceBeforeGetComputedStyle(*styledNode, propertyI
D); | 1538 DocumentAnimations::serviceBeforeGetComputedStyle(*styledNode, propertyI
D); |
(...skipping 15 matching lines...) Expand all Loading... |
1554 document.updateLayoutIgnorePendingStylesheets(); | 1554 document.updateLayoutIgnorePendingStylesheets(); |
1555 styledNode = this->styledNode(); | 1555 styledNode = this->styledNode(); |
1556 style = computeRenderStyle(propertyID); | 1556 style = computeRenderStyle(propertyID); |
1557 renderer = styledNode->renderer(); | 1557 renderer = styledNode->renderer(); |
1558 } | 1558 } |
1559 } else { | 1559 } else { |
1560 style = computeRenderStyle(propertyID); | 1560 style = computeRenderStyle(propertyID); |
1561 } | 1561 } |
1562 | 1562 |
1563 if (!style) | 1563 if (!style) |
1564 return 0; | 1564 return nullptr; |
1565 | 1565 |
1566 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); | 1566 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d
irection(), style->writingMode()); |
1567 | 1567 |
1568 switch (propertyID) { | 1568 switch (propertyID) { |
1569 case CSSPropertyInvalid: | 1569 case CSSPropertyInvalid: |
1570 break; | 1570 break; |
1571 | 1571 |
1572 case CSSPropertyBackgroundColor: | 1572 case CSSPropertyBackgroundColor: |
1573 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidCo
lor(*style, style->backgroundColor()); | 1573 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidCo
lor(*style, style->backgroundColor()); |
1574 case CSSPropertyBackgroundImage: | 1574 case CSSPropertyBackgroundImage: |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1791 return cssValuePool().createValue(style->printColorAdjust()); | 1791 return cssValuePool().createValue(style->printColorAdjust()); |
1792 case CSSPropertyWebkitColumnAxis: | 1792 case CSSPropertyWebkitColumnAxis: |
1793 return cssValuePool().createValue(style->columnAxis()); | 1793 return cssValuePool().createValue(style->columnAxis()); |
1794 case CSSPropertyWebkitColumnCount: | 1794 case CSSPropertyWebkitColumnCount: |
1795 if (style->hasAutoColumnCount()) | 1795 if (style->hasAutoColumnCount()) |
1796 return cssValuePool().createIdentifierValue(CSSValueAuto); | 1796 return cssValuePool().createIdentifierValue(CSSValueAuto); |
1797 return cssValuePool().createValue(style->columnCount(), CSSPrimitive
Value::CSS_NUMBER); | 1797 return cssValuePool().createValue(style->columnCount(), CSSPrimitive
Value::CSS_NUMBER); |
1798 case CSSPropertyColumnFill: | 1798 case CSSPropertyColumnFill: |
1799 if (RuntimeEnabledFeatures::regionBasedColumnsEnabled()) | 1799 if (RuntimeEnabledFeatures::regionBasedColumnsEnabled()) |
1800 return cssValuePool().createValue(style->columnFill()); | 1800 return cssValuePool().createValue(style->columnFill()); |
1801 return 0; | 1801 return nullptr; |
1802 case CSSPropertyWebkitColumnGap: | 1802 case CSSPropertyWebkitColumnGap: |
1803 if (style->hasNormalColumnGap()) | 1803 if (style->hasNormalColumnGap()) |
1804 return cssValuePool().createIdentifierValue(CSSValueNormal); | 1804 return cssValuePool().createIdentifierValue(CSSValueNormal); |
1805 return zoomAdjustedPixelValue(style->columnGap(), *style); | 1805 return zoomAdjustedPixelValue(style->columnGap(), *style); |
1806 case CSSPropertyWebkitColumnProgression: | 1806 case CSSPropertyWebkitColumnProgression: |
1807 return cssValuePool().createValue(style->columnProgression()); | 1807 return cssValuePool().createValue(style->columnProgression()); |
1808 case CSSPropertyWebkitColumnRuleColor: | 1808 case CSSPropertyWebkitColumnRuleColor: |
1809 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(*style, style->columnRuleColor()); | 1809 return m_allowVisitedStyle ? cssValuePool().createColorValue(style->
visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor
(*style, style->columnRuleColor()); |
1810 case CSSPropertyWebkitColumnRuleStyle: | 1810 case CSSPropertyWebkitColumnRuleStyle: |
1811 return cssValuePool().createValue(style->columnRuleStyle()); | 1811 return cssValuePool().createValue(style->columnRuleStyle()); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2128 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd
ingLeft(), *style); | 2128 return zoomAdjustedPixelValue(toRenderBox(renderer)->computedCSSPadd
ingLeft(), *style); |
2129 } | 2129 } |
2130 case CSSPropertyPageBreakAfter: | 2130 case CSSPropertyPageBreakAfter: |
2131 return cssValuePool().createValue(style->pageBreakAfter()); | 2131 return cssValuePool().createValue(style->pageBreakAfter()); |
2132 case CSSPropertyPageBreakBefore: | 2132 case CSSPropertyPageBreakBefore: |
2133 return cssValuePool().createValue(style->pageBreakBefore()); | 2133 return cssValuePool().createValue(style->pageBreakBefore()); |
2134 case CSSPropertyPageBreakInside: { | 2134 case CSSPropertyPageBreakInside: { |
2135 EPageBreak pageBreak = style->pageBreakInside(); | 2135 EPageBreak pageBreak = style->pageBreakInside(); |
2136 ASSERT(pageBreak != PBALWAYS); | 2136 ASSERT(pageBreak != PBALWAYS); |
2137 if (pageBreak == PBALWAYS) | 2137 if (pageBreak == PBALWAYS) |
2138 return 0; | 2138 return nullptr; |
2139 return cssValuePool().createValue(style->pageBreakInside()); | 2139 return cssValuePool().createValue(style->pageBreakInside()); |
2140 } | 2140 } |
2141 case CSSPropertyPosition: | 2141 case CSSPropertyPosition: |
2142 return cssValuePool().createValue(style->position()); | 2142 return cssValuePool().createValue(style->position()); |
2143 case CSSPropertyRight: | 2143 case CSSPropertyRight: |
2144 return valueForPositionOffset(*style, CSSPropertyRight, renderer); | 2144 return valueForPositionOffset(*style, CSSPropertyRight, renderer); |
2145 case CSSPropertyWebkitRubyPosition: | 2145 case CSSPropertyWebkitRubyPosition: |
2146 return cssValuePool().createValue(style->rubyPosition()); | 2146 return cssValuePool().createValue(style->rubyPosition()); |
2147 case CSSPropertyScrollBehavior: | 2147 case CSSPropertyScrollBehavior: |
2148 return cssValuePool().createValue(style->scrollBehavior()); | 2148 return cssValuePool().createValue(style->scrollBehavior()); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2243 case TOP: | 2243 case TOP: |
2244 return cssValuePool().createIdentifierValue(CSSValueTop); | 2244 return cssValuePool().createIdentifierValue(CSSValueTop); |
2245 case BOTTOM: | 2245 case BOTTOM: |
2246 return cssValuePool().createIdentifierValue(CSSValueBottom); | 2246 return cssValuePool().createIdentifierValue(CSSValueBottom); |
2247 case BASELINE_MIDDLE: | 2247 case BASELINE_MIDDLE: |
2248 return cssValuePool().createIdentifierValue(CSSValueWebkitBa
selineMiddle); | 2248 return cssValuePool().createIdentifierValue(CSSValueWebkitBa
selineMiddle); |
2249 case LENGTH: | 2249 case LENGTH: |
2250 return cssValuePool().createValue(style->verticalAlignLength
()); | 2250 return cssValuePool().createValue(style->verticalAlignLength
()); |
2251 } | 2251 } |
2252 ASSERT_NOT_REACHED(); | 2252 ASSERT_NOT_REACHED(); |
2253 return 0; | 2253 return nullptr; |
2254 case CSSPropertyVisibility: | 2254 case CSSPropertyVisibility: |
2255 return cssValuePool().createValue(style->visibility()); | 2255 return cssValuePool().createValue(style->visibility()); |
2256 case CSSPropertyWhiteSpace: | 2256 case CSSPropertyWhiteSpace: |
2257 return cssValuePool().createValue(style->whiteSpace()); | 2257 return cssValuePool().createValue(style->whiteSpace()); |
2258 case CSSPropertyWidows: | 2258 case CSSPropertyWidows: |
2259 if (style->hasAutoWidows()) | 2259 if (style->hasAutoWidows()) |
2260 return cssValuePool().createIdentifierValue(CSSValueAuto); | 2260 return cssValuePool().createIdentifierValue(CSSValueAuto); |
2261 return cssValuePool().createValue(style->widows(), CSSPrimitiveValue
::CSS_NUMBER); | 2261 return cssValuePool().createValue(style->widows(), CSSPrimitiveValue
::CSS_NUMBER); |
2262 case CSSPropertyWidth: | 2262 case CSSPropertyWidth: |
2263 if (renderer) { | 2263 if (renderer) { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2662 return list.release(); | 2662 return list.release(); |
2663 } | 2663 } |
2664 case CSSPropertyBackground: | 2664 case CSSPropertyBackground: |
2665 return valuesForBackgroundShorthand(); | 2665 return valuesForBackgroundShorthand(); |
2666 case CSSPropertyBorder: { | 2666 case CSSPropertyBorder: { |
2667 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(CSSProperty
BorderTop, DoNotUpdateLayout); | 2667 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(CSSProperty
BorderTop, DoNotUpdateLayout); |
2668 const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPro
pertyBorderBottom, | 2668 const CSSPropertyID properties[3] = { CSSPropertyBorderRight, CSSPro
pertyBorderBottom, |
2669 CSSPropertyBorderLeft }; | 2669 CSSPropertyBorderLeft }; |
2670 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { | 2670 for (size_t i = 0; i < WTF_ARRAY_LENGTH(properties); ++i) { |
2671 if (!compareCSSValuePtr<CSSValue>(value, getPropertyCSSValue(pro
perties[i], DoNotUpdateLayout))) | 2671 if (!compareCSSValuePtr<CSSValue>(value, getPropertyCSSValue(pro
perties[i], DoNotUpdateLayout))) |
2672 return 0; | 2672 return nullptr; |
2673 } | 2673 } |
2674 return value.release(); | 2674 return value.release(); |
2675 } | 2675 } |
2676 case CSSPropertyBorderBottom: | 2676 case CSSPropertyBorderBottom: |
2677 return valuesForShorthandProperty(borderBottomShorthand()); | 2677 return valuesForShorthandProperty(borderBottomShorthand()); |
2678 case CSSPropertyBorderColor: | 2678 case CSSPropertyBorderColor: |
2679 return valuesForSidesShorthand(borderColorShorthand()); | 2679 return valuesForSidesShorthand(borderColorShorthand()); |
2680 case CSSPropertyBorderLeft: | 2680 case CSSPropertyBorderLeft: |
2681 return valuesForShorthandProperty(borderLeftShorthand()); | 2681 return valuesForShorthandProperty(borderLeftShorthand()); |
2682 case CSSPropertyBorderImage: | 2682 case CSSPropertyBorderImage: |
(...skipping 19 matching lines...) Expand all Loading... |
2702 case CSSPropertyOutline: | 2702 case CSSPropertyOutline: |
2703 return valuesForShorthandProperty(outlineShorthand()); | 2703 return valuesForShorthandProperty(outlineShorthand()); |
2704 case CSSPropertyPadding: | 2704 case CSSPropertyPadding: |
2705 return valuesForSidesShorthand(paddingShorthand()); | 2705 return valuesForSidesShorthand(paddingShorthand()); |
2706 /* Individual properties not part of the spec */ | 2706 /* Individual properties not part of the spec */ |
2707 case CSSPropertyBackgroundRepeatX: | 2707 case CSSPropertyBackgroundRepeatX: |
2708 case CSSPropertyBackgroundRepeatY: | 2708 case CSSPropertyBackgroundRepeatY: |
2709 break; | 2709 break; |
2710 case CSSPropertyInternalCallback: | 2710 case CSSPropertyInternalCallback: |
2711 // This property is hidden from the web. | 2711 // This property is hidden from the web. |
2712 return 0; | 2712 return nullptr; |
2713 | 2713 |
2714 /* Unimplemented CSS 3 properties (including CSS3 shorthand properties)
*/ | 2714 /* Unimplemented CSS 3 properties (including CSS3 shorthand properties)
*/ |
2715 case CSSPropertyWebkitTextEmphasis: | 2715 case CSSPropertyWebkitTextEmphasis: |
2716 case CSSPropertyTextLineThroughColor: | 2716 case CSSPropertyTextLineThroughColor: |
2717 case CSSPropertyTextLineThroughMode: | 2717 case CSSPropertyTextLineThroughMode: |
2718 case CSSPropertyTextLineThroughStyle: | 2718 case CSSPropertyTextLineThroughStyle: |
2719 case CSSPropertyTextLineThroughWidth: | 2719 case CSSPropertyTextLineThroughWidth: |
2720 case CSSPropertyTextOverlineColor: | 2720 case CSSPropertyTextOverlineColor: |
2721 case CSSPropertyTextOverlineMode: | 2721 case CSSPropertyTextOverlineMode: |
2722 case CSSPropertyTextOverlineStyle: | 2722 case CSSPropertyTextOverlineStyle: |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 case CSSPropertyUserZoom: | 2794 case CSSPropertyUserZoom: |
2795 break; | 2795 break; |
2796 | 2796 |
2797 // Internal properties that shouldn't be exposed throught getComputedSty
le. | 2797 // Internal properties that shouldn't be exposed throught getComputedSty
le. |
2798 case CSSPropertyInternalMarqueeDirection: | 2798 case CSSPropertyInternalMarqueeDirection: |
2799 case CSSPropertyInternalMarqueeIncrement: | 2799 case CSSPropertyInternalMarqueeIncrement: |
2800 case CSSPropertyInternalMarqueeRepetition: | 2800 case CSSPropertyInternalMarqueeRepetition: |
2801 case CSSPropertyInternalMarqueeSpeed: | 2801 case CSSPropertyInternalMarqueeSpeed: |
2802 case CSSPropertyInternalMarqueeStyle: | 2802 case CSSPropertyInternalMarqueeStyle: |
2803 ASSERT_NOT_REACHED(); | 2803 ASSERT_NOT_REACHED(); |
2804 return 0; | 2804 return nullptr; |
2805 | 2805 |
2806 case CSSPropertyBufferedRendering: | 2806 case CSSPropertyBufferedRendering: |
2807 case CSSPropertyClipPath: | 2807 case CSSPropertyClipPath: |
2808 case CSSPropertyClipRule: | 2808 case CSSPropertyClipRule: |
2809 case CSSPropertyMask: | 2809 case CSSPropertyMask: |
2810 case CSSPropertyEnableBackground: | 2810 case CSSPropertyEnableBackground: |
2811 case CSSPropertyFilter: | 2811 case CSSPropertyFilter: |
2812 case CSSPropertyFloodColor: | 2812 case CSSPropertyFloodColor: |
2813 case CSSPropertyFloodOpacity: | 2813 case CSSPropertyFloodOpacity: |
2814 case CSSPropertyLightingColor: | 2814 case CSSPropertyLightingColor: |
(...skipping 27 matching lines...) Expand all Loading... |
2842 case CSSPropertyGlyphOrientationVertical: | 2842 case CSSPropertyGlyphOrientationVertical: |
2843 case CSSPropertyKerning: | 2843 case CSSPropertyKerning: |
2844 case CSSPropertyTextAnchor: | 2844 case CSSPropertyTextAnchor: |
2845 case CSSPropertyVectorEffect: | 2845 case CSSPropertyVectorEffect: |
2846 case CSSPropertyPaintOrder: | 2846 case CSSPropertyPaintOrder: |
2847 case CSSPropertyWritingMode: | 2847 case CSSPropertyWritingMode: |
2848 return getSVGPropertyCSSValue(propertyID, DoNotUpdateLayout); | 2848 return getSVGPropertyCSSValue(propertyID, DoNotUpdateLayout); |
2849 } | 2849 } |
2850 | 2850 |
2851 logUnimplementedPropertyID(propertyID); | 2851 logUnimplementedPropertyID(propertyID); |
2852 return 0; | 2852 return nullptr; |
2853 } | 2853 } |
2854 | 2854 |
2855 String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) c
onst | 2855 String CSSComputedStyleDeclaration::getPropertyValue(CSSPropertyID propertyID) c
onst |
2856 { | 2856 { |
2857 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); | 2857 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); |
2858 if (value) | 2858 if (value) |
2859 return value->cssText(); | 2859 return value->cssText(); |
2860 return ""; | 2860 return ""; |
2861 } | 2861 } |
2862 | 2862 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2917 { | 2917 { |
2918 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; | 2918 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated()
; |
2919 // Assume the properties are in the usual order top, right, bottom, left. | 2919 // Assume the properties are in the usual order top, right, bottom, left. |
2920 RefPtrWillBeRawPtr<CSSValue> topValue = getPropertyCSSValue(shorthand.proper
ties()[0], DoNotUpdateLayout); | 2920 RefPtrWillBeRawPtr<CSSValue> topValue = getPropertyCSSValue(shorthand.proper
ties()[0], DoNotUpdateLayout); |
2921 RefPtrWillBeRawPtr<CSSValue> rightValue = getPropertyCSSValue(shorthand.prop
erties()[1], DoNotUpdateLayout); | 2921 RefPtrWillBeRawPtr<CSSValue> rightValue = getPropertyCSSValue(shorthand.prop
erties()[1], DoNotUpdateLayout); |
2922 RefPtrWillBeRawPtr<CSSValue> bottomValue = getPropertyCSSValue(shorthand.pro
perties()[2], DoNotUpdateLayout); | 2922 RefPtrWillBeRawPtr<CSSValue> bottomValue = getPropertyCSSValue(shorthand.pro
perties()[2], DoNotUpdateLayout); |
2923 RefPtrWillBeRawPtr<CSSValue> leftValue = getPropertyCSSValue(shorthand.prope
rties()[3], DoNotUpdateLayout); | 2923 RefPtrWillBeRawPtr<CSSValue> leftValue = getPropertyCSSValue(shorthand.prope
rties()[3], DoNotUpdateLayout); |
2924 | 2924 |
2925 // All 4 properties must be specified. | 2925 // All 4 properties must be specified. |
2926 if (!topValue || !rightValue || !bottomValue || !leftValue) | 2926 if (!topValue || !rightValue || !bottomValue || !leftValue) |
2927 return 0; | 2927 return nullptr; |
2928 | 2928 |
2929 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); | 2929 bool showLeft = !compareCSSValuePtr(rightValue, leftValue); |
2930 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; | 2930 bool showBottom = !compareCSSValuePtr(topValue, bottomValue) || showLeft; |
2931 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; | 2931 bool showRight = !compareCSSValuePtr(topValue, rightValue) || showBottom; |
2932 | 2932 |
2933 list->append(topValue.release()); | 2933 list->append(topValue.release()); |
2934 if (showRight) | 2934 if (showRight) |
2935 list->append(rightValue.release()); | 2935 list->append(rightValue.release()); |
2936 if (showBottom) | 2936 if (showBottom) |
2937 list->append(bottomValue.release()); | 2937 list->append(bottomValue.release()); |
(...skipping 27 matching lines...) Expand all Loading... |
2965 | 2965 |
2966 CSSRule* CSSComputedStyleDeclaration::parentRule() const | 2966 CSSRule* CSSComputedStyleDeclaration::parentRule() const |
2967 { | 2967 { |
2968 return 0; | 2968 return 0; |
2969 } | 2969 } |
2970 | 2970 |
2971 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(const String& propertyName) | 2971 PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
e(const String& propertyName) |
2972 { | 2972 { |
2973 CSSPropertyID propertyID = cssPropertyID(propertyName); | 2973 CSSPropertyID propertyID = cssPropertyID(propertyName); |
2974 if (!propertyID) | 2974 if (!propertyID) |
2975 return 0; | 2975 return nullptr; |
2976 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); | 2976 RefPtrWillBeRawPtr<CSSValue> value = getPropertyCSSValue(propertyID); |
2977 return value ? value->cloneForCSSOM() : 0; | 2977 return value ? value->cloneForCSSOM() : nullptr; |
2978 } | 2978 } |
2979 | 2979 |
2980 String CSSComputedStyleDeclaration::getPropertyValue(const String& propertyName) | 2980 String CSSComputedStyleDeclaration::getPropertyValue(const String& propertyName) |
2981 { | 2981 { |
2982 CSSPropertyID propertyID = cssPropertyID(propertyName); | 2982 CSSPropertyID propertyID = cssPropertyID(propertyName); |
2983 if (!propertyID || !RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID)) | 2983 if (!propertyID || !RuntimeCSSEnabled::isCSSPropertyEnabled(propertyID)) |
2984 return String(); | 2984 return String(); |
2985 return getPropertyValue(propertyID); | 2985 return getPropertyValue(propertyID); |
2986 } | 2986 } |
2987 | 2987 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3035 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, | 3035 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB
ackgroundSize, CSSPropertyBackgroundOrigin, |
3036 CSSPropertyB
ackgroundClip }; | 3036 CSSPropertyB
ackgroundClip }; |
3037 | 3037 |
3038 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; | 3038 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated()
; |
3039 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); | 3039 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash
Seperator)))); |
3040 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); | 3040 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa
ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe
perator)))); |
3041 return list.release(); | 3041 return list.release(); |
3042 } | 3042 } |
3043 | 3043 |
3044 } // namespace WebCore | 3044 } // namespace WebCore |
OLD | NEW |