Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 1265903002: CSSValue Immediates: Remove redundant isTaggedPtr() checks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@tagged_ptrs_base
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 typedef HashMap<const CSSPrimitiveValue*, String> CSSTextCache; 162 typedef HashMap<const CSSPrimitiveValue*, String> CSSTextCache;
163 static CSSTextCache& cssTextCache() 163 static CSSTextCache& cssTextCache()
164 { 164 {
165 AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCache>, cache, ne w ThreadSpecific<CSSTextCache>()); 165 AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCache>, cache, ne w ThreadSpecific<CSSTextCache>());
166 return *cache; 166 return *cache;
167 } 167 }
168 168
169 CSSPrimitiveValue::UnitType CSSPrimitiveValue::primitiveType() const 169 CSSPrimitiveValue::UnitType CSSPrimitiveValue::primitiveType() const
170 { 170 {
171 if (type() == CSS_PROPERTY_ID || type() == CSS_VALUE_ID) 171 CSSPrimitiveValue::UnitType unitType = type();
172
173 if (unitType == CSS_PROPERTY_ID || unitType == CSS_VALUE_ID)
172 return CSS_IDENT; 174 return CSS_IDENT;
173 175
174 if (type() != CSS_CALC) 176 if (unitType != CSS_CALC)
175 return type(); 177 return unitType;
176 178
177 switch (value().calc->category()) { 179 ASSERT(!isTaggedPtr());
180 switch (m_value.calc->category()) {
178 case CalcAngle: 181 case CalcAngle:
179 return CSS_DEG; 182 return CSS_DEG;
180 case CalcFrequency: 183 case CalcFrequency:
181 return CSS_HZ; 184 return CSS_HZ;
182 case CalcNumber: 185 case CalcNumber:
183 return CSS_NUMBER; 186 return CSS_NUMBER;
184 case CalcPercent: 187 case CalcPercent:
185 return CSS_PERCENTAGE; 188 return CSS_PERCENTAGE;
186 case CalcLength: 189 case CalcLength:
187 return CSS_PX; 190 return CSS_PX;
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 CSSPrimitiveValue::~CSSPrimitiveValue() 402 CSSPrimitiveValue::~CSSPrimitiveValue()
400 { 403 {
401 cleanup(); 404 cleanup();
402 } 405 }
403 406
404 void CSSPrimitiveValue::cleanup() 407 void CSSPrimitiveValue::cleanup()
405 { 408 {
406 if (isTaggedPtr()) 409 if (isTaggedPtr())
407 return; 410 return;
408 411
409 switch (type()) { 412 switch (m_primitiveUnitType) {
410 case CSS_CUSTOM_IDENT: 413 case CSS_CUSTOM_IDENT:
411 case CSS_STRING: 414 case CSS_STRING:
412 case CSS_URI: 415 case CSS_URI:
413 case CSS_ATTR: 416 case CSS_ATTR:
414 if (m_value.string) 417 if (m_value.string)
415 m_value.string->deref(); 418 m_value.string->deref();
416 break; 419 break;
417 case CSS_COUNTER: 420 case CSS_COUNTER:
418 // We must not call deref() when oilpan is enabled because m_value.count er is traced. 421 // We must not call deref() when oilpan is enabled because m_value.count er is traced.
419 #if !ENABLE(OILPAN) 422 #if !ENABLE(OILPAN)
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa ta& conversionData) 565 template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionDa ta& conversionData)
563 { 566 {
564 return computeLengthDouble(conversionData); 567 return computeLengthDouble(conversionData);
565 } 568 }
566 569
567 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c onversionData) 570 double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& c onversionData)
568 { 571 {
569 // The logic in this function is duplicated in MediaValues::computeLength 572 // The logic in this function is duplicated in MediaValues::computeLength
570 // because MediaValues::computeLength needs nearly identical logic, but we h aven't found a way to make 573 // because MediaValues::computeLength needs nearly identical logic, but we h aven't found a way to make
571 // CSSPrimitiveValue::computeLengthDouble more generic (to solve both cases) without hurting performance. 574 // CSSPrimitiveValue::computeLengthDouble more generic (to solve both cases) without hurting performance.
572 if (type() == CSS_CALC) 575 if (!isTaggedPtr() && m_primitiveUnitType == CSS_CALC)
573 return value().calc->computeLengthPx(conversionData); 576 return m_value.calc->computeLengthPx(conversionData);
574 577
575 double factor; 578 double factor;
576 579
577 switch (primitiveType()) { 580 switch (primitiveType()) {
578 case CSS_EMS: 581 case CSS_EMS:
579 factor = conversionData.emFontSize(); 582 factor = conversionData.emFontSize();
580 break; 583 break;
581 case CSS_EXS: 584 case CSS_EXS:
582 factor = conversionData.exFontSize(); 585 factor = conversionData.exFontSize();
583 break; 586 break;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 if (isFontRelativeLength()) 636 if (isFontRelativeLength())
634 return result; 637 return result;
635 638
636 return result * conversionData.zoom(); 639 return result * conversionData.zoom();
637 } 640 }
638 641
639 void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, CSSLe ngthTypeArray& lengthTypeArray, double multiplier) const 642 void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, CSSLe ngthTypeArray& lengthTypeArray, double multiplier) const
640 { 643 {
641 ASSERT(lengthArray.size() == LengthUnitTypeCount); 644 ASSERT(lengthArray.size() == LengthUnitTypeCount);
642 645
643 if (type() == CSS_CALC) { 646 if (!isTaggedPtr() && m_primitiveUnitType == CSS_CALC) {
644 cssCalcValue()->accumulateLengthArray(lengthArray, lengthTypeArray, mult iplier); 647 cssCalcValue()->accumulateLengthArray(lengthArray, lengthTypeArray, mult iplier);
645 return; 648 return;
646 } 649 }
647 650
648 LengthUnitType lengthType; 651 LengthUnitType lengthType;
649 if (unitTypeToLengthUnitType(type(), lengthType)) { 652 CSSPrimitiveValue::UnitType unitType = type();
650 lengthArray.at(lengthType) += value().num * conversionToCanonicalUnitsSc aleFactor(type()) * multiplier; 653 if (unitTypeToLengthUnitType(unitType, lengthType)) {
654 lengthArray.at(lengthType) += numValue() * conversionToCanonicalUnitsSca leFactor(unitType) * multiplier;
651 lengthTypeArray.set(lengthType); 655 lengthTypeArray.set(lengthType);
652 } 656 }
653 } 657 }
654 658
655 void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, doubl e multiplier) const 659 void CSSPrimitiveValue::accumulateLengthArray(CSSLengthArray& lengthArray, doubl e multiplier) const
656 { 660 {
657 CSSLengthTypeArray lengthTypeArray; 661 CSSLengthTypeArray lengthTypeArray;
658 lengthTypeArray.resize(CSSPrimitiveValue::LengthUnitTypeCount); 662 lengthTypeArray.resize(CSSPrimitiveValue::LengthUnitTypeCount);
659 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; ++i) 663 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; ++i)
660 lengthTypeArray.clear(i); 664 lengthTypeArray.clear(i);
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 if (isPercentage()) 724 if (isPercentage())
721 return Length(getDoubleValue(), Percent); 725 return Length(getDoubleValue(), Percent);
722 ASSERT(isCalculated()); 726 ASSERT(isCalculated());
723 return Length(cssCalcValue()->toCalcValue(conversionData)); 727 return Length(cssCalcValue()->toCalcValue(conversionData));
724 } 728 }
725 729
726 double CSSPrimitiveValue::getCalcDoubleValue() const 730 double CSSPrimitiveValue::getCalcDoubleValue() const
727 { 731 {
728 ASSERT(!isTaggedPtr()); 732 ASSERT(!isTaggedPtr());
729 ASSERT(m_primitiveUnitType == CSS_CALC); 733 ASSERT(m_primitiveUnitType == CSS_CALC);
730 return value().calc->doubleValue(); 734 return m_value.calc->doubleValue();
731 } 735 }
732 736
733 CSSPrimitiveValue::UnitType CSSPrimitiveValue::canonicalUnitTypeForCategory(Unit Category category) 737 CSSPrimitiveValue::UnitType CSSPrimitiveValue::canonicalUnitTypeForCategory(Unit Category category)
734 { 738 {
735 // The canonical unit type is chosen according to the way CSSPropertyParser: :validUnit() chooses the default unit 739 // The canonical unit type is chosen according to the way CSSPropertyParser: :validUnit() chooses the default unit
736 // in each category (based on unitflags). 740 // in each category (based on unitflags).
737 switch (category) { 741 switch (category) {
738 case UNumber: 742 case UNumber:
739 return CSS_NUMBER; 743 return CSS_NUMBER;
740 case ULength: 744 case ULength:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 return CSSPrimitiveValue::CSS_UNKNOWN; 831 return CSSPrimitiveValue::CSS_UNKNOWN;
828 } 832 }
829 833
830 String CSSPrimitiveValue::getStringValue() const 834 String CSSPrimitiveValue::getStringValue() const
831 { 835 {
832 switch (type()) { 836 switch (type()) {
833 case CSS_CUSTOM_IDENT: 837 case CSS_CUSTOM_IDENT:
834 case CSS_STRING: 838 case CSS_STRING:
835 case CSS_ATTR: 839 case CSS_ATTR:
836 case CSS_URI: 840 case CSS_URI:
837 return value().string; 841 return m_value.string;
838 case CSS_VALUE_ID: 842 case CSS_VALUE_ID:
839 return valueName(value().valueID); 843 return valueName(valueIDValue());
840 case CSS_PROPERTY_ID: 844 case CSS_PROPERTY_ID:
841 return propertyName(value().propertyID); 845 return propertyName(propertyIDValue());
842 default: 846 default:
843 break; 847 break;
844 } 848 }
845 849
846 return String(); 850 return String();
847 } 851 }
848 852
849 static String formatNumber(double number, const char* suffix, unsigned suffixLen gth) 853 static String formatNumber(double number, const char* suffix, unsigned suffixLen gth)
850 { 854 {
851 #if OS(WIN) && _MSC_VER < 1900 855 #if OS(WIN) && _MSC_VER < 1900
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 { 962 {
959 if (isTaggedPtr() && cssTextCache().contains(this)) 963 if (isTaggedPtr() && cssTextCache().contains(this))
960 return cssTextCache().get(this); 964 return cssTextCache().get(this);
961 965
962 if (!isTaggedPtr() && m_hasCachedCSSText) { 966 if (!isTaggedPtr() && m_hasCachedCSSText) {
963 ASSERT(cssTextCache().contains(this)); 967 ASSERT(cssTextCache().contains(this));
964 return cssTextCache().get(this); 968 return cssTextCache().get(this);
965 } 969 }
966 970
967 String text; 971 String text;
968 switch (type()) { 972 CSSPrimitiveValue::UnitType unitType = type();
973 switch (unitType) {
969 case CSS_UNKNOWN: 974 case CSS_UNKNOWN:
970 // FIXME 975 // FIXME
971 break; 976 break;
972 case CSS_INTEGER: 977 case CSS_INTEGER:
973 text = String::format("%d", getIntValue()); 978 text = String::format("%d", getIntValue());
974 break; 979 break;
975 case CSS_NUMBER: 980 case CSS_NUMBER:
976 case CSS_PERCENTAGE: 981 case CSS_PERCENTAGE:
977 case CSS_EMS: 982 case CSS_EMS:
978 case CSS_EXS: 983 case CSS_EXS:
(...skipping 14 matching lines...) Expand all
993 case CSS_MS: 998 case CSS_MS:
994 case CSS_S: 999 case CSS_S:
995 case CSS_HZ: 1000 case CSS_HZ:
996 case CSS_KHZ: 1001 case CSS_KHZ:
997 case CSS_TURN: 1002 case CSS_TURN:
998 case CSS_FR: 1003 case CSS_FR:
999 case CSS_VW: 1004 case CSS_VW:
1000 case CSS_VH: 1005 case CSS_VH:
1001 case CSS_VMIN: 1006 case CSS_VMIN:
1002 case CSS_VMAX: 1007 case CSS_VMAX:
1003 text = formatNumber(value().num, unitTypeToString(type())); 1008 text = formatNumber(numValue(), unitTypeToString(unitType));
1004 break; 1009 break;
1005 case CSS_CUSTOM_IDENT: 1010 case CSS_CUSTOM_IDENT:
1006 text = quoteCSSStringIfNeeded(value().string); 1011 text = quoteCSSStringIfNeeded(m_value.string);
1007 break; 1012 break;
1008 case CSS_STRING: { 1013 case CSS_STRING: {
1009 text = serializeString(value().string); 1014 text = serializeString(m_value.string);
1010 break; 1015 break;
1011 } 1016 }
1012 case CSS_URI: 1017 case CSS_URI:
1013 text = "url(" + quoteCSSURLIfNeeded(value().string) + ")"; 1018 text = "url(" + quoteCSSURLIfNeeded(m_value.string) + ")";
1014 break; 1019 break;
1015 case CSS_VALUE_ID: 1020 case CSS_VALUE_ID:
1016 text = valueName(value().valueID); 1021 text = valueName(valueIDValue());
1017 break; 1022 break;
1018 case CSS_PROPERTY_ID: 1023 case CSS_PROPERTY_ID:
1019 text = propertyName(value().propertyID); 1024 text = propertyName(propertyIDValue());
1020 break; 1025 break;
1021 case CSS_ATTR: { 1026 case CSS_ATTR: {
1022 StringBuilder result; 1027 StringBuilder result;
1023 result.reserveCapacity(6 + value().string->length()); 1028 result.reserveCapacity(6 + m_value.string->length());
1024 result.appendLiteral("attr("); 1029 result.appendLiteral("attr(");
1025 result.append(value().string); 1030 result.append(m_value.string);
1026 result.append(')'); 1031 result.append(')');
1027 1032
1028 text = result.toString(); 1033 text = result.toString();
1029 break; 1034 break;
1030 } 1035 }
1031 case CSS_COUNTER: { 1036 case CSS_COUNTER: {
1032 StringBuilder result; 1037 StringBuilder result;
1033 String separator = value().counter->separator(); 1038 String separator = m_value.counter->separator();
1034 if (separator.isEmpty()) 1039 if (separator.isEmpty())
1035 result.appendLiteral("counter("); 1040 result.appendLiteral("counter(");
1036 else 1041 else
1037 result.appendLiteral("counters("); 1042 result.appendLiteral("counters(");
1038 1043
1039 result.append(value().counter->identifier()); 1044 result.append(m_value.counter->identifier());
1040 if (!separator.isEmpty()) { 1045 if (!separator.isEmpty()) {
1041 result.appendLiteral(", "); 1046 result.appendLiteral(", ");
1042 result.append(serializeString(separator)); 1047 result.append(serializeString(separator));
1043 } 1048 }
1044 String listStyle = value().counter->listStyle(); 1049 String listStyle = m_value.counter->listStyle();
1045 bool isDefaultListStyle = value().counter->listStyleIdent() == CSSVa lueDecimal; 1050 bool isDefaultListStyle = m_value.counter->listStyleIdent() == CSSVa lueDecimal;
1046 if (!listStyle.isEmpty() && !isDefaultListStyle) { 1051 if (!listStyle.isEmpty() && !isDefaultListStyle) {
1047 result.appendLiteral(", "); 1052 result.appendLiteral(", ");
1048 result.append(listStyle); 1053 result.append(listStyle);
1049 } 1054 }
1050 result.append(')'); 1055 result.append(')');
1051 1056
1052 text = result.toString(); 1057 text = result.toString();
1053 break; 1058 break;
1054 } 1059 }
1055 case CSS_RECT: 1060 case CSS_RECT:
1056 text = getRectValue()->cssText(); 1061 text = getRectValue()->cssText();
1057 break; 1062 break;
1058 case CSS_QUAD: 1063 case CSS_QUAD:
1059 text = getQuadValue()->cssText(); 1064 text = getQuadValue()->cssText();
1060 break; 1065 break;
1061 case CSS_RGBCOLOR: { 1066 case CSS_RGBCOLOR: {
1062 text = Color(value().rgbcolor).serializedAsCSSComponentValue(); 1067 text = Color(rgbcolorValue()).serializedAsCSSComponentValue();
1063 break; 1068 break;
1064 } 1069 }
1065 case CSS_PAIR: 1070 case CSS_PAIR:
1066 text = getPairValue()->cssText(); 1071 text = getPairValue()->cssText();
1067 break; 1072 break;
1068 case CSS_CALC: 1073 case CSS_CALC:
1069 text = value().calc->cssText(); 1074 text = m_value.calc->cssText();
1070 break; 1075 break;
1071 case CSS_SHAPE: 1076 case CSS_SHAPE:
1072 text = value().shape->cssText(); 1077 text = m_value.shape->cssText();
1073 break; 1078 break;
1074 case CSS_IDENT: 1079 case CSS_IDENT:
1075 case CSS_CALC_PERCENTAGE_WITH_NUMBER: 1080 case CSS_CALC_PERCENTAGE_WITH_NUMBER:
1076 case CSS_CALC_PERCENTAGE_WITH_LENGTH: 1081 case CSS_CALC_PERCENTAGE_WITH_LENGTH:
1077 case CSS_QEM: 1082 case CSS_QEM:
1078 break; 1083 break;
1079 } 1084 }
1080 1085
1081 ASSERT(!cssTextCache().contains(this)); 1086 ASSERT(!cssTextCache().contains(this));
1082 cssTextCache().set(this, text); 1087 cssTextCache().set(this, text);
1083 if (!isTaggedPtr()) 1088 if (!isTaggedPtr())
1084 m_hasCachedCSSText = true; 1089 m_hasCachedCSSText = true;
1085 return text; 1090 return text;
1086 } 1091 }
1087 1092
1088 bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const 1093 bool CSSPrimitiveValue::equals(const CSSPrimitiveValue& other) const
1089 { 1094 {
1090 if (type() != other.type()) 1095 if (isTaggedPtr() && other.isTaggedPtr())
1096 return this == &other;
1097
1098 CSSPrimitiveValue::UnitType thisType = type();
1099 CSSPrimitiveValue::UnitType otherType = other.type();
1100
1101 if (thisType != otherType)
1091 return false; 1102 return false;
1092 1103
1093 switch (type()) { 1104 switch (thisType) {
1094 case CSS_UNKNOWN: 1105 case CSS_UNKNOWN:
1095 return false; 1106 return false;
1096 case CSS_NUMBER: 1107 case CSS_NUMBER:
1097 case CSS_PERCENTAGE: 1108 case CSS_PERCENTAGE:
1098 case CSS_EMS: 1109 case CSS_EMS:
1099 case CSS_EXS: 1110 case CSS_EXS:
1100 case CSS_REMS: 1111 case CSS_REMS:
1101 case CSS_PX: 1112 case CSS_PX:
1102 case CSS_CM: 1113 case CSS_CM:
1103 case CSS_DPPX: 1114 case CSS_DPPX:
1104 case CSS_DPI: 1115 case CSS_DPI:
1105 case CSS_DPCM: 1116 case CSS_DPCM:
1106 case CSS_MM: 1117 case CSS_MM:
1107 case CSS_IN: 1118 case CSS_IN:
1108 case CSS_PT: 1119 case CSS_PT:
1109 case CSS_PC: 1120 case CSS_PC:
1110 case CSS_DEG: 1121 case CSS_DEG:
1111 case CSS_RAD: 1122 case CSS_RAD:
1112 case CSS_GRAD: 1123 case CSS_GRAD:
1113 case CSS_MS: 1124 case CSS_MS:
1114 case CSS_S: 1125 case CSS_S:
1115 case CSS_HZ: 1126 case CSS_HZ:
1116 case CSS_KHZ: 1127 case CSS_KHZ:
1117 case CSS_TURN: 1128 case CSS_TURN:
1118 case CSS_VW: 1129 case CSS_VW:
1119 case CSS_VH: 1130 case CSS_VH:
1120 case CSS_VMIN: 1131 case CSS_VMIN:
1121 case CSS_VMAX: 1132 case CSS_VMAX:
1122 case CSS_FR: 1133 case CSS_FR:
1123 return value().num == other.value().num; 1134 return numValue() == other.numValue();
1124 case CSS_PROPERTY_ID: 1135 case CSS_PROPERTY_ID:
1125 return value().propertyID == other.value().propertyID; 1136 return propertyIDValue() == other.propertyIDValue();
1126 case CSS_VALUE_ID: 1137 case CSS_VALUE_ID:
1127 return value().valueID == other.value().valueID; 1138 return valueIDValue() == other.valueIDValue();
1128 case CSS_CUSTOM_IDENT: 1139 case CSS_CUSTOM_IDENT:
1129 case CSS_STRING: 1140 case CSS_STRING:
1130 case CSS_URI: 1141 case CSS_URI:
1131 case CSS_ATTR: 1142 case CSS_ATTR:
1132 return equal(value().string, other.value().string); 1143 return equal(m_value.string, other.m_value.string);
1133 case CSS_COUNTER: 1144 case CSS_COUNTER:
1134 return value().counter && other.value().counter && value().counter->equa ls(*other.value().counter); 1145 return m_value.counter && other.m_value.counter && m_value.counter->equa ls(*other.m_value.counter);
1135 case CSS_RECT: 1146 case CSS_RECT:
1136 return value().rect && other.value().rect && value().rect->equals(*other .value().rect); 1147 return m_value.pair && other.m_value.pair && m_value.pair->equals(*other .m_value.pair);
1137 case CSS_QUAD: 1148 case CSS_QUAD:
1138 return value().quad && other.value().quad && value().quad->equals(*other .value().quad); 1149 return m_value.quad && other.m_value.quad && m_value.quad->equals(*other .m_value.quad);
1139 case CSS_RGBCOLOR: 1150 case CSS_RGBCOLOR:
1140 return value().rgbcolor == other.value().rgbcolor; 1151 return rgbcolorValue() == other.rgbcolorValue();
1141 case CSS_PAIR: 1152 case CSS_PAIR:
1142 return value().pair && other.value().pair && value().pair->equals(*other .value().pair); 1153 return m_value.pair && other.m_value.pair && m_value.pair->equals(*other .m_value.pair);
1143 case CSS_CALC: 1154 case CSS_CALC:
1144 return value().calc && other.value().calc && value().calc->equals(*other .value().calc); 1155 return m_value.calc && other.m_value.calc && m_value.calc->equals(*other .m_value.calc);
1145 case CSS_SHAPE: 1156 case CSS_SHAPE:
1146 return value().shape && other.value().shape && value().shape->equals(*ot her.value().shape); 1157 return m_value.shape && other.m_value.shape && m_value.shape->equals(*ot her.m_value.shape);
1147 case CSS_IDENT: 1158 case CSS_IDENT:
1148 case CSS_INTEGER: 1159 case CSS_INTEGER:
1149 case CSS_CHS: 1160 case CSS_CHS:
1150 case CSS_CALC_PERCENTAGE_WITH_NUMBER: 1161 case CSS_CALC_PERCENTAGE_WITH_NUMBER:
1151 case CSS_CALC_PERCENTAGE_WITH_LENGTH: 1162 case CSS_CALC_PERCENTAGE_WITH_LENGTH:
1152 case CSS_QEM: 1163 case CSS_QEM:
1153 return false; 1164 return false;
1154 } 1165 }
1155 return false; 1166 return false;
1156 } 1167 }
1157 1168
1158 DEFINE_TRACE_AFTER_DISPATCH(CSSPrimitiveValue) 1169 DEFINE_TRACE_AFTER_DISPATCH(CSSPrimitiveValue)
1159 { 1170 {
1160 #if ENABLE(OILPAN) 1171 #if ENABLE(OILPAN)
1161 switch (type()) { 1172 if (!isTaggedPtr()) {
1162 case CSS_COUNTER: 1173 switch (m_type) {
1163 visitor->trace(value().counter); 1174 case CSS_COUNTER:
1164 break; 1175 visitor->trace(m_value.counter);
1165 case CSS_RECT: 1176 break;
1166 visitor->trace(value().rect); 1177 case CSS_RECT:
1167 break; 1178 visitor->trace(m_value.pair);
1168 case CSS_QUAD: 1179 break;
1169 visitor->trace(value().quad); 1180 case CSS_QUAD:
1170 break; 1181 visitor->trace(m_value.quad);
1171 case CSS_PAIR: 1182 break;
1172 visitor->trace(value().pair); 1183 case CSS_PAIR:
1173 break; 1184 visitor->trace(m_value.pair);
1174 case CSS_CALC: 1185 break;
1175 visitor->trace(value().calc); 1186 case CSS_CALC:
1176 break; 1187 visitor->trace(m_value.calc);
1177 case CSS_SHAPE: 1188 break;
1178 visitor->trace(value().shape); 1189 case CSS_SHAPE:
1179 break; 1190 visitor->trace(m_value.shape);
1180 default: 1191 break;
1181 break; 1192 default:
1193 break;
1194 }
1182 } 1195 }
1183 #endif 1196 #endif
1184 CSSValue::traceAfterDispatch(visitor); 1197 CSSValue::traceAfterDispatch(visitor);
1185 } 1198 }
1186 1199
1187 } // namespace blink 1200 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698