| 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 26 matching lines...) Expand all Loading... |
| 37 #include "sky/engine/core/css/CSSFunctionValue.h" | 37 #include "sky/engine/core/css/CSSFunctionValue.h" |
| 38 #include "sky/engine/core/css/CSSGradientValue.h" | 38 #include "sky/engine/core/css/CSSGradientValue.h" |
| 39 #include "sky/engine/core/css/CSSInheritedValue.h" | 39 #include "sky/engine/core/css/CSSInheritedValue.h" |
| 40 #include "sky/engine/core/css/CSSInitialValue.h" | 40 #include "sky/engine/core/css/CSSInitialValue.h" |
| 41 #include "sky/engine/core/css/CSSLineBoxContainValue.h" | 41 #include "sky/engine/core/css/CSSLineBoxContainValue.h" |
| 42 #include "sky/engine/core/css/CSSPrimitiveValue.h" | 42 #include "sky/engine/core/css/CSSPrimitiveValue.h" |
| 43 #include "sky/engine/core/css/CSSPropertySourceData.h" | 43 #include "sky/engine/core/css/CSSPropertySourceData.h" |
| 44 #include "sky/engine/core/css/CSSSelector.h" | 44 #include "sky/engine/core/css/CSSSelector.h" |
| 45 #include "sky/engine/core/css/CSSShadowValue.h" | 45 #include "sky/engine/core/css/CSSShadowValue.h" |
| 46 #include "sky/engine/core/css/CSSStyleSheet.h" | 46 #include "sky/engine/core/css/CSSStyleSheet.h" |
| 47 #include "sky/engine/core/css/CSSTimingFunctionValue.h" | |
| 48 #include "sky/engine/core/css/CSSTransformValue.h" | 47 #include "sky/engine/core/css/CSSTransformValue.h" |
| 49 #include "sky/engine/core/css/CSSUnicodeRangeValue.h" | 48 #include "sky/engine/core/css/CSSUnicodeRangeValue.h" |
| 50 #include "sky/engine/core/css/CSSValueList.h" | 49 #include "sky/engine/core/css/CSSValueList.h" |
| 51 #include "sky/engine/core/css/CSSValuePool.h" | 50 #include "sky/engine/core/css/CSSValuePool.h" |
| 52 #include "sky/engine/core/css/HashTools.h" | 51 #include "sky/engine/core/css/HashTools.h" |
| 53 #include "sky/engine/core/css/Pair.h" | 52 #include "sky/engine/core/css/Pair.h" |
| 54 #include "sky/engine/core/css/Rect.h" | 53 #include "sky/engine/core/css/Rect.h" |
| 55 #include "sky/engine/core/css/StylePropertySet.h" | 54 #include "sky/engine/core/css/StylePropertySet.h" |
| 56 #include "sky/engine/core/css/StyleRule.h" | 55 #include "sky/engine/core/css/StyleRule.h" |
| 57 #include "sky/engine/core/css/StyleSheetContents.h" | 56 #include "sky/engine/core/css/StyleSheetContents.h" |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, HTMLStandar
dMode, 0)) | 697 if (!parseValue(dummyStyle.get(), CSSPropertyFontFamily, string, HTMLStandar
dMode, 0)) |
| 699 return nullptr; | 698 return nullptr; |
| 700 | 699 |
| 701 RefPtr<CSSValue> fontFamily = dummyStyle->getPropertyCSSValue(CSSPropertyFon
tFamily); | 700 RefPtr<CSSValue> fontFamily = dummyStyle->getPropertyCSSValue(CSSPropertyFon
tFamily); |
| 702 if (!fontFamily->isValueList()) | 701 if (!fontFamily->isValueList()) |
| 703 return nullptr; | 702 return nullptr; |
| 704 | 703 |
| 705 return toCSSValueList(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily)
.get()); | 704 return toCSSValueList(dummyStyle->getPropertyCSSValue(CSSPropertyFontFamily)
.get()); |
| 706 } | 705 } |
| 707 | 706 |
| 708 PassRefPtr<CSSValue> BisonCSSParser::parseAnimationTimingFunctionValue(const Str
ing& string) | |
| 709 { | |
| 710 if (string.isEmpty()) | |
| 711 return nullptr; | |
| 712 RefPtr<MutableStylePropertySet> style = MutableStylePropertySet::create(); | |
| 713 if (!parseValue(style.get(), CSSPropertyTransitionTimingFunction, string, HT
MLStandardMode, 0)) | |
| 714 return nullptr; | |
| 715 | |
| 716 RefPtr<CSSValue> value = style->getPropertyCSSValue(CSSPropertyTransitionTim
ingFunction); | |
| 717 if (!value || value->isInitialValue() || value->isInheritedValue()) | |
| 718 return nullptr; | |
| 719 CSSValueList* valueList = toCSSValueList(value.get()); | |
| 720 if (valueList->length() > 1) | |
| 721 return nullptr; | |
| 722 return valueList->item(0); | |
| 723 } | |
| 724 | |
| 725 bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert
yID propertyID, const String& string, const Document& document) | 707 bool BisonCSSParser::parseValue(MutableStylePropertySet* declaration, CSSPropert
yID propertyID, const String& string, const Document& document) |
| 726 { | 708 { |
| 727 ASSERT(!string.isEmpty()); | 709 ASSERT(!string.isEmpty()); |
| 728 | 710 |
| 729 CSSParserContext context(document); | 711 CSSParserContext context(document); |
| 730 | 712 |
| 731 if (parseSimpleLengthValue(declaration, propertyID, string, context.mode())) | 713 if (parseSimpleLengthValue(declaration, propertyID, string, context.mode())) |
| 732 return true; | 714 return true; |
| 733 if (parseColorValue(declaration, propertyID, string, context.mode())) | 715 if (parseColorValue(declaration, propertyID, string, context.mode())) |
| 734 return true; | 716 return true; |
| (...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1553 m_observer->endProperty(isPropertyParsed, m_tokenizer.safeUserStringToke
nOffset(), errorType); | 1535 m_observer->endProperty(isPropertyParsed, m_tokenizer.safeUserStringToke
nOffset(), errorType); |
| 1554 } | 1536 } |
| 1555 | 1537 |
| 1556 void BisonCSSParser::startEndUnknownRule() | 1538 void BisonCSSParser::startEndUnknownRule() |
| 1557 { | 1539 { |
| 1558 if (m_observer) | 1540 if (m_observer) |
| 1559 m_observer->startEndUnknownRule(); | 1541 m_observer->startEndUnknownRule(); |
| 1560 } | 1542 } |
| 1561 | 1543 |
| 1562 } | 1544 } |
| OLD | NEW |