Bug 863246 - Alias resource://gre-res to resource://gre/res and make it content-accessible draft
authorChung-Sheng Fu <cfu@mozilla.com>
Thu, 08 Jun 2017 17:52:46 +0800
changeset 607974 a34dca98a4b807fe09f3a04ae248ddec4aa0af6d
parent 607973 8af3a7338d76078cb40d2a3e1de151db32713355
child 607975 5746006e9811a14444af2902542643e8942b019a
push id68148
push userbmo:cfu@mozilla.com
push dateThu, 13 Jul 2017 02:00:12 +0000
bugs863246
milestone56.0a1
Bug 863246 - Alias resource://gre-res to resource://gre/res and make it content-accessible MozReview-Commit-ID: GPX69c5pkSt
chrome/chrome-resources.manifest
chrome/moz.build
dom/html/ImageDocument.cpp
dom/html/VideoDocument.cpp
new file mode 100644
--- /dev/null
+++ b/chrome/chrome-resources.manifest
@@ -0,0 +1,1 @@
+resource gre-res resource://gre/res/ contentaccessible=yes
--- a/chrome/moz.build
+++ b/chrome/moz.build
@@ -6,16 +6,20 @@
 
 TEST_DIRS += ['test']
 
 XPIDL_SOURCES += [
     'nsIChromeRegistry.idl',
     'nsIToolkitChromeRegistry.idl',
 ]
 
+EXTRA_COMPONENTS += [
+    'chrome-resources.manifest',
+]
+
 XPIDL_MODULE = 'chrome'
 
 EXPORTS.mozilla.chrome += [
     'RegistryMessageUtils.h',
 ]
 
 UNIFIED_SOURCES += [
     'nsChromeProtocolHandler.cpp',
--- a/dom/html/ImageDocument.cpp
+++ b/dom/html/ImageDocument.cpp
@@ -275,19 +275,19 @@ ImageDocument::SetScriptGlobalObject(nsI
       target->AddEventListener(NS_LITERAL_STRING("click"), this, false);
     }
 
     target = do_QueryInterface(aScriptGlobalObject);
     target->AddEventListener(NS_LITERAL_STRING("resize"), this, false);
     target->AddEventListener(NS_LITERAL_STRING("keypress"), this, false);
 
     if (GetReadyStateEnum() != nsIDocument::READYSTATE_COMPLETE) {
-      LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/ImageDocument.css"));
+      LinkStylesheet(NS_LITERAL_STRING("resource://gre-res/ImageDocument.css"));
       if (!nsContentUtils::IsChildOfSameType(this)) {
-        LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/TopLevelImageDocument.css"));
+        LinkStylesheet(NS_LITERAL_STRING("resource://gre-res/TopLevelImageDocument.css"));
         LinkStylesheet(NS_LITERAL_STRING("chrome://global/skin/media/TopLevelImageDocument.css"));
       }
     }
     BecomeInteractive();
   }
 }
 
 void
--- a/dom/html/VideoDocument.cpp
+++ b/dom/html/VideoDocument.cpp
@@ -69,17 +69,17 @@ VideoDocument::SetScriptGlobalObject(nsI
 {
   // Set the script global object on the superclass before doing
   // anything that might require it....
   MediaDocument::SetScriptGlobalObject(aScriptGlobalObject);
 
   if (aScriptGlobalObject) {
     if (!nsContentUtils::IsChildOfSameType(this) &&
         GetReadyStateEnum() != nsIDocument::READYSTATE_COMPLETE) {
-      LinkStylesheet(NS_LITERAL_STRING("resource://gre/res/TopLevelVideoDocument.css"));
+      LinkStylesheet(NS_LITERAL_STRING("resource://gre-res/TopLevelVideoDocument.css"));
       LinkStylesheet(NS_LITERAL_STRING("chrome://global/skin/media/TopLevelVideoDocument.css"));
       LinkScript(NS_LITERAL_STRING("chrome://global/content/TopLevelVideoDocument.js"));
     }
     BecomeInteractive();
   }
 }
 
 nsresult