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

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

Issue 1020023002: Treat standalone default/initial/inherit in font-family as invalid (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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 | « LayoutTests/fast/css/font-family-parse-keyword-expected.html ('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 4618 matching lines...) Expand 10 before | Expand all | Expand 10 after
4629 4629
4630 while (value) { 4630 while (value) {
4631 CSSParserValue* nextValue = m_valueList->next(); 4631 CSSParserValue* nextValue = m_valueList->next();
4632 bool nextValBreaksFont = !nextValue || isComma(nextValue); 4632 bool nextValBreaksFont = !nextValue || isComma(nextValue);
4633 bool nextValIsFontName = nextValue && 4633 bool nextValIsFontName = nextValue &&
4634 ((nextValue->id >= CSSValueSerif && nextValue->id <= CSSValueWebkitB ody) || 4634 ((nextValue->id >= CSSValueSerif && nextValue->id <= CSSValueWebkitB ody) ||
4635 (nextValue->unit == CSSPrimitiveValue::CSS_STRING || nextValue->unit == CSSPrimitiveValue::CSS_IDENT)); 4635 (nextValue->unit == CSSPrimitiveValue::CSS_STRING || nextValue->unit == CSSPrimitiveValue::CSS_IDENT));
4636 4636
4637 if (isCSSWideKeyword(*value) && !inFamily) { 4637 if (isCSSWideKeyword(*value) && !inFamily) {
4638 if (nextValBreaksFont) 4638 if (nextValBreaksFont)
4639 value = m_valueList->next(); 4639 return nullptr;
4640 else if (nextValIsFontName) 4640 else if (nextValIsFontName)
4641 value = nextValue; 4641 value = nextValue;
4642 continue; 4642 continue;
4643 } 4643 }
4644 4644
4645 if (value->id >= CSSValueSerif && value->id <= CSSValueWebkitBody) { 4645 if (value->id >= CSSValueSerif && value->id <= CSSValueWebkitBody) {
4646 if (inFamily) 4646 if (inFamily)
4647 familyBuilder.add(value->string); 4647 familyBuilder.add(value->string);
4648 else if (nextValBreaksFont || !nextValIsFontName) 4648 else if (nextValBreaksFont || !nextValIsFontName)
4649 list->append(cssValuePool().createIdentifierValue(value->id)); 4649 list->append(cssValuePool().createIdentifierValue(value->id));
(...skipping 3840 matching lines...) Expand 10 before | Expand all | Expand 10 after
8490 } 8490 }
8491 } 8491 }
8492 8492
8493 if (!list->length()) 8493 if (!list->length())
8494 return nullptr; 8494 return nullptr;
8495 8495
8496 return list.release(); 8496 return list.release();
8497 } 8497 }
8498 8498
8499 } // namespace blink 8499 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/font-family-parse-keyword-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698