| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "CSSValueKeywords.h" | 34 #include "CSSValueKeywords.h" |
| 35 #include "FontFamilyNames.h" | 35 #include "FontFamilyNames.h" |
| 36 #include "bindings/v8/Dictionary.h" | 36 #include "bindings/v8/Dictionary.h" |
| 37 #include "bindings/v8/ExceptionState.h" | 37 #include "bindings/v8/ExceptionState.h" |
| 38 #include "bindings/v8/ScriptPromiseResolver.h" | 38 #include "bindings/v8/ScriptPromiseResolver.h" |
| 39 #include "bindings/v8/ScriptScope.h" | 39 #include "bindings/v8/ScriptScope.h" |
| 40 #include "bindings/v8/ScriptState.h" | 40 #include "bindings/v8/ScriptState.h" |
| 41 #include "core/css/CSSFontFace.h" | 41 #include "core/css/CSSFontFace.h" |
| 42 #include "core/css/CSSFontFaceSrcValue.h" | 42 #include "core/css/CSSFontFaceSrcValue.h" |
| 43 #include "core/css/parser/BisonCSSParser.h" | 43 #include "core/css/parser/CSSParser.h" |
| 44 #include "core/css/CSSPrimitiveValue.h" | 44 #include "core/css/CSSPrimitiveValue.h" |
| 45 #include "core/css/CSSUnicodeRangeValue.h" | 45 #include "core/css/CSSUnicodeRangeValue.h" |
| 46 #include "core/css/CSSValueList.h" | 46 #include "core/css/CSSValueList.h" |
| 47 #include "core/css/StylePropertySet.h" | 47 #include "core/css/StylePropertySet.h" |
| 48 #include "core/css/StyleRule.h" | 48 #include "core/css/StyleRule.h" |
| 49 #include "core/dom/DOMError.h" | 49 #include "core/dom/DOMError.h" |
| 50 #include "core/dom/Document.h" | 50 #include "core/dom/Document.h" |
| 51 #include "core/dom/ExceptionCode.h" | 51 #include "core/dom/ExceptionCode.h" |
| 52 #include "core/frame/Frame.h" | 52 #include "core/frame/Frame.h" |
| 53 #include "core/frame/Settings.h" | 53 #include "core/frame/Settings.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 { } | 87 { } |
| 88 ScriptState* m_scriptState; | 88 ScriptState* m_scriptState; |
| 89 RefPtr<ScriptPromiseResolver> m_resolver; | 89 RefPtr<ScriptPromiseResolver> m_resolver; |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 static PassRefPtr<CSSValue> parseCSSValue(const String& s, CSSPropertyID propert
yID) | 92 static PassRefPtr<CSSValue> parseCSSValue(const String& s, CSSPropertyID propert
yID) |
| 93 { | 93 { |
| 94 if (s.isEmpty()) | 94 if (s.isEmpty()) |
| 95 return 0; | 95 return 0; |
| 96 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); | 96 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); |
| 97 BisonCSSParser::parseValue(parsedStyle.get(), propertyID, s, true, HTMLStand
ardMode, 0); | 97 CSSParser::parseValue(parsedStyle.get(), propertyID, s, true, HTMLStandardMo
de, 0); |
| 98 return parsedStyle->getPropertyCSSValue(propertyID); | 98 return parsedStyle->getPropertyCSSValue(propertyID); |
| 99 } | 99 } |
| 100 | 100 |
| 101 PassRefPtr<FontFace> FontFace::create(const AtomicString& family, const String&
source, const Dictionary& descriptors, ExceptionState& exceptionState) | 101 PassRefPtr<FontFace> FontFace::create(const AtomicString& family, const String&
source, const Dictionary& descriptors, ExceptionState& exceptionState) |
| 102 { | 102 { |
| 103 RefPtr<CSSValue> src = parseCSSValue(source, CSSPropertySrc); | 103 RefPtr<CSSValue> src = parseCSSValue(source, CSSPropertySrc); |
| 104 if (!src || !src->isValueList()) { | 104 if (!src || !src->isValueList()) { |
| 105 exceptionState.throwUninformativeAndGenericDOMException(SyntaxError); | 105 exceptionState.throwUninformativeAndGenericDOMException(SyntaxError); |
| 106 return 0; | 106 return 0; |
| 107 } | 107 } |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 unsigned numRanges = rangeList->length(); | 531 unsigned numRanges = rangeList->length(); |
| 532 for (unsigned i = 0; i < numRanges; i++) { | 532 for (unsigned i = 0; i < numRanges; i++) { |
| 533 CSSUnicodeRangeValue* range = toCSSUnicodeRangeValue(rangeList->item
WithoutBoundsCheck(i)); | 533 CSSUnicodeRangeValue* range = toCSSUnicodeRangeValue(rangeList->item
WithoutBoundsCheck(i)); |
| 534 cssFontFace->ranges().add(range->from(), range->to()); | 534 cssFontFace->ranges().add(range->from(), range->to()); |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 return cssFontFace; | 537 return cssFontFace; |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace WebCore | 540 } // namespace WebCore |
| OLD | NEW |