summaryrefslogtreecommitdiffstats
path: root/WebCore/css/CSSImportRule.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-10-08 17:19:54 +0100
committerSteve Block <steveblock@google.com>2009-10-20 00:41:58 +0100
commit231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch)
treea6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/css/CSSImportRule.cpp
parente196732677050bd463301566a68a643b6d14b907 (diff)
downloadexternal_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/css/CSSImportRule.cpp')
-rw-r--r--WebCore/css/CSSImportRule.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/WebCore/css/CSSImportRule.cpp b/WebCore/css/CSSImportRule.cpp
index 50e60f4..6e62f6d 100644
--- a/WebCore/css/CSSImportRule.cpp
+++ b/WebCore/css/CSSImportRule.cpp
@@ -1,7 +1,7 @@
/*
* (C) 1999-2003 Lars Knoll (knoll@kde.org)
* (C) 2002-2003 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2002, 2005, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2002, 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -26,6 +26,8 @@
#include "DocLoader.h"
#include "Document.h"
#include "MediaList.h"
+#include "Settings.h"
+#include <wtf/StdLibExtras.h>
namespace WebCore {
@@ -60,7 +62,20 @@ void CSSImportRule::setCSSStyleSheet(const String& url, const String& charset, c
CSSStyleSheet* parent = parentStyleSheet();
bool strict = !parent || parent->useStrictParsing();
- m_styleSheet->parseString(sheet->sheetText(strict), strict);
+ String sheetText = sheet->sheetText(strict);
+ m_styleSheet->parseString(sheetText, strict);
+
+ if (strict && parent && parent->doc() && parent->doc()->settings() && parent->doc()->settings()->needsSiteSpecificQuirks()) {
+ // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
+ DEFINE_STATIC_LOCAL(const String, slashKHTMLFixesDotCss, ("/KHTMLFixes.css"));
+ DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, ("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n"));
+ if (url.endsWith(slashKHTMLFixesDotCss) && sheetText == mediaWikiKHTMLFixesStyleSheet) {
+ ASSERT(m_styleSheet->length() == 1);
+ ExceptionCode ec;
+ m_styleSheet->deleteRule(0, ec);
+ }
+ }
+
m_loading = false;
if (parent)
@@ -85,7 +100,7 @@ void CSSImportRule::insertedIntoParent()
String absHref = m_strHref;
if (!parentSheet->href().isNull())
// use parent styleheet's URL as the base URL
- absHref = KURL(KURL(parentSheet->href()), m_strHref).string();
+ absHref = KURL(KURL(ParsedURLString, parentSheet->href()), m_strHref).string();
// Check for a cycle in our import chain. If we encounter a stylesheet
// in our parent chain with the same URL, then just bail.
@@ -96,7 +111,10 @@ void CSSImportRule::insertedIntoParent()
root = curr;
}
- m_cachedSheet = docLoader->requestCSSStyleSheet(absHref, parentSheet->charset());
+ if (parentSheet->isUserStyleSheet())
+ m_cachedSheet = docLoader->requestUserCSSStyleSheet(absHref, parentSheet->charset());
+ else
+ m_cachedSheet = docLoader->requestCSSStyleSheet(absHref, parentSheet->charset());
if (m_cachedSheet) {
// if the import rule is issued dynamically, the sheet may be
// removed from the pending sheet count, so let the doc know