Changeset 166782 in webkit
- Timestamp:
- Apr 4, 2014 9:12:35 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166781 r166782 1 2014-04-03 Brent Fulgham <bfulgham@apple.com> 2 3 [Win] Load Media Controls js/css from bundle 4 https://bugs.webkit.org/show_bug.cgi?id=131194 5 6 Reviewed by Dean Jackson. 7 8 * DerivedSources.cpp: Remove no-longer generated file. 9 * DerivedSources.make: Don't generate unneeded files. 10 * WebCore.vcxproj/WebCore.vcxproj: Don't compile unneeded files. 11 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto. 12 * WebCore.vcxproj/copyWebCoreResourceFiles.cmd: Copy css/js to resource 13 * rendering/RenderThemeSafari.cpp: 14 * rendering/RenderThemeSafari.h: 15 * rendering/RenderThemeWin.cpp: 16 * rendering/RenderThemeWin.h: 17 1 18 2014-04-04 Mihnea Ovidenie <mihnea@adobe.com> 2 19 -
trunk/Source/WebCore/DerivedSources.cpp
r166221 r166782 247 247 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 248 248 #include "JSMediaControlsHost.cpp" 249 #include "UserAgentScriptsData.cpp"250 249 #endif 251 250 #include "JSMediaError.cpp" -
trunk/Source/WebCore/DerivedSources.make
r166689 r166782 883 883 endif 884 884 885 ifeq ($(OS),Windows_NT)886 ifeq ($(findstring ENABLE_MEDIA_CONTROLS_SCRIPT,$(FEATURE_DEFINES)), ENABLE_MEDIA_CONTROLS_SCRIPT)887 USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.css888 endif889 endif890 891 885 ifeq ($(findstring ENABLE_IMAGE_CONTROLS,$(FEATURE_DEFINES)), ENABLE_IMAGE_CONTROLS) 892 886 USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/html/shadow/mac/imageControlsMac.css … … 905 899 906 900 USER_AGENT_SCRIPTS = 907 908 ifeq ($(OS),Windows_NT)909 ifeq ($(findstring ENABLE_MEDIA_CONTROLS_SCRIPT,$(FEATURE_DEFINES)), ENABLE_MEDIA_CONTROLS_SCRIPT)910 USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.js911 endif912 endif913 901 914 902 ifeq ($(OS),MACOS) -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r166752 r166782 6426 6426 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementFactory.cpp" /> 6427 6427 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGNames.cpp" /> 6428 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScriptsData.cpp">6429 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>6430 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>6431 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>6432 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>6433 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>6434 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>6435 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>6436 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>6437 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>6438 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>6439 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>6440 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>6441 </ClCompile>6442 6428 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentStyleSheetsData.cpp"> 6443 6429 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> … … 18540 18526 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGElementTypeHelpers.h" /> 18541 18527 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\SVGNames.h" /> 18542 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScripts.h" />18543 18528 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentStyleSheets.h" /> 18544 18529 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\WebKitFontFamilyNames.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r166752 r166782 6830 6830 <Filter>DerivedSources</Filter> 6831 6831 </ClCompile> 6832 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScriptsData.cpp">6833 <Filter>DerivedSources</Filter>6834 </ClCompile>6835 6832 <ClCompile Include="..\Modules\mediacontrols\MediaControlsHost.cpp"> 6836 6833 <Filter>Modules\mediacontrols</Filter> … … 14829 14826 <ClInclude Include="..\rendering\TextPaintStyle.h"> 14830 14827 <Filter>rendering</Filter> 14831 </ClInclude>14832 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\UserAgentScripts.h">14833 <Filter>DerivedSources</Filter>14834 14828 </ClInclude> 14835 14829 <ClInclude Include="..\rendering\OrderIterator.h"> -
trunk/Source/WebCore/WebCore.vcxproj/copyWebCoreResourceFiles.cmd
r157465 r166782 1 1 mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\en.lproj" 2 2 xcopy /y /d /s /exclude:xcopy.excludes "%ProjectDir%..\English.lproj\Localizable.strings" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources\en.lproj" 3 xcopy /y /d /s "%ProjectDir%..\Modules\mediacontrols\mediaControlsApple.css" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources" 4 xcopy /y /d /s "%ProjectDir%..\Modules\mediacontrols\mediaControlsApple.js" "%CONFIGURATIONBUILDDIR%\bin%PlatformArchitecture%\WebKit.resources" -
trunk/Source/WebCore/rendering/RenderThemeSafari.cpp
r166653 r166782 47 47 #include "StyleResolver.h" 48 48 #include "UserAgentStyleSheets.h" 49 #include "WebCoreBundleWin.h" 49 50 #include <CoreGraphics/CoreGraphics.h> 50 51 #include <wtf/RetainPtr.h> 51 52 #if ENABLE(MEDIA_CONTROLS_SCRIPT)53 #include "UserAgentScripts.h"54 #endif55 52 56 53 using std::min; … … 1179 1176 { 1180 1177 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 1181 return String(mediaControlsAppleUserAgentStyleSheet, sizeof(mediaControlsAppleUserAgentStyleSheet)); 1178 if (m_mediaControlsStyleSheet.isEmpty()) 1179 m_mediaControlsStyleSheet = RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("css")); 1180 return m_mediaControlsStyleSheet; 1182 1181 #else 1183 1182 return emptyString(); … … 1188 1187 { 1189 1188 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 1190 return String(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript)); 1189 if (m_mediaControlsScript.isEmpty()) 1190 m_mediaControlsScript = RenderThemeWin::stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("js")); 1191 return m_mediaControlsScript; 1191 1192 #else 1192 1193 return emptyString(); -
trunk/Source/WebCore/rendering/RenderThemeSafari.h
r166653 r166782 1 1 /* 2 * Copyright (C) 2007, 2008, 2013 Apple Inc.2 * Copyright (C) 2007, 2008, 2013, 2014 Apple Inc. 3 3 * Copyright (C) 2009 Kenneth Rohde Christiansen 4 4 * … … 182 182 183 183 ThemeControlState determineState(RenderObject*) const; 184 185 String m_mediaControlsScript; 186 String m_mediaControlsStyleSheet; 184 187 }; 185 188 -
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
r165084 r166782 38 38 #include "SystemInfo.h" 39 39 #include "UserAgentStyleSheets.h" 40 #include "WebCoreBundleWin.h" 40 41 #include <wtf/win/GDIObject.h> 41 42 #if ENABLE(MEDIA_CONTROLS_SCRIPT)43 #include "UserAgentScripts.h"44 #endif45 42 46 43 #if ENABLE(VIDEO) … … 1080 1077 1081 1078 #if ENABLE(VIDEO) 1079 static const size_t maximumReasonableBufferSize = 32768; 1080 1081 static void fillBufferWithContentsOfFile(PlatformFileHandle file, long long filesize, Vector<char>& buffer) 1082 { 1083 // Load the file content into buffer 1084 buffer.resize(filesize + 1); 1085 1086 int bufferPosition = 0; 1087 int bufferReadSize = 4096; 1088 int bytesRead = 0; 1089 while (filesize > bufferPosition) { 1090 if (filesize - bufferPosition < bufferReadSize) 1091 bufferReadSize = filesize - bufferPosition; 1092 1093 bytesRead = readFromFile(file, buffer.data() + bufferPosition, bufferReadSize); 1094 if (bytesRead != bufferReadSize) { 1095 buffer.clear(); 1096 return; 1097 } 1098 1099 bufferPosition += bufferReadSize; 1100 } 1101 1102 buffer[filesize] = 0; 1103 } 1104 1105 String RenderThemeWin::stringWithContentsOfFile(CFStringRef name, CFStringRef type) 1106 { 1107 RetainPtr<CFURLRef> requestedURLRef = adoptCF(CFBundleCopyResourceURL(webKitBundle(), name, type, 0)); 1108 if (!requestedURLRef) 1109 return String(); 1110 1111 UInt8 requestedFilePath[MAX_PATH]; 1112 if (!CFURLGetFileSystemRepresentation(requestedURLRef.get(), false, requestedFilePath, MAX_PATH)) 1113 return String(); 1114 1115 PlatformFileHandle requestedFileHandle = openFile(requestedFilePath, OpenForRead); 1116 if (!isHandleValid(requestedFileHandle)) 1117 return String(); 1118 1119 long long filesize = -1; 1120 if (!getFileSize(requestedFilePath, filesize)) { 1121 closeFile(requestedFileHandle); 1122 return String(); 1123 } 1124 1125 Vector<char> fileContents; 1126 fillBufferWithContentsOfFile(requestedFileHandle, filesize, fileContents); 1127 closeFile(requestedFileHandle); 1128 1129 return String(fileContents.data(), static_cast<size_t>(filesize)); 1130 } 1131 1082 1132 String RenderThemeWin::mediaControlsStyleSheet() 1083 1133 { 1084 1134 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 1085 return String(mediaControlsAppleUserAgentStyleSheet, sizeof(mediaControlsAppleUserAgentStyleSheet)); 1135 if (m_mediaControlsStyleSheet.isEmpty()) 1136 m_mediaControlsStyleSheet = stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("css")); 1137 return m_mediaControlsStyleSheet; 1086 1138 #else 1087 1139 return emptyString(); … … 1092 1144 { 1093 1145 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 1094 return String(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript)); 1146 if (m_mediaControlsScript.isEmpty()) 1147 m_mediaControlsScript = stringWithContentsOfFile(CFSTR("mediaControlsApple"), CFSTR("js")); 1148 return m_mediaControlsScript; 1095 1149 #else 1096 1150 return emptyString(); -
trunk/Source/WebCore/rendering/RenderThemeWin.h
r165676 r166782 2 2 * This file is part of the WebKit project. 3 3 * 4 * Copyright (C) 2006, 2008, 2013 Apple Inc.4 * Copyright (C) 2006, 2008, 2013, 2014 Apple Inc. 5 5 * Copyright (C) 2009 Kenneth Rohde Christiansen 6 6 * … … 121 121 static void setWebKitIsBeingUnloaded(); 122 122 123 static String stringWithContentsOfFile(CFStringRef name, CFStringRef type); 124 123 125 virtual bool supportsFocusRing(const RenderStyle*) const; 124 126 … … 174 176 mutable HANDLE m_spinButtonTheme; 175 177 mutable HANDLE m_progressBarTheme; 178 179 String m_mediaControlsScript; 180 String m_mediaControlsStyleSheet; 176 181 }; 177 182
Note: See TracChangeset
for help on using the changeset viewer.