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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp

Issue 1442233002: Move stroke-dasharray property into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 case CSSPropertyPadding: 1146 case CSSPropertyPadding:
1147 case CSSPropertyMarker: 1147 case CSSPropertyMarker:
1148 case CSSPropertyMarkerStart: 1148 case CSSPropertyMarkerStart:
1149 case CSSPropertyMarkerMid: 1149 case CSSPropertyMarkerMid:
1150 case CSSPropertyMarkerEnd: 1150 case CSSPropertyMarkerEnd:
1151 case CSSPropertyFlex: 1151 case CSSPropertyFlex:
1152 case CSSPropertyFlexBasis: 1152 case CSSPropertyFlexBasis:
1153 case CSSPropertyFlexGrow: 1153 case CSSPropertyFlexGrow:
1154 case CSSPropertyFlexShrink: 1154 case CSSPropertyFlexShrink:
1155 case CSSPropertyFlexFlow: 1155 case CSSPropertyFlexFlow:
1156 case CSSPropertyStrokeDasharray:
1156 validPrimitive = false; 1157 validPrimitive = false;
1157 break; 1158 break;
1158 1159
1159 case CSSPropertyScrollSnapPointsX: 1160 case CSSPropertyScrollSnapPointsX:
1160 case CSSPropertyScrollSnapPointsY: 1161 case CSSPropertyScrollSnapPointsY:
1161 parsedValue = parseScrollSnapPoints(); 1162 parsedValue = parseScrollSnapPoints();
1162 break; 1163 break;
1163 case CSSPropertyScrollSnapCoordinate: 1164 case CSSPropertyScrollSnapCoordinate:
1164 parsedValue = parseScrollSnapCoordinate(); 1165 parsedValue = parseScrollSnapCoordinate();
1165 break; 1166 break;
(...skipping 4268 matching lines...) Expand 10 before | Expand all | Expand 10 after
5434 case CSSPropertyStrokeDashoffset: 5435 case CSSPropertyStrokeDashoffset:
5435 case CSSPropertyCx: 5436 case CSSPropertyCx:
5436 case CSSPropertyCy: 5437 case CSSPropertyCy:
5437 case CSSPropertyX: 5438 case CSSPropertyX:
5438 case CSSPropertyY: 5439 case CSSPropertyY:
5439 case CSSPropertyR: 5440 case CSSPropertyR:
5440 case CSSPropertyRx: 5441 case CSSPropertyRx:
5441 case CSSPropertyRy: 5442 case CSSPropertyRy:
5442 validPrimitive = validUnit(value, FLength | FPercent, SVGAttributeMode); 5443 validPrimitive = validUnit(value, FLength | FPercent, SVGAttributeMode);
5443 break; 5444 break;
5444 case CSSPropertyStrokeDasharray: // none | <dasharray> | inherit
5445 if (id == CSSValueNone)
5446 validPrimitive = true;
5447 else
5448 parsedValue = parseSVGStrokeDasharray();
5449 break;
5450 5445
5451 default: 5446 default:
5452 // If you crash here, it's because you added a css property and are not handling it 5447 // If you crash here, it's because you added a css property and are not handling it
5453 // in either this switch statement or the one in CSSPropertyParser::pars eValue 5448 // in either this switch statement or the one in CSSPropertyParser::pars eValue
5454 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId); 5449 ASSERT_WITH_MESSAGE(0, "unimplemented propertyID: %d", propId);
5455 return false; 5450 return false;
5456 } 5451 }
5457 5452
5458 if (validPrimitive) { 5453 if (validPrimitive) {
5459 if (id) 5454 if (id)
(...skipping 14 matching lines...) Expand all
5474 } 5469 }
5475 m_valueList->next(); 5470 m_valueList->next();
5476 } 5471 }
5477 if (!parsedValue || (m_valueList->current() && !inShorthand())) 5472 if (!parsedValue || (m_valueList->current() && !inShorthand()))
5478 return false; 5473 return false;
5479 5474
5480 addProperty(propId, parsedValue.release(), important); 5475 addProperty(propId, parsedValue.release(), important);
5481 return true; 5476 return true;
5482 } 5477 }
5483 5478
5484 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSVGStrokeDasharray()
5485 {
5486 RefPtrWillBeRawPtr<CSSValueList> ret = CSSValueList::createCommaSeparated();
5487 CSSParserValue* value = m_valueList->current();
5488 bool validPrimitive = true;
5489 while (value) {
5490 validPrimitive = validUnit(value, FLength | FPercent | FNonNeg, SVGAttri buteMode);
5491 if (!validPrimitive)
5492 break;
5493 if (value->id)
5494 ret->append(CSSPrimitiveValue::createIdentifier(value->id));
5495 else if (value->unit() >= CSSPrimitiveValue::UnitType::Number && value-> unit() <= CSSPrimitiveValue::UnitType::Kilohertz)
5496 ret->append(CSSPrimitiveValue::create(value->fValue, value->unit())) ;
5497 else if (value->unit() == CSSPrimitiveValue::UnitType::Rems || value->un it() == CSSPrimitiveValue::UnitType::Chs)
5498 ret->append(CSSPrimitiveValue::create(value->fValue, value->unit())) ;
5499 value = m_valueList->next();
5500 bool commaConsumed = consumeComma(m_valueList);
5501 value = m_valueList->current();
5502 if (commaConsumed && !value)
5503 return nullptr;
5504 }
5505 if (!validPrimitive)
5506 return nullptr;
5507 return ret.release();
5508 }
5509
5510 } // namespace blink 5479 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698