| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
| 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 3009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3020 if (!args || (args->size() != 1 && args->size() != 3)) | 3020 if (!args || (args->size() != 1 && args->size() != 3)) |
| 3021 return nullptr; | 3021 return nullptr; |
| 3022 | 3022 |
| 3023 // There are two values. | 3023 // There are two values. |
| 3024 int numSteps; | 3024 int numSteps; |
| 3025 StepsTimingFunction::StepAtPosition stepAtPosition = StepsTimingFunction
::End; | 3025 StepsTimingFunction::StepAtPosition stepAtPosition = StepsTimingFunction
::End; |
| 3026 | 3026 |
| 3027 CSSParserValue* v = args->current(); | 3027 CSSParserValue* v = args->current(); |
| 3028 if (!validUnit(v, FInteger)) | 3028 if (!validUnit(v, FInteger)) |
| 3029 return nullptr; | 3029 return nullptr; |
| 3030 numSteps = clampToInteger(v->fValue); | 3030 numSteps = clampTo<int>(v->fValue); |
| 3031 if (numSteps < 1) | 3031 if (numSteps < 1) |
| 3032 return nullptr; | 3032 return nullptr; |
| 3033 | 3033 |
| 3034 if (args->next()) { | 3034 if (args->next()) { |
| 3035 // There is a comma so we need to parse the second value | 3035 // There is a comma so we need to parse the second value |
| 3036 if (!consumeComma(args)) | 3036 if (!consumeComma(args)) |
| 3037 return nullptr; | 3037 return nullptr; |
| 3038 switch (args->current()->id) { | 3038 switch (args->current()->id) { |
| 3039 case CSSValueMiddle: | 3039 case CSSValueMiddle: |
| 3040 if (!RuntimeEnabledFeatures::webAnimationsAPIEnabled()) | 3040 if (!RuntimeEnabledFeatures::webAnimationsAPIEnabled()) |
| (...skipping 2528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5569 args->next(); | 5569 args->next(); |
| 5570 } | 5570 } |
| 5571 | 5571 |
| 5572 if (flexGrow == unsetValue) | 5572 if (flexGrow == unsetValue) |
| 5573 flexGrow = 1; | 5573 flexGrow = 1; |
| 5574 if (flexShrink == unsetValue) | 5574 if (flexShrink == unsetValue) |
| 5575 flexShrink = 1; | 5575 flexShrink = 1; |
| 5576 if (!flexBasis) | 5576 if (!flexBasis) |
| 5577 flexBasis = cssValuePool().createValue(0, CSSPrimitiveValue::CSS_PERCENT
AGE); | 5577 flexBasis = cssValuePool().createValue(0, CSSPrimitiveValue::CSS_PERCENT
AGE); |
| 5578 | 5578 |
| 5579 addProperty(CSSPropertyFlexGrow, cssValuePool().createValue(clampToFloat(fle
xGrow), CSSPrimitiveValue::CSS_NUMBER), important); | 5579 addProperty(CSSPropertyFlexGrow, cssValuePool().createValue(clampTo<float>(f
lexGrow), CSSPrimitiveValue::CSS_NUMBER), important); |
| 5580 addProperty(CSSPropertyFlexShrink, cssValuePool().createValue(clampToFloat(f
lexShrink), CSSPrimitiveValue::CSS_NUMBER), important); | 5580 addProperty(CSSPropertyFlexShrink, cssValuePool().createValue(clampTo<float>
(flexShrink), CSSPrimitiveValue::CSS_NUMBER), important); |
| 5581 addProperty(CSSPropertyFlexBasis, flexBasis, important); | 5581 addProperty(CSSPropertyFlexBasis, flexBasis, important); |
| 5582 return true; | 5582 return true; |
| 5583 } | 5583 } |
| 5584 | 5584 |
| 5585 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseObjectPosition() | 5585 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseObjectPosition() |
| 5586 { | 5586 { |
| 5587 RefPtrWillBeRawPtr<CSSValue> xValue = nullptr; | 5587 RefPtrWillBeRawPtr<CSSValue> xValue = nullptr; |
| 5588 RefPtrWillBeRawPtr<CSSValue> yValue = nullptr; | 5588 RefPtrWillBeRawPtr<CSSValue> yValue = nullptr; |
| 5589 parseFillPosition(m_valueList, xValue, yValue); | 5589 parseFillPosition(m_valueList, xValue, yValue); |
| 5590 if (!xValue || !yValue) | 5590 if (!xValue || !yValue) |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6176 while (m_valueList->current()) { | 6176 while (m_valueList->current()) { |
| 6177 CSSParserValue* val = m_valueList->current(); | 6177 CSSParserValue* val = m_valueList->current(); |
| 6178 if (val->unit != CSSPrimitiveValue::CSS_IDENT) | 6178 if (val->unit != CSSPrimitiveValue::CSS_IDENT) |
| 6179 return nullptr; | 6179 return nullptr; |
| 6180 RefPtrWillBeRawPtr<CSSPrimitiveValue> counterName = createPrimitiveStrin
gValue(val); | 6180 RefPtrWillBeRawPtr<CSSPrimitiveValue> counterName = createPrimitiveStrin
gValue(val); |
| 6181 m_valueList->next(); | 6181 m_valueList->next(); |
| 6182 | 6182 |
| 6183 val = m_valueList->current(); | 6183 val = m_valueList->current(); |
| 6184 int i = defaultValue; | 6184 int i = defaultValue; |
| 6185 if (val && validUnit(val, FInteger)) { | 6185 if (val && validUnit(val, FInteger)) { |
| 6186 i = clampToInteger(val->fValue); | 6186 i = clampTo<int>(val->fValue); |
| 6187 m_valueList->next(); | 6187 m_valueList->next(); |
| 6188 } | 6188 } |
| 6189 | 6189 |
| 6190 list->append(createPrimitiveValuePair(counterName.release(), | 6190 list->append(createPrimitiveValuePair(counterName.release(), |
| 6191 cssValuePool().createValue(i, CSSPrimitiveValue::CSS_NUMBER))); | 6191 cssValuePool().createValue(i, CSSPrimitiveValue::CSS_NUMBER))); |
| 6192 } | 6192 } |
| 6193 | 6193 |
| 6194 if (!list->length()) | 6194 if (!list->length()) |
| 6195 return nullptr; | 6195 return nullptr; |
| 6196 return list.release(); | 6196 return list.release(); |
| (...skipping 1371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7568 if (character < 0x20 || character > 0x7E) | 7568 if (character < 0x20 || character > 0x7E) |
| 7569 return false; | 7569 return false; |
| 7570 } | 7570 } |
| 7571 | 7571 |
| 7572 AtomicString tag = value->string; | 7572 AtomicString tag = value->string; |
| 7573 int tagValue = 1; | 7573 int tagValue = 1; |
| 7574 // Feature tag values could follow: <integer> | on | off | 7574 // Feature tag values could follow: <integer> | on | off |
| 7575 value = m_valueList->next(); | 7575 value = m_valueList->next(); |
| 7576 if (value) { | 7576 if (value) { |
| 7577 if (value->unit == CSSPrimitiveValue::CSS_NUMBER && value->isInt && valu
e->fValue >= 0) { | 7577 if (value->unit == CSSPrimitiveValue::CSS_NUMBER && value->isInt && valu
e->fValue >= 0) { |
| 7578 tagValue = clampToInteger(value->fValue); | 7578 tagValue = clampTo<int>(value->fValue); |
| 7579 if (tagValue < 0) | 7579 if (tagValue < 0) |
| 7580 return false; | 7580 return false; |
| 7581 m_valueList->next(); | 7581 m_valueList->next(); |
| 7582 } else if (value->id == CSSValueOn || value->id == CSSValueOff) { | 7582 } else if (value->id == CSSValueOn || value->id == CSSValueOff) { |
| 7583 tagValue = value->id == CSSValueOn; | 7583 tagValue = value->id == CSSValueOn; |
| 7584 m_valueList->next(); | 7584 m_valueList->next(); |
| 7585 } | 7585 } |
| 7586 } | 7586 } |
| 7587 settings->append(CSSFontFeatureValue::create(tag, tagValue)); | 7587 settings->append(CSSFontFeatureValue::create(tag, tagValue)); |
| 7588 return true; | 7588 return true; |
| (...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8396 return nullptr; | 8396 return nullptr; |
| 8397 a = args->next(); | 8397 a = args->next(); |
| 8398 | 8398 |
| 8399 argNumber++; | 8399 argNumber++; |
| 8400 } | 8400 } |
| 8401 | 8401 |
| 8402 return transformValue.release(); | 8402 return transformValue.release(); |
| 8403 } | 8403 } |
| 8404 | 8404 |
| 8405 } // namespace blink | 8405 } // namespace blink |
| OLD | NEW |