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

Side by Side Diff: Source/core/css/CSSFontFaceSrcValue.h

Issue 656913006: Remove SVG fonts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update tests for landing Created 6 years, 2 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 18 matching lines...) Expand all
29 #include "core/css/CSSValue.h" 29 #include "core/css/CSSValue.h"
30 #include "core/fetch/ResourcePtr.h" 30 #include "core/fetch/ResourcePtr.h"
31 #include "platform/weborigin/Referrer.h" 31 #include "platform/weborigin/Referrer.h"
32 #include "wtf/PassRefPtr.h" 32 #include "wtf/PassRefPtr.h"
33 #include "wtf/text/WTFString.h" 33 #include "wtf/text/WTFString.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class FontResource; 37 class FontResource;
38 class Document; 38 class Document;
39 class SVGFontFaceElement;
40 39
41 class CSSFontFaceSrcValue : public CSSValue { 40 class CSSFontFaceSrcValue : public CSSValue {
42 public: 41 public:
43 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso urce) 42 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso urce)
44 { 43 {
45 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false)); 44 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false));
46 } 45 }
47 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String& resource) 46 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String& resource)
48 { 47 {
49 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true)); 48 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true));
50 } 49 }
51 50
52 const String& resource() const { return m_resource; } 51 const String& resource() const { return m_resource; }
53 const String& format() const { return m_format; } 52 const String& format() const { return m_format; }
54 bool isLocal() const { return m_isLocal; } 53 bool isLocal() const { return m_isLocal; }
55 54
56 void setFormat(const String& format) { m_format = format; } 55 void setFormat(const String& format) { m_format = format; }
57 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } 56 void setReferrer(const Referrer& referrer) { m_referrer = referrer; }
58 57
59 bool isSupportedFormat() const; 58 bool isSupportedFormat() const;
60 59
61 #if ENABLE(SVG_FONTS)
62 bool isSVGFontFaceSrc() const;
63
64 SVGFontFaceElement* svgFontFaceElement() const { return m_svgFontFaceElement ; }
65 void setSVGFontFaceElement(SVGFontFaceElement* element) { m_svgFontFaceEleme nt = element; }
66 #endif
67
68 String customCSSText() const; 60 String customCSSText() const;
69 61
70 bool hasFailedOrCanceledSubresources() const; 62 bool hasFailedOrCanceledSubresources() const;
71 63
72 FontResource* fetch(Document*); 64 FontResource* fetch(Document*);
73 65
74 bool equals(const CSSFontFaceSrcValue&) const; 66 bool equals(const CSSFontFaceSrcValue&) const;
75 67
76 void traceAfterDispatch(Visitor* visitor) { CSSValue::traceAfterDispatch(vis itor); } 68 void traceAfterDispatch(Visitor* visitor) { CSSValue::traceAfterDispatch(vis itor); }
77 69
78 private: 70 private:
79 CSSFontFaceSrcValue(const String& resource, bool local) 71 CSSFontFaceSrcValue(const String& resource, bool local)
80 : CSSValue(FontFaceSrcClass) 72 : CSSValue(FontFaceSrcClass)
81 , m_resource(resource) 73 , m_resource(resource)
82 , m_isLocal(local) 74 , m_isLocal(local)
83 #if ENABLE(SVG_FONTS)
84 , m_svgFontFaceElement(0)
85 #endif
86 { 75 {
87 } 76 }
88 77
89 void restoreCachedResourceIfNeeded(Document*); 78 void restoreCachedResourceIfNeeded(Document*);
90 bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin* ); 79 bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin* );
91 80
92 String m_resource; 81 String m_resource;
93 String m_format; 82 String m_format;
94 Referrer m_referrer; 83 Referrer m_referrer;
95 bool m_isLocal; 84 bool m_isLocal;
96 85
97 ResourcePtr<FontResource> m_fetched; 86 ResourcePtr<FontResource> m_fetched;
98
99 #if ENABLE(SVG_FONTS)
100 // FIXME: Oilpan: Changing this to a member leaks Document.
101 // Figure out the retaining path. See https://codereview.chromium.org/337703 004
102 SVGFontFaceElement* m_svgFontFaceElement;
103 #endif
104 }; 87 };
105 88
106 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); 89 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue());
107 90
108 } 91 }
109 92
110 #endif 93 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698