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");
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 5
0
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("*/*");
}
Ejemplo n.º 6
0
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);
}
Ejemplo n.º 7
0
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");
}
Ejemplo n.º 8
0
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;
}
Ejemplo n.º 9
0
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();
}
Ejemplo n.º 10
0
void ImageResource::setCustomAcceptHeader()
{
    DEFINE_STATIC_LOCAL(const AtomicString, acceptWebP, ("image/webp,*/*;q=0.8", AtomicString::ConstructFromLiteral));
    setAccept(acceptWebP);
}
Ejemplo n.º 11
0
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");
}