OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/css/parser/CSSParserImpl.h" | 6 #include "core/css/parser/CSSParserImpl.h" |
7 | 7 |
8 #include "core/css/CSSKeyframesRule.h" | 8 #include "core/css/CSSKeyframesRule.h" |
9 #include "core/css/CSSStyleSheet.h" | 9 #include "core/css/CSSStyleSheet.h" |
10 #include "core/css/StylePropertySet.h" | 10 #include "core/css/StylePropertySet.h" |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 m_observerWrapper->observer().startRuleBody(endOffset); | 464 m_observerWrapper->observer().startRuleBody(endOffset); |
465 m_observerWrapper->observer().endRuleBody(endOffset, false); | 465 m_observerWrapper->observer().endRuleBody(endOffset, false); |
466 } | 466 } |
467 | 467 |
468 consumeDeclarationList(block, StyleRule::FontFace); | 468 consumeDeclarationList(block, StyleRule::FontFace); |
469 | 469 |
470 // FIXME: This logic should be in CSSPropertyParser | 470 // FIXME: This logic should be in CSSPropertyParser |
471 // FIXME: Shouldn't we fail if font-family or src aren't specified? | 471 // FIXME: Shouldn't we fail if font-family or src aren't specified? |
472 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { | 472 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { |
473 CSSProperty& property = m_parsedProperties[i]; | 473 CSSProperty& property = m_parsedProperties[i]; |
474 if (property.id() == CSSPropertyFontVariant && property.value()->isPrimi
tiveValue()) { | 474 if (property.id() == CSSPropertyFontFamily && (!property.value()->isValu
eList() || toCSSValueList(property.value())->length() != 1)) { |
475 property.wrapValueInCommaSeparatedList(); | |
476 } else if (property.id() == CSSPropertyFontFamily && (!property.value()-
>isValueList() || toCSSValueList(property.value())->length() != 1)) { | |
477 m_parsedProperties.clear(); | 475 m_parsedProperties.clear(); |
478 return nullptr; | 476 return nullptr; |
479 } | 477 } |
480 } | 478 } |
481 | 479 |
482 RefPtrWillBeRawPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(); | 480 RefPtrWillBeRawPtr<StyleRuleFontFace> rule = StyleRuleFontFace::create(); |
483 rule->setProperties(createStylePropertySet(m_parsedProperties, m_context.mod
e())); | 481 rule->setProperties(createStylePropertySet(m_parsedProperties, m_context.mod
e())); |
484 m_parsedProperties.clear(); | 482 m_parsedProperties.clear(); |
485 if (m_styleSheet) | 483 if (m_styleSheet) |
486 m_styleSheet->setHasFontFaceRule(true); | 484 m_styleSheet->setHasFontFaceRule(true); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 else | 748 else |
751 return nullptr; // Parser error, invalid value in keyframe selector | 749 return nullptr; // Parser error, invalid value in keyframe selector |
752 if (range.atEnd()) | 750 if (range.atEnd()) |
753 return result.release(); | 751 return result.release(); |
754 if (range.consume().type() != CommaToken) | 752 if (range.consume().type() != CommaToken) |
755 return nullptr; // Parser error | 753 return nullptr; // Parser error |
756 } | 754 } |
757 } | 755 } |
758 | 756 |
759 } // namespace blink | 757 } // namespace blink |
OLD | NEW |