Lines Matching full:value
280 setupParser("@-webkit-value{", string, "} ");
317 CSSValue* value = parser.m_parsedProperties[0]->value();
318 if (value->cssValueType() == CSSValue::CSS_PRIMITIVE_VALUE) {
319 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value);
422 void CSSParser::addProperty(int propId, PassRefPtr<CSSValue> value, bool important)
424 auto_ptr<CSSProperty> prop(new CSSProperty(propId, value, important, m_currentShorthand, m_implicitShorthand));
463 bool CSSParser::validUnit(CSSParserValue* value, Units unitflags, bool strict)
466 switch (value->unit) {
469 if (!b && ((unitflags & (FLength | FAngle | FTime)) && (value->fValue == 0 || !strict))) {
470 value->unit = (unitflags & FLength) ? CSSPrimitiveValue::CSS_PX :
474 if (!b && (unitflags & FInteger) && value->isInt)
508 if (b && unitflags & FNonNeg && value->fValue < 0)
513 static int unitFromString(CSSParserValue* value)
515 if (value->unit != CSSPrimitiveValue::CSS_IDENT || value->id)
518 if (equal(value->string, "em"))
520 if (equal(value->string, "rem"))
522 if (equal(value->string, "ex"))
524 if (equal(value->string, "px"))
526 if (equal(value->string, "cm"))
528 value->string, "mm"))
530 if (equal(value->string, "in"))
532 if (equal(value->string, "pt"))
534 if (equal(value->string, "pc"))
536 if (equal(value->string, "deg"))
538 if (equal(value->string, "rad"))
540 if (equal(value->string, "grad"))
542 if (equal(value->string, "turn"))
544 if (equal(value->string, "ms"))
546 if (equal(value->string, "s"))
548 if (equal(value->string, "Hz"))
550 if (equal(value->string, "kHz"))
566 CSSParserValue* value = m_valueList->valueAt(i);
570 int unit = unitFromString(value);
575 // Now delete the bogus unit value.
577 i--; // We're safe even though |i| is unsigned, since we only hit this code if we had a previous numeric value (so |i| is always > 0 here).
583 numericVal = (value->unit == CSSPrimitiveValue::CSS_NUMBER) ? value : 0;
592 CSSParserValue *value = m_valueList->current();
594 if (!value)
597 int id = value->id;
630 /* The comment to the left defines all valid value of this properties as defined
699 else if (value->unit == CSSParserValue::Function)
726 CSSValue* value = m_parsedProperties[m_numParsedProperties - 1]->value();
727 addProperty(CSSPropertyOverflowY, value, important);
786 value->unit == CSSPrimitiveValue::CSS_STRING)
814 CSSValue* value = m_parsedProperties[m_numParsedProperties-1]->value();
815 addProperty(properties[1], value, important);
828 validPrimitive = validUnit(value, FLength | FNonNeg, m_strict);
872 while (value && value->unit == CSSPrimitiveValue::CSS_URI) {
875 String uri = value->string;
877 value = m_valueList->next();
878 while (value && value->unit == CSSPrimitiveValue::CSS_NUMBER) {
879 coords.append(int(value->fValue));
880 value = m_valueList->next();
895 if ((m_strict && !value) || (value && !(value->unit == CSSParserValue::Operator && value->iValue == ',')))
897 value = m_valueList->next(); // comma
900 if (!value) { // no value after url list (MSIE 5 compatibility)
903 } else if (!m_strict && value->id == CSSValueHand) // MSIE 5 compatibility :/
905 else if (value && ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitGrabbing) || value->id == CSSValueCopy || value->id == CSSValueNone))
906 list->append(CSSPrimitiveValue::createIdentifier(value->id));
911 id = value->id;
912 if (!m_strict && value->id == CSSValueHand) { // MSIE 5 compatibility :/
915 } else if ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitGrabbing) || value->id == CSSValueCopy || value->id == CSSValueNone)
971 } else if (value->unit == CSSPrimitiveValue::CSS_URI) {
975 parsedValue = CSSImageValue::create(m_styleSheet->completeURL(value->string));
978 } else if (value->unit == CSSParserValue::Function && equalIgnoringCase(value->function->name, "-webkit-gradient(")) {
996 validPrimitive = validUnit(value, FLength, m_strict);
1004 validPrimitive = validUnit(value, FLength, m_strict);
1023 validPrimitive = (!id && validUnit(value, FLength | FPercent, m_strict));
1038 validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict));
1046 validPrimitive = (validUnit(value, FLength | FPercent | FNonNeg, m_strict));
1062 validPrimitive = (!id && validUnit(value, FLength | FPercent, m_strict));
1071 validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict));
1086 validPrimitive = (!id && validUnit(value, FLength | FPercent, m_strict));
1098 validPrimitive = (!id && validUnit(value, FInteger, false));
1105 validPrimitive = (!id && validUnit(value, FNumber | FLength | FPercent | FNonNeg, m_strict));
1132 while (isValid && value) {
1133 switch (value->id) {
1139 list->append(CSSPrimitiveValue::createIdentifier(value->id));
1144 value = m_valueList->next();
1157 validPrimitive = (!id && validUnit(value, FNumber | FPercent | FNonNeg, true));
1196 // into the last seen URI value!?
1229 validPrimitive = validUnit(value, FLength, m_strict);
1232 RefPtr<CSSPrimitiveValue> parsedValue1 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
1235 value = m_valueList->next();
1236 validPrimitive = validUnit(value, FLength, m_strict);
1239 parsedValue2 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
1252 validPrimitive = validUnit(value, FLength, m_strict);
1268 validPrimitive = validUnit(value, FNumber, m_strict);
1294 validPrimitive = validUnit(value, FNumber, m_strict);
1298 value, FInteger | FNonNeg, true);
1322 validPrimitive = validUnit(value, FLength | FPercent, m_strict);
1332 validPrimitive = validUnit(value, FInteger | FNonNeg, m_strict);
1338 validPrimitive = validUnit(value, FTime | FInteger | FNonNeg, m_strict);
1353 validPrimitive = validUnit(value, FInteger | FNonNeg, m_strict);
1359 validPrimitive = validUnit(value, FTime | FInteger | FNonNeg, m_strict);
1409 if (value->id == CSSValueFlat || value->id == CSSValuePreserve3d)
1413 if (value->id == CSSValueVisible || value->id == CSSValueHidden)
1421 if (validUnit(value, FNumber | FLength | FNonNeg, m_strict)) {
1422 RefPtr<CSSValue> val = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
1470 CSSValue* value = m_parsedProperties[m_numParsedProperties-1]->value();
1471 addProperty(properties[1], value, important);
1513 validPrimitive = !id && validUnit(value, FNumber | FLength | FPercent, m_strict);
1523 validPrimitive = !id && validUnit(value, FInteger | FNonNeg, false);
1529 validPrimitive = validUnit(value, FLength | FNonNeg, m_strict);
1535 validPrimitive = validUnit(value, FLength, true);
1550 // When specifying number of lines, don't allow 0 as a valid value
1552 validPrimitive = (!id && (value->unit == CSSPrimitiveValue::CSS_PERCENTAGE || value->fValue) && validUnit(value, FInteger | FPercent | FNonNeg, false));
1564 validPrimitive = validUnit(value, FLength, m_strict);
1583 if (id == CSSValueNone || value->unit == CSSPrimitiveValue::CSS_STRING)
1606 if (value->unit == CSSParserValue::Function || id == CSSValueNone)
1762 else if (value->unit == CSSPrimitiveValue::CSS_STRING)
1763 parsedValue = CSSPrimitiveValue::create(value->string, (CSSPrimitiveValue::UnitTypes) value->unit);
1764 else if (value->unit >= CSSPrimitiveValue::CSS_NUMBER && value->unit <= CSSPrimitiveValue::CSS_KHZ)
1765 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
1766 else if (value->unit >= CSSPrimitiveValue::CSS_TURN && value->unit <= CSSPrimitiveValue::CSS_REMS)
1767 parsedValue = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
1768 else if (value->unit >= CSSParserValue::Q_EMS)
1769 parsedValue = CSSQuirkPrimitiveValue::create(value->fValue, CSSPrimitiveValue::CSS_EMS);
1827 // We hit the end. Fill in all remaining values with the initial value.
1867 // Reparse the value as a clip, and see if we succeed.
1871 addFillValue(clipValue, CSSInitialValue::createImplicit()); // Some value was used for origin that is not supported by clip. Just reset clip instead.
1883 // Fill in any remaining properties with the initial value.
1965 // We hit the end. Fill in all remaining values with the initial value.
1993 // Fill in any remaining properties with the initial value.
2023 // We hit the end. Fill in all remaining values with the initial value.
2051 // Fill in any remaining properties with the initial value.
2091 // Fill in any remaining properties with the initial value.
2105 * If there is only one value, it applies to all sides. If there are two values, the top and
2106 * bottom margins are set to the first value and the right and left margins are set to the second.
2107 * If there are three values, the top is set to the first value, the left and right are set to the
2121 CSSValue *value = m_parsedProperties[m_numParsedProperties-1]->value();
2123 addProperty(properties[1], value, important);
2124 addProperty(properties[2], value, important);
2125 addProperty(properties[3], value, important);
2132 CSSValue *value = m_parsedProperties[m_numParsedProperties-2]->value();
2134 addProperty(properties[2], value, important);
2135 value = m_parsedProperties[m_numParsedProperties-2]->value();
2136 addProperty(properties[3], value, important);
2143 CSSValue *value = m_parsedProperties[m_numParsedProperties-2]->value();
2145 addProperty(properties[3], value, important);
2258 bool CSSParser::parseFillImage(RefPtr<CSSValue>& value)
2261 value = CSSImageValue::create();
2268 value = CSSImageValue::create(m_styleSheet->completeURL(m_valueList->current()->string));
2274 return parseGradient(value);
2276 return parseCanvas(value);
2315 CSSParserValue* value = m_valueList->current();
2317 // Parse the first value. We're just making sure that it is one of the valid keywords or a percentage/length.
2323 // It only takes one value for background-position to be correctly parsed if it was specified in a shorthand (since we
2325 // value was explicitly specified for our property.
2326 value = m_valueList->next();
2328 // First check for the comma. If so, we are finished parsing this value or value pair.
2329 if (value && value->unit == CSSParserValue::Operator && value->iValue == ',')
2330 value = 0;
2333 if (value) {
2346 // Only one value was specified. If that value was not a keyword, then it sets the x position, and the y position
2358 CSSParserValue* value = m_valueList->current();
2382 value = m_valueList->next();
2384 // First check for the comma. If so, we are finished parsing this value or value pair.
2385 if (value && value->unit == CSSParserValue::Operator && value->iValue == ',')
2386 value = 0;
2388 if (value)
2391 if (value && (id == CSSValueRepeat || id == CSSValueNoRepeat || id == CSSValueRound || id == CSSValueSpace)) {
2395 // If only one value was specified, value2 is the same as value1.
2404 CSSParserValue* value = m_valueList->current();
2406 if (value->id == CSSValueContain || value->id == CSSValueCover)
2407 return CSSPrimitiveValue::createIdentifier(value->id);
2411 if (value->id == CSSValueAuto)
2414 if (!validUnit(value, FLength | FPercent, m_strict))
2416 parsedValue1 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
2421 if ((value = m_valueList->next())) {
2422 if (value->id == CSSValueAuto)
2424 else if (value->unit == CSSParserValue::Operator && value->iValue == ',')
2427 if (!validUnit(value, FLength | FPercent, m_strict))
2429 parsedValue2 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
2448 RefPtr<CSSValue> value
2568 if (value && !values) {
2570 values->append(value.release());
2581 value = currValue.release();
2602 if (value) {
2603 retValue1 = value.release();
2612 CSSParserValue* value = m_valueList->current();
2613 if (validUnit(value, FTime, m_strict))
2614 return CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
2620 CSSParserValue* value = m_valueList->current();
2621 if (value->id == CSSValueNormal || value->id == CSSValueAlternate)
2622 return CSSPrimitiveValue::createIdentifier(value->id);
2628 CSSParserValue* value = m_valueList->current();
2629 if (validUnit(value, FTime | FNonNeg, m_strict))
2630 return CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
2636 CSSParserValue* value = m_valueList->current();
2637 if (value->id == CSSValueInfinite)
2638 return CSSPrimitiveValue::createIdentifier(value->id);
2639 if (validUnit(value, FInteger | FNonNeg, m_strict))
2640 return CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit);
2646 CSSParserValue* value = m_valueList->current();
2647 if (value->unit == CSSPrimitiveValue::CSS_STRING || value->unit == CSSPrimitiveValue::CSS_IDENT) {
2648 if (value->id == CSSValueNone || (value->unit == CSSPrimitiveValue::CSS_STRING && equalIgnoringCase(value->string, "none"))) {
2651 return CSSPrimitiveValue::create(value->string, CSSPrimitiveValue::CSS_STRING);
2659 CSSParserValue* value = m_valueList->current();
2660 if (value->id == CSSValueRunning || value->id == CSSValuePaused)
2661 return CSSPrimitiveValue::createIdentifier(value->id);
2667 CSSParserValue* value = m_valueList->current();
2668 if (value->unit != CSSPrimitiveValue::CSS_IDENT)
2670 int result = cssPropertyID(value->string);
2673 if (equalIgnoringCase(value->string, "all"))
2675 if (equalIgnoringCase(value->string, "none"))
2712 CSSParserValue* value = m_valueList->current();
2713 if (value->id == CSSValueEase || value->id == CSSValueLinear || value->id == CSSValueEaseIn || value->id == CSSValueEaseOut || value->id == CSSValueEaseInOut)
2714 return CSSPrimitiveValue::createIdentifier(value->id);
2717 if (value->unit != CSSParserValue::Function)
2721 CSSParserValueList* args = value->function->args;
2722 if (!equalIgnoringCase(value->function->name, "cubic-bezier(") || !args || args->size() != 7)
2744 RefPtr<CSSValue> value;
2807 if (value && !values) {
2809 values->append(value.release());
2815 value = currValue.release();
2830 if (value) {
2831 result = value.release();
2859 CSSParserValue* value = m_valueList->current();
2861 if (value->id == CSSValueNone) {
2864 addProperty(propId, CSSPrimitiveValue::createIdentifier(value->id), important);
2871 while (value) {
2880 if (value->unit != CSSParserValue::Function) {
2891 CSSParserValueList* args = value->function->args;
2892 if (!equalIgnoringCase(value->function->name, "dashboard-region(") || !args) {
2969 value = m_valueList->next();
3036 CSSParserValue* value = m_valueList->current();
3037 CSSParserValueList* args = value->function->args;
3039 if (!equalIgnoringCase(value->function->name, "rect(") || !args)
3087 CSSParserValue *value = m_valueList->current();
3090 while (value) {
3091 int id = value->id;
3094 // do nothing, it's the inital value for all three
3110 } else if (!font->weight && validUnit(value, FInteger | FNonNeg, true)) {
3111 int weight = (int)value->fValue;
3141 value = m_valueList->next();
3143 if (!value)
3156 if (value->id >= CSSValueXxSmall && value->id <= CSSValueLarger)
3157 font->size = CSSPrimitiveValue::createIdentifier(value->id);
3158 else if (validUnit(value, FLength | FPercent | FNonNeg, m_strict))
3159 font->size = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
3160 value = m_valueList->next();
3161 if (!font->size || !value)
3164 if (value->unit == CSSParserValue::Operator && value->iValue == '/') {
3166 value = m_valueList->next();
3167 if (!value)
3169 if (value->id == CSSValueNormal) {
3170 // default value, nothing to do
3171 } else if (validUnit(value, FNumber | FLength | FPercent | FNonNeg, m_strict))
3172 font->lineHeight = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes) value->unit);
3175 value = m_valueList->next();
3176 if (!value)
3196 CSSParserValue* value = m_valueList->current();
3199 while (value) {
3207 if (value->id >= CSSValueSerif && value->id <= CSSValueWebkitBody) {
3209 currFamily->appendSpaceSeparated(value->string.characters, value->string.length);
3211 list->append(CSSPrimitiveValue::createIdentifier(value->id));
3213 RefPtr<FontFamilyValue> newFamily = FontFamilyValue::create(value->string);
3217 } else if (value->unit == CSSPrimitiveValue::CSS_STRING) {
3220 list->append(FontFamilyValue::create(value->string));
3221 } else if (value->unit == CSSPrimitiveValue::CSS_IDENT) {
3223 currFamily->appendSpaceSeparated(value->string.characters, value->string.length);
3225 list->append(FontFamilyValue::create(value->string));
3227 RefPtr<FontFamilyValue> newFamily = FontFamilyValue::create(value->string);
3239 value = m_valueList->next();
3243 value = nextValue;
3266 // 'all' is only allowed in @font-face and with no other values. Make a value list to
3313 // 'all' is only allowed in @font-face and with no other values. Make a value list to
3361 // 'all' is only allowed in @font-face and with no other values. Make a value list to
3570 bool CSSParser::parseColorParameters(CSSParserValue* value, int* colorArray, bool parseAlpha)
3572 CSSParserValueList* args = value->function->args;
3575 // Get the first value and its type
3608 // The first value, HUE, is in an angle with a value between 0 and 360
3609 bool CSSParser::parseHSLParameters(CSSParserValue* value, double* colorArray, bool parseAlpha)
3611 CSSParserValueList* args = value->function->args;
3613 // Get the first value
3616 // normalize the Hue value and change it to be between 0 and 1.0
3625 colorArray[i] = max(0.0, min(100.0, v->fValue)) / 100.0; // needs to be value between 0 and 1.0
3639 PassRefPtr<CSSPrimitiveValue> CSSParser::parseColor(CSSParserValue* value)
3642 if (!parseColorFromValue(value ? value : m_valueList->current(), c))
3647 bool CSSParser::parseColorFromValue(CSSParserValue* value, RGBA32& c, bool svg)
3649 if (!m_strict && value->unit == CSSPrimitiveValue::CSS_NUMBER &&
3650 value->fValue >= 0. && value->fValue < 1000000.) {
3651 String str = String::format("%06d", (int)(value->fValue+.5));
3654 } else if (value->unit == CSSPrimitiveValue::CSS_PARSER_HEXCOLOR ||
3655 value->unit == CSSPrimitiveValue::CSS_IDENT ||
3656 (!m_strict && value->unit == CSSPrimitiveValue::CSS_DIMENSION)) {
3657 if (!CSSParser::parseColor(value->string, c, m_strict && value->unit == CSSPrimitiveValue::CSS_IDENT))
3659 } else if (value->unit == CSSParserValue::Function &&
3660 value->function->args != 0 &&
3661 value->function->args->size() == 5 /* rgb + two commas */ &&
3662 equalIgnoringCase(value->function->name, "rgb(")) {
3664 if (!parseColorParameters(value, colorValues, false))
3668 if (value->unit == CSSParserValue::Function &&
3669 value->function->args != 0 &&
3670 value->function->args->size() == 7 /* rgba + three commas */ &&
3671 equalIgnoringCase(value->function->name, "rgba(")) {
3673 if (!parseColorParameters(value, colorValues, true))
3676 } else if (value->unit == CSSParserValue::Function &&
3677 value->function->args != 0 &&
3678 value->function->args->size() == 5 /* hsl + two commas */ &&
3679 equalIgnoringCase(value->function->name, "hsl(")) {
3681 if (!parseHSLParameters(value, colorValues, false))
3684 } else if (value->unit == CSSParserValue::Function &&
3685 value->function->args != 0 &&
3686 value->function->args->size() == 7 /* hsla + three commas */ &&
3687 equalIgnoringCase(value->function->name, "hsla(")) {
3689 if (!parseHSLParameters(value, colorValues, true))
3724 // Construct the current shadow value and add it to the list.
3728 // Now reset for the next shadow value.
3828 // value. Treat as invalid.
3835 // The value is good. Commit it.
3842 // A length is allowed here. Construct the value and add it.
3850 // The only other type of value that's ok is a color value.
3865 return false; // This value is not a color or length and is invalid or
4014 // Now build a rect value to hold all four of our primitive values.
4029 // Now we have to deal with the border widths. The best way to deal with these is to actually put these values into a value
4046 // Make our new border image value now.
4074 // Look for an image initially. If the first value is not a URI, then we're done.
4082 RefPtr<CSSValue> value;
4083 if ((equalIgnoringCase(val->function->name, "-webkit-gradient(") && parseGradient(value)) ||
4084 (equalIgnoringCase(val->function->name, "-webkit-canvas(") && parseCanvas(value)))
4085 context.commitImage(value);
4115 // Need to fully commit as a single value.
4145 CSSParserValue* value = m_valueList->valueAt(i);
4146 if (value->unit == CSSParserValue::Operator) {
4147 if (value->iValue != '/')
4161 if (!validUnit(value, FLength, m_strict))
4164 RefPtr<CSSPrimitiveValue> radius = CSSPrimitiveValue::create(value->fValue, static_cast<CSSPrimitiveValue::UnitTypes>(value->unit));
4554 // We collect a list of WebKitCSSTransformValues, where each value specifies a single operation.
4556 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) {
4557 if (value->unit != CSSParserValue::Function || !value->function)
4561 CSSParserValueList* args = value->function->args;
4566 TransformOperationInfo info(value->function->name);
4590 // Add the value to the current transform operation.
4607 bool CSSParser::parseTransformOrigin(int propId, int& propId1, int& propId2, int& propId3, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2, RefPtr<CSSValue>& value3)
4620 parseTransformOriginShorthand(value, value2, value3);
4625 value = parseFillPositionXY(xFound, yFound);
4626 if (value)
4632 value = parseFillPositionXY(xFound, yFound);
4633 if (value)
4639 value = CSSPrimitiveValue::create(m_valueList->current()->fValue, (CSSPrimitiveValue::UnitTypes)m_valueList->current()->unit);
4640 if (value)
4646 return value;
4649 bool CSSParser::parsePerspectiveOrigin(int propId, int& propId1, int& propId2, RefPtr<CSSValue>& value, RefPtr<CSSValue>& value2)
4660 parseFillPosition(value, value2);
4664 value = parseFillPositionXY(xFound, yFound);
4665 if (value)
4671 value = parseFillPositionXY(xFound, yFound);
4672 if (value)
4678 return value;
4969 CSSParserValue& CSSParser::sinkFloatingValue(CSSParserValue& value)
4971 if (value.unit == CSSParserValue::Function) {
4972 ASSERT(m_floatingFunctions.contains(value.function));
4973 m_floatingFunctions.remove(value.function);
4975 return value;
5109 if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isPrimitiveValue()) {
5110 RefPtr<CSSValue> value = property->m_value.release();
5112 static_cast<CSSValueList*>(property->m_value.get())->append(value.release());
5268 if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isValueList()) {