Changeset 242780 in webkit


Ignore:
Timestamp:
Mar 11, 2019 11:09:58 PM (5 years ago)
Author:
rniwa@webkit.org
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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r242779 r242780  
     12019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Remove MediaWiki site specific quirks
     4        https://bugs.webkit.org/show_bug.cgi?id=195597
     5
     6        Reviewed by Simon Fraser.
     7
     8        r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
     9
     10        Blink since removed this workaround:
     11        https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
     12
     13        Given Chrome has been shipping without this quirk for six years, it's safe to assume
     14        this site specific quirk is no longer neeed for Web compatibility.
     15
     16        * css/StyleSheetContents.cpp:
     17        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
     18        * css/parser/CSSParserContext.cpp:
     19        (WebCore::CSSParserContext::CSSParserContext):
     20        (WebCore::operator==):
     21        * css/parser/CSSParserContext.h:
     22        (WebCore::CSSParserContextHash::hash):
     23
    1242019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
    225
  • trunk/Source/WebCore/css/StyleSheetContents.cpp

    r228453 r242780  
    338338    }
    339339
    340     CSSParser p(parserContext());
    341     p.parseSheet(this, sheetText, CSSParser::RuleParsing::Deferred);
    342 
    343     if (m_parserContext.needsSiteSpecificQuirks && isStrictParserMode(m_parserContext.mode)) {
    344         // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
    345         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"));
    346         // There are two variants of KHTMLFixes.css. One is equal to mediaWikiKHTMLFixesStyleSheet,
    347         // while the other lacks the second trailing newline.
    348         if (baseURL().string().endsWith("/KHTMLFixes.css") && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.get().startsWith(sheetText)
    349             && sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.get().length() - 1)
    350             clearRules();
    351     }
     340    CSSParser(parserContext()).parseSheet(this, sheetText, CSSParser::RuleParsing::Deferred);
    352341}
    353342
  • trunk/Source/WebCore/css/parser/CSSParserContext.cpp

    r237932 r242780  
    4545    , mode(mode)
    4646{
    47 #if PLATFORM(IOS_FAMILY)
    48     // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
    49     // to see if we can enable the preference all together is to be handled by:
    50     // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
    51     needsSiteSpecificQuirks = true;
    52 #endif
    5347}
    5448
     
    6054    , hasDocumentSecurityOrigin(sheetBaseURL.isNull() || document.securityOrigin().canRequest(baseURL))
    6155{
    62 
    63     needsSiteSpecificQuirks = document.settings().needsSiteSpecificQuirks();
    6456    enforcesCSSMIMETypeInNoQuirksMode = document.settings().enforceCSSMIMETypeInNoQuirksMode();
    6557    useLegacyBackgroundSizeShorthandBehavior = document.settings().useLegacyBackgroundSizeShorthandBehavior();
     
    7567    deferredCSSParserEnabled = document.settings().deferredCSSParserEnabled();
    7668    useSystemAppearance = document.page() ? document.page()->useSystemAppearance() : false;
    77 
    78 #if PLATFORM(IOS_FAMILY)
    79     // FIXME: Force the site specific quirk below to work on iOS. Investigating other site specific quirks
    80     // to see if we can enable the preference all together is to be handled by:
    81     // <rdar://problem/8493309> Investigate Enabling Site Specific Quirks in MobileSafari and UIWebView
    82     needsSiteSpecificQuirks = true;
    83 #endif
    8469}
    8570
     
    9378        && a.textAutosizingEnabled == b.textAutosizingEnabled
    9479#endif
    95         && a.needsSiteSpecificQuirks == b.needsSiteSpecificQuirks
    9680        && a.enforcesCSSMIMETypeInNoQuirksMode == b.enforcesCSSMIMETypeInNoQuirksMode
    9781        && a.useLegacyBackgroundSizeShorthandBehavior == b.useLegacyBackgroundSizeShorthandBehavior
  • trunk/Source/WebCore/css/parser/CSSParserContext.h

    r238771 r242780  
    5050    bool textAutosizingEnabled { false };
    5151#endif
    52     bool needsSiteSpecificQuirks { false };
    5352    bool enforcesCSSMIMETypeInNoQuirksMode { true };
    5453    bool useLegacyBackgroundSizeShorthandBehavior { false };
     
    9594            & key.textAutosizingEnabled                     << 1
    9695#endif
    97             & key.needsSiteSpecificQuirks                   << 2
    98             & key.enforcesCSSMIMETypeInNoQuirksMode         << 3
    99             & key.useLegacyBackgroundSizeShorthandBehavior  << 4
    100             & key.springTimingFunctionEnabled               << 5
    101             & key.constantPropertiesEnabled                 << 6
    102             & key.colorFilterEnabled                        << 7
    103             & key.deferredCSSParserEnabled                  << 8
    104             & key.hasDocumentSecurityOrigin                 << 9
    105             & key.useSystemAppearance                       << 10
     96            & key.enforcesCSSMIMETypeInNoQuirksMode         << 2
     97            & key.useLegacyBackgroundSizeShorthandBehavior  << 3
     98            & key.springTimingFunctionEnabled               << 4
     99            & key.constantPropertiesEnabled                 << 5
     100            & key.colorFilterEnabled                        << 6
     101            & key.deferredCSSParserEnabled                  << 7
     102            & key.hasDocumentSecurityOrigin                 << 8
     103            & key.useSystemAppearance                       << 9
    106104#if ENABLE(ATTACHMENT_ELEMENT)
    107             & key.attachmentEnabled                         << 11
     105            & key.attachmentEnabled                         << 10
    108106#endif
    109             & key.mode                                      << 12; // Keep this last.
     107            & key.mode                                      << 11; // Keep this last.
    110108        hash ^= WTF::intHash(bits);
    111109        return hash;
Note: See TracChangeset for help on using the changeset viewer.