Source/WebCore/ChangeLog

 12018-07-05 Youenn Fablet <youenn@apple.com>
 2
 3 REGRESSION (r230843): Flash doesn't work; Produces blue box on page
 4 https://bugs.webkit.org/show_bug.cgi?id=187346
 5 <rdar://problem/41773974>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Introduce clearPagesPluginData used by WebProcess when a plugin policy changes.
 10 Add a new internals API to get the plugin count as navigator.plugin is filtering plugins.
 11
 12 Test: http/tests/plugins/plugin-allow-then-reload.html
 13
 14 * plugins/PluginData.h:
 15 * plugins/PluginInfoProvider.cpp:
 16 (WebCore::PluginInfoProvider::clearPagesPluginData):
 17 * plugins/PluginInfoProvider.h:
 18 * testing/Internals.cpp:
 19 (WebCore::Internals::pluginCount):
 20 * testing/Internals.h:
 21 * testing/Internals.idl:
 22
1232018-07-05 Timothy Hatcher <timothy@apple.com>
224
325 Don't invert text color for selections in light mode.

Source/WebKit/ChangeLog

 12018-07-05 Youenn Fablet <youenn@apple.com>
 2
 3 REGRESSION (r230843): Flash doesn't work; Produces blue box on page
 4 https://bugs.webkit.org/show_bug.cgi?id=187346
 5 <rdar://problem/41773974>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Reset page plugins when the load client policies are updated.
 10 This will ensure that pages will rebuild their plugin lists based on the new policies.
 11
 12 * WebProcess/Plugins/WebPluginInfoProvider.cpp:
 13 (WebKit::WebPluginInfoProvider::setPluginLoadClientPolicy):
 14 (WebKit::WebPluginInfoProvider::clearPluginClientPolicies):
 15
1162018-07-05 Rob Buis <rbuis@igalia.com>
217
318 [GTK] Remove soup/DownloadSoupErrors.h

Source/WebCore/plugins/PluginData.h

@@public:
102102 static Ref<PluginData> create(Page& page) { return adoptRef(*new PluginData(page)); }
103103
104104 const Vector<PluginInfo>& plugins() const { return m_plugins; }
105  const Vector<PluginInfo>& webVisiblePlugins() const;
 105 WEBCORE_EXPORT const Vector<PluginInfo>& webVisiblePlugins() const;
106106 Vector<PluginInfo> publiclyVisiblePlugins() const;
107107 WEBCORE_EXPORT void getWebVisibleMimesAndPluginIndices(Vector<MimeClassInfo>&, Vector<size_t>&) const;
108108

Source/WebCore/plugins/PluginInfoProvider.cpp

@@PluginInfoProvider::~PluginInfoProvider()
3838 ASSERT(m_pages.isEmpty());
3939}
4040
 41void PluginInfoProvider::clearPagesPluginData()
 42{
 43 for (auto& page : m_pages)
 44 page->clearPluginData();
 45}
 46
4147void PluginInfoProvider::refresh(bool reloadPages)
4248{
4349 refreshPlugins();

Source/WebCore/plugins/PluginInfoProvider.h

@@public:
3838
3939 void addPage(Page&);
4040 void removePage(Page&);
 41 void clearPagesPluginData();
4142
4243 virtual Vector<PluginInfo> pluginInfo(Page&, std::optional<Vector<SupportedPluginIdentifier>>&) = 0;
4344 virtual Vector<PluginInfo> webVisiblePluginInfo(Page&, const URL&) = 0;

Source/WebCore/testing/Internals.cpp

119119#include "PathUtilities.h"
120120#include "PlatformMediaSessionManager.h"
121121#include "PlatformStrategies.h"
 122#include "PluginData.h"
122123#include "PrintContext.h"
123124#include "PseudoElement.h"
124125#include "Range.h"

@@void Internals::setUseSystemAppearance(bool value)
46374638 contextDocument()->page()->setUseSystemAppearance(value);
46384639}
46394640
 4641size_t Internals::pluginCount()
 4642{
 4643#if PLATFORM(MAC)
 4644 if (!contextDocument() || !contextDocument()->page())
 4645 return 0;
 4646
 4647 return contextDocument()->page()->pluginData().webVisiblePlugins().size();
 4648#else
 4649 return 0;
 4650#endif
 4651}
 4652
