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 29 matching lines...) Expand all Loading... |
40 #include "core/css/CSSFontSelector.h" | 40 #include "core/css/CSSFontSelector.h" |
41 #include "core/css/CSSPrimitiveValue.h" | 41 #include "core/css/CSSPrimitiveValue.h" |
42 #include "core/css/CSSUnicodeRangeValue.h" | 42 #include "core/css/CSSUnicodeRangeValue.h" |
43 #include "core/css/CSSValueList.h" | 43 #include "core/css/CSSValueList.h" |
44 #include "core/css/FontFaceDescriptors.h" | 44 #include "core/css/FontFaceDescriptors.h" |
45 #include "core/css/LocalFontFaceSource.h" | 45 #include "core/css/LocalFontFaceSource.h" |
46 #include "core/css/RemoteFontFaceSource.h" | 46 #include "core/css/RemoteFontFaceSource.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/css/parser/CSSParser.h" | 49 #include "core/css/parser/CSSParser.h" |
| 50 #include "core/dom/DOMArrayBuffer.h" |
| 51 #include "core/dom/DOMArrayBufferView.h" |
50 #include "core/dom/DOMException.h" | 52 #include "core/dom/DOMException.h" |
51 #include "core/dom/Document.h" | 53 #include "core/dom/Document.h" |
52 #include "core/dom/ExceptionCode.h" | 54 #include "core/dom/ExceptionCode.h" |
53 #include "core/dom/StyleEngine.h" | 55 #include "core/dom/StyleEngine.h" |
54 #include "core/frame/LocalFrame.h" | 56 #include "core/frame/LocalFrame.h" |
55 #include "core/frame/Settings.h" | 57 #include "core/frame/Settings.h" |
56 #include "core/frame/UseCounter.h" | 58 #include "core/frame/UseCounter.h" |
57 #include "core/svg/SVGFontFaceElement.h" | 59 #include "core/svg/SVGFontFaceElement.h" |
58 #include "core/svg/SVGFontFaceSource.h" | 60 #include "core/svg/SVGFontFaceSource.h" |
59 #include "core/svg/SVGRemoteFontFaceSource.h" | 61 #include "core/svg/SVGRemoteFontFaceSource.h" |
(...skipping 13 matching lines...) Expand all Loading... |
73 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont
ext, family, descriptors)); | 75 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont
ext, family, descriptors)); |
74 | 76 |
75 RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source
, CSSPropertySrc); | 77 RefPtrWillBeRawPtr<CSSValue> src = parseCSSValue(toDocument(context), source
, CSSPropertySrc); |
76 if (!src || !src->isValueList()) | 78 if (!src || !src->isValueList()) |
77 fontFace->setError(DOMException::create(SyntaxError, "The source provide
d ('" + source + "') could not be parsed as a value list.")); | 79 fontFace->setError(DOMException::create(SyntaxError, "The source provide
d ('" + source + "') could not be parsed as a value list.")); |
78 | 80 |
79 fontFace->initCSSFontFace(toDocument(context), src); | 81 fontFace->initCSSFontFace(toDocument(context), src); |
80 return fontFace.release(); | 82 return fontFace.release(); |
81 } | 83 } |
82 | 84 |
83 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
st AtomicString& family, PassRefPtr<ArrayBuffer> source, const FontFaceDescripto
rs& descriptors) | 85 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
st AtomicString& family, PassRefPtr<DOMArrayBuffer> source, const FontFaceDescri
ptors& descriptors) |
84 { | 86 { |
85 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont
ext, family, descriptors)); | 87 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont
ext, family, descriptors)); |
86 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->data()),
source->byteLength()); | 88 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->data()),
source->byteLength()); |
87 return fontFace.release(); | 89 return fontFace.release(); |
88 } | 90 } |
89 | 91 |
90 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
st AtomicString& family, PassRefPtr<ArrayBufferView> source, const FontFaceDescr
iptors& descriptors) | 92 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(ExecutionContext* context, con
st AtomicString& family, PassRefPtr<DOMArrayBufferView> source, const FontFaceDe
scriptors& descriptors) |
91 { | 93 { |
92 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont
ext, family, descriptors)); | 94 RefPtrWillBeRawPtr<FontFace> fontFace = adoptRefWillBeNoop(new FontFace(cont
ext, family, descriptors)); |
93 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddr
ess()), source->byteLength()); | 95 fontFace->initCSSFontFace(static_cast<const unsigned char*>(source->baseAddr
ess()), source->byteLength()); |
94 return fontFace.release(); | 96 return fontFace.release(); |
95 } | 97 } |
96 | 98 |
97 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const Styl
eRuleFontFace* fontFaceRule) | 99 PassRefPtrWillBeRawPtr<FontFace> FontFace::create(Document* document, const Styl
eRuleFontFace* fontFaceRule) |
98 { | 100 { |
99 const StylePropertySet& properties = fontFaceRule->properties(); | 101 const StylePropertySet& properties = fontFaceRule->properties(); |
100 | 102 |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 { | 594 { |
593 return m_cssFontFace->hadBlankText(); | 595 return m_cssFontFace->hadBlankText(); |
594 } | 596 } |
595 | 597 |
596 bool FontFace::hasPendingActivity() const | 598 bool FontFace::hasPendingActivity() const |
597 { | 599 { |
598 return m_status == Loading && executionContext() && !executionContext()->act
iveDOMObjectsAreStopped(); | 600 return m_status == Loading && executionContext() && !executionContext()->act
iveDOMObjectsAreStopped(); |
599 } | 601 } |
600 | 602 |
601 } // namespace blink | 603 } // namespace blink |
OLD | NEW |