Bug 750910: Add warning about removal of 'java' and 'Packages' DOM objects. r=smaug r=ahecht a=akeybl
authorJosh Aas <joshmoz@gmail.com>
Thu, 10 May 2012 02:13:01 -0400
changeset 94198 0bd74da75dc9452fdbf03628e7ab1ca8855603c6
parent 94197 7ffd2eac063d4c600a85b8c337e48c64af16e345
child 94199 56cc5a3c431612fa98f0550f02a9f34b566e1d9b
push idunknown
push userunknown
push dateunknown
reviewerssmaug, ahecht, akeybl
bugs750910
milestone14.0a2
Bug 750910: Add warning about removal of 'java' and 'Packages' DOM objects. r=smaug r=ahecht a=akeybl
content/base/public/nsDeprecatedOperationList.h
dom/base/nsDOMClassInfo.cpp
dom/locales/en-US/chrome/dom/dom.properties
--- a/content/base/public/nsDeprecatedOperationList.h
+++ b/content/base/public/nsDeprecatedOperationList.h
@@ -72,8 +72,9 @@ DEPRECATED_OPERATION(IsEqualNode)
 DEPRECATED_OPERATION(TextContent)
 DEPRECATED_OPERATION(EnablePrivilege)
 DEPRECATED_OPERATION(Position)
 DEPRECATED_OPERATION(TotalSize)
 DEPRECATED_OPERATION(InputEncoding)
 DEPRECATED_OPERATION(MozBeforePaint)
 DEPRECATED_OPERATION(MozBlobBuilder)
 DEPRECATED_OPERATION(DOMExceptionCode)
+DEPRECATED_OPERATION(JavaPackages)
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -7267,16 +7267,22 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
           return NS_ERROR_UNEXPECTED;
         }
       }
 
       return NS_OK;
     }
 
     if (id == sJava_id || id == sPackages_id) {
+      nsIDOMDocument* domDoc = win->GetExtantDocument();
+      if (domDoc) {
+        nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
+        doc->WarnOnceAbout(nsIDocument::eJavaPackages);
+      }
+
       static bool isResolvingJavaProperties;
 
       if (!isResolvingJavaProperties) {
         isResolvingJavaProperties = true;
 
         // Tell the window to initialize the Java properties. The
         // window needs to do this as we need to do this only once,
         // and detecting that reliably from here is hard.
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -147,8 +147,10 @@ MediaLoadUnsupportedType=Specified "type
 # LOCALIZATION NOTE: %1$S is the MIME type HTTP header being sent by the web server, %2$S is the URL of the media resource which failed to load.
 MediaLoadUnsupportedMimeType=HTTP "Content-Type" of "%1$S" is not supported. Load of media resource %2$S failed.
 # LOCALIZATION NOTE: %S is the URL of the media resource which failed to load because of error in decoding.
 MediaLoadDecodeError=Media resource %S could not be decoded.
 # LOCALIZATION NOTE: Do not translate "MozBlobBuilder" and "Blob"
 MozBlobBuilderWarning=Use of MozBlobBuilder is deprecated. Use Blob constructor instead.
 # LOCALIZATION NOTE: Do not translate "DOMException", "code" and "name"
 DOMExceptionCodeWarning=Use of DOMException's code attribute is deprecated. Use name instead.
+# LOCALIZATION NOTE: Do not translate "java" or "Packages".
+JavaPackagesWarning=Use of the 'java' and 'Packages' DOM objects to access Java functionality is deprecated. Support will be removed soon.