Title: [242780] trunk/Source/WebCore
Revision
242780
Author
[email protected]
Date
2019-03-11 23:09:58 -0700 (Mon, 11 Mar 2019)

Log Message

Remove MediaWiki site specific quirks
https://bugs.webkit.org/show_bug.cgi?id=195597

Reviewed by Simon Fraser.

r47383 added a site specific quirk for the KHTML workaround in MediaWiki.

Blink since removed this workaround:
https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0

Given Chrome has been shipping without this quirk for six years, it's safe to assume
this site specific quirk is no longer neeed for Web compatibility.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (242779 => 242780)


--- trunk/Source/WebCore/ChangeLog	2019-03-12 06:07:14 UTC (rev 242779)
+++ trunk/Source/WebCore/ChangeLog	2019-03-12 06:09:58 UTC (rev 242780)
@@ -1,3 +1,26 @@
+2019-03-12  Ryosuke Niwa  <[email protected]>
+
+        Remove MediaWiki site specific quirks
+        https://bugs.webkit.org/show_bug.cgi?id=195597
+
+        Reviewed by Simon Fraser.
+
+        r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
+
+        Blink since removed this workaround:
+        https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
+
+        Given Chrome has been shipping without this quirk for six years, it's safe to assume
+        this site specific quirk is no longer neeed for Web compatibility.
+
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+        * css/parser/CSSParserContext.cpp:
+        (WebCore::CSSParserContext::CSSParserContext):
+        (WebCore::operator==):
+        * css/parser/CSSParserContext.h:
+        (WebCore::CSSParserContextHash::hash):
+
 2019-03-11  Ryosuke Niwa  <[email protected]>
 
         Remove OpenCube QuickMenu quirks from navigator.appVersion

Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (242779 => 242780)


--- trunk/Source/WebCore/css/StyleSheetContents.cpp	2019-03-12 06:07:14 UTC (rev 242779)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp	2019-03-12 06:09:58 UTC (rev 242780)
@@ -337,18 +337,7 @@
         return;
     }
 
-    CSSParser p(parserContext());
-    p.parseSheet(this, sheetText, CSSParser::RuleParsing::Deferred);
-
-    if (m_parserContext.needsSiteSpecificQuirks && isStrictParserMode(m_parserContext.mode)) {
-        // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
-        static NeverDestroyed<const String> mediaWikiKHTMLFixesStyleSheet(MAKE_STATIC_STRING_IMPL("/* 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 (baseURL().string().endsWith("/KHTMLFixes.css") && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.get().startsWith(sheetText)
-            && sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.get().length() - 1)
-            clearRules();
-    }
+    CSSParser(parserContext()).parseSheet(this, sheetText, CSSParser::RuleParsing::Deferred);
 }
 
 bool StyleSheetContents::parseString(const String& sheetText)

Modified: trunk/Source/WebCore/css/parser/CSSParserContext.cpp (242779 => 242780)


--- trunk/Source/WebCore/css/parser/CSSParserContext.cpp	2019-03-12 06:07:14 UTC (rev 242779)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.cpp	2019-03-12 06:09:58 UTC (rev 242780)
@@ -44,12 +44,6 @@
     : baseURL(baseURL)
     , mode(mode)
 {
-#if PLATFORM(IOS_FAMILY)
-    // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
-    // to see if we can enable the preference all together is to be handled by:
-    // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
-    needsSiteSpecificQuirks = true;
-#endif
 }
 
 CSSParserContext::CSSParserContext(const Document& document, const URL& sheetBaseURL, const String& charset)
@@ -59,8 +53,6 @@
     , isHTMLDocument(document.isHTMLDocument())
     , hasDocumentSecurityOrigin(sheetBaseURL.isNull() || document.securityOrigin().canRequest(baseURL))
 {
-
-    needsSiteSpecificQuirks = document.settings().needsSiteSpecificQuirks();
     enforcesCSSMIMETypeInNoQuirksMode = document.settings().enforceCSSMIMETypeInNoQuirksMode();
     useLegacyBackgroundSizeShorthandBehavior = document.settings().useLegacyBackgroundSizeShorthandBehavior();
 #if ENABLE(TEXT_AUTOSIZING)
@@ -74,13 +66,6 @@
 #endif
     deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
     useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
-
-#if PLATFORM(IOS_FAMILY)
-    // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
-    // to see if we can enable the preference all together is to be handled by:
-    // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
-    needsSiteSpecificQuirks = true;
-#endif
 }
 
 bool operator==(const CSSParserContext& a, const CSSParserContext& b)
@@ -92,7 +77,6 @@
 #if ENABLE(TEXT_AUTOSIZING)
         && a.textAutosizingEnabled == b.textAutosizingEnabled
 #endif
-        && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks
         && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
         && a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
         && a.springTimingFunctionEnabled == b.springTimingFunctionEnabled

Modified: trunk/Source/WebCore/css/parser/CSSParserContext.h (242779 => 242780)


--- trunk/Source/WebCore/css/parser/CSSParserContext.h	2019-03-12 06:07:14 UTC (rev 242779)
+++ trunk/Source/WebCore/css/parser/CSSParserContext.h	2019-03-12 06:09:58 UTC (rev 242780)
@@ -49,7 +49,6 @@
 #if ENABLE(TEXT_AUTOSIZING)
     bool textAutosizingEnabled { false };
 #endif
-    bool needsSiteSpecificQuirks { false };
     bool enforcesCSSMIMETypeInNoQuirksMode { true };
     bool useLegacyBackgroundSizeShorthandBehavior { false };
     bool springTimingFunctionEnabled { false };
@@ -94,19 +93,18 @@
 #if ENABLE(TEXT_AUTOSIZING)
             & key.textAutosizingEnabled                     << 1
 #endif
-            & key.needsSiteSpecificQuirks                   << 2
-            & key.enforcesCSSMIMETypeInNoQuirksMode         << 3
-            & key.useLegacyBackgroundSizeShorthandBehavior  << 4
-            & key.springTimingFunctionEnabled               << 5
-            & key.constantPropertiesEnabled                 << 6
-            & key.colorFilterEnabled                        << 7
-            & key.deferredCSSParserEnabled                  << 8
-            & key.hasDocumentSecurityOrigin                 << 9
-            & key.useSystemAppearance                       << 10
+            & key.enforcesCSSMIMETypeInNoQuirksMode         << 2
+            & key.useLegacyBackgroundSizeShorthandBehavior  << 3
+            & key.springTimingFunctionEnabled               << 4
+            & key.constantPropertiesEnabled                 << 5
+            & key.colorFilterEnabled                        << 6
+            & key.deferredCSSParserEnabled                  << 7
+            & key.hasDocumentSecurityOrigin                 << 8
+            & key.useSystemAppearance                       << 9
 #if ENABLE(ATTACHMENT_ELEMENT)
-            & key.attachmentEnabled                         << 11
+            & key.attachmentEnabled                         << 10
 #endif
-            & key.mode                                      << 12; // Keep this last.
+            & key.mode                                      << 11; // Keep this last.
         hash ^= WTF::intHash(bits);
         return hash;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to