~ubuntu-branches/ubuntu/lucid/webkit/lucid-security

« back to all changes in this revision

Viewing changes to WebCore/css/CSSImportRule.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2010-01-06 21:25:06 UTC
  • mfrom: (1.2.6 upstream) (4.3.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100106212506-gd0czn4zrwf1j19l
* New upstream release
- adds basic Content-Encoding support, thanks to soup
  (Closes: #529271)
- fixes over-advertising content types as supported by
  the media player (Closes: #559420)
* debian/control:
- updated libsoup build requirement (>= 2.28.2)
* debian/libwebkit-1.0-2.symbols:
- updated with new symbols
* debian/copyright:
- updated information since 1.1.17
* Imported patch from https://bugs.webkit.org/show_bug.cgi?id=30623
- I am shipping this patch because I believe it is correct, it is the
  way to go, it fixes a race, and it needs testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "CachedCSSStyleSheet.h"
26
26
#include "DocLoader.h"
27
27
#include "Document.h"
 
28
#include "SecurityOrigin.h"
28
29
#include "Settings.h"
29
30
#include <wtf/StdLibExtras.h>
30
31
 
59
60
        m_styleSheet->setParent(0);
60
61
    m_styleSheet = CSSStyleSheet::create(this, url, charset);
61
62
 
 
63
    bool crossOriginCSS = false;
 
64
    bool validMIMEType = false;
62
65
    CSSStyleSheet* parent = parentStyleSheet();
63
66
    bool strict = !parent || parent->useStrictParsing();
64
 
    String sheetText = sheet->sheetText(strict);
 
67
    bool enforceMIMEType = strict;
 
68
    bool needsSiteSpecificQuirks = parent && parent->doc() && parent->doc()->settings() && parent->doc()->settings()->needsSiteSpecificQuirks();
 
69
 
 
70
#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
 
71
    if (enforceMIMEType && needsSiteSpecificQuirks) {
 
72
        // Covers both http and https, with or without "www."
 
73
        if (url.contains("mcafee.com/japan/", false))
 
74
            enforceMIMEType = false;
 
75
    }
 
76
#endif
 
77
 
 
78
    String sheetText = sheet->sheetText(enforceMIMEType, &validMIMEType);
65
79
    m_styleSheet->parseString(sheetText, strict);
66
80
 
67
 
    if (strict && parent && parent->doc() && parent->doc()->settings() && parent->doc()->settings()->needsSiteSpecificQuirks()) {
 
81
    if (!parent || !parent->doc() || !parent->doc()->securityOrigin()->canRequest(KURL(ParsedURLString, url)))
 
82
        crossOriginCSS = true;
 
83
 
 
84
    if (crossOriginCSS && !validMIMEType && !m_styleSheet->hasSyntacticallyValidCSSHeader())
 
85
        m_styleSheet = CSSStyleSheet::create(this, url, charset);
 
86
 
 
87
    if (strict && needsSiteSpecificQuirks) {
68
88
        // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
69
89
        DEFINE_STATIC_LOCAL(const String, slashKHTMLFixesDotCss, ("/KHTMLFixes.css"));
70
90
        DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, ("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n"));