<!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>[166782] trunk/Source/WebCore</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/166782">166782</a></dd>
<dt>Author</dt> <dd>bfulgham@apple.com</dd>
<dt>Date</dt> <dd>2014-04-04 09:12:35 -0700 (Fri, 04 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Win] Load Media Controls js/css from bundle
https://bugs.webkit.org/show_bug.cgi?id=131194
Reviewed by Dean Jackson.
* DerivedSources.cpp: Remove no-longer generated file.
* DerivedSources.make: Don't generate unneeded files.
* WebCore.vcxproj/WebCore.vcxproj: Don't compile unneeded files.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Copy css/js to resource
* rendering/RenderThemeSafari.cpp:
* rendering/RenderThemeSafari.h:
* rendering/RenderThemeWin.cpp:
* rendering/RenderThemeWin.h:</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="#trunkSourceWebCoreWebCorevcxprojcopyWebCoreResourceFilescmd">trunk/Source/WebCore/WebCore.vcxproj/copyWebCoreResourceFiles.cmd</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeSafaricpp">trunk/Source/WebCore/rendering/RenderThemeSafari.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeSafarih">trunk/Source/WebCore/rendering/RenderThemeSafari.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeWincpp">trunk/Source/WebCore/rendering/RenderThemeWin.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeWinh">trunk/Source/WebCore/rendering/RenderThemeWin.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/ChangeLog        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-04-03 Brent Fulgham <bfulgham@apple.com>
+
+ [Win] Load Media Controls js/css from bundle
+ https://bugs.webkit.org/show_bug.cgi?id=131194
+
+ Reviewed by Dean Jackson.
+
+ * DerivedSources.cpp: Remove no-longer generated file.
+ * DerivedSources.make: Don't generate unneeded files.
+ * WebCore.vcxproj/WebCore.vcxproj: Don't compile unneeded files.
+ * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+ * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Copy css/js to resource
+ * rendering/RenderThemeSafari.cpp:
+ * rendering/RenderThemeSafari.h:
+ * rendering/RenderThemeWin.cpp:
+ * rendering/RenderThemeWin.h:
+
</ins><span class="cx"> 2014-04-04 Mihnea Ovidenie <mihnea@adobe.com>
</span><span class="cx">
</span><span class="cx"> [CSSRegions] Region's behaviour not updated when becoming valid from invalid
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/DerivedSources.cpp        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -246,7 +246,6 @@
</span><span class="cx"> #include "JSMediaController.cpp"
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><span class="cx"> #include "JSMediaControlsHost.cpp"
</span><del>-#include "UserAgentScriptsData.cpp"
</del><span class="cx"> #endif
</span><span class="cx"> #include "JSMediaError.cpp"
</span><span class="cx"> #include "JSMediaList.cpp"
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/DerivedSources.make        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -882,12 +882,6 @@
</span><span class="cx"> USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/fullscreen.css
</span><span class="cx"> endif
</span><span class="cx">
</span><del>-ifeq ($(OS),Windows_NT)
-ifeq ($(findstring ENABLE_MEDIA_CONTROLS_SCRIPT,$(FEATURE_DEFINES)), ENABLE_MEDIA_CONTROLS_SCRIPT)
-        USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.css
-endif
-endif
-
</del><span class="cx"> ifeq ($(findstring ENABLE_IMAGE_CONTROLS,$(FEATURE_DEFINES)), ENABLE_IMAGE_CONTROLS)
</span><span class="cx">         USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/html/shadow/mac/imageControlsMac.css
</span><span class="cx"> endif
</span><span class="lines">@@ -905,12 +899,6 @@
</span><span class="cx">
</span><span class="cx"> USER_AGENT_SCRIPTS =
</span><span class="cx">
</span><del>-ifeq ($(OS),Windows_NT)
-ifeq ($(findstring ENABLE_MEDIA_CONTROLS_SCRIPT,$(FEATURE_DEFINES)), ENABLE_MEDIA_CONTROLS_SCRIPT)
-        USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.js
-endif
-endif
-
</del><span class="cx"> ifeq ($(OS),MACOS)
</span><span class="cx">         USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/plugins/QuickTimePluginReplacement.js
</span><span class="cx"> endif
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -6425,20 +6425,6 @@
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\MathMLNames.cpp" />
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementFactory.cpp" />
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGNames.cpp" />
</span><del>- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScriptsData.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>
</del><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentStyleSheetsData.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">@@ -18539,7 +18525,6 @@
</span><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementFactory.h" />
</span><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementTypeHelpers.h" />
</span><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGNames.h" />
</span><del>- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScripts.h" />
</del><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentStyleSheets.h" />
</span><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\WebKitFontFamilyNames.h" />
</span><span class="cx"> <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\XMLNames.h" />
</span><span class="lines">@@ -21155,4 +21140,4 @@
</span><span class="cx"> <ImportGroup Label="ExtensionTargets">
</span><span class="cx"> <Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
</span><span class="cx"> </ImportGroup>
</span><del>-</Project>
</del><ins>+</Project>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -6829,9 +6829,6 @@
</span><span class="cx"> <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSBeforeUnloadEvent.cpp">
</span><span class="cx"> <Filter>DerivedSources</Filter>
</span><span class="cx"> </ClCompile>
</span><del>- <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScriptsData.cpp">
- <Filter>DerivedSources</Filter>
- </ClCompile>
</del><span class="cx"> <ClCompile Include="..\Modules\mediacontrols\MediaControlsHost.cpp">
</span><span class="cx"> <Filter>Modules\mediacontrols</Filter>
</span><span class="cx"> </ClCompile>
</span><span class="lines">@@ -14829,9 +14826,6 @@
</span><span class="cx"> <ClInclude Include="..\rendering\TextPaintStyle.h">
</span><span class="cx"> <Filter>rendering</Filter>
</span><span class="cx"> </ClInclude>
</span><del>- <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScripts.h">
- <Filter>DerivedSources</Filter>
- </ClInclude>
</del><span class="cx"> <ClInclude Include="..\rendering\OrderIterator.h">
</span><span class="cx"> <Filter>rendering</Filter>
</span><span class="cx"> </ClInclude>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojcopyWebCoreResourceFilescmd"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/copyWebCoreResourceFiles.cmd (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/copyWebCoreResourceFiles.cmd        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/WebCore.vcxproj/copyWebCoreResourceFiles.cmd        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -1,2 +1,4 @@
</span><span class="cx"> mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\en.lproj"
</span><span class="cx"> xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\English.lproj\Localizable.strings" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\en.lproj"
</span><ins>+xcopy /y /d /s "%ProjectDir%..\Modules\mediacontrols\mediaControlsApple.css" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources"
+xcopy /y /d /s "%ProjectDir%..\Modules\mediacontrols\mediaControlsApple.js" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources"
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeSafaricpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.cpp (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeSafari.cpp        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.cpp        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -46,13 +46,10 @@
</span><span class="cx"> #include "SoftLinking.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "UserAgentStyleSheets.h"
</span><ins>+#include "WebCoreBundleWin.h"
</ins><span class="cx"> #include <CoreGraphics/CoreGraphics.h>
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx">
</span><del>-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
-#include "UserAgentScripts.h"
-#endif
-
</del><span class="cx"> using std::min;
</span><span class="cx">
</span><span class="cx"> // FIXME: The platform-independent code in this class should be factored out and merged with RenderThemeMac.
</span><span class="lines">@@ -1178,7 +1175,9 @@
</span><span class="cx"> String RenderThemeSafari::mediaControlsStyleSheet()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><del>- return String(mediaControlsAppleUserAgentStyleSheet, sizeof(mediaControlsAppleUserAgentStyleSheet));
</del><ins>+ if (m_mediaControlsStyleSheet.isEmpty())
+ m_mediaControlsStyleSheet = RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("css"));
+ return m_mediaControlsStyleSheet;
</ins><span class="cx"> #else
</span><span class="cx"> return emptyString();
</span><span class="cx"> #endif
</span><span class="lines">@@ -1187,7 +1186,9 @@
</span><span class="cx"> String RenderThemeSafari::mediaControlsScript()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><del>- return String(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript));
</del><ins>+ if (m_mediaControlsScript.isEmpty())
+ m_mediaControlsScript = RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("js"));
+ return m_mediaControlsScript;
</ins><span class="cx"> #else
</span><span class="cx"> return emptyString();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeSafarih"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.h (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeSafari.h        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.h        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2007, 2008, 2013 Apple Inc.
</del><ins>+ * Copyright (C) 2007, 2008, 2013, 2014 Apple Inc.
</ins><span class="cx"> * Copyright (C) 2009 Kenneth Rohde Christiansen
</span><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -181,6 +181,9 @@
</span><span class="cx"> void setSearchFieldSize(RenderStyle*) const;
</span><span class="cx">
</span><span class="cx"> ThemeControlState determineState(RenderObject*) const;
</span><ins>+
+ String m_mediaControlsScript;
+ String m_mediaControlsStyleSheet;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -37,12 +37,9 @@
</span><span class="cx"> #include "SoftLinking.h"
</span><span class="cx"> #include "SystemInfo.h"
</span><span class="cx"> #include "UserAgentStyleSheets.h"
</span><ins>+#include "WebCoreBundleWin.h"
</ins><span class="cx"> #include <wtf/win/GDIObject.h>
</span><span class="cx">
</span><del>-#if ENABLE(MEDIA_CONTROLS_SCRIPT)
-#include "UserAgentScripts.h"
-#endif
-
</del><span class="cx"> #if ENABLE(VIDEO)
</span><span class="cx"> #include "RenderMediaControls.h"
</span><span class="cx"> #endif
</span><span class="lines">@@ -1079,10 +1076,65 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><ins>+static const size_t maximumReasonableBufferSize = 32768;
+
+static void fillBufferWithContentsOfFile(PlatformFileHandle file, long long filesize, Vector<char>& buffer)
+{
+ // Load the file content into buffer
+ buffer.resize(filesize + 1);
+
+ int bufferPosition = 0;
+ int bufferReadSize = 4096;
+ int bytesRead = 0;
+ while (filesize > bufferPosition) {
+ if (filesize - bufferPosition < bufferReadSize)
+ bufferReadSize = filesize - bufferPosition;
+
+ bytesRead = readFromFile(file, buffer.data() + bufferPosition, bufferReadSize);
+ if (bytesRead != bufferReadSize) {
+ buffer.clear();
+ return;
+ }
+
+ bufferPosition += bufferReadSize;
+ }
+
+ buffer[filesize] = 0;
+}
+
+String RenderThemeWin::stringWithContentsOfFile(CFStringRef name, CFStringRef type)
+{
+ RetainPtr<CFURLRef> requestedURLRef = adoptCF(CFBundleCopyResourceURL(webKitBundle(), name, type, 0));
+ if (!requestedURLRef)
+ return String();
+
+ UInt8 requestedFilePath[MAX_PATH];
+ if (!CFURLGetFileSystemRepresentation(requestedURLRef.get(), false, requestedFilePath, MAX_PATH))
+ return String();
+
+ PlatformFileHandle requestedFileHandle = openFile(requestedFilePath, OpenForRead);
+ if (!isHandleValid(requestedFileHandle))
+ return String();
+
+ long long filesize = -1;
+ if (!getFileSize(requestedFilePath, filesize)) {
+ closeFile(requestedFileHandle);
+ return String();
+ }
+
+ Vector<char> fileContents;
+ fillBufferWithContentsOfFile(requestedFileHandle, filesize, fileContents);
+ closeFile(requestedFileHandle);
+
+ return String(fileContents.data(), static_cast<size_t>(filesize));
+}
+
</ins><span class="cx"> String RenderThemeWin::mediaControlsStyleSheet()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><del>- return String(mediaControlsAppleUserAgentStyleSheet, sizeof(mediaControlsAppleUserAgentStyleSheet));
</del><ins>+ if (m_mediaControlsStyleSheet.isEmpty())
+ m_mediaControlsStyleSheet = stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("css"));
+ return m_mediaControlsStyleSheet;
</ins><span class="cx"> #else
</span><span class="cx"> return emptyString();
</span><span class="cx"> #endif
</span><span class="lines">@@ -1091,7 +1143,9 @@
</span><span class="cx"> String RenderThemeWin::mediaControlsScript()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(MEDIA_CONTROLS_SCRIPT)
</span><del>- return String(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript));
</del><ins>+ if (m_mediaControlsScript.isEmpty())
+ m_mediaControlsScript = stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("js"));
+ return m_mediaControlsScript;
</ins><span class="cx"> #else
</span><span class="cx"> return emptyString();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeWin.h (166781 => 166782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeWin.h        2014-04-04 15:05:43 UTC (rev 166781)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.h        2014-04-04 16:12:35 UTC (rev 166782)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx"> * This file is part of the WebKit project.
</span><span class="cx"> *
</span><del>- * Copyright (C) 2006, 2008, 2013 Apple Inc.
</del><ins>+ * Copyright (C) 2006, 2008, 2013, 2014 Apple Inc.
</ins><span class="cx"> * Copyright (C) 2009 Kenneth Rohde Christiansen
</span><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="lines">@@ -120,6 +120,8 @@
</span><span class="cx">
</span><span class="cx"> static void setWebKitIsBeingUnloaded();
</span><span class="cx">
</span><ins>+ static String stringWithContentsOfFile(CFStringRef name, CFStringRef type);
+
</ins><span class="cx"> virtual bool supportsFocusRing(const RenderStyle*) const;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(VIDEO)
</span><span class="lines">@@ -173,6 +175,9 @@
</span><span class="cx"> mutable HANDLE m_sliderTheme;
</span><span class="cx"> mutable HANDLE m_spinButtonTheme;
</span><span class="cx"> mutable HANDLE m_progressBarTheme;
</span><ins>+
+ String m_mediaControlsScript;
+ String m_mediaControlsStyleSheet;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>