46404653} // namespace WebCore

Source/WebCore/testing/Internals.h

@@public:
717717
718718 void setUseSystemAppearance(bool);
719719
 720 size_t pluginCount();
 721
720722private:
721723 explicit Internals(Document&);
722724 Document* contextDocument() const;

Source/WebCore/testing/Internals.idl

@@enum EventThrottlingBehavior {
654654 void reloadWithoutContentExtensions();
655655
656656 void setUseSystemAppearance(boolean value);
 657
 658 unsigned long pluginCount();
657659};

Source/WebKit/WebProcess/Plugins/WebPluginInfoProvider.cpp

@@void WebPluginInfoProvider::setPluginLoadClientPolicy(WebCore::PluginLoadClientP
8080 versionsToPolicies.set(versionStringToSet, clientPolicy);
8181 policiesByIdentifier.set(bundleIdentifierToSet, versionsToPolicies);
8282 m_hostsToPluginIdentifierData.set(hostToSet, policiesByIdentifier);
 83
 84 clearPagesPluginData();
8385}
8486
8587void WebPluginInfoProvider::clearPluginClientPolicies()
8688{
8789 m_hostsToPluginIdentifierData.clear();
 90 clearPagesPluginData();
8891}
8992#endif
9093

Tools/ChangeLog

 12018-07-05 Youenn Fablet <youenn@apple.com>
 2
 3 REGRESSION (r230843): Flash doesn't work; Produces blue box on page
 4 https://bugs.webkit.org/show_bug.cgi?id=187346
 5 <rdar://problem/41773974>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 * WebKitTestRunner/TestController.cpp:
 10 (WTR::TestController::resetStateToConsistentValues):
 11 (WTR::TestController::setBlockAllPlugins):
 12 When not blocked, set the load policy to allow once.
 13 * WebKitTestRunner/TestController.h:
 14
1152018-07-05 Aakash Jain <aakash_jain@apple.com>
216
317 [ews-build] Bindings-tests-EWS should output result in json

Tools/WebKitTestRunner/TestController.cpp

@@bool TestController::resetStateToConsistentValues(const TestOptions& options)
879879 m_authenticationUsername = String();
880880 m_authenticationPassword = String();
881881
882  m_shouldBlockAllPlugins = false;
 882 setBlockAllPlugins(false);
883883 setPluginSupportedMode({ });
884884
885885 m_shouldLogDownloadCallbacks = false;

@@WKPluginLoadPolicy TestController::decidePolicyForPluginLoad(WKPageRef, WKPlugin
17401740#endif
17411741}
17421742
 1743void TestController::setBlockAllPlugins(bool shouldBlock)
 1744{
 1745 m_shouldBlockAllPlugins = shouldBlock;
 1746
 1747#if PLATFORM(MAC)
 1748 auto policy = shouldBlock ? kWKPluginLoadClientPolicyBlock : kWKPluginLoadClientPolicyAllow;
 1749
 1750 WKRetainPtr<WKStringRef> nameNetscape = adoptWK(WKStringCreateWithUTF8CString("com.apple.testnetscapeplugin"));
 1751 WKRetainPtr<WKStringRef> nameFlash = adoptWK(WKStringCreateWithUTF8CString("com.macromedia.Flash Player.plugin"));
 1752 WKRetainPtr<WKStringRef> emptyString = adoptWK(WKStringCreateWithUTF8CString(""));
 1753 WKContextSetPluginLoadClientPolicy(m_context.get(), policy, emptyString.get(), nameNetscape.get(), emptyString.get());
 1754 WKContextSetPluginLoadClientPolicy(m_context.get(), policy, emptyString.get(), nameFlash.get(), emptyString.get());
 1755#endif
 1756}
 1757
