Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: Source/core/css/CSSParser.cpp

Issue 14178009: Remove CSS_REGIONS compile flag from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use RuntimeEnabledFeatures::cssRegionsEnabled all over the places. Guard WEBKIT_REGION_RULE at runt… Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 { 254 {
256 } 255 }
257 256
258 CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons t String& charset) 257 CSSParserContext::CSSParserContext(Document* document, const KURL& baseURL, cons t String& charset)
259 : baseURL(baseURL.isNull() ? document->baseURL() : baseURL) 258 : baseURL(baseURL.isNull() ? document->baseURL() : baseURL)
260 , charset(charset) 259 , charset(charset)
261 , mode(document->inQuirksMode() ? CSSQuirksMode : CSSStrictMode) 260 , mode(document->inQuirksMode() ? CSSQuirksMode : CSSStrictMode)
262 , isHTMLDocument(document->isHTMLDocument()) 261 , isHTMLDocument(document->isHTMLDocument())
263 , isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCS SCustomFilterEnabled() : false) 262 , isCSSCustomFilterEnabled(document->settings() ? document->settings()->isCS SCustomFilterEnabled() : false)
264 , isCSSStickyPositionEnabled(document->cssStickyPositionEnabled()) 263 , isCSSStickyPositionEnabled(document->cssStickyPositionEnabled())
265 , isCSSRegionsEnabled(document->cssRegionsEnabled())
266 , isCSSCompositingEnabled(document->cssCompositingEnabled()) 264 , isCSSCompositingEnabled(document->cssCompositingEnabled())
267 , isCSSGridLayoutEnabled(document->cssGridLayoutEnabled()) 265 , isCSSGridLayoutEnabled(document->cssGridLayoutEnabled())
268 , isCSSVariablesEnabled(document->settings() ? document->settings()->cssVari ablesEnabled() : false) 266 , isCSSVariablesEnabled(document->settings() ? document->settings()->cssVari ablesEnabled() : false)
269 , needsSiteSpecificQuirks(document->settings() ? document->settings()->needs SiteSpecificQuirks() : false) 267 , needsSiteSpecificQuirks(document->settings() ? document->settings()->needs SiteSpecificQuirks() : false)
270 { 268 {
271 } 269 }
272 270
273 bool operator==(const CSSParserContext& a, const CSSParserContext& b) 271 bool operator==(const CSSParserContext& a, const CSSParserContext& b)
274 { 272 {
275 return a.baseURL == b.baseURL 273 return a.baseURL == b.baseURL
276 && a.charset == b.charset 274 && a.charset == b.charset
277 && a.mode == b.mode 275 && a.mode == b.mode
278 && a.isHTMLDocument == b.isHTMLDocument 276 && a.isHTMLDocument == b.isHTMLDocument
279 && a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled 277 && a.isCSSCustomFilterEnabled == b.isCSSCustomFilterEnabled
280 && a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled 278 && a.isCSSStickyPositionEnabled == b.isCSSStickyPositionEnabled
281 && a.isCSSRegionsEnabled == b.isCSSRegionsEnabled
282 && a.isCSSCompositingEnabled == b.isCSSCompositingEnabled 279 && a.isCSSCompositingEnabled == b.isCSSCompositingEnabled
283 && a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled 280 && a.isCSSGridLayoutEnabled == b.isCSSGridLayoutEnabled
284 && a.isCSSVariablesEnabled == b.isCSSVariablesEnabled 281 && a.isCSSVariablesEnabled == b.isCSSVariablesEnabled
285 && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks; 282 && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks;
286 } 283 }
287 284
288 CSSParser::CSSParser(const CSSParserContext& context) 285 CSSParser::CSSParser(const CSSParserContext& context)
289 : m_context(context) 286 : m_context(context)
290 , m_important(false) 287 , m_important(false)
291 , m_id(CSSPropertyInvalid) 288 , m_id(CSSPropertyInvalid)
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1094 case CSSPropertyWebkitMarginAfterCollapse: 1089 case CSSPropertyWebkitMarginAfterCollapse:
1095 case CSSPropertyWebkitMarginBeforeCollapse: 1090 case CSSPropertyWebkitMarginBeforeCollapse:
1096 case CSSPropertyWebkitMarginBottomCollapse: 1091 case CSSPropertyWebkitMarginBottomCollapse:
1097 case CSSPropertyWebkitMarginTopCollapse: 1092 case CSSPropertyWebkitMarginTopCollapse:
1098 case CSSPropertyWebkitMarqueeDirection: 1093 case CSSPropertyWebkitMarqueeDirection:
1099 case CSSPropertyWebkitMarqueeStyle: 1094 case CSSPropertyWebkitMarqueeStyle:
1100 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) 1095 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
1101 case CSSPropertyWebkitOverflowScrolling: 1096 case CSSPropertyWebkitOverflowScrolling:
1102 #endif 1097 #endif
1103 case CSSPropertyWebkitPrintColorAdjust: 1098 case CSSPropertyWebkitPrintColorAdjust:
1104 #if ENABLE(CSS_REGIONS)
1105 case CSSPropertyWebkitRegionBreakAfter: 1099 case CSSPropertyWebkitRegionBreakAfter:
1106 case CSSPropertyWebkitRegionBreakBefore: 1100 case CSSPropertyWebkitRegionBreakBefore:
1107 case CSSPropertyWebkitRegionBreakInside: 1101 case CSSPropertyWebkitRegionBreakInside:
1108 case CSSPropertyWebkitRegionOverflow: 1102 case CSSPropertyWebkitRegionOverflow:
1109 #endif
1110 case CSSPropertyWebkitRtlOrdering: 1103 case CSSPropertyWebkitRtlOrdering:
1111 case CSSPropertyWebkitRubyPosition: 1104 case CSSPropertyWebkitRubyPosition:
1112 #if ENABLE(CSS3_TEXT) 1105 #if ENABLE(CSS3_TEXT)
1113 case CSSPropertyWebkitTextAlignLast: 1106 case CSSPropertyWebkitTextAlignLast:
1114 #endif // CSS3_TEXT 1107 #endif // CSS3_TEXT
1115 case CSSPropertyWebkitTextCombine: 1108 case CSSPropertyWebkitTextCombine:
1116 case CSSPropertyWebkitTextEmphasisPosition: 1109 case CSSPropertyWebkitTextEmphasisPosition:
1117 case CSSPropertyWebkitTextSecurity: 1110 case CSSPropertyWebkitTextSecurity:
1118 case CSSPropertyWebkitTransformStyle: 1111 case CSSPropertyWebkitTransformStyle:
1119 case CSSPropertyWebkitUserDrag: 1112 case CSSPropertyWebkitUserDrag:
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2427 validPrimitive = true; 2420 validPrimitive = true;
2428 else 2421 else
2429 validPrimitive = validUnit(value, FInteger | FNonNeg); 2422 validPrimitive = validUnit(value, FInteger | FNonNeg);
2430 break; 2423 break;
2431 case CSSPropertyWebkitMarqueeSpeed: 2424 case CSSPropertyWebkitMarqueeSpeed:
2432 if (id == CSSValueNormal || id == CSSValueSlow || id == CSSValueFast) 2425 if (id == CSSValueNormal || id == CSSValueSlow || id == CSSValueFast)
2433 validPrimitive = true; 2426 validPrimitive = true;
2434 else 2427 else
2435 validPrimitive = validUnit(value, FTime | FInteger | FNonNeg); 2428 validPrimitive = validUnit(value, FTime | FInteger | FNonNeg);
2436 break; 2429 break;
2437 #if ENABLE(CSS_REGIONS)
2438 case CSSPropertyWebkitFlowInto: 2430 case CSSPropertyWebkitFlowInto:
2439 if (!cssRegionsEnabled()) 2431 if (!RuntimeEnabledFeatures::cssRegionsEnabled())
2440 return false; 2432 return false;
2441 return parseFlowThread(propId, important); 2433 return parseFlowThread(propId, important);
2442 case CSSPropertyWebkitFlowFrom: 2434 case CSSPropertyWebkitFlowFrom:
2443 if (!cssRegionsEnabled()) 2435 if (!RuntimeEnabledFeatures::cssRegionsEnabled())
2444 return false; 2436 return false;
2445 return parseRegionThread(propId, important); 2437 return parseRegionThread(propId, important);
2446 #endif
2447 case CSSPropertyWebkitTransform: 2438 case CSSPropertyWebkitTransform:
2448 if (id == CSSValueNone) 2439 if (id == CSSValueNone)
2449 validPrimitive = true; 2440 validPrimitive = true;
2450 else { 2441 else {
2451 RefPtr<CSSValue> transformValue = parseTransform(); 2442 RefPtr<CSSValue> transformValue = parseTransform();
2452 if (transformValue) { 2443 if (transformValue) {
2453 addProperty(propId, transformValue.release(), important); 2444 addProperty(propId, transformValue.release(), important);
2454 return true; 2445 return true;
2455 } 2446 }
2456 return false; 2447 return false;
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 case CSSPropertyWebkitMarginAfterCollapse: 2909 case CSSPropertyWebkitMarginAfterCollapse:
2919 case CSSPropertyWebkitMarginBeforeCollapse: 2910 case CSSPropertyWebkitMarginBeforeCollapse:
2920 case CSSPropertyWebkitMarginBottomCollapse: 2911 case CSSPropertyWebkitMarginBottomCollapse:
2921 case CSSPropertyWebkitMarginTopCollapse: 2912 case CSSPropertyWebkitMarginTopCollapse:
2922 case CSSPropertyWebkitMarqueeDirection: 2913 case CSSPropertyWebkitMarqueeDirection:
2923 case CSSPropertyWebkitMarqueeStyle: 2914 case CSSPropertyWebkitMarqueeStyle:
2924 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) 2915 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
2925 case CSSPropertyWebkitOverflowScrolling: 2916 case CSSPropertyWebkitOverflowScrolling:
2926 #endif 2917 #endif
2927 case CSSPropertyWebkitPrintColorAdjust: 2918 case CSSPropertyWebkitPrintColorAdjust:
2928 #if ENABLE(CSS_REGIONS)
2929 case CSSPropertyWebkitRegionBreakAfter: 2919 case CSSPropertyWebkitRegionBreakAfter:
2930 case CSSPropertyWebkitRegionBreakBefore: 2920 case CSSPropertyWebkitRegionBreakBefore:
2931 case CSSPropertyWebkitRegionBreakInside: 2921 case CSSPropertyWebkitRegionBreakInside:
2932 case CSSPropertyWebkitRegionOverflow: 2922 case CSSPropertyWebkitRegionOverflow:
2933 #endif
2934 case CSSPropertyWebkitRtlOrdering: 2923 case CSSPropertyWebkitRtlOrdering:
2935 case CSSPropertyWebkitRubyPosition: 2924 case CSSPropertyWebkitRubyPosition:
2936 #if ENABLE(CSS3_TEXT) 2925 #if ENABLE(CSS3_TEXT)
2937 case CSSPropertyWebkitTextAlignLast: 2926 case CSSPropertyWebkitTextAlignLast:
2938 #endif // CSS3_TEXT 2927 #endif // CSS3_TEXT
2939 case CSSPropertyWebkitTextCombine: 2928 case CSSPropertyWebkitTextCombine:
2940 case CSSPropertyWebkitTextEmphasisPosition: 2929 case CSSPropertyWebkitTextEmphasisPosition:
2941 case CSSPropertyWebkitTextSecurity: 2930 case CSSPropertyWebkitTextSecurity:
2942 case CSSPropertyWebkitTransformStyle: 2931 case CSSPropertyWebkitTransformStyle:
2943 case CSSPropertyWebkitUserDrag: 2932 case CSSPropertyWebkitUserDrag:
(...skipping 5735 matching lines...) Expand 10 before | Expand all | Expand 10 after
8679 if (!filterValue) 8668 if (!filterValue)
8680 return 0; 8669 return 0;
8681 8670
8682 list->append(filterValue); 8671 list->append(filterValue);
8683 } 8672 }
8684 } 8673 }
8685 8674
8686 return list.release(); 8675 return list.release();
8687 } 8676 }
8688 8677
8689 #if ENABLE(CSS_REGIONS)
8690 static bool validFlowName(const String& flowName) 8678 static bool validFlowName(const String& flowName)
8691 { 8679 {
8692 return !(equalIgnoringCase(flowName, "auto") 8680 return !(equalIgnoringCase(flowName, "auto")
8693 || equalIgnoringCase(flowName, "default") 8681 || equalIgnoringCase(flowName, "default")
8694 || equalIgnoringCase(flowName, "inherit") 8682 || equalIgnoringCase(flowName, "inherit")
8695 || equalIgnoringCase(flowName, "initial") 8683 || equalIgnoringCase(flowName, "initial")
8696 || equalIgnoringCase(flowName, "none")); 8684 || equalIgnoringCase(flowName, "none"));
8697 } 8685 }
8698 #endif
8699
8700 bool CSSParser::cssRegionsEnabled() const
8701 {
8702 return m_context.isCSSRegionsEnabled;
8703 }
8704 8686
8705 bool CSSParser::cssCompositingEnabled() const 8687 bool CSSParser::cssCompositingEnabled() const
8706 { 8688 {
8707 return m_context.isCSSCompositingEnabled; 8689 return m_context.isCSSCompositingEnabled;
8708 } 8690 }
8709 8691
8710 bool CSSParser::cssGridLayoutEnabled() const 8692 bool CSSParser::cssGridLayoutEnabled() const
8711 { 8693 {
8712 return m_context.isCSSGridLayoutEnabled; 8694 return m_context.isCSSGridLayoutEnabled;
8713 } 8695 }
8714 8696
8715 #if ENABLE(CSS_REGIONS)
8716 bool CSSParser::parseFlowThread(const String& flowName) 8697 bool CSSParser::parseFlowThread(const String& flowName)
8717 { 8698 {
8718 setupParser("@-internal-decls{-webkit-flow-into:", flowName, "}"); 8699 setupParser("@-internal-decls{-webkit-flow-into:", flowName, "}");
8719 cssyyparse(this); 8700 cssyyparse(this);
8720 8701
8721 m_rule = 0; 8702 m_rule = 0;
8722 8703
8723 return ((m_parsedProperties.size() == 1) && (m_parsedProperties.first().id() == CSSPropertyWebkitFlowInto)); 8704 return ((m_parsedProperties.size() == 1) && (m_parsedProperties.first().id() == CSSPropertyWebkitFlowInto));
8724 } 8705 }
8725 8706
8726 // none | <ident> 8707 // none | <ident>
8727 bool CSSParser::parseFlowThread(CSSPropertyID propId, bool important) 8708 bool CSSParser::parseFlowThread(CSSPropertyID propId, bool important)
8728 { 8709 {
8729 ASSERT(propId == CSSPropertyWebkitFlowInto); 8710 ASSERT(propId == CSSPropertyWebkitFlowInto);
8730 ASSERT(cssRegionsEnabled()); 8711 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
8731 8712
8732 if (m_valueList->size() != 1) 8713 if (m_valueList->size() != 1)
8733 return false; 8714 return false;
8734 8715
8735 CSSParserValue* value = m_valueList->current(); 8716 CSSParserValue* value = m_valueList->current();
8736 if (!value) 8717 if (!value)
8737 return false; 8718 return false;
8738 8719
8739 if (value->unit != CSSPrimitiveValue::CSS_IDENT) 8720 if (value->unit != CSSPrimitiveValue::CSS_IDENT)
8740 return false; 8721 return false;
(...skipping 11 matching lines...) Expand all
8752 } else 8733 } else
8753 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone), important); 8734 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNone), important);
8754 8735
8755 return true; 8736 return true;
8756 } 8737 }
8757 8738
8758 // -webkit-flow-from: none | <ident> 8739 // -webkit-flow-from: none | <ident>
8759 bool CSSParser::parseRegionThread(CSSPropertyID propId, bool important) 8740 bool CSSParser::parseRegionThread(CSSPropertyID propId, bool important)
8760 { 8741 {
8761 ASSERT(propId == CSSPropertyWebkitFlowFrom); 8742 ASSERT(propId == CSSPropertyWebkitFlowFrom);
8762 ASSERT(cssRegionsEnabled()); 8743 ASSERT(RuntimeEnabledFeatures::cssRegionsEnabled());
8763 8744
8764 if (m_valueList->size() != 1) 8745 if (m_valueList->size() != 1)
8765 return false; 8746 return false;
8766 8747
8767 CSSParserValue* value = m_valueList->current(); 8748 CSSParserValue* value = m_valueList->current();
8768 if (!value) 8749 if (!value)
8769 return false; 8750 return false;
8770 8751
8771 if (value->unit != CSSPrimitiveValue::CSS_IDENT) 8752 if (value->unit != CSSPrimitiveValue::CSS_IDENT)
8772 return false; 8753 return false;
8773 8754
8774 if (value->id == CSSValueNone) 8755 if (value->id == CSSValueNone)
8775 addProperty(propId, cssValuePool().createIdentifierValue(value->id), imp ortant); 8756 addProperty(propId, cssValuePool().createIdentifierValue(value->id), imp ortant);
8776 else { 8757 else {
8777 String inputProperty = String(value->string); 8758 String inputProperty = String(value->string);
8778 if (!inputProperty.isEmpty()) { 8759 if (!inputProperty.isEmpty()) {
8779 if (!validFlowName(inputProperty)) 8760 if (!validFlowName(inputProperty))
8780 return false; 8761 return false;
8781 addProperty(propId, cssValuePool().createValue(inputProperty, CSSPri mitiveValue::CSS_STRING), important); 8762 addProperty(propId, cssValuePool().createValue(inputProperty, CSSPri mitiveValue::CSS_STRING), important);
8782 } else 8763 } else
8783 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNon e), important); 8764 addProperty(propId, cssValuePool().createIdentifierValue(CSSValueNon e), important);
8784 } 8765 }
8785 8766
8786 return true; 8767 return true;
8787 } 8768 }
8788 #endif
8789 8769
8790 bool CSSParser::parseTransformOrigin(CSSPropertyID propId, CSSPropertyID& propId 1, CSSPropertyID& propId2, CSSPropertyID& propId3, RefPtr<CSSValue>& value, RefP tr<CSSValue>& value2, RefPtr<CSSValue>& value3) 8770 bool CSSParser::parseTransformOrigin(CSSPropertyID propId, CSSPropertyID& propId 1, CSSPropertyID& propId2, CSSPropertyID& propId3, RefPtr<CSSValue>& value, RefP tr<CSSValue>& value2, RefPtr<CSSValue>& value3)
8791 { 8771 {
8792 propId1 = propId; 8772 propId1 = propId;
8793 propId2 = propId; 8773 propId2 = propId;
8794 propId3 = propId; 8774 propId3 = propId;
8795 if (propId == CSSPropertyWebkitTransformOrigin) { 8775 if (propId == CSSPropertyWebkitTransformOrigin) {
8796 propId1 = CSSPropertyWebkitTransformOriginX; 8776 propId1 = CSSPropertyWebkitTransformOriginX;
8797 propId2 = CSSPropertyWebkitTransformOriginY; 8777 propId2 = CSSPropertyWebkitTransformOriginY;
8798 propId3 = CSSPropertyWebkitTransformOriginZ; 8778 propId3 = CSSPropertyWebkitTransformOriginZ;
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
10239 switch (length) { 10219 switch (length) {
10240 case 15: 10220 case 15:
10241 if (hasEscape) 10221 if (hasEscape)
10242 return; 10222 return;
10243 10223
10244 if (isEqualToCSSIdentifier(name + 2, "internal-rule")) { 10224 if (isEqualToCSSIdentifier(name + 2, "internal-rule")) {
10245 m_token = INTERNAL_RULE_SYM; 10225 m_token = INTERNAL_RULE_SYM;
10246 return; 10226 return;
10247 } 10227 }
10248 10228
10249 #if ENABLE(CSS_REGIONS)
10250 if (isASCIIAlphaCaselessEqual(name[14], 'n') && isEqualToCSSIdentifi er(name + 2, "webkit-regio")) { 10229 if (isASCIIAlphaCaselessEqual(name[14], 'n') && isEqualToCSSIdentifi er(name + 2, "webkit-regio")) {
10251 m_token = WEBKIT_REGION_RULE_SYM; 10230 m_token = WEBKIT_REGION_RULE_SYM;
10252 return; 10231 return;
10253 } 10232 }
10254 #endif 10233
10255 if (isASCIIAlphaCaselessEqual(name[14], 'r') && isEqualToCSSIdentifi er(name + 2, "webkit-filte")) { 10234 if (isASCIIAlphaCaselessEqual(name[14], 'r') && isEqualToCSSIdentifi er(name + 2, "webkit-filte")) {
10256 m_token = WEBKIT_FILTER_RULE_SYM; 10235 m_token = WEBKIT_FILTER_RULE_SYM;
10257 return; 10236 return;
10258 } 10237 }
10259 return; 10238 return;
10260 10239
10261 case 16: 10240 case 16:
10262 if (hasEscape) 10241 if (hasEscape)
10263 return; 10242 return;
10264 10243
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
11209 } 11188 }
11210 11189
11211 void CSSParser::setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector> >* selectors) 11190 void CSSParser::setReusableRegionSelectorVector(Vector<OwnPtr<CSSParserSelector> >* selectors)
11212 { 11191 {
11213 if (selectors) 11192 if (selectors)
11214 m_reusableRegionSelectorVector.swap(*selectors); 11193 m_reusableRegionSelectorVector.swap(*selectors);
11215 } 11194 }
11216 11195
11217 StyleRuleBase* CSSParser::createRegionRule(Vector<OwnPtr<CSSParserSelector> >* r egionSelector, RuleList* rules) 11196 StyleRuleBase* CSSParser::createRegionRule(Vector<OwnPtr<CSSParserSelector> >* r egionSelector, RuleList* rules)
11218 { 11197 {
11219 if (!cssRegionsEnabled() || !regionSelector || !rules) { 11198 if (!RuntimeEnabledFeatures::cssRegionsEnabled() || !regionSelector || !rule s) {
11220 endRuleBody(true); 11199 endRuleBody(true);
11221 return 0; 11200 return 0;
11222 } 11201 }
11223 11202
11224 m_allowImportRules = m_allowNamespaceDeclarations = false; 11203 m_allowImportRules = m_allowNamespaceDeclarations = false;
11225 11204
11226 RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector, *rules); 11205 RefPtr<StyleRuleRegion> regionRule = StyleRuleRegion::create(regionSelector, *rules);
11227 11206
11228 StyleRuleRegion* result = regionRule.get(); 11207 StyleRuleRegion* result = regionRule.get();
11229 m_parsedRules.append(regionRule.release()); 11208 m_parsedRules.append(regionRule.release());
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
11727 { 11706 {
11728 // The tokenizer checks for the construct of an+b. 11707 // The tokenizer checks for the construct of an+b.
11729 // However, since the {ident} rule precedes the {nth} rule, some of those 11708 // However, since the {ident} rule precedes the {nth} rule, some of those
11730 // tokens are identified as string literal. Furthermore we need to accept 11709 // tokens are identified as string literal. Furthermore we need to accept
11731 // "odd" and "even" which does not match to an+b. 11710 // "odd" and "even" which does not match to an+b.
11732 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11711 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11733 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11712 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11734 } 11713 }
11735 11714
11736 } 11715 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698