59
60
m_styleSheet->setParent(0);
60
61
m_styleSheet = CSSStyleSheet::create(this, url, charset);
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();
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;
78
String sheetText = sheet->sheetText(enforceMIMEType, &validMIMEType);
65
79
m_styleSheet->parseString(sheetText, strict);
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;
84
if (crossOriginCSS && !validMIMEType && !m_styleSheet->hasSyntacticallyValidCSSHeader())
85
m_styleSheet = CSSStyleSheet::create(this, url, charset);
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"));