17431758void TestController::setPluginSupportedMode(const String& mode)
17441759{
17451760 if (m_unsupportedPluginMode == mode)

Tools/WebKitTestRunner/TestController.h

@@public:
139139 void setAuthenticationPassword(String password) { m_authenticationPassword = password; }
140140 void setAllowsAnySSLCertificate(bool);
141141
142  void setBlockAllPlugins(bool shouldBlock) { m_shouldBlockAllPlugins = shouldBlock; }
 142 void setBlockAllPlugins(bool shouldBlock);
143143 void setPluginSupportedMode(const String&);
144144
145145 void setShouldLogHistoryClientCallbacks(bool shouldLog) { m_shouldLogHistoryClientCallbacks = shouldLog; }

LayoutTests/ChangeLog

 12018-07-05 Youenn Fablet <youenn@apple.com>
 2
 3 REGRESSION (r230843): Flash doesn't work; Produces blue box on page
 4 https://bugs.webkit.org/show_bug.cgi?id=187346
 5 <rdar://problem/41773974>
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 Skip new test on WK1 since it does not have the ability to block plugins.
 10
 11 * http/tests/plugins/plugin-allow-then-reload-expected.txt: Added.
 12 * http/tests/plugins/plugin-allow-then-reload.html: Added.
 13 * platform/mac-wk1/TestExpectations:
 14
1152018-07-05 Nan Wang <n_wang@apple.com>
216
317 AX: setValue on text controls should send out key events

LayoutTests/http/tests/plugins/plugin-allow-then-reload-expected.txt

 1CONSOLE MESSAGE: line 36: number of plugins decreased after blocking: PASS
 2CONSOLE MESSAGE: line 37: number of plugins increased after allowing: PASS
 3PASS

LayoutTests/http/tests/plugins/plugin-allow-then-reload.html

 1<html>
 2<body>
 3<script>
 4function doTest()
 5{
 6 if (!window.testRunner || !window.internals) {
 7 document.body.innerHTML = "FAIL: requires internals API";
 8 return;
 9 }
 10 if (!window.localStorage.step) {
 11 testRunner.waitUntilDone();
 12 testRunner.dumpAsText();
 13
 14 window.localStorage.step = 1;
 15 window.localStorage.step0Value = window.internals.pluginCount();
 16
 17 if (window.testRunner)
 18 testRunner.setBlockAllPlugins(true);
 19
 20 window.location.reload();
 21 return;
 22 }
 23 if (window.localStorage.step == 1) {
 24 window.localStorage.step = 2;
 25 window.localStorage.step1Value = window.internals.pluginCount();
 26
 27 testRunner.setBlockAllPlugins(false);
 28
 29 window.location.reload();
 30 return;
 31 }
 32 window.localStorage.step2Value = window.internals.pluginCount();
 33 var test1 = window.localStorage.step0Value > window.localStorage.step1Value;
 34 var test2 = window.localStorage.step2Value > window.localStorage.step1Value;
 35
 36 console.log("number of plugins decreased after blocking: " + (test1 ? "PASS" : "FAIL"));
 37 console.log("number of plugins increased after allowing: " + (test2 ? "PASS" : "FAIL"));
 38 document.body.innerHTML = test1 && test2 ? "PASS" : "FAIL";
 39
 40 testRunner.notifyDone();
 41}
 42doTest();
 43</script>
 44</body>
 45</html>

LayoutTests/platform/mac-wk1/TestExpectations

@@editing/secure-input/reset-state-on-navigation.html [ Failure ]
111111
112112# Plug-in blocking callback doesn't exist in WebKit1.
113113plugins/unavailable-plugin-indicator-obscurity.html
 114http/tests/plugins/plugin-allow-then-reload.html [ Skip ]
114115
115116http/tests/plugins/nounsupported-plugin.html [ Skip ]
116117http/tests/plugins/supported-plugin-all-origin-visibility.html [ Skip ]