CachedXSLStyleSheet::CachedXSLStyleSheet(const ResourceRequest& resourceRequest, SessionID sessionID) : CachedResource(resourceRequest, XSLStyleSheet, sessionID) , m_decoder(TextResourceDecoder::create("text/xsl")) { // It's XML we want. // FIXME: This should accept more general xml formats */*+xml, image/svg+xml for example. setAccept("text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml"); }
CachedCSSStyleSheet::CachedCSSStyleSheet(const ResourceRequest& resourceRequest, const String& charset) : CachedResource(resourceRequest, CSSStyleSheet) , m_decoder(TextResourceDecoder::create("text/css", charset)) { // Prefer text/css but accept any type (dell.com serves a stylesheet // as text/html; see <http://bugs.webkit.org/show_bug.cgi?id=11451>). setAccept("text/css,*/*;q=0.1"); }
CachedScript::CachedScript(const ResourceRequest& resourceRequest, const String& charset) : CachedResource(resourceRequest, Script) , m_decoder(TextResourceDecoder::create("application/javascript", charset)) { // It's javascript we want. // But some websites think their scripts are <some wrong mimetype here> // and refuse to serve them if we only accept application/x-javascript. setAccept("*/*"); }
XSLStyleSheetResource::XSLStyleSheetResource(const ResourceRequest& resourceRequest, const String& charset) : StyleSheetResource(resourceRequest, XSLStyleSheet, "text/xsl", charset) { ASSERT(RuntimeEnabledFeatures::xsltEnabled()); DEFINE_STATIC_LOCAL(const AtomicString, acceptXSLT, ("text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml", AtomicString::ConstructFromLiteral)); // It's XML we want. // FIXME: This should accept more general xml formats */*+xml, image/svg+xml for example. setAccept(acceptXSLT); }
CachedScript::CachedScript(const String& url, const String& charset) : CachedResource(url, Script) , m_decoder(TextResourceDecoder::create("application/javascript", charset)) , m_decodedDataDeletionTimer(this, &CachedScript::decodedDataDeletionTimerFired) { // It's javascript we want. // But some websites think their scripts are <some wrong mimetype here> // and refuse to serve them if we only accept application/x-javascript. setAccept("*/*"); }
ScriptResource::ScriptResource(const ResourceRequest& resourceRequest, const String& charset) : TextResource(resourceRequest, Script, "application/javascript", charset), m_integrityChecked(false) { DEFINE_STATIC_LOCAL(const AtomicString, acceptScript, ("*/*", AtomicString::ConstructFromLiteral)); // It's javascript we want. // But some websites think their scripts are <some wrong mimetype here> // and refuse to serve them if we only accept application/x-javascript. setAccept(acceptScript); }
CachedXBLDocument::CachedXBLDocument(DocLoader* dl, const String &url) : CachedResource(url, XBL), m_document(0) { // It's XML we want. setAccept("text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml"); // Load the file Cache::loader()->load(dl, this, false); m_loading = true; m_decoder = new TextResourceDecoder("application/xml"); }
CachedXSLStyleSheet::CachedXSLStyleSheet(DocLoader* dl, const String &url, CachePolicy cachePolicy) : CachedResource(url, XSLStyleSheet, cachePolicy) { // It's XML we want. // FIXME: This should accept more general xml formats */*+xml, image/svg+xml for example. setAccept("text/xml, application/xml, application/xhtml+xml, text/xsl, application/rss+xml, application/atom+xml"); // load the file cache()->loader()->load(dl, this, false); m_loading = true; m_decoder = new Decoder; }
CachedScript::CachedScript(DocLoader* dl, const String& url, const String& charset) : CachedResource(url, Script) , m_encoding(charset) { // It's javascript we want. // But some websites think their scripts are <some wrong mimetype here> // and refuse to serve them if we only accept application/x-javascript. setAccept("*/*"); // load the file cache()->loader()->load(dl, this, false); m_loading = true; if (!m_encoding.isValid()) m_encoding = Latin1Encoding(); }
void ImageResource::setCustomAcceptHeader() { DEFINE_STATIC_LOCAL(const AtomicString, acceptWebP, ("image/webp,*/*;q=0.8", AtomicString::ConstructFromLiteral)); setAccept(acceptWebP); }
JsonRestListModel::JsonRestListModel(QObject *parent) : BaseRestListModel(parent) { setAccept("application/json"); }
CachedSVGDocument::CachedSVGDocument(const ResourceRequest& request) : CachedResource(request, SVGDocumentResource) , m_decoder(TextResourceDecoder::create("application/xml")) { setAccept("image/svg+xml"); }