<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[187370] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/187370">187370</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2015-07-24 16:24:38 -0700 (Fri, 24 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Source/WebCore:
[Win] Connect UserScript and UserStyleSheet through WebView.
https://bugs.webkit.org/show_bug.cgi?id=147279
<rdar://problem/21990767>
Reviewed by Dean Jackson.
Tested by http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.html as well
as many skipped tests.
* DerivedSources.cpp: Conditionally compile JSSecurityPolicyViolationEvent.cpp if CSP_NEXT is enabled.
* DerivedSources.make: Generate bindings for SecurityPolicyViolationEvent.idl.
* WebCore.vcxproj/WebCore.vcxproj: Add missing files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
Source/WebKit/win:
[Win] Connect UserScript and UserStyleSheet through WebView.
https://bugs.webkit.org/show_bug.cgi?id=147279
<rdar://problem/21990767>
Reviewed by Dean Jackson.
* Interfaces/IWebViewPrivate.idl: Add updated API for 'addUserScriptToGroup' and
'addUserStyleSheetToGroup'
* WebView.cpp:
(WebView::addUserScriptToGroup): Add implementation.
(toStringVector): Added helper function.
(WebView::addUserStyleSheetToGroup): Add implementation.
(WebView::removeUserScriptFromGroup): Ditto.
(WebView::removeUserStyleSheetFromGroup): Ditto.
(WebView::removeUserScriptsFromGroup): Ditto.
(WebView::removeUserStyleSheetsFromGroup): Ditto.
(WebView::removeAllUserContentFromGroup): Ditto.
* WebView.h:
Tools:
[Win] Activate CSP_NEXT and Connect UserScript and UserStyleSheet through WebView.
https://bugs.webkit.org/show_bug.cgi?id=147279
<rdar://problem/21990767>
Reviewed by Dean Jackson.
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::addUserScript):
(TestRunner::addUserStyleSheet):
(TestRunner::setDeveloperExtrasEnabled):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesIWebViewPrivateidl">trunk/Source/WebKit/win/Interfaces/IWebViewPrivate.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewh">trunk/Source/WebKit/win/WebView.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreewinTestRunnerWincpp">trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp</a></li>
<li><a href="#trunkWebKitLibrarieswintoolsvspropsFeatureDefinesprops">trunk/WebKitLibraries/win/tools/vsprops/FeatureDefines.props</a></li>
<li><a href="#trunkWebKitLibrarieswintoolsvspropsFeatureDefinesCairoprops">trunk/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props</a></li>
<li><a href="#trunkWebKitLibrarieswintoolsvspropscommonprops">trunk/WebKitLibraries/win/tools/vsprops/common.props</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebCore/ChangeLog        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-07-24 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] Connect UserScript and UserStyleSheet through WebView.
+ https://bugs.webkit.org/show_bug.cgi?id=147279
+ <rdar://problem/21990767>
+
+ Reviewed by Dean Jackson.
+
+ Tested by http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.html as well
+ as many skipped tests.
+
+ * DerivedSources.cpp: Conditionally compile JSSecurityPolicyViolationEvent.cpp if CSP_NEXT is enabled.
+ * DerivedSources.make: Generate bindings for SecurityPolicyViolationEvent.idl.
+ * WebCore.vcxproj/WebCore.vcxproj: Add missing files.
+ * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+
</ins><span class="cx"> 2015-07-24 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> [Cocoa] Clean up server trust handling in ResourceHandle.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebCore/DerivedSources.cpp        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -314,6 +314,9 @@
</span><span class="cx"> #include "JSScreen.cpp"
</span><span class="cx"> #include "JSScriptProfile.cpp"
</span><span class="cx"> #include "JSScriptProfileNode.cpp"
</span><ins>+#if ENABLE(CSP_NEXT)
+#include "JSSecurityPolicyViolationEvent.cpp"
+#endif
</ins><span class="cx"> #include "JSSQLError.cpp"
</span><span class="cx"> #include "JSSQLException.cpp"
</span><span class="cx"> #include "JSSQLResultSet.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebCore/DerivedSources.make        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -318,6 +318,7 @@
</span><span class="cx"> $(WebCore)/dom/Range.idl \
</span><span class="cx"> $(WebCore)/dom/RangeException.idl \
</span><span class="cx"> $(WebCore)/dom/RequestAnimationFrameCallback.idl \
</span><ins>+ $(WebCore)/dom/SecurityPolicyViolationEvent.idl \
</ins><span class="cx"> $(WebCore)/dom/StringCallback.idl \
</span><span class="cx"> $(WebCore)/dom/Text.idl \
</span><span class="cx"> $(WebCore)/dom/TextEvent.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -4029,6 +4029,21 @@
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSSecurityPolicyViolationEvent.cpp">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
+ </ClCompile>
+
</ins><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSSQLError.cpp">
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
</span><span class="cx"> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</span><span class="lines">@@ -7217,6 +7232,7 @@
</span><span class="cx"> <ClCompile Include="..\page\animation\CSSPropertyAnimation.cpp" />
</span><span class="cx"> <ClCompile Include="..\page\DeviceController.cpp" />
</span><span class="cx"> <ClCompile Include="..\page\DiagnosticLoggingKeys.cpp" />
</span><ins>+ <ClCompile Include="..\page\DOMSecurityPolicy.cpp" />
</ins><span class="cx"> <ClCompile Include="..\page\DOMSelection.cpp" />
</span><span class="cx"> <ClCompile Include="..\page\DOMTimer.cpp" />
</span><span class="cx"> <ClCompile Include="..\page\DOMWindow.cpp" />
</span><span class="lines">@@ -19874,6 +19890,7 @@
</span><span class="cx"> <ClInclude Include="..\page\DeviceController.h" />
</span><span class="cx"> <ClInclude Include="..\page\DiagnosticLoggingKeys.h" />
</span><span class="cx"> <ClInclude Include="..\page\DiagnosticLoggingResultType.h" />
</span><ins>+ <ClInclude Include="..\page\DOMSecurityPolicy.h" />
</ins><span class="cx"> <ClInclude Include="..\page\DOMSelection.h" />
</span><span class="cx"> <ClInclude Include="..\page\DOMTimer.h" />
</span><span class="cx"> <ClInclude Include="..\page\DOMWindow.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -5722,6 +5722,9 @@
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSScreen.cpp">
</span><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSSecurityPolicyViolationEvent.cpp">
+ <Filter>DerivedSources</Filter>
+ </ClCompile>
</ins><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSSQLError.cpp">
</span><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -7272,6 +7275,9 @@
</span><span class="cx"> <ClCompile Include="..\platform\win\GDIUtilities.cpp">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </ClCompile>
</span><ins>+ <ClCompile Include="..\page\DOMSecurityPolicy.cpp">
+ <Filter>page</Filter>
+ </ClCompile>
</ins><span class="cx"> </ItemGroup>
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <ClInclude Include="..\Modules\geolocation\Coordinates.h">
</span><span class="lines">@@ -15264,6 +15270,9 @@
</span><span class="cx"> <ClInclude Include="..\platform\win\GDIUtilities.h">
</span><span class="cx"> <Filter>platform\graphics\win</Filter>
</span><span class="cx"> </ClInclude>
</span><ins>+ <ClInclude Include="..\page\DOMSecurityPolicy.h">
+ <Filter>page</Filter>
+ </ClInclude>
</ins><span class="cx"> </ItemGroup>
</span><span class="cx"> <ItemGroup>
</span><span class="cx"> <None Include="..\css\CSSGrammar.y.in">
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebKit/win/ChangeLog        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-07-24 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] Connect UserScript and UserStyleSheet through WebView.
+ https://bugs.webkit.org/show_bug.cgi?id=147279
+ <rdar://problem/21990767>
+
+ Reviewed by Dean Jackson.
+
+ * Interfaces/IWebViewPrivate.idl: Add updated API for 'addUserScriptToGroup' and
+ 'addUserStyleSheetToGroup'
+ * WebView.cpp:
+ (WebView::addUserScriptToGroup): Add implementation.
+ (toStringVector): Added helper function.
+ (WebView::addUserStyleSheetToGroup): Add implementation.
+ (WebView::removeUserScriptFromGroup): Ditto.
+ (WebView::removeUserStyleSheetFromGroup): Ditto.
+ (WebView::removeUserScriptsFromGroup): Ditto.
+ (WebView::removeUserStyleSheetsFromGroup): Ditto.
+ (WebView::removeAllUserContentFromGroup): Ditto.
+ * WebView.h:
+
</ins><span class="cx"> 2015-07-24 Yusuke Suzuki <utatane.tea@gmail.com>
</span><span class="cx">
</span><span class="cx"> Remove runtime flags for symbols
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesIWebViewPrivateidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/IWebViewPrivate.idl (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/IWebViewPrivate.idl        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebKit/win/Interfaces/IWebViewPrivate.idl        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -50,6 +50,11 @@
</span><span class="cx"> WebInjectAtDocumentEnd,
</span><span class="cx"> } WebUserScriptInjectionTime;
</span><span class="cx">
</span><ins>+typedef enum {
+ WebInjectInAllFrames = 0,
+ WebInjectInTopFrameOnly,
+} WebUserContentInjectedFrames;
+
</ins><span class="cx"> [
</span><span class="cx"> object,
</span><span class="cx"> oleautomation,
</span><span class="lines">@@ -304,4 +309,14 @@
</span><span class="cx">
</span><span class="cx"> HRESULT setCustomBackingScaleFactor([in] double);
</span><span class="cx"> HRESULT backingScaleFactor([out] double*);
</span><ins>+
+ HRESULT addUserScriptToGroup([in] BSTR groupName, [in] IWebScriptWorld*, [in] BSTR source, [in] BSTR url,
+ [in] unsigned whitelistCount, [in, size_is(whitelistCount)] BSTR* whitelist,
+ [in] unsigned blacklistCount, [in, size_is(blacklistCount)] BSTR* blacklist,
+ [in] WebUserScriptInjectionTime injectionTime, [in] WebUserContentInjectedFrames injectedFrames);
+
+ HRESULT addUserStyleSheetToGroup([in] BSTR groupName, [in] IWebScriptWorld*, [in] BSTR source, [in] BSTR url,
+ [in] unsigned whitelistCount, [in, size_is(whitelistCount)] BSTR* whitelist,
+ [in] unsigned blacklistCount, [in, size_is(blacklistCount)] BSTR* blacklist,
+ [in] WebUserContentInjectedFrames injectedFrames);
</ins><span class="cx"> }
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -157,6 +157,8 @@
</span><span class="cx"> #include <WebCore/Settings.h>
</span><span class="cx"> #include <WebCore/SystemInfo.h>
</span><span class="cx"> #include <WebCore/UserContentController.h>
</span><ins>+#include <WebCore/UserScript.h>
+#include <WebCore/UserStyleSheet.h>
</ins><span class="cx"> #include <WebCore/WindowMessageBroadcaster.h>
</span><span class="cx"> #include <WebCore/WindowsTouch.h>
</span><span class="cx"> #include <bindings/ScriptValue.h>
</span><span class="lines">@@ -6518,34 +6520,141 @@
</span><span class="cx"> unsigned blacklistCount, BSTR* blacklist,
</span><span class="cx"> WebUserScriptInjectionTime injectionTime)
</span><span class="cx"> {
</span><del>- return E_NOTIMPL;
</del><ins>+ return addUserScriptToGroup(groupName, iWorld, source, url, whitelistCount, whitelist, blacklistCount, blacklist, injectionTime, WebInjectInAllFrames);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+static Vector<String> toStringVector(BSTR* entries, unsigned count)
+{
+ Vector<String> entriesVector;
+ if (!entries || !count)
+ return entriesVector;
+
+ for (unsigned i = 0; i < count; ++i)
+ entriesVector.append(toString(entries[i]));
+
+ return entriesVector;
+}
+
+HRESULT WebView::addUserScriptToGroup(BSTR groupName, IWebScriptWorld* iWorld, BSTR source, BSTR url,
+ unsigned whitelistCount, BSTR* whitelist, unsigned blacklistCount, BSTR* blacklist,
+ WebUserScriptInjectionTime injectionTime, WebUserContentInjectedFrames injectedFrames)
+{
+ String group = toString(groupName);
+ if (group.isEmpty())
+ return E_FAIL;
+
+ auto viewGroup = WebViewGroup::getOrCreate(group, String());
+ if (!viewGroup)
+ return E_FAIL;
+
+ if (!iWorld)
+ return E_POINTER;
+
+ WebScriptWorld* world = reinterpret_cast<WebScriptWorld*>(iWorld);
+ auto userScript = std::make_unique<UserScript>(source, toURL(url), toStringVector(whitelist, whitelistCount),
+ toStringVector(blacklist, blacklistCount), injectionTime == WebInjectAtDocumentStart ? InjectAtDocumentStart : InjectAtDocumentEnd,
+ injectedFrames == WebInjectInAllFrames ? InjectInAllFrames : InjectInTopFrameOnly);
+ viewGroup->userContentController().addUserScript(world->world(), WTF::move(userScript));
+ return S_OK;
+}
+
</ins><span class="cx"> HRESULT WebView::addUserStyleSheetToGroup(BSTR groupName, IWebScriptWorld* iWorld, BSTR source, BSTR url,
</span><del>- unsigned whitelistCount, BSTR* whitelist,
- unsigned blacklistCount, BSTR* blacklist)
</del><ins>+ unsigned whitelistCount, BSTR* whitelist, unsigned blacklistCount, BSTR* blacklist)
</ins><span class="cx"> {
</span><del>- return E_NOTIMPL;
</del><ins>+ return addUserStyleSheetToGroup(groupName, iWorld, source, url, whitelistCount, whitelist, blacklistCount, blacklist, WebInjectInAllFrames);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+HRESULT WebView::addUserStyleSheetToGroup(BSTR groupName, IWebScriptWorld* iWorld, BSTR source, BSTR url,
+ unsigned whitelistCount, BSTR* whitelist, unsigned blacklistCount, BSTR* blacklist, WebUserContentInjectedFrames injectedFrames)
+{
+ String group = toString(groupName);
+ if (group.isEmpty())
+ return E_FAIL;
+
+ auto viewGroup = WebViewGroup::getOrCreate(group, String());
+ if (!viewGroup)
+ return E_FAIL;
+
+ if (!iWorld)
+ return E_POINTER;
+
+ WebScriptWorld* world = reinterpret_cast<WebScriptWorld*>(iWorld);
+ auto styleSheet = std::make_unique<UserStyleSheet>(source, toURL(url), toStringVector(whitelist, whitelistCount), toStringVector(blacklist, blacklistCount),
+ injectedFrames == WebInjectInAllFrames ? InjectInAllFrames : InjectInTopFrameOnly, UserStyleUserLevel);
+ viewGroup->userContentController().addUserStyleSheet(world->world(), WTF::move(styleSheet), InjectInExistingDocuments);
+ return S_OK;
+}
+
</ins><span class="cx"> HRESULT WebView::removeUserScriptFromGroup(BSTR groupName, IWebScriptWorld* iWorld, BSTR url)
</span><span class="cx"> {
</span><del>- return E_NOTIMPL;
</del><ins>+ String group = toString(groupName);
+ if (group.isEmpty())
+ return E_FAIL;
+
+ auto viewGroup = WebViewGroup::get(group);
+ if (!viewGroup)
+ return S_OK;
+
+ if (!iWorld)
+ return E_POINTER;
+
+ WebScriptWorld* world = reinterpret_cast<WebScriptWorld*>(iWorld);
+ viewGroup->userContentController().removeUserScript(world->world(), toURL(url));
+ return S_OK;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> HRESULT WebView::removeUserStyleSheetFromGroup(BSTR groupName, IWebScriptWorld* iWorld, BSTR url)
</span><span class="cx"> {
</span><del>- return E_NOTIMPL;
</del><ins>+ String group = toString(groupName);
+ if (group.isEmpty())
+ return E_FAIL;
+
+ auto viewGroup = WebViewGroup::get(group);
+ if (!viewGroup)
+ return S_OK;
+
+ if (!iWorld)
+ return E_POINTER;
+
+ WebScriptWorld* world = reinterpret_cast<WebScriptWorld*>(iWorld);
+ viewGroup->userContentController().removeUserStyleSheet(world->world(), toURL(url));
+ return S_OK;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> HRESULT WebView::removeUserScriptsFromGroup(BSTR groupName, IWebScriptWorld* iWorld)
</span><span class="cx"> {
</span><del>- return E_NOTIMPL;
</del><ins>+ String group = toString(groupName);
+ if (group.isEmpty())
+ return E_FAIL;
+
+ auto viewGroup = WebViewGroup::get(group);
+ if (!viewGroup)
+ return S_OK;
+
+ if (!iWorld)
+ return E_POINTER;
+
+ WebScriptWorld* world = reinterpret_cast<WebScriptWorld*>(iWorld);
+ viewGroup->userContentController().removeUserScripts(world->world());
+ return S_OK;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> HRESULT WebView::removeUserStyleSheetsFromGroup(BSTR groupName, IWebScriptWorld* iWorld)
</span><span class="cx"> {
</span><del>- return E_NOTIMPL;
</del><ins>+ String group = toString(groupName);
+ if (group.isEmpty())
+ return E_FAIL;
+
+ auto viewGroup = WebViewGroup::get(group);
+ if (!viewGroup)
+ return S_OK;
+
+ if (!iWorld)
+ return E_POINTER;
+
+ WebScriptWorld* world = reinterpret_cast<WebScriptWorld*>(iWorld);
+ viewGroup->userContentController().removeUserStyleSheets(world->world());
+ return S_OK;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> HRESULT WebView::removeAllUserContentFromGroup(BSTR groupName)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.h (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.h        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Source/WebKit/win/WebView.h        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006-2012, 2014-2015 Apple Inc. All rights reserved.
</ins><span class="cx"> * Copyright (C) 2009, 2010, 2011 Appcelerator, Inc. All rights reserved.
</span><span class="cx"> * Copyright (C) 2011 Brent Fulgham. All rights reserved.
</span><span class="cx"> *
</span><span class="lines">@@ -846,6 +846,10 @@
</span><span class="cx"> HRESULT STDMETHODCALLTYPE dispatchPendingLoadRequests();
</span><span class="cx"> virtual HRESULT STDMETHODCALLTYPE setCustomBackingScaleFactor(double);
</span><span class="cx"> virtual HRESULT STDMETHODCALLTYPE backingScaleFactor(double*);
</span><ins>+ virtual HRESULT STDMETHODCALLTYPE addUserScriptToGroup(BSTR groupName, IWebScriptWorld*, BSTR source, BSTR url,
+ unsigned whitelistCount, BSTR* whitelist, unsigned blacklistCount, BSTR* blacklist, WebUserScriptInjectionTime, WebUserContentInjectedFrames);
+ virtual HRESULT STDMETHODCALLTYPE addUserStyleSheetToGroup(BSTR groupName, IWebScriptWorld*, BSTR source, BSTR url,
+ unsigned whitelistCount, BSTR* whitelist, unsigned blacklistCount, BSTR* blacklist, WebUserContentInjectedFrames);
</ins><span class="cx">
</span><span class="cx"> // WebView
</span><span class="cx"> bool shouldUseEmbeddedView(const WTF::String& mimeType) const;
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Tools/ChangeLog        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-07-24 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] Activate CSP_NEXT and Connect UserScript and UserStyleSheet through WebView.
+ https://bugs.webkit.org/show_bug.cgi?id=147279
+ <rdar://problem/21990767>
+
+ Reviewed by Dean Jackson.
+
+ * DumpRenderTree/win/TestRunnerWin.cpp:
+ (TestRunner::addUserScript):
+ (TestRunner::addUserStyleSheet):
+ (TestRunner::setDeveloperExtrasEnabled):
+
</ins><span class="cx"> 2015-07-24 Basile Clement <basile_clement@apple.com>
</span><span class="cx">
</span><span class="cx"> Call fixChangeLogPatch when generating patches from webkit-patch
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreewinTestRunnerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/Tools/DumpRenderTree/win/TestRunnerWin.cpp        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -997,7 +997,9 @@
</span><span class="cx"> if (FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(world), reinterpret_cast<void**>(&world))))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- webView->addUserScriptToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0, runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd);
</del><ins>+ webView->addUserScriptToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(),
+ nullptr, 0, nullptr, 0, nullptr, runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd,
+ allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames)
</span><span class="lines">@@ -1010,7 +1012,8 @@
</span><span class="cx"> if (FAILED(WebKitCreateInstance(__uuidof(WebScriptWorld), 0, __uuidof(world), reinterpret_cast<void**>(&world))))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0);
</del><ins>+ webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(),
+ nullptr, 0, nullptr, 0, nullptr, allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void TestRunner::setDeveloperExtrasEnabled(bool enabled)
</span></span></pre></div>
<a id="trunkWebKitLibrarieswintoolsvspropsFeatureDefinesprops"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/win/tools/vsprops/FeatureDefines.props (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/win/tools/vsprops/FeatureDefines.props        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/WebKitLibraries/win/tools/vsprops/FeatureDefines.props        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> <ENABLE_CANVAS_PATH>ENABLE_CANVAS_PATH</ENABLE_CANVAS_PATH>
</span><span class="cx"> <ENABLE_CANVAS_PROXY />
</span><span class="cx"> <ENABLE_CHANNEL_MESSAGING>ENABLE_CHANNEL_MESSAGING</ENABLE_CHANNEL_MESSAGING>
</span><del>- <ENABLE_CSP_NEXT />
</del><ins>+ <ENABLE_CSP_NEXT>ENABLE_CSP_NEXT</ENABLE_CSP_NEXT>
</ins><span class="cx"> <ENABLE_CSS3_CONDITIONAL_RULES>ENABLE_CSS3_CONDITIONAL_RULES</ENABLE_CSS3_CONDITIONAL_RULES>
</span><span class="cx"> <ENABLE_CSS3_TEXT />
</span><span class="cx"> <ENABLE_CSS_BOX_DECORATION_BREAK>ENABLE_CSS_BOX_DECORATION_BREAK</ENABLE_CSS_BOX_DECORATION_BREAK>
</span></span></pre></div>
<a id="trunkWebKitLibrarieswintoolsvspropsFeatureDefinesCairoprops"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.props        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> <ENABLE_CANVAS_PATH>ENABLE_CANVAS_PATH</ENABLE_CANVAS_PATH>
</span><span class="cx"> <ENABLE_CANVAS_PROXY />
</span><span class="cx"> <ENABLE_CHANNEL_MESSAGING>ENABLE_CHANNEL_MESSAGING</ENABLE_CHANNEL_MESSAGING>
</span><del>- <ENABLE_CSP_NEXT />
</del><ins>+ <ENABLE_CSP_NEXT>ENABLE_CSP_NEXT</ENABLE_CSP_NEXT>
</ins><span class="cx"> <ENABLE_CSS3_CONDITIONAL_RULES>ENABLE_CSS3_CONDITIONAL_RULES</ENABLE_CSS3_CONDITIONAL_RULES>
</span><span class="cx"> <ENABLE_CSS3_TEXT />
</span><span class="cx"> <ENABLE_CSS_BOX_DECORATION_BREAK>ENABLE_CSS_BOX_DECORATION_BREAK</ENABLE_CSS_BOX_DECORATION_BREAK>
</span></span></pre></div>
<a id="trunkWebKitLibrarieswintoolsvspropscommonprops"></a>
<div class="modfile"><h4>Modified: trunk/WebKitLibraries/win/tools/vsprops/common.props (187369 => 187370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitLibraries/win/tools/vsprops/common.props        2015-07-24 23:12:41 UTC (rev 187369)
+++ trunk/WebKitLibraries/win/tools/vsprops/common.props        2015-07-24 23:24:38 UTC (rev 187370)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> <ClCompile>
</span><span class="cx"> <AdditionalOptions>/bigobj /GS %(AdditionalOptions)</AdditionalOptions>
</span><span class="cx"> <PreprocessorDefinitions>_WINDOWS;WINVER=0x502;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_HAS_EXCEPTIONS=0;BUILDING_$(ProjectName);NOMINMAX;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</span><del>- <PreprocessorDefinitions Condition="$(Platform)=='Win32'">WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</del><ins>+ <PreprocessorDefinitions Condition="$(Platform)=='Win32'">WIN32;WINVER=0x601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ins><span class="cx"> <PreprocessorDefinitions Condition="$(Platform)=='Win64'">x64</PreprocessorDefinitions>
</span><span class="cx"> <ExceptionHandling>false</ExceptionHandling>
</span><span class="cx"> <RuntimeTypeInfo>false</RuntimeTypeInfo>
</span></span></pre>
</div>
</div>
</body>
</html>