Changeset 252301 in webkit
- Timestamp:
- Nov 8, 2019 7:29:14 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252300 r252301 1 2019-11-08 Chris Dumez <cdumez@apple.com> 2 3 Add back/forward cache quirk for Vimeo.com 4 https://bugs.webkit.org/show_bug.cgi?id=204025 5 <rdar://problem/56996057> 6 7 Reviewed by Antti Koivisto. 8 9 Vimeo.com used to bypass the back/forward cache by serving "Cache-Control: no-store" over HTTPS. 10 We started caching such content in r250437 but the vimeo.com content unfortunately is not currently compatible 11 because it changes the opacity of its body to 0 when navigating away and fails to restore the original opacity 12 when coming back from the back/forward cache (e.g. in 'pageshow' event handler). 13 14 To address the issue, this patch introduces a quirk to restore pre-r250437 on Vimeo.com, until they get 15 a chance to fix their content. 16 17 * history/BackForwardCache.cpp: 18 (WebCore::canCacheFrame): 19 * page/DiagnosticLoggingKeys.cpp: 20 (WebCore::DiagnosticLoggingKeys::siteSpecificQuirkKey): 21 * page/DiagnosticLoggingKeys.h: 22 * page/Quirks.cpp: 23 (WebCore::Quirks::shouldBypassBackForwardCache const): 24 * page/Quirks.h: 25 1 26 2019-11-08 Youenn Fablet <youenn@apple.com> 2 27 -
trunk/Source/WebCore/history/BackForwardCache.cpp
r251357 r252301 46 46 #include "Logging.h" 47 47 #include "Page.h" 48 #include "Quirks.h" 48 49 #include "ScriptDisallowedScope.h" 49 50 #include "Settings.h" … … 117 118 118 119 bool isCacheable = true; 120 121 if (frame.isMainFrame() && frame.document()->quirks().shouldBypassBackForwardCache()) { 122 PCLOG(" -Disabled by site-specific quirk"); 123 logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::siteSpecificQuirkKey()); 124 isCacheable = false; 125 } 126 119 127 // Do not cache error pages (these can be recognized as pages with substitute data or unreachable URLs). 120 128 if (documentLoader->substituteData().isValid() && !documentLoader->substituteData().failingURL().isEmpty()) { -
trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp
r251275 r252301 536 536 } 537 537 538 String DiagnosticLoggingKeys::siteSpecificQuirkKey() 539 { 540 return "siteSpecificQuirk"_s; 541 } 542 538 543 String DiagnosticLoggingKeys::streamingMedia() 539 544 { -
trunk/Source/WebCore/page/DiagnosticLoggingKeys.h
r251275 r252301 150 150 static String scriptKey(); 151 151 static String serviceWorkerKey(); 152 static String siteSpecificQuirkKey(); 152 153 WEBCORE_EXPORT static String streamingMedia(); 153 154 static String styleSheetKey(); -
trunk/Source/WebCore/page/Quirks.cpp
r251827 r252301 610 610 } 611 611 612 } 612 bool Quirks::shouldBypassBackForwardCache() const 613 { 614 if (!needsQuirks()) 615 return false; 616 617 auto topURL = m_document->topDocument().url(); 618 auto host = topURL.host(); 619 620 // Vimeo.com used to bypass the back/forward cache by serving "Cache-Control: no-store" over HTTPS. 621 // We started caching such content in r250437 but the vimeo.com content unfortunately is not currently compatible 622 // because it changes the opacity of its body to 0 when navigating away and fails to restore the original opacity 623 // when coming back from the back/forward cache (e.g. in 'pageshow' event handler). See <rdar://problem/56996057>. 624 if (topURL.protocolIs("https") && equalLettersIgnoringASCIICase(host, "vimeo.com")) { 625 if (auto* documentLoader = m_document->frame() ? m_document->frame()->loader().documentLoader() : nullptr) 626 return documentLoader->response().cacheControlContainsNoStore(); 627 } 628 629 return false; 630 } 631 632 } -
trunk/Source/WebCore/page/Quirks.h
r251827 r252301 83 83 bool needsFullWidthHeightFullscreenStyleQuirk() const; 84 84 85 bool shouldBypassBackForwardCache() const; 86 85 87 private: 86 88 bool needsQuirks() const;
Note: See TracChangeset
for help on using the changeset viewer.