| 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 DEFINE_STATIC_LOCAL(CSSParserContext, strictContext, (CSSStrictMode)); | 240 DEFINE_STATIC_LOCAL(CSSParserContext, strictContext, (CSSStrictMode)); |
| 241 return strictContext; | 241 return strictContext; |
| 242 } | 242 } |
| 243 | 243 |
| 244 CSSParserContext::CSSParserContext(CSSParserMode mode, const KURL& baseURL) | 244 CSSParserContext::CSSParserContext(CSSParserMode mode, const KURL& baseURL) |
| 245 : baseURL(baseURL) | 245 : baseURL(baseURL) |
| 246 , mode(mode) | 246 , mode(mode) |
| 247 , isHTMLDocument(false) | 247 , isHTMLDocument(false) |
| 248 , isCSSCustomFilterEnabled(false) | 248 , isCSSCustomFilterEnabled(false) |
| 249 , isCSSStickyPositionEnabled(false) | 249 , isCSSStickyPositionEnabled(false) |
| 250 , isCSSRegionsEnabled(false) | |
| 251 , isCSSCompositingEnabled(false) | 250 , isCSSCompositingEnabled(false) |
| 252 , isCSSGridLayoutEnabled(false) | 251 , isCSSGridLayoutEnabled(false) |
| 253 , isCSSVariablesEnabled(false) | 252 , isCSSVariablesEnabled(false) |
| 254 , needsSiteSpecificQuirks(false) | 253 , needsSiteSpecificQuirks(false) |
| 255 , m_document(0) | 254 , m_document(0) |
| 256 { | 255 { |
| 257 } | 256 } |
| 258 | 257 |
| 259 CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons
t String& charset) | 258 CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons
t String& charset) |
| 260 : baseURL(baseURL.isNull() ? document->baseURL() : baseURL) | 259 : baseURL(baseURL.isNull() ? document->baseURL() : baseURL) |
| 261 , charset(charset) | 260 , charset(charset) |
| 262 , mode(document->inQuirksMode() ? CSSQuirksMode : CSSStrictMode) | 261 , mode(document->inQuirksMode() ? CSSQuirksMode : CSSStrictMode) |
| 263 , isHTMLDocument(document->isHTMLDocument()) | 262 , isHTMLDocument(document->isHTMLDocument()) |
| 264 , isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCS
SCustomFilterEnabled() : false) | 263 , isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCS
SCustomFilterEnabled() : false) |
| 265 , isCSSStickyPositionEnabled(document->cssStickyPositionEnabled()) | 264 , isCSSStickyPositionEnabled(document->cssStickyPositionEnabled()) |
| 266 , isCSSRegionsEnabled(document->cssRegionsEnabled()) | |
| 267 , isCSSCompositingEnabled(document->cssCompositingEnabled()) | 265 , isCSSCompositingEnabled(document->cssCompositingEnabled()) |
| 268 , isCSSGridLayoutEnabled(document->cssGridLayoutEnabled()) | 266 , isCSSGridLayoutEnabled(document->cssGridLayoutEnabled()) |
| 269 , isCSSVariablesEnabled(document->settings() ? document->settings()->cssVari
ablesEnabled() : false) | 267 , isCSSVariablesEnabled(document->settings() ? document->settings()->cssVari
ablesEnabled() : false) |
| 270 , needsSiteSpecificQuirks(document->settings() ? document->settings()->needs
SiteSpecificQuirks() : false) | 268 , needsSiteSpecificQuirks(document->settings() ? document->settings()->needs
SiteSpecificQuirks() : false) |
| 271 , m_document(document) | 269 , m_document(document) |
| 272 { | 270 { |
| 273 } | 271 } |
| 274 | 272 |
| 275 bool operator==(const CSSParserContext& a, const CSSParserContext& b) | 273 bool operator==(const CSSParserContext& a, const CSSParserContext& b) |
| 276 { | 274 { |
| 277 return a.baseURL == b.baseURL | 275 return a.baseURL == b.baseURL |
| 278 && a.charset == b.charset | 276 && a.charset == b.charset |
| 279 && a.mode == b.mode | 277 && a.mode == b.mode |
| 280 && a.isHTMLDocument == b.isHTMLDocument | 278 && a.isHTMLDocument == b.isHTMLDocument |
| 281 && a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled | 279 && a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled |
| 282 && a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled | 280 && a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled |
| 283 && a.isCSSRegionsEnabled == b.isCSSRegionsEnabled | |
| 284 && a.isCSSCompositingEnabled == b.isCSSCompositingEnabled | 281 && a.isCSSCompositingEnabled == b.isCSSCompositingEnabled |
| 285 && a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled | 282 && a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled |
| 286 && a.isCSSVariablesEnabled == b.isCSSVariablesEnabled | 283 && a.isCSSVariablesEnabled == b.isCSSVariablesEnabled |
| 287 && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks; | 284 && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks; |
| 288 } | 285 } |
| 289 | 286 |
| 290 CSSParser::CSSParser(const CSSParserContext& context) | 287 CSSParser::CSSParser(const CSSParserContext& context) |
| 291 : m_context(context) | 288 : m_context(context) |
| 292 , m_important(false) | 289 , m_important(false) |
| 293 , m_id(CSSPropertyInvalid) | 290 , m_id(CSSPropertyInvalid) |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 915 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) | 912 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) |
| 916 case CSSPropertyWebkitOverflowScrolling: | 913 case CSSPropertyWebkitOverflowScrolling: |
| 917 if (valueID == CSSValueAuto || valueID == CSSValueTouch) | 914 if (valueID == CSSValueAuto || valueID == CSSValueTouch) |
| 918 return true; | 915 return true; |
| 919 break; | 916 break; |
| 920 #endif | 917 #endif |
| 921 case CSSPropertyWebkitPrintColorAdjust: | 918 case CSSPropertyWebkitPrintColorAdjust: |
| 922 if (valueID == CSSValueExact || valueID == CSSValueEconomy) | 919 if (valueID == CSSValueExact || valueID == CSSValueEconomy) |
| 923 return true; | 920 return true; |
| 924 break; | 921 break; |
| 925 #if ENABLE(CSS_REGIONS) | |
| 926 case CSSPropertyWebkitRegionBreakAfter: | 922 case CSSPropertyWebkitRegionBreakAfter: |
| 927 case CSSPropertyWebkitRegionBreakBefore: | 923 case CSSPropertyWebkitRegionBreakBefore: |
| 928 if (parserContext.isCSSRegionsEnabled && (valueID == CSSValueAuto || val
ueID == CSSValueAlways || valueID == CSSValueAvoid || valueID == CSSValueLeft ||
valueID == CSSValueRight)) | 924 if (RuntimeEnabledFeatures::cssRegionsEnabled() && (valueID == CSSValueA
uto || valueID == CSSValueAlways || valueID == CSSValueAvoid || valueID == CSSVa
lueLeft || valueID == CSSValueRight)) |
| 929 return true; | 925 return true; |
| 930 break; | 926 break; |
| 931 case CSSPropertyWebkitRegionBreakInside: | 927 case CSSPropertyWebkitRegionBreakInside: |
| 932 if (parserContext.isCSSRegionsEnabled && (valueID == CSSValueAuto || val
ueID == CSSValueAvoid)) | 928 if (RuntimeEnabledFeatures::cssRegionsEnabled() && (valueID == CSSValueA
uto || valueID == CSSValueAvoid)) |
| 933 return true; | 929 return true; |
| 934 break; | 930 break; |
| 935 case CSSPropertyWebkitRegionOverflow: | 931 case CSSPropertyWebkitRegionOverflow: |
| 936 if (parserContext.isCSSRegionsEnabled && (valueID == CSSValueAuto || val
ueID == CSSValueBreak)) | 932 if (RuntimeEnabledFeatures::cssRegionsEnabled() && (valueID == CSSValueA
uto || valueID == CSSValueBreak)) |
| 937 return true; | 933 return true; |
| 938 break; | 934 break; |
| 939 #endif | |
| 940 case CSSPropertyWebkitRtlOrdering: | 935 case CSSPropertyWebkitRtlOrdering: |
| 941 if (valueID == CSSValueLogical || valueID == CSSValueVisual) | 936 if (valueID == CSSValueLogical || valueID == CSSValueVisual) |
| 942 return true; | 937 return true; |
| 943 break; | 938 break; |
| 944 | 939 |
| 945 case CSSPropertyWebkitRubyPosition: | 940 case CSSPropertyWebkitRubyPosition: |
| 946 if (valueID == CSSValueBefore || valueID == CSSValueAfter) | 941 if (valueID == CSSValueBefore || valueID == CSSValueAfter) |
| 947 return true; | 942 return true; |
| 948 break; | 943 break; |
| 949 | 944 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 case CSSPropertyWebkitMarginAfterCollapse: | 1087 case CSSPropertyWebkitMarginAfterCollapse: |
| 1093 case CSSPropertyWebkitMarginBeforeCollapse: | 1088 case CSSPropertyWebkitMarginBeforeCollapse: |
| 1094 case CSSPropertyWebkitMarginBottomCollapse: | 1089 case CSSPropertyWebkitMarginBottomCollapse: |
| 1095 case CSSPropertyWebkitMarginTopCollapse: | 1090 case CSSPropertyWebkitMarginTopCollapse: |
| 1096 case CSSPropertyWebkitMarqueeDirection: | 1091 case CSSPropertyWebkitMarqueeDirection: |
| 1097 case CSSPropertyWebkitMarqueeStyle: | 1092 case CSSPropertyWebkitMarqueeStyle: |
| 1098 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) | 1093 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) |
| 1099 case CSSPropertyWebkitOverflowScrolling: | 1094 case CSSPropertyWebkitOverflowScrolling: |
| 1100 #endif | 1095 #endif |
| 1101 case CSSPropertyWebkitPrintColorAdjust: | 1096 case CSSPropertyWebkitPrintColorAdjust: |
| 1102 #if ENABLE(CSS_REGIONS) | |
| 1103 case CSSPropertyWebkitRegionBreakAfter: | 1097 case CSSPropertyWebkitRegionBreakAfter: |
| 1104 case CSSPropertyWebkitRegionBreakBefore: | 1098 case CSSPropertyWebkitRegionBreakBefore: |
| 1105 case CSSPropertyWebkitRegionBreakInside: | 1099 case CSSPropertyWebkitRegionBreakInside: |
| 1106 case CSSPropertyWebkitRegionOverflow: | 1100 case CSSPropertyWebkitRegionOverflow: |
| 1107 #endif | |
| 1108 case CSSPropertyWebkitRtlOrdering: | 1101 case CSSPropertyWebkitRtlOrdering: |
| 1109 case CSSPropertyWebkitRubyPosition: | 1102 case CSSPropertyWebkitRubyPosition: |
| 1110 #if ENABLE(CSS3_TEXT) | 1103 #if ENABLE(CSS3_TEXT) |
| 1111 case CSSPropertyWebkitTextAlignLast: | 1104 case CSSPropertyWebkitTextAlignLast: |
| 1112 #endif // CSS3_TEXT | 1105 #endif // CSS3_TEXT |
| 1113 case CSSPropertyWebkitTextCombine: | 1106 case CSSPropertyWebkitTextCombine: |
| 1114 case CSSPropertyWebkitTextEmphasisPosition: | 1107 case CSSPropertyWebkitTextEmphasisPosition: |
| 1115 case CSSPropertyWebkitTextSecurity: | 1108 case CSSPropertyWebkitTextSecurity: |
| 1116 case CSSPropertyWebkitTransformStyle: | 1109 case CSSPropertyWebkitTransformStyle: |
| 1117 case CSSPropertyWebkitUserDrag: | 1110 case CSSPropertyWebkitUserDrag: |
| (...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 validPrimitive = true; | 2413 validPrimitive = true; |
| 2421 else | 2414 else |
| 2422 validPrimitive = validUnit(value, FInteger | FNonNeg); | 2415 validPrimitive = validUnit(value, FInteger | FNonNeg); |
| 2423 break; | 2416 break; |
| 2424 case CSSPropertyWebkitMarqueeSpeed: | 2417 case CSSPropertyWebkitMarqueeSpeed: |
| 2425 if (id == CSSValueNormal || id == CSSValueSlow || id == CSSValueFast) | 2418 if (id == CSSValueNormal || id == CSSValueSlow || id == CSSValueFast) |
| 2426 validPrimitive = true; | 2419 validPrimitive = true; |
| 2427 else | 2420 else |
| 2428 validPrimitive = validUnit(value, FTime | FInteger | FNonNeg); | 2421 validPrimitive = validUnit(value, FTime | FInteger | FNonNeg); |
| 2429 break; | 2422 break; |
| 2430 #if ENABLE(CSS_REGIONS) | |
| 2431 case CSSPropertyWebkitFlowInto: | 2423 case CSSPropertyWebkitFlowInto: |
| 2432 if (!cssRegionsEnabled()) | 2424 if (!RuntimeEnabledFeatures::cssRegionsEnabled()) |
| 2433 return false; | 2425 return false; |
| 2434 return parseFlowThread(propId, important); | 2426 return parseFlowThread(propId, important); |
| 2435 case CSSPropertyWebkitFlowFrom: | 2427 case CSSPropertyWebkitFlowFrom: |
| 2436 if (!cssRegionsEnabled()) | 2428 if (!RuntimeEnabledFeatures::cssRegionsEnabled()) |
| 2437 return false; | 2429 return false; |
| 2438 return parseRegionThread(propId, important); | 2430 return parseRegionThread(propId, important); |
| 2439 #endif | |
| 2440 case CSSPropertyWebkitTransform: | 2431 case CSSPropertyWebkitTransform: |
| 2441 if (id == CSSValueNone) | 2432 if (id == CSSValueNone) |
| 2442 validPrimitive = true; | 2433 validPrimitive = true; |
| 2443 else { | 2434 else { |
| 2444 RefPtr<CSSValue> transformValue = parseTransform(); | 2435 RefPtr<CSSValue> transformValue = parseTransform(); |
| 2445 if (transformValue) { | 2436 if (transformValue) { |
| 2446 addProperty(propId, transformValue.release(), important); | 2437 addProperty(propId, transformValue.release(), important); |
| 2447 return true; | 2438 return true; |
| 2448 } | 2439 } |
| 2449 return false; | 2440 return false; |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2909 case CSSPropertyWebkitMarginAfterCollapse: | 2900 case CSSPropertyWebkitMarginAfterCollapse: |
| 2910 case CSSPropertyWebkitMarginBeforeCollapse: | 2901 case CSSPropertyWebkitMarginBeforeCollapse: |
| 2911 case CSSPropertyWebkitMarginBottomCollapse: | 2902 case CSSPropertyWebkitMarginBottomCollapse: |
| 2912 case CSSPropertyWebkitMarginTopCollapse: | 2903 case CSSPropertyWebkitMarginTopCollapse: |
| 2913 case CSSPropertyWebkitMarqueeDirection: | 2904 case CSSPropertyWebkitMarqueeDirection: |
| 2914 case CSSPropertyWebkitMarqueeStyle: | 2905 case CSSPropertyWebkitMarqueeStyle: |
| 2915 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) | 2906 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) |
| 2916 case CSSPropertyWebkitOverflowScrolling: | 2907 case CSSPropertyWebkitOverflowScrolling: |
| 2917 #endif | 2908 #endif |
| 2918 case CSSPropertyWebkitPrintColorAdjust: | 2909 case CSSPropertyWebkitPrintColorAdjust: |
| 2919 #if ENABLE(CSS_REGIONS) | |
| 2920 case CSSPropertyWebkitRegionBreakAfter: | 2910 case CSSPropertyWebkitRegionBreakAfter: |
| 2921 case CSSPropertyWebkitRegionBreakBefore: | 2911 case CSSPropertyWebkitRegionBreakBefore: |
| 2922 case CSSPropertyWebkitRegionBreakInside: | 2912 case CSSPropertyWebkitRegionBreakInside: |
| 2923 case CSSPropertyWebkitRegionOverflow: | 2913 case CSSPropertyWebkitRegionOverflow: |
| 2924 #endif | |
| 2925 case CSSPropertyWebkitRtlOrdering: | 2914 case CSSPropertyWebkitRtlOrdering: |
| 2926 case CSSPropertyWebkitRubyPosition: | 2915 case CSSPropertyWebkitRubyPosition: |
| 2927 #if ENABLE(CSS3_TEXT) | 2916 #if ENABLE(CSS3_TEXT) |
| 2928 case CSSPropertyWebkitTextAlignLast: | 2917 case CSSPropertyWebkitTextAlignLast: |
| 2929 #endif // CSS3_TEXT | 2918 #endif // CSS3_TEXT |
| 2930 case CSSPropertyWebkitTextCombine: | 2919 case CSSPropertyWebkitTextCombine: |
| 2931 case CSSPropertyWebkitTextEmphasisPosition: | 2920 case CSSPropertyWebkitTextEmphasisPosition: |
| 2932 case CSSPropertyWebkitTextSecurity: | 2921 case CSSPropertyWebkitTextSecurity: |
| 2933 case CSSPropertyWebkitTransformStyle: | 2922 case CSSPropertyWebkitTransformStyle: |
| 2934 case CSSPropertyWebkitUserDrag: | 2923 case CSSPropertyWebkitUserDrag: |
| (...skipping 5743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8678 if (!filterValue) | 8667 if (!filterValue) |
| 8679 return 0; | 8668 return 0; |
| 8680 | 8669 |
| 8681 list->append(filterValue); | 8670 list->append(filterValue); |
| 8682 } | 8671 } |
| 8683 } | 8672 } |
| 8684 | 8673 |
| 8685 return list.release(); | 8674 return list.release(); |
| 8686 } | 8675 } |
| 8687 | 8676 |
| 8688 #if ENABLE(CSS_REGIONS) | |
| 8689 static bool validFlowName(const String& flowName) | 8677 static bool validFlowName(const String& flowName) |
| 8690 { | 8678 { |
| 8691 return !(equalIgnoringCase(flowName, "auto") | 8679 return !(equalIgnoringCase(flowName, "auto") |
| 8692 || equalIgnoringCase(flowName, "default") | 8680 || equalIgnoringCase(flowName, "default") |
| 8693 || equalIgnoringCase(flowName, "inherit") | 8681 || equalIgnoringCase(flowName, "inherit") |
| 8694 || equalIgnoringCase(flowName, "initial") | 8682 || equalIgnoringCase(flowName, "initial") |
| 8695 || equalIgnoringCase(flowName, "none")); | 8683 || equalIgnoringCase(flowName, "none")); |
| 8696 } | 8684 } |
| 8697 #endif | |
| 8698 | |
| 8699 bool CSSParser::cssRegionsEnabled() const | |
| 8700 { | |
| 8701 return m_context.isCSSRegionsEnabled; | |
| 8702 } | |
| 8703 | 8685 |
| 8704 bool CSSParser::cssCompositingEnabled() const | 8686 bool CSSParser::cssCompositingEnabled() const |
| 8705 { | 8687 { |
| 8706 return m_context.isCSSCompositingEnabled; | 8688 return m_context.isCSSCompositingEnabled; |
| 8707 } | 8689 } |
| 8708 | 8690 |
| 8709 bool CSSParser::cssGridLayoutEnabled() const | 8691 bool CSSParser::cssGridLayoutEnabled() const |
| 8710 { | 8692 { |
| 8711 return m_context.isCSSGridLayoutEnabled; | 8693 return m_context.isCSSGridLayoutEnabled; |
| 8712 } | 8694 } |
| 8713 | 8695 |
| 8714 #if ENABLE(CSS_REGIONS) | |
| 8715 bool CSSParser::parseFlowThread(const String& flowName) | 8696 bool CSSParser::parseFlowThread(const String& flowName) |
| 8716 { | 8697 { |
| 8717 setupParser("@-internal-decls{-webkit-flow-into:", flowName, "}"); | 8698 setupParser("@-internal-decls{-webkit-flow-into:", flowName, "}"); |
| 8718 cssyyparse(this); | 8699 cssyyparse(this); |
| 8719 | 8700 |
| 8720 m_rule = 0; | 8701 m_rule = 0; |
| 8721 | 8702 |
| 8722 return ((m_parsedProperties.size() == 1) && (m_parsedProperties.first().id()
== CSSPropertyWebkitFlowInto)); | 8703 return ((m_parsedProperties.size() == 1) && (m_parsedProperties.first().id()
== CSSPropertyWebkitFlowInto)); |
| 8723 } | 8704 } |
| 8724 | 8705 |
| 8725 // none | <ident> | 8706 // none | <ident> |
| 8726 bool CSSParser::parseFlowThread(CSSPropertyID propId, bool important) | 8707 bool CSSParser::parseFlowThread(CSSPropertyID propId, bool important) |
| 8727 { | 8708 { |
| 8728 ASSERT(propId == CSSPropertyWebkitFlowInto); | 8709 ASSERT(propId == CSSPropertyWebkitFlowInto); |
| 8729 ASSERT(cssRegionsEnabled()); | 8710 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled()); |
| 8730 | 8711 |
| 8731 if (m_valueList->size() != 1) | 8712 if (m_valueList->size() != 1) |
| 8732 return false; | 8713 return false; |
| 8733 | 8714 |
| 8734 CSSParserValue* value = m_valueList->current(); | 8715 CSSParserValue* value = m_valueList->current(); |
| 8735 if (!value) | 8716 if (!value) |
| 8736 return false; | 8717 return false; |
| 8737 | 8718 |
| 8738 if (value->unit != CSSPrimitiveValue::CSS_IDENT) | 8719 if (value->unit != CSSPrimitiveValue::CSS_IDENT) |
| 8739 return false; | 8720 return false; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 8751 } else | 8732 } else |
| 8752 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone),
important); | 8733 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone),
important); |
| 8753 | 8734 |
| 8754 return true; | 8735 return true; |
| 8755 } | 8736 } |
| 8756 | 8737 |
| 8757 // -webkit-flow-from: none | <ident> | 8738 // -webkit-flow-from: none | <ident> |
| 8758 bool CSSParser::parseRegionThread(CSSPropertyID propId, bool important) | 8739 bool CSSParser::parseRegionThread(CSSPropertyID propId, bool important) |
| 8759 { | 8740 { |
| 8760 ASSERT(propId == CSSPropertyWebkitFlowFrom); | 8741 ASSERT(propId == CSSPropertyWebkitFlowFrom); |
| 8761 ASSERT(cssRegionsEnabled()); | 8742 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled()); |
| 8762 | 8743 |
| 8763 if (m_valueList->size() != 1) | 8744 if (m_valueList->size() != 1) |
| 8764 return false; | 8745 return false; |
| 8765 | 8746 |
| 8766 CSSParserValue* value = m_valueList->current(); | 8747 CSSParserValue* value = m_valueList->current(); |
| 8767 if (!value) | 8748 if (!value) |
| 8768 return false; | 8749 return false; |
| 8769 | 8750 |
| 8770 if (value->unit != CSSPrimitiveValue::CSS_IDENT) | 8751 if (value->unit != CSSPrimitiveValue::CSS_IDENT) |
| 8771 return false; | 8752 return false; |
| 8772 | 8753 |
| 8773 if (value->id == CSSValueNone) | 8754 if (value->id == CSSValueNone) |
| 8774 addProperty(propId, cssValuePool().createIdentifierValue(value->id), imp
ortant); | 8755 addProperty(propId, cssValuePool().createIdentifierValue(value->id), imp
ortant); |
| 8775 else { | 8756 else { |
| 8776 String inputProperty = String(value->string); | 8757 String inputProperty = String(value->string); |
| 8777 if (!inputProperty.isEmpty()) { | 8758 if (!inputProperty.isEmpty()) { |
| 8778 if (!validFlowName(inputProperty)) | 8759 if (!validFlowName(inputProperty)) |
| 8779 return false; | 8760 return false; |
| 8780 addProperty(propId, cssValuePool().createValue(inputProperty, CSSPri
mitiveValue::CSS_STRING), important); | 8761 addProperty(propId, cssValuePool().createValue(inputProperty, CSSPri
mitiveValue::CSS_STRING), important); |
| 8781 } else | 8762 } else |
| 8782 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNon
e), important); | 8763 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNon
e), important); |
| 8783 } | 8764 } |
| 8784 | 8765 |
| 8785 return true; | 8766 return true; |
| 8786 } | 8767 } |
| 8787 #endif | |
| 8788 | 8768 |
| 8789 bool CSSParser::parseTransformOrigin(CSSPropertyID propId, CSSPropertyID& propId
1, CSSPropertyID& propId2, CSSPropertyID& propId3, RefPtr<CSSValue>& value, RefP
tr<CSSValue>& value2, RefPtr<CSSValue>& value3) | 8769 bool CSSParser::parseTransformOrigin(CSSPropertyID propId, CSSPropertyID& propId
1, CSSPropertyID& propId2, CSSPropertyID& propId3, RefPtr<CSSValue>& value, RefP
tr<CSSValue>& value2, RefPtr<CSSValue>& value3) |
| 8790 { | 8770 { |
| 8791 propId1 = propId; | 8771 propId1 = propId; |
| 8792 propId2 = propId; | 8772 propId2 = propId; |
| 8793 propId3 = propId; | 8773 propId3 = propId; |
| 8794 if (propId == CSSPropertyWebkitTransformOrigin) { | 8774 if (propId == CSSPropertyWebkitTransformOrigin) { |
| 8795 propId1 = CSSPropertyWebkitTransformOriginX; | 8775 propId1 = CSSPropertyWebkitTransformOriginX; |
| 8796 propId2 = CSSPropertyWebkitTransformOriginY; | 8776 propId2 = CSSPropertyWebkitTransformOriginY; |
| 8797 propId3 = CSSPropertyWebkitTransformOriginZ; | 8777 propId3 = CSSPropertyWebkitTransformOriginZ; |
| (...skipping 1444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10242 switch (length) { | 10222 switch (length) { |
| 10243 case 15: | 10223 case 15: |
| 10244 if (hasEscape) | 10224 if (hasEscape) |
| 10245 return; | 10225 return; |
| 10246 | 10226 |
| 10247 if (isEqualToCSSIdentifier(name + 2, "internal-rule")) { | 10227 if (isEqualToCSSIdentifier(name + 2, "internal-rule")) { |
| 10248 m_token = INTERNAL_RULE_SYM; | 10228 m_token = INTERNAL_RULE_SYM; |
| 10249 return; | 10229 return; |
| 10250 } | 10230 } |
| 10251 | 10231 |
| 10252 #if ENABLE(CSS_REGIONS) | |
| 10253 if (isASCIIAlphaCaselessEqual(name[14], 'n') && isEqualToCSSIdentifi
er(name + 2, "webkit-regio")) { | 10232 if (isASCIIAlphaCaselessEqual(name[14], 'n') && isEqualToCSSIdentifi
er(name + 2, "webkit-regio")) { |
| 10254 m_token = WEBKIT_REGION_RULE_SYM; | 10233 m_token = WEBKIT_REGION_RULE_SYM; |
| 10255 return; | 10234 return; |
| 10256 } | 10235 } |
| 10257 #endif | 10236 |
| 10258 if (isASCIIAlphaCaselessEqual(name[14], 'r') && isEqualToCSSIdentifi
er(name + 2, "webkit-filte")) { | 10237 if (isASCIIAlphaCaselessEqual(name[14], 'r') && isEqualToCSSIdentifi
er(name + 2, "webkit-filte")) { |
| 10259 m_token = WEBKIT_FILTER_RULE_SYM; | 10238 m_token = WEBKIT_FILTER_RULE_SYM; |
| 10260 return; | 10239 return; |
| 10261 } | 10240 } |
| 10262 return; | 10241 return; |
| 10263 | 10242 |
| 10264 case 16: | 10243 case 16: |
| 10265 if (hasEscape) | 10244 if (hasEscape) |
| 10266 return; | 10245 return; |
| 10267 | 10246 |
| (...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11212 } | 11191 } |
| 11213 | 11192 |
| 11214 void CSSParser::setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector>
>* selectors) | 11193 void CSSParser::setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector>
>* selectors) |
| 11215 { | 11194 { |
| 11216 if (selectors) | 11195 if (selectors) |
| 11217 m_reusableRegionSelectorVector.swap(*selectors); | 11196 m_reusableRegionSelectorVector.swap(*selectors); |
| 11218 } | 11197 } |
| 11219 | 11198 |
| 11220 StyleRuleBase* CSSParser::createRegionRule(Vector<OwnPtr<CSSParserSelector> >* r
egionSelector, RuleList* rules) | 11199 StyleRuleBase* CSSParser::createRegionRule(Vector<OwnPtr<CSSParserSelector> >* r
egionSelector, RuleList* rules) |
| 11221 { | 11200 { |
| 11222 if (!cssRegionsEnabled() || !regionSelector || !rules) { | 11201 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !regionSelector || !rule
s) { |
| 11223 endRuleBody(true); | 11202 endRuleBody(true); |
| 11224 return 0; | 11203 return 0; |
| 11225 } | 11204 } |
| 11226 | 11205 |
| 11227 m_allowImportRules = m_allowNamespaceDeclarations = false; | 11206 m_allowImportRules = m_allowNamespaceDeclarations = false; |
| 11228 | 11207 |
| 11229 RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector,
*rules); | 11208 RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector,
*rules); |
| 11230 | 11209 |
| 11231 StyleRuleRegion* result = regionRule.get(); | 11210 StyleRuleRegion* result = regionRule.get(); |
| 11232 m_parsedRules.append(regionRule.release()); | 11211 m_parsedRules.append(regionRule.release()); |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11723 { | 11702 { |
| 11724 // The tokenizer checks for the construct of an+b. | 11703 // The tokenizer checks for the construct of an+b. |
| 11725 // However, since the {ident} rule precedes the {nth} rule, some of those | 11704 // However, since the {ident} rule precedes the {nth} rule, some of those |
| 11726 // tokens are identified as string literal. Furthermore we need to accept | 11705 // tokens are identified as string literal. Furthermore we need to accept |
| 11727 // "odd" and "even" which does not match to an+b. | 11706 // "odd" and "even" which does not match to an+b. |
| 11728 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 11707 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
| 11729 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 11708 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
| 11730 } | 11709 } |
| 11731 | 11710 |
| 11732 } | 11711 } |
| OLD | NEW |