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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 439 |
440 return parseViewportProperty(propId, important); | 440 return parseViewportProperty(propId, important); |
441 } | 441 } |
442 | 442 |
443 // Note: m_parsedCalculation is used to pass the calc value to validUnit and
then cleared at the end of this function. | 443 // Note: m_parsedCalculation is used to pass the calc value to validUnit and
then cleared at the end of this function. |
444 // FIXME: This is to avoid having to pass parsedCalc to all validUnit caller
s. | 444 // FIXME: This is to avoid having to pass parsedCalc to all validUnit caller
s. |
445 ASSERT(!m_parsedCalculation); | 445 ASSERT(!m_parsedCalculation); |
446 | 446 |
447 CSSValueID id = value->id; | 447 CSSValueID id = value->id; |
448 | 448 |
449 int num = inShorthand() ? 1 : m_valueList->size(); | |
450 | |
451 if (id == CSSValueInherit) { | 449 if (id == CSSValueInherit) { |
452 if (num != 1) | 450 if (m_valueList->size() != 1) |
453 return false; | 451 return false; |
454 addExpandedPropertyForValue(propId, cssValuePool().createInheritedValue(
), important); | 452 addExpandedPropertyForValue(propId, cssValuePool().createInheritedValue(
), important); |
455 return true; | 453 return true; |
456 } else if (id == CSSValueInitial) { | 454 } else if (id == CSSValueInitial) { |
457 if (num != 1) | 455 if (m_valueList->size() != 1) |
458 return false; | 456 return false; |
459 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial
Value(), important); | 457 addExpandedPropertyForValue(propId, cssValuePool().createExplicitInitial
Value(), important); |
460 return true; | 458 return true; |
461 } else if (id == CSSValueUnset) { | 459 } else if (id == CSSValueUnset) { |
462 if (num != 1) | 460 if (m_valueList->size() != 1) |
463 return false; | 461 return false; |
464 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i
mportant); | 462 addExpandedPropertyForValue(propId, cssValuePool().createUnsetValue(), i
mportant); |
465 return true; | 463 return true; |
466 } | 464 } |
467 | 465 |
| 466 int num = inShorthand() ? 1 : m_valueList->size(); |
| 467 |
468 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { | 468 if (CSSParserFastPaths::isKeywordPropertyID(propId)) { |
469 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) | 469 if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id)) |
470 return false; | 470 return false; |
471 if (m_valueList->next() && !inShorthand()) | 471 if (m_valueList->next() && !inShorthand()) |
472 return false; | 472 return false; |
473 addProperty(propId, cssValuePool().createIdentifierValue(id), important)
; | 473 addProperty(propId, cssValuePool().createIdentifierValue(id), important)
; |
474 return true; | 474 return true; |
475 } | 475 } |
476 | 476 |
477 bool validPrimitive = false; | 477 bool validPrimitive = false; |
(...skipping 8007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8485 } | 8485 } |
8486 } | 8486 } |
8487 | 8487 |
8488 if (!list->length()) | 8488 if (!list->length()) |
8489 return nullptr; | 8489 return nullptr; |
8490 | 8490 |
8491 return list.release(); | 8491 return list.release(); |
8492 } | 8492 } |
8493 | 8493 |
8494 } // namespace blink | 8494 } // namespace blink |
OLD | NEW |