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

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

Issue 7033030: Merge 86500 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 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
« no previous file with comments | « LayoutTests/fast/css/invalid-font-family-in-font-face-crash-expected.txt ('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 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 6318 matching lines...) Expand 10 before | Expand all | Expand 10 after
6329 6329
6330 CSSRule* CSSParser::createFontFaceRule() 6330 CSSRule* CSSParser::createFontFaceRule()
6331 { 6331 {
6332 m_allowImportRules = m_allowNamespaceDeclarations = false; 6332 m_allowImportRules = m_allowNamespaceDeclarations = false;
6333 for (unsigned i = 0; i < m_numParsedProperties; ++i) { 6333 for (unsigned i = 0; i < m_numParsedProperties; ++i) {
6334 CSSProperty* property = m_parsedProperties[i]; 6334 CSSProperty* property = m_parsedProperties[i];
6335 int id = property->id(); 6335 int id = property->id();
6336 if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isPrimitiveValue()) { 6336 if ((id == CSSPropertyFontWeight || id == CSSPropertyFontStyle || id == CSSPropertyFontVariant) && property->value()->isPrimitiveValue()) {
6337 RefPtr<CSSValue> value = property->m_value.release(); 6337 RefPtr<CSSValue> value = property->m_value.release();
6338 property->m_value = CSSValueList::createCommaSeparated(); 6338 property->m_value = CSSValueList::createCommaSeparated();
6339 static_cast<CSSValueList*>(property->m_value.get())->append(value.re lease()); 6339 static_cast<CSSValueList*>(property->value())->append(value.release( ));
6340 } else if (id == CSSPropertyFontFamily && static_cast<CSSValueList*>(pro perty->m_value.get())->length() != 1) { 6340 } else if (id == CSSPropertyFontFamily && (!property->value()->isValueLi st() || static_cast<CSSValueList*>(property->value())->length() != 1)) {
6341 // Unlike font-family property, font-family descriptor in @font-face rule can take only one family name. 6341 // Unlike font-family property, font-family descriptor in @font-face rule
6342 // has to be a value list with exactly one family name. It cannot ha ve a
6343 // have 'initial' value and cannot 'inherit' from parent.
6342 // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc 6344 // See http://dev.w3.org/csswg/css3-fonts/#font-family-desc
6343 clearProperties(); 6345 clearProperties();
6344 return 0; 6346 return 0;
6345 } 6347 }
6346 } 6348 }
6347 RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet); 6349 RefPtr<CSSFontFaceRule> rule = CSSFontFaceRule::create(m_styleSheet);
6348 rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsed Properties, m_numParsedProperties)); 6350 rule->setDeclaration(CSSMutableStyleDeclaration::create(rule.get(), m_parsed Properties, m_numParsedProperties));
6349 clearProperties(); 6351 clearProperties();
6350 CSSFontFaceRule* result = rule.get(); 6352 CSSFontFaceRule* result = rule.get();
6351 m_parsedStyleObjects.append(rule.release()); 6353 m_parsedStyleObjects.append(rule.release());
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
6799 // The macro is used in the tokenizer grammar with lines containing 6801 // The macro is used in the tokenizer grammar with lines containing
6800 // BEGIN(mediaqueries) and BEGIN(initial). yy_start acts as index to 6802 // BEGIN(mediaqueries) and BEGIN(initial). yy_start acts as index to
6801 // tokenizer transition table, and 'mediaqueries' and 'initial' are 6803 // tokenizer transition table, and 'mediaqueries' and 'initial' are
6802 // offset multipliers that specify which transitions are active 6804 // offset multipliers that specify which transitions are active
6803 // in the tokenizer during in each condition (tokenizer state). 6805 // in the tokenizer during in each condition (tokenizer state).
6804 #define BEGIN yy_start = 1 + 2 * 6806 #define BEGIN yy_start = 1 + 2 *
6805 6807
6806 #include "tokenizer.cpp" 6808 #include "tokenizer.cpp"
6807 6809
6808 } 6810 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/invalid-font-family-in-font-face-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698