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

Side by Side Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1312543003: Split out Attribute from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@clean_up_get_string_value
Patch Set: Rebase Created 5 years, 3 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
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | 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 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after
2260 String attrName = a->string; 2260 String attrName = a->string;
2261 // CSS allows identifiers with "-" at the start, like "-webkit-mask-image". 2261 // CSS allows identifiers with "-" at the start, like "-webkit-mask-image".
2262 // But HTML attribute names can't have those characters, and we should not 2262 // But HTML attribute names can't have those characters, and we should not
2263 // even parse them inside attr(). 2263 // even parse them inside attr().
2264 if (attrName[0] == '-') 2264 if (attrName[0] == '-')
2265 return nullptr; 2265 return nullptr;
2266 2266
2267 if (m_context.isHTMLDocument()) 2267 if (m_context.isHTMLDocument())
2268 attrName = attrName.lower(); 2268 attrName = attrName.lower();
2269 2269
2270 return cssValuePool().createValue(attrName, CSSPrimitiveValue::UnitType::Att ribute); 2270 RefPtrWillBeRawPtr<CSSFunctionValue> attrValue = CSSFunctionValue::create(CS SValueAttr);
2271 attrValue->append(CSSPrimitiveValue::create(attrName, CSSPrimitiveValue::Uni tType::CustomIdentifier));
2272 return attrValue.release();
2271 } 2273 }
2272 2274
2273 bool CSSPropertyParser::acceptQuirkyColors(CSSPropertyID propertyId) const 2275 bool CSSPropertyParser::acceptQuirkyColors(CSSPropertyID propertyId) const
2274 { 2276 {
2275 if (!inQuirksMode()) 2277 if (!inQuirksMode())
2276 return false; 2278 return false;
2277 switch (propertyId) { 2279 switch (propertyId) {
2278 case CSSPropertyBackgroundColor: 2280 case CSSPropertyBackgroundColor:
2279 case CSSPropertyBorderBottomColor: 2281 case CSSPropertyBorderBottomColor:
2280 case CSSPropertyBorderLeftColor: 2282 case CSSPropertyBorderLeftColor:
(...skipping 5811 matching lines...) Expand 10 before | Expand all | Expand 10 after
8092 } 8094 }
8093 } 8095 }
8094 8096
8095 if (!list->length()) 8097 if (!list->length())
8096 return nullptr; 8098 return nullptr;
8097 8099
8098 return list.release(); 8100 return list.release();
8099 } 8101 }
8100 8102
8101 } // namespace blink 8103 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698