[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

mitz at apple.com mitz at apple.com
Thu Oct 29 20:35:04 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 9545758d02711b9bcc772e0d71b11dc67724e54f
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 28 16:34:53 2009 +0000

    Extend the MediaWiki/KHTMLFixes.css workaround to cover older MediaWiki versions
    https://bugs.webkit.org/show_bug.cgi?id=29792
    
    Reviewed by Darin Adler.
    
    * html/HTMLLinkElement.cpp:
    (WebCore::HTMLLinkElement::setCSSStyleSheet): If site specific hacks are
    enabled, check if the linked style sheet is one of two versions of the
    MediaWiki KHTMLFixes.css. If so, remove the offending rule.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3b07327..567e400 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-09-28  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Extend the MediaWiki/KHTMLFixes.css workaround to cover older MediaWiki versions
+        https://bugs.webkit.org/show_bug.cgi?id=29792
+
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::setCSSStyleSheet): If site specific hacks are
+        enabled, check if the linked style sheet is one of two versions of the
+        MediaWiki KHTMLFixes.css. If so, remove the offending rule.
+
 2009-09-28  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index 8705521..0971ef5 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -252,7 +252,23 @@ void HTMLLinkElement::setCSSStyleSheet(const String& url, const String& charset,
     if (enforceMIMEType && document()->page() && !document()->page()->settings()->enforceCSSMIMETypeInStrictMode())
         enforceMIMEType = false;
 
-    m_sheet->parseString(sheet->sheetText(enforceMIMEType), strictParsing);
+    String sheetText = sheet->sheetText(enforceMIMEType);
+    m_sheet->parseString(sheetText, strictParsing);
+
+    if (strictParsing && document()->settings() && document()->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"));
+        // There are two variants of KHTMLFixes.css. One is equal to mediaWikiKHTMLFixesStyleSheet,
+        // while the other lacks the second trailing newline.
+        if (url.endsWith(slashKHTMLFixesDotCss) && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
+                && sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.length() - 1) {
+            ASSERT(m_sheet->length() == 1);
+            ExceptionCode ec;
+            m_sheet->deleteRule(0, ec);
+        }
+    }
+
     m_sheet->setTitle(title());
 
     RefPtr<MediaList> media = MediaList::createAllowingDescriptionSyntax(m_media);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list