Diff
Modified: trunk/Source/WebCore/ChangeLog (258457 => 258458)
--- trunk/Source/WebCore/ChangeLog 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/ChangeLog 2020-03-14 02:10:54 UTC (rev 258458)
@@ -1,3 +1,28 @@
+2020-03-13 Alex Christensen <achristen...@webkit.org>
+
+ WKWebView._negotiatedLegacyTLS should be correct after back/forward navigations
+ https://bugs.webkit.org/show_bug.cgi?id=209011
+ <rdar://problem/59370588>
+
+ Reviewed by Youenn Fablet.
+
+ This is basically r258343 but for legacy TLS negotiation instead of plaintext HTTP use.
+
+ * dom/SecurityContext.h:
+ (WebCore::SecurityContext::usedLegacyTLS const):
+ (WebCore::SecurityContext::setUsedLegacyTLS):
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrame::usedLegacyTLS const):
+ (WebCore::CachedFrame::setUsedLegacyTLS): Deleted.
+ * history/CachedFrame.h:
+ (WebCore::CachedFrame::usedLegacyTLS const): Deleted.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ * platform/network/ResourceResponseBase.cpp:
+ (WebCore::ResourceResponseBase::includeCertificateInfo const):
+ * platform/network/ResourceResponseBase.h:
+ (WebCore::ResourceResponseBase::setUsedLegacyTLS):
+
2020-03-13 Zalan Bujtas <za...@apple.com>
[Tree building] Block::attachIgnoringContinuation should allow inline tables as before child container
Modified: trunk/Source/WebCore/dom/SecurityContext.h (258457 => 258458)
--- trunk/Source/WebCore/dom/SecurityContext.h 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/dom/SecurityContext.h 2020-03-14 02:10:54 UTC (rev 258458)
@@ -92,6 +92,8 @@
Active = 1 << 1,
};
+ bool usedLegacyTLS() const { return m_usedLegacyTLS; }
+ void setUsedLegacyTLS(bool used) { m_usedLegacyTLS = used; }
const OptionSet<MixedContentType>& foundMixedContent() const { return m_mixedContentTypes; }
void setFoundMixedContent(MixedContentType type) { m_mixedContentTypes.add(type); }
bool geolocationAccessed() const { return m_geolocationAccessed; }
@@ -126,6 +128,7 @@
bool m_geolocationAccessed { false };
bool m_secureCookiesAccessed { false };
bool m_isStrictMixedContentMode { false };
+ bool m_usedLegacyTLS { false };
};
} // namespace WebCore
Modified: trunk/Source/WebCore/history/CachedFrame.cpp (258457 => 258458)
--- trunk/Source/WebCore/history/CachedFrame.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/history/CachedFrame.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -80,13 +80,12 @@
void CachedFrameBase::pruneDetachedChildFrames()
{
- for (size_t i = m_childFrames.size(); i;) {
- --i;
- if (m_childFrames[i]->view()->frame().page())
- continue;
- m_childFrames[i]->destroy();
- m_childFrames.remove(i);
- }
+ m_childFrames.removeAllMatching([] (auto& childFrame) {
+ if (childFrame->view()->frame().page())
+ return false;
+ childFrame->destroy();
+ return true;
+ });
}
void CachedFrameBase::restore()
@@ -163,7 +162,7 @@
// Create the CachedFrames for all Frames in the FrameTree.
for (Frame* child = frame.tree().firstChild(); child; child = child->tree().nextSibling())
- m_childFrames.append(makeUnique<CachedFrame>(*child));
+ m_childFrames.append(makeUniqueRef<CachedFrame>(*child));
RELEASE_ASSERT(m_document->domWindow());
RELEASE_ASSERT(m_document->frame());
@@ -302,18 +301,27 @@
return m_cachedFramePlatformData.get();
}
-void CachedFrame::setUsedLegacyTLS(UsedLegacyTLS usedLegacyTLS)
+size_t CachedFrame::descendantFrameCount() const
{
- m_usedLegacyTLS = usedLegacyTLS;
+ size_t count = m_childFrames.size();
+ for (const auto& childFrame : m_childFrames)
+ count += childFrame->descendantFrameCount();
+ return count;
}
-int CachedFrame::descendantFrameCount() const
+UsedLegacyTLS CachedFrame::usedLegacyTLS() const
{
- int count = m_childFrames.size();
- for (size_t i = 0; i < m_childFrames.size(); ++i)
- count += m_childFrames[i]->descendantFrameCount();
+ if (auto* document = this->document()) {
+ if (document->usedLegacyTLS())
+ return UsedLegacyTLS::Yes;
+ }
- return count;
+ for (const auto& cachedFrame : m_childFrames) {
+ if (cachedFrame->usedLegacyTLS() == UsedLegacyTLS::Yes)
+ return UsedLegacyTLS::Yes;
+ }
+
+ return UsedLegacyTLS::No;
}
HasInsecureContent CachedFrame::hasInsecureContent() const
@@ -324,7 +332,7 @@
}
for (const auto& cachedFrame : m_childFrames) {
- if (cachedFrame && cachedFrame->hasInsecureContent() == HasInsecureContent::Yes)
+ if (cachedFrame->hasInsecureContent() == HasInsecureContent::Yes)
return HasInsecureContent::Yes;
}
Modified: trunk/Source/WebCore/history/CachedFrame.h (258457 => 258458)
--- trunk/Source/WebCore/history/CachedFrame.h 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/history/CachedFrame.h 2020-03-14 02:10:54 UTC (rev 258458)
@@ -29,6 +29,7 @@
#include <wtf/URL.h>
#include "ScriptCachedFrameData.h"
#include <wtf/RefPtr.h>
+#include <wtf/UniqueRef.h>
namespace WebCore {
@@ -63,9 +64,8 @@
std::unique_ptr<ScriptCachedFrameData> m_cachedFrameScriptData;
std::unique_ptr<CachedFramePlatformData> m_cachedFramePlatformData;
bool m_isMainFrame;
- Optional<UsedLegacyTLS> m_usedLegacyTLS;
- Vector<std::unique_ptr<CachedFrame>> m_childFrames;
+ Vector<UniqueRef<CachedFrame>> m_childFrames;
};
class CachedFrame : private CachedFrameBase {
@@ -80,9 +80,8 @@
WEBCORE_EXPORT void setCachedFramePlatformData(std::unique_ptr<CachedFramePlatformData>);
WEBCORE_EXPORT CachedFramePlatformData* cachedFramePlatformData();
- WEBCORE_EXPORT void setUsedLegacyTLS(UsedLegacyTLS);
HasInsecureContent hasInsecureContent() const;
- Optional<UsedLegacyTLS> usedLegacyTLS() const { return m_usedLegacyTLS; }
+ UsedLegacyTLS usedLegacyTLS() const;
using CachedFrameBase::document;
using CachedFrameBase::view;
@@ -89,7 +88,7 @@
using CachedFrameBase::url;
DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
- int descendantFrameCount() const;
+ size_t descendantFrameCount() const;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (258457 => 258458)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -2076,7 +2076,7 @@
notifier().dispatchDidReceiveResponse(cachedPage->documentLoader(), mainResourceIdentifier, cachedPage->documentLoader()->response());
auto hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent();
- Optional<UsedLegacyTLS> usedLegacyTLS = cachedPage->cachedMainFrame()->usedLegacyTLS();
+ auto usedLegacyTLS = cachedPage->cachedMainFrame()->usedLegacyTLS();
dispatchDidCommitLoad(hasInsecureContent, usedLegacyTLS);
Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (258457 => 258458)
--- trunk/Source/WebCore/loader/ResourceLoader.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -500,6 +500,13 @@
// anything including possibly derefing this; one example of this is Radar 3266216.
Ref<ResourceLoader> protectedThis(*this);
+ if (r.usedLegacyTLS()) {
+ if (auto* frame = m_frame.get()) {
+ if (auto* document = m_frame->document())
+ document->setUsedLegacyTLS(true);
+ }
+ }
+
logResourceResponseSource(m_frame.get(), r.source());
m_response = r;
Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp (258457 => 258458)
--- trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -279,12 +279,11 @@
m_type = type;
}
-void ResourceResponseBase::includeCertificateInfo(UsedLegacyTLS usedLegacyTLS) const
+void ResourceResponseBase::includeCertificateInfo() const
{
if (m_certificateInfo)
return;
m_certificateInfo = static_cast<const ResourceResponse*>(this)->platformCertificateInfo();
- m_usedLegacyTLS = usedLegacyTLS;
}
String ResourceResponseBase::suggestedFilename() const
Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.h (258457 => 258458)
--- trunk/Source/WebCore/platform/network/ResourceResponseBase.h 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.h 2020-03-14 02:10:54 UTC (rev 258458)
@@ -134,9 +134,10 @@
WEBCORE_EXPORT String suggestedFilename() const;
WEBCORE_EXPORT static String sanitizeSuggestedFilename(const String&);
- WEBCORE_EXPORT void includeCertificateInfo(UsedLegacyTLS = UsedLegacyTLS::No) const;
+ WEBCORE_EXPORT void includeCertificateInfo() const;
const Optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; };
bool usedLegacyTLS() const { return m_usedLegacyTLS == UsedLegacyTLS::Yes; }
+ void setUsedLegacyTLS(UsedLegacyTLS used) { m_usedLegacyTLS = used; }
// These functions return parsed values of the corresponding response headers.
WEBCORE_EXPORT bool cacheControlContainsNoCache() const;
Modified: trunk/Source/WebKit/ChangeLog (258457 => 258458)
--- trunk/Source/WebKit/ChangeLog 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/ChangeLog 2020-03-14 02:10:54 UTC (rev 258458)
@@ -1,3 +1,24 @@
+2020-03-13 Alex Christensen <achristen...@webkit.org>
+
+ WKWebView._negotiatedLegacyTLS should be correct after back/forward navigations
+ https://bugs.webkit.org/show_bug.cgi?id=209011
+ <rdar://problem/59370588>
+
+ Reviewed by Youenn Fablet.
+
+ * NetworkProcess/NetworkDataTask.cpp:
+ (WebKit::NetworkDataTask::didReceiveResponse):
+ * NetworkProcess/NetworkLoad.cpp:
+ (WebKit::NetworkLoad::notifyDidReceiveResponse):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::usedLegacyTLS): Deleted.
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/Network/WebResourceLoader.cpp:
+ (WebKit::WebResourceLoader::didReceiveResponse):
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):
+
2020-03-13 Wenson Hsieh <wenson_hs...@apple.com>
[watchOS] Don’t display empty text suggestions in Quickboard when editing input fields
Modified: trunk/Source/WebKit/NetworkProcess/NetworkDataTask.cpp (258457 => 258458)
--- trunk/Source/WebKit/NetworkProcess/NetworkDataTask.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/NetworkProcess/NetworkDataTask.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -110,6 +110,11 @@
return;
}
}
+
+ response.setSource(ResourceResponse::Source::Network);
+ if (negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes)
+ response.setUsedLegacyTLS(UsedLegacyTLS::Yes);
+
if (m_client)
m_client->didReceiveResponse(WTFMove(response), negotiatedLegacyTLS, WTFMove(completionHandler));
else
Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp (258457 => 258458)
--- trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -231,9 +231,8 @@
{
ASSERT(RunLoop::isMain());
- response.setSource(ResourceResponse::Source::Network);
if (m_parameters.needsCertificateInfo)
- response.includeCertificateInfo(negotiatedLegacyTLS == NegotiatedLegacyTLS::Yes ? UsedLegacyTLS::Yes : UsedLegacyTLS::No);
+ response.includeCertificateInfo();
m_client.get().didReceiveResponse(WTFMove(response), WTFMove(completionHandler));
}
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (258457 => 258458)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -4293,11 +4293,6 @@
networkProcess->preconnectTo(sessionID(), url, userAgent(), WebCore::StoredCredentialsPolicy::Use);
}
-void WebPageProxy::usedLegacyTLS(CompletionHandler<void(WebCore::UsedLegacyTLS)>&& completionHandler)
-{
- completionHandler(m_pageLoadState.hasNegotiatedLegacyTLS() ? UsedLegacyTLS::Yes : UsedLegacyTLS::No);
-}
-
void WebPageProxy::didDestroyNavigation(uint64_t navigationID)
{
PageClientProtector protector(pageClient());
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (258457 => 258458)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-03-14 02:10:54 UTC (rev 258458)
@@ -1791,8 +1791,6 @@
void preconnectTo(const URL&);
- void usedLegacyTLS(CompletionHandler<void(WebCore::UsedLegacyTLS)>&&);
-
void didDestroyNavigation(uint64_t navigationID);
void decidePolicyForNavigationAction(Ref<WebProcessProxy>&&, WebFrameProxy&, FrameInfoData&&, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo,
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (258457 => 258458)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in 2020-03-14 02:10:54 UTC (rev 258458)
@@ -142,8 +142,6 @@
DidExplicitOpenForFrame(WebCore::FrameIdentifier frameID, URL url, String mimeType)
DidDestroyNavigation(uint64_t navigationID)
- UsedLegacyTLS() -> (enum:bool WebCore::UsedLegacyTLS usedLegacyTLS) Synchronous
-
MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture)
FrameDidBecomeFrameSet(WebCore::FrameIdentifier frameID, bool value)
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (258457 => 258458)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2020-03-14 02:10:54 UTC (rev 258458)
@@ -1464,16 +1464,8 @@
return webPage->overrideContentSecurityPolicy();
}
-void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame)
+void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame*)
{
- WebPage* webPage = m_frame->page();
- if (!webPage)
- return;
-
- // FIXME: Remember in the web process rather than send this sync message.
- UsedLegacyTLS usedLegacyTLS;
- if (webPage->sendSync(Messages::WebPageProxy::UsedLegacyTLS(), Messages::WebPageProxy::UsedLegacyTLS::Reply(usedLegacyTLS)))
- cachedFrame->setUsedLegacyTLS(usedLegacyTLS);
}
void WebFrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame*)
Modified: trunk/Tools/ChangeLog (258457 => 258458)
--- trunk/Tools/ChangeLog 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Tools/ChangeLog 2020-03-14 02:10:54 UTC (rev 258458)
@@ -1,3 +1,14 @@
+2020-03-13 Alex Christensen <achristen...@webkit.org>
+
+ WKWebView._negotiatedLegacyTLS should be correct after back/forward navigations
+ https://bugs.webkit.org/show_bug.cgi?id=209011
+ <rdar://problem/59370588>
+
+ Reviewed by Youenn Fablet.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm:
+ (TestWebKitAPI::TEST):
+
2020-03-13 Wenson Hsieh <wenson_hs...@apple.com>
[watchOS] Don’t display empty text suggestions in Quickboard when editing input fields
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm (258457 => 258458)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm 2020-03-14 02:01:28 UTC (rev 258457)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm 2020-03-14 02:10:54 UTC (rev 258458)
@@ -301,6 +301,42 @@
[webView removeObserver:observer.get() forKeyPath:@"_negotiatedLegacyTLS"];
}
+TEST(TLSVersion, BackForwardNegotiatedLegacyTLS)
+{
+ HTTPServer secureServer({
+ { "/", { "hello" }}
+ }, HTTPServer::Protocol::Https);
+ HTTPServer insecureServer({
+ { "/", { "hello" } }
+ }, HTTPServer::Protocol::HttpsWithLegacyTLS);
+ HTTPServer mixedContentServer({
+ { "/", { {{ "Content-Type", "text/html" }}, makeString("<img src=''></img>") } },
+ }, HTTPServer::Protocol::Https);
+
+ auto [webView, delegate] = webViewWithNavigationDelegate();
+ EXPECT_FALSE([webView _negotiatedLegacyTLS]);
+
+ [webView loadRequest:secureServer.request()];
+ [delegate waitForDidFinishNavigation];
+ EXPECT_FALSE([webView _negotiatedLegacyTLS]);
+
+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://localhost:%d/", mixedContentServer.port()]]]];
+ [delegate waitForDidFinishNavigation];
+ while (![webView _negotiatedLegacyTLS])
+ TestWebKitAPI::Util::spinRunLoop();
+ EXPECT_TRUE([webView _negotiatedLegacyTLS]);
+
+ [webView goBack];
+ [delegate waitForDidFinishNavigation];
+ EXPECT_FALSE([webView _negotiatedLegacyTLS]);
+
+ [webView goForward];
+ [delegate waitForDidFinishNavigation];
+ while (![webView _negotiatedLegacyTLS])
+ TestWebKitAPI::Util::spinRunLoop();
+ EXPECT_TRUE([webView _negotiatedLegacyTLS]);
+}
+
TEST(TLSVersion, Subresource)
{
HTTPServer legacyTLSServer({