Changeset 166669 in webkit
- Timestamp:
- Apr 2, 2014 2:42:30 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166668 r166669 1 2014-04-01 Dean Jackson <dino@apple.com> 2 3 Load Media Controls js/css from bundle 4 https://bugs.webkit.org/show_bug.cgi?id=131086 5 6 Reviewed by Eric Carlson. 7 8 Rather than embed encoded versions of the JS and CSS files 9 into C++ source, just load the files directly from the bundle. 10 11 * DerivedSources.make: Removed now unnecessary rules. 12 * WebCore.xcodeproj/project.pbxproj: Copy mediaControls files to the bundle. 13 * rendering/RenderThemeIOS.h: 14 * rendering/RenderThemeIOS.mm: 15 (WebCore::RenderThemeIOS::RenderThemeIOS): 16 (WebCore::RenderThemeIOS::mediaControlsStyleSheet): Load from the bundle. 17 (WebCore::RenderThemeIOS::mediaControlsScript): Ditto. 18 * rendering/RenderThemeMac.h: 19 * rendering/RenderThemeMac.mm: 20 (WebCore::RenderThemeMac::RenderThemeMac): 21 (WebCore::RenderThemeMac::mediaControlsStyleSheet): 22 (WebCore::RenderThemeMac::mediaControlsScript): 23 1 24 2014-04-02 Daniel Bates <dabates@apple.com> 2 25 -
trunk/Source/WebCore/DerivedSources.make
r166657 r166669 883 883 endif 884 884 885 ifeq ($(findstring ENABLE_MEDIA_CONTROLS_SCRIPT,$(FEATURE_DEFINES)), ENABLE_MEDIA_CONTROLS_SCRIPT)886 USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.css887 ifeq ($(WTF_PLATFORM_IOS), 1)888 USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/mediacontrols/mediaControlsiOS.css889 endif890 endif891 892 885 ifeq ($(findstring ENABLE_IMAGE_CONTROLS,$(FEATURE_DEFINES)), ENABLE_IMAGE_CONTROLS) 893 886 USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/html/shadow/mac/imageControlsMac.css … … 906 899 907 900 USER_AGENT_SCRIPTS = 908 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 ifeq ($(WTF_PLATFORM_IOS), 1)912 USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/mediacontrols/mediaControlsiOS.js913 endif914 endif915 901 916 902 ifeq ($(OS),MACOS) -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r166657 r166669 1153 1153 31078CC91880AAC9008099DC /* JSOESTextureHalfFloatLinear.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31078CC51880AAAA008099DC /* JSOESTextureHalfFloatLinear.cpp */; }; 1154 1154 31078CCA1880AACE008099DC /* JSOESTextureHalfFloatLinear.h in Headers */ = {isa = PBXBuildFile; fileRef = 31078CC61880AAAA008099DC /* JSOESTextureHalfFloatLinear.h */; }; 1155 311C08BD18EB7CAF00B65615 /* mediaControlsApple.css in Resources */ = {isa = PBXBuildFile; fileRef = CDC1DD4117CC2C48008CB55D /* mediaControlsApple.css */; }; 1156 311C08BE18EB7CAF00B65615 /* mediaControlsApple.js in Resources */ = {isa = PBXBuildFile; fileRef = CDE6560E17CA6E7600526BA7 /* mediaControlsApple.js */; }; 1157 311C08BF18EB7CAF00B65615 /* mediaControlsiOS.css in Resources */ = {isa = PBXBuildFile; fileRef = CDAAF45D1869094E003C1717 /* mediaControlsiOS.css */; }; 1158 311C08C018EB7CAF00B65615 /* mediaControlsiOS.js in Resources */ = {isa = PBXBuildFile; fileRef = CD32A189184EB46A0029B1BB /* mediaControlsiOS.js */; }; 1155 1159 31288E720E3005D6003619AE /* WebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */; }; 1156 1160 31288E730E3005D6003619AE /* WebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */; }; … … 26426 26430 85136C9C0AED665900F90A3D /* linkCursor.png in Resources */, 26427 26431 BCAD180A131C7A0D00990406 /* Localizable.strings in Resources */, 26432 311C08BD18EB7CAF00B65615 /* mediaControlsApple.css in Resources */, 26433 311C08BE18EB7CAF00B65615 /* mediaControlsApple.js in Resources */, 26434 311C08BF18EB7CAF00B65615 /* mediaControlsiOS.css in Resources */, 26435 311C08C018EB7CAF00B65615 /* mediaControlsiOS.js in Resources */, 26428 26436 93153BE214195A5700FCF5BE /* missingImage.png in Resources */, 26429 26437 93153BDA14181F7A00FCF5BE /* missingImage@2x.png in Resources */, -
trunk/Source/WebCore/rendering/RenderThemeIOS.h
r162139 r166669 117 117 const Color& shadowColor() const; 118 118 FloatRect addRoundedBorderClip(RenderObject* box, GraphicsContext*, const IntRect&); 119 120 String m_mediaControlsScript; 121 String m_mediaControlsStyleSheet; 122 bool m_mediaControlsScriptLoaded; 123 bool m_mediaControlsStyleSheetLoaded; 119 124 }; 120 125 -
trunk/Source/WebCore/rendering/RenderThemeIOS.mm
r165057 r166669 77 77 #define UIContentSizeCategoryDidChangeNotification getUIContentSizeCategoryDidChangeNotification() 78 78 79 @interface WebCoreRenderThemeBundle : NSObject 80 @end 81 82 @implementation WebCoreRenderThemeBundle 83 @end 84 79 85 namespace WebCore { 80 86 … … 277 283 278 284 RenderThemeIOS::RenderThemeIOS() 285 : m_mediaControlsScriptLoaded(false) 286 , m_mediaControlsStyleSheetLoaded(false) 279 287 { 280 288 CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, contentSizeCategoryDidChange, UIContentSizeCategoryDidChangeNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately); … … 1198 1206 { 1199 1207 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 1200 return String(mediaControlsiOSUserAgentStyleSheet, sizeof(mediaControlsiOSUserAgentStyleSheet)); 1208 if (!m_mediaControlsStyleSheetLoaded) { 1209 m_mediaControlsStyleSheet = [NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]; 1210 m_mediaControlsStyleSheetLoaded = true; 1211 } 1212 return m_mediaControlsStyleSheet; 1201 1213 #else 1202 1214 return emptyString(); … … 1207 1219 { 1208 1220 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 1209 StringBuilder scriptBuilder; 1210 scriptBuilder.append(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript)); 1211 scriptBuilder.append(mediaControlsiOSJavaScript, sizeof(mediaControlsiOSJavaScript)); 1212 return scriptBuilder.toString(); 1221 if (!m_mediaControlsScriptLoaded) { 1222 StringBuilder scriptBuilder; 1223 scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]); 1224 scriptBuilder.append([NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsiOS" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]); 1225 m_mediaControlsScript = scriptBuilder.toString(); 1226 m_mediaControlsScriptLoaded = true; 1227 } 1228 return m_mediaControlsScript; 1213 1229 #else 1214 1230 return emptyString(); -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r165676 r166669 249 249 250 250 RetainPtr<WebCoreRenderThemeNotificationObserver> m_notificationObserver; 251 252 String m_mediaControlsScript; 253 String m_mediaControlsStyleSheet; 254 bool m_mediaControlsScriptLoaded; 255 bool m_mediaControlsStyleSheetLoaded; 251 256 }; 252 257 -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r166422 r166669 166 166 @end 167 167 168 @interface WebCoreRenderThemeBundle : NSObject 169 @end 170 171 @implementation WebCoreRenderThemeBundle 172 @end 173 168 174 namespace WebCore { 169 175 … … 199 205 , m_isSliderThumbVerticalPressed(false) 200 206 , m_notificationObserver(adoptNS([[WebCoreRenderThemeNotificationObserver alloc] initWithTheme:this])) 207 , m_mediaControlsScriptLoaded(false) 208 , m_mediaControlsStyleSheetLoaded(false) 201 209 { 202 210 [[NSNotificationCenter defaultCenter] addObserver:m_notificationObserver.get() … … 221 229 { 222 230 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 223 return String(mediaControlsAppleUserAgentStyleSheet, sizeof(mediaControlsAppleUserAgentStyleSheet)); 231 if (!m_mediaControlsStyleSheetLoaded) { 232 m_mediaControlsStyleSheet = [NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"css"] encoding:NSUTF8StringEncoding error:nil]; 233 m_mediaControlsStyleSheetLoaded = true; 234 } 235 return m_mediaControlsStyleSheet; 224 236 #else 225 237 return emptyString(); … … 230 242 { 231 243 #if ENABLE(MEDIA_CONTROLS_SCRIPT) 232 return String(mediaControlsAppleJavaScript, sizeof(mediaControlsAppleJavaScript)); 244 if (!m_mediaControlsScriptLoaded) { 245 m_mediaControlsScript = [NSString stringWithContentsOfFile:[[NSBundle bundleForClass:[WebCoreRenderThemeBundle class]] pathForResource:@"mediaControlsApple" ofType:@"js"] encoding:NSUTF8StringEncoding error:nil]; 246 m_mediaControlsScriptLoaded = true; 247 } 248 return m_mediaControlsScript; 233 249 #else 234 250 return emptyString(); -
trunk/Tools/ChangeLog
r166661 r166669 1 2014-04-01 Dean Jackson <dino@apple.com> 2 3 Load Media Controls js/css from bundle 4 https://bugs.webkit.org/show_bug.cgi?id=131086 5 6 Reviewed by Eric Carlson. 7 8 We're now putting CSS files into the bundle, so remove the test for them. 9 10 * Scripts/check-for-inappropriate-files-in-framework: 11 1 12 2014-04-02 Martin Hock <mhock@apple.com> 2 13 -
trunk/Tools/Scripts/check-for-inappropriate-files-in-framework
r80080 r166669 28 28 is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES" 29 29 30 $INAPPROPRIATE_FILES = { "WebCore" => { "Resources" => ["*. css", "*.in", "*.idl", "*.h"] },30 $INAPPROPRIATE_FILES = { "WebCore" => { "Resources" => ["*.in", "*.idl", "*.h"] }, 31 31 "WebKit2" => { "Resources" => ["*.in", "*.h"] }, 32 32 }
Note: See TracChangeset
for help on using the changeset viewer.