Bug 1489047 - Remove C++ support for, and testing of, the XPIDL DOMString type. r=nika
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 06 Sep 2018 18:03:18 +1000
changeset 439132 079e9287971001d839030ce8e60bb175018da76c
parent 439131 31941d904a7c3df53ed5b4c9ecdc40025d865dfb
child 439133 77dfc06a7c782f3ffb14ddf139d885ab2dab43d6
push id34757
push userrgurzau@mozilla.com
push dateTue, 02 Oct 2018 16:04:13 +0000
treeherdermozilla-central@17c314f6930d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1489047
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1489047 - Remove C++ support for, and testing of, the XPIDL DOMString type. r=nika
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCVariant.cpp
js/xpconnect/src/xpcprivate.h
js/xpconnect/src/xpcpublic.h
js/xpconnect/tests/components/js/xpctest_params.js
js/xpconnect/tests/components/native/xpctest_params.cpp
js/xpconnect/tests/idl/xpctest_params.idl
js/xpconnect/tests/unit/test_params.js
storage/Variant_inl.h
storage/mozStoragePrivateHelpers.cpp
storage/variantToSQLiteT_impl.h
toolkit/components/places/nsAnnotationService.cpp
toolkit/components/telemetry/core/TelemetryScalar.cpp
xpcom/ds/nsIVariant.idl
xpcom/ds/nsVariant.cpp
xpcom/ds/nsVariant.h
xpcom/reflect/xptinfo/xptinfo.h
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
@@ -773,17 +773,16 @@ txMozillaXSLTProcessor::SetParameter(con
         case nsIDataType::VTYPE_DOUBLE:
 
         // Boolean
         case nsIDataType::VTYPE_BOOL:
 
         // String
         case nsIDataType::VTYPE_CHAR:
         case nsIDataType::VTYPE_WCHAR:
-        case nsIDataType::VTYPE_DOMSTRING:
         case nsIDataType::VTYPE_CHAR_STR:
         case nsIDataType::VTYPE_WCHAR_STR:
         case nsIDataType::VTYPE_STRING_SIZE_IS:
         case nsIDataType::VTYPE_WSTRING_SIZE_IS:
         case nsIDataType::VTYPE_UTF8STRING:
         case nsIDataType::VTYPE_CSTRING:
         case nsIDataType::VTYPE_ASTRING:
         {
@@ -1352,17 +1351,16 @@ txVariable::Convert(nsIVariant *aValue, 
             NS_ADDREF(*aResult);
 
             return NS_OK;
         }
 
         // String
         case nsIDataType::VTYPE_CHAR:
         case nsIDataType::VTYPE_WCHAR:
-        case nsIDataType::VTYPE_DOMSTRING:
         case nsIDataType::VTYPE_CHAR_STR:
         case nsIDataType::VTYPE_WCHAR_STR:
         case nsIDataType::VTYPE_STRING_SIZE_IS:
         case nsIDataType::VTYPE_WSTRING_SIZE_IS:
         case nsIDataType::VTYPE_UTF8STRING:
         case nsIDataType::VTYPE_CSTRING:
         case nsIDataType::VTYPE_ASTRING:
         {
--- a/js/xpconnect/src/XPCConvert.cpp
+++ b/js/xpconnect/src/XPCConvert.cpp
@@ -200,19 +200,16 @@ XPCConvert::NativeData2JS(MutableHandleV
             return false;
         }
 
         d.setObject(*obj);
         return true;
     }
 
     case nsXPTType::T_ASTRING:
-        // Fall through to T_DOMSTRING case
-
-    case nsXPTType::T_DOMSTRING:
     {
         const nsAString* p = static_cast<const nsAString*>(s);
         if (!p || p->IsVoid()) {
             d.setNull();
             return true;
         }
 
         nsStringBuffer* buf;
@@ -603,47 +600,34 @@ XPCConvert::JSData2Native(JSContext* cx,
             return false;
         }
         *((const nsID**)d) = pid->Clone();
         return true;
     }
 
     case nsXPTType::T_ASTRING:
     {
-        if (s.isUndefined()) {
-            ((nsAString*)d)->SetIsVoid(true);
-            return true;
-        }
-        MOZ_FALLTHROUGH;
-    }
-    case nsXPTType::T_DOMSTRING:
-    {
         nsAString* ws = (nsAString*)d;
-        if (s.isNull()) {
+        if (s.isUndefined() || s.isNull()) {
             ws->SetIsVoid(true);
             return true;
         }
         size_t length = 0;
-        JSString* str = nullptr;
-        if (!s.isUndefined()) {
-            str = ToString(cx, s);
-            if (!str) {
-                return false;
-            }
-
-            length = JS_GetStringLength(str);
-            if (!length) {
-                ws->Truncate();
-                return true;
-            }
+        JSString* str = ToString(cx, s);
+        if (!str) {
+            return false;
         }
 
-        if (!str) {
-            ws->AssignLiteral(u"undefined");
-        } else if (XPCStringConvert::IsDOMString(str)) {
+        length = JS_GetStringLength(str);
+        if (!length) {
+            ws->Truncate();
+            return true;
+        }
+
+        if (XPCStringConvert::IsDOMString(str)) {
             // The characters represent an existing nsStringBuffer that
             // was shared by XPCStringConvert::ReadableToJSVal.
             const char16_t* chars = JS_GetTwoByteExternalStringChars(str);
             if (chars[length] == '\0') {
                 // Safe to share the buffer.
                 nsStringBuffer::FromData((void*)chars)->ToString(length, *ws);
             } else {
                 // We have to copy to ensure null-termination.
@@ -1680,17 +1664,16 @@ xpc::InnerCleanupValue(const nsXPTType& 
             break;
 
         case nsXPTType::T_INTERFACE:
         case nsXPTType::T_INTERFACE_IS:
             (*(nsISupports**)aValue)->Release();
             break;
 
         // String types
-        case nsXPTType::T_DOMSTRING:
         case nsXPTType::T_ASTRING:
             ((nsAString*)aValue)->Truncate();
             break;
         case nsXPTType::T_UTF8STRING:
         case nsXPTType::T_CSTRING:
             ((nsACString*)aValue)->Truncate();
             break;
 
--- a/js/xpconnect/src/XPCVariant.cpp
+++ b/js/xpconnect/src/XPCVariant.cpp
@@ -493,24 +493,16 @@ XPCVariant::VariantDataToJS(nsIVariant* 
         case nsIDataType::VTYPE_ASTRING:
         {
             nsAutoString astring;
             if (NS_FAILED(variant->GetAsAString(astring))) {
                 return false;
             }
             return XPCConvert::NativeData2JS(pJSVal, &astring, { TD_ASTRING }, &iid, 0, pErr);
         }
-        case nsIDataType::VTYPE_DOMSTRING:
-        {
-            nsAutoString astring;
-            if (NS_FAILED(variant->GetAsAString(astring))) {
-                return false;
-            }
-            return XPCConvert::NativeData2JS(pJSVal, &astring, { TD_DOMSTRING }, &iid, 0, pErr);
-        }
         case nsIDataType::VTYPE_CSTRING:
         {
             nsAutoCString cString;
             if (NS_FAILED(variant->GetAsACString(cString))) {
                 return false;
             }
             return XPCConvert::NativeData2JS(pJSVal, &cString, { TD_CSTRING }, &iid, 0, pErr);
         }
@@ -666,17 +658,16 @@ XPCVariant::VariantDataToJS(nsIVariant* 
                 case nsIDataType::VTYPE_INTERFACE_IS:
                     pid = &du.u.array.mArrayInterfaceID;
                     xptIndex = nsXPTType::Idx::INTERFACE_IS_TYPE;
                     break;
 
                 // The rest are illegal.
                 case nsIDataType::VTYPE_VOID:
                 case nsIDataType::VTYPE_ASTRING:
-                case nsIDataType::VTYPE_DOMSTRING:
                 case nsIDataType::VTYPE_CSTRING:
                 case nsIDataType::VTYPE_UTF8STRING:
                 case nsIDataType::VTYPE_WSTRING_SIZE_IS:
                 case nsIDataType::VTYPE_STRING_SIZE_IS:
                 case nsIDataType::VTYPE_ARRAY:
                 case nsIDataType::VTYPE_EMPTY_ARRAY:
                 case nsIDataType::VTYPE_EMPTY:
                 default:
@@ -794,23 +785,16 @@ NS_IMETHODIMP_(nsresult) XPCVariant::Get
     return mData.ConvertToID(retval);
 }
 
 NS_IMETHODIMP XPCVariant::GetAsAString(nsAString & _retval)
 {
     return mData.ConvertToAString(_retval);
 }
 
-NS_IMETHODIMP XPCVariant::GetAsDOMString(nsAString & _retval)
-{
-    // A DOMString maps to an AString internally, so we can re-use
-    // ConvertToAString here.
-    return mData.ConvertToAString(_retval);
-}
-
 NS_IMETHODIMP XPCVariant::GetAsACString(nsACString & _retval)
 {
     return mData.ConvertToACString(_retval);
 }
 
 NS_IMETHODIMP XPCVariant::GetAsAUTF8String(nsAUTF8String & _retval)
 {
     return mData.ConvertToAUTF8String(_retval);
--- a/js/xpconnect/src/xpcprivate.h
+++ b/js/xpconnect/src/xpcprivate.h
@@ -3207,17 +3207,17 @@ nsresult HasInstance(JSContext* cx, JS::
 nsIPrincipal* GetObjectPrincipal(JSObject* obj);
 
 // Attempt to clean up the passed in value pointer. The pointer `value` must be
 // a pointer to a value described by the type `nsXPTType`.
 //
 // This method expects a value of the following types:
 //   TD_PNSIID
 //     value : nsID* (free)
-//   TD_DOMSTRING, TD_ASTRING, TD_CSTRING, TD_UTF8STRING
+//   TD_ASTRING, TD_CSTRING, TD_UTF8STRING
 //     value : ns[C]String* (truncate)
 //   TD_PSTRING, TD_PWSTRING, TD_PSTRING_SIZE_IS, TD_PWSTRING_SIZE_IS
 //     value : char[16_t]** (free)
 //   TD_INTERFACE_TYPE, TD_INTERFACE_IS_TYPE
 //     value : nsISupports** (release)
 //   TD_LEGACY_ARRAY (NOTE: aArrayLen should be passed)
 //     value : void** (destroy elements & free)
 //   TD_ARRAY
--- a/js/xpconnect/src/xpcpublic.h
+++ b/js/xpconnect/src/xpcpublic.h
@@ -348,17 +348,17 @@ bool Base64Decode(JSContext* cx, JS::Han
 /**
  * Convert an nsString to jsval, returning true on success.
  * Note, the ownership of the string buffer may be moved from str to rval.
  * If that happens, str will point to an empty string after this call.
  */
 bool NonVoidStringToJsval(JSContext* cx, nsAString& str, JS::MutableHandleValue rval);
 inline bool StringToJsval(JSContext* cx, nsAString& str, JS::MutableHandleValue rval)
 {
-    // From the T_DOMSTRING case in XPCConvert::NativeData2JS.
+    // From the T_ASTRING case in XPCConvert::NativeData2JS.
     if (str.IsVoid()) {
         rval.setNull();
         return true;
     }
     return NonVoidStringToJsval(cx, str, rval);
 }
 
 inline bool
--- a/js/xpconnect/tests/components/js/xpctest_params.js
+++ b/js/xpconnect/tests/components/js/xpctest_params.js
@@ -54,17 +54,16 @@ TestParams.prototype = {
   testUnsignedLong: f,
   testUnsignedLongLong: f,
   testFloat: f,
   testDouble: f,
   testChar: f,
   testString: f,
   testWchar: f,
   testWstring: f,
-  testDOMString: f,
   testAString: f,
   testAUTF8String: f,
   testACString: f,
   testJsval: f,
   testShortSequence: f,
   testDoubleSequence: f,
   testAStringSequence: f,
   testACStringSequence: f,
--- a/js/xpconnect/tests/components/native/xpctest_params.cpp
+++ b/js/xpconnect/tests/components/native/xpctest_params.cpp
@@ -157,22 +157,16 @@ NS_IMETHODIMP nsXPCTestParams::TestWstri
 
     // XPCOM ownership rules dictate that overwritten inout params must be callee-freed.
     // See https://developer.mozilla.org/en/XPIDL
     free((void*)bprime.get());
 
     return NS_OK;
 }
 
-NS_IMETHODIMP nsXPCTestParams::TestDOMString(const nsAString & a, nsAString & b, nsAString & _retval)
-{
-    STRING_METHOD_IMPL;
-}
-
-
 NS_IMETHODIMP nsXPCTestParams::TestAString(const nsAString & a, nsAString & b, nsAString & _retval)
 {
     STRING_METHOD_IMPL;
 }
 
 NS_IMETHODIMP nsXPCTestParams::TestAUTF8String(const nsACString & a, nsACString & b, nsACString & _retval)
 {
     STRING_METHOD_IMPL;
--- a/js/xpconnect/tests/idl/xpctest_params.idl
+++ b/js/xpconnect/tests/idl/xpctest_params.idl
@@ -28,17 +28,16 @@ interface nsIXPCTestParams : nsISupports
   unsigned long         testUnsignedLong(in unsigned long a, inout unsigned long b);
   unsigned long long    testUnsignedLongLong(in unsigned long long a, inout unsigned long long b);
   float                 testFloat(in float a, inout float b);
   double                testDouble(in double a, inout float b);
   char                  testChar(in char a, inout char b);
   string                testString(in string a, inout string b);
   wchar                 testWchar(in wchar a, inout wchar b);
   wstring               testWstring(in wstring a, inout wstring b);
-  DOMString             testDOMString(in DOMString a, inout DOMString b);
   AString               testAString(in AString a, inout AString b);
   AUTF8String           testAUTF8String(in AUTF8String a, inout AUTF8String b);
   ACString              testACString(in ACString a, inout ACString b);
   jsval                 testJsval(in jsval a, inout jsval b);
 
   // Test various forms of the Array<T> type.
   Array<short>          testShortSequence(in Array<short> a, inout Array<short> b);
   Array<double>         testDoubleSequence(in Array<double> a, inout Array<double> b);
--- a/js/xpconnect/tests/unit/test_params.js
+++ b/js/xpconnect/tests/unit/test_params.js
@@ -119,17 +119,16 @@ function test_component(contractid) {
   doTest("testUnsignedLong", 0, 4000000000);
   doTest("testUnsignedLongLong", 215435, 3453492580348535809);
   doTest("testFloat", 4.9, -11.2, fuzzComparator);
   doTest("testDouble", -80.5, 15000.2, fuzzComparator);
   doTest("testChar", "a", "2");
   doTest("testString", "someString", "another string");
   doTest("testWstring", "Why wasnt this", "turned on before? ಠ_ಠ");
   doTest("testWchar", "z", "ア");
-  doTestWorkaround("testDOMString", "Beware: ☠ s");
   doTestWorkaround("testAString", "Frosty the ☃ ;-)");
   doTestWorkaround("testAUTF8String", "We deliver 〠!");
   doTestWorkaround("testACString", "Just a regular C string.");
   doTest("testJsval", {aprop: 12, bprop: "str"}, 4.22);
 
   // Test out dipper parameters, since they're special and we can't really test
   // inouts.
   let outAString = {};
--- a/storage/Variant_inl.h
+++ b/storage/Variant_inl.h
@@ -156,23 +156,16 @@ inline
 NS_IMETHODIMP
 Variant_base::GetAsID(nsID *)
 {
   return NS_ERROR_CANNOT_CONVERT_DATA;
 }
 
 inline
 NS_IMETHODIMP
-Variant_base::GetAsDOMString(nsAString &)
-{
-  return NS_ERROR_CANNOT_CONVERT_DATA;
-}
-
-inline
-NS_IMETHODIMP
 Variant_base::GetAsString(char **)
 {
   return NS_ERROR_CANNOT_CONVERT_DATA;
 }
 
 inline
 NS_IMETHODIMP
 Variant_base::GetAsWString(char16_t **)
--- a/storage/mozStoragePrivateHelpers.cpp
+++ b/storage/mozStoragePrivateHelpers.cpp
@@ -203,17 +203,16 @@ convertVariantToStorageVariant(nsIVarian
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING: {
       nsCString v;
       rv = aVariant->GetAsAUTF8String(v);
       NS_ENSURE_SUCCESS(rv, nullptr);
       return new UTF8TextVariant(v);
     }
     case nsIDataType::VTYPE_WCHAR:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     case nsIDataType::VTYPE_ASTRING: {
       nsString v;
       rv = aVariant->GetAsAString(v);
       NS_ENSURE_SUCCESS(rv, nullptr);
       return new TextVariant(v);
     }
--- a/storage/variantToSQLiteT_impl.h
+++ b/storage/variantToSQLiteT_impl.h
@@ -70,17 +70,16 @@ variantToSQLiteT(T aObj,
       // GetAsAUTF8String should never perform conversion when coming from
       // 8-bit string types, and thus can accept strings with arbitrary encoding
       // (including UTF8 and ASCII).
       nsresult rv = aValue->GetAsAUTF8String(value);
       NS_ENSURE_SUCCESS(rv, SQLITE_MISMATCH);
       return sqlite3_T_text(aObj, value);
     }
     case nsIDataType::VTYPE_WCHAR:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     case nsIDataType::VTYPE_ASTRING:
     {
       nsAutoString value;
       // GetAsAString does proper conversion to UCS2 from all string-like types.
       // It can be used universally without problems (unless someone implements
       // their own variant, but that's their problem).
--- a/toolkit/components/places/nsAnnotationService.cpp
+++ b/toolkit/components/places/nsAnnotationService.cpp
@@ -187,17 +187,16 @@ nsAnnotationService::SetItemAnnotation(i
       NS_ENSURE_SUCCESS(rv, rv);
       rv = SetAnnotationDoubleInternal(aItemId, &bookmark,
                                        aName, valueDouble, aFlags, aExpiration);
       NS_ENSURE_SUCCESS(rv, rv);
       break;
     }
     case nsIDataType::VTYPE_CHAR:
     case nsIDataType::VTYPE_WCHAR:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_CHAR_STR:
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING:
     case nsIDataType::VTYPE_ASTRING: {
       nsAutoString stringValue;
--- a/toolkit/components/telemetry/core/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/core/TelemetryScalar.cpp
@@ -527,17 +527,16 @@ private:
 ScalarResult
 ScalarString::SetValue(nsIVariant* aValue)
 {
   // Check that we got the correct data type.
   uint16_t type;
   aValue->GetDataType(&type);
   if (type != nsIDataType::VTYPE_CHAR &&
       type != nsIDataType::VTYPE_WCHAR &&
-      type != nsIDataType::VTYPE_DOMSTRING &&
       type != nsIDataType::VTYPE_CHAR_STR &&
       type != nsIDataType::VTYPE_WCHAR_STR &&
       type != nsIDataType::VTYPE_STRING_SIZE_IS &&
       type != nsIDataType::VTYPE_WSTRING_SIZE_IS &&
       type != nsIDataType::VTYPE_UTF8STRING &&
       type != nsIDataType::VTYPE_CSTRING &&
       type != nsIDataType::VTYPE_ASTRING) {
     return ScalarResult::InvalidType;
--- a/xpcom/ds/nsIVariant.idl
+++ b/xpcom/ds/nsIVariant.idl
@@ -29,17 +29,16 @@ struct nsIDataType
         VTYPE_UINT64            = TD_UINT64           ,
         VTYPE_FLOAT             = TD_FLOAT            ,
         VTYPE_DOUBLE            = TD_DOUBLE           ,
         VTYPE_BOOL              = TD_BOOL             ,
         VTYPE_CHAR              = TD_CHAR             ,
         VTYPE_WCHAR             = TD_WCHAR            ,
         VTYPE_VOID              = TD_VOID             ,
         VTYPE_ID                = TD_PNSIID           ,
-        VTYPE_DOMSTRING         = TD_DOMSTRING        ,
         VTYPE_CHAR_STR          = TD_PSTRING          ,
         VTYPE_WCHAR_STR         = TD_PWSTRING         ,
         VTYPE_INTERFACE         = TD_INTERFACE_TYPE   ,
         VTYPE_INTERFACE_IS      = TD_INTERFACE_IS_TYPE,
         VTYPE_ARRAY             = TD_LEGACY_ARRAY     ,
         VTYPE_STRING_SIZE_IS    = TD_PSTRING_SIZE_IS  ,
         VTYPE_WSTRING_SIZE_IS   = TD_PWSTRING_SIZE_IS ,
         VTYPE_UTF8STRING        = TD_UTF8STRING       ,
@@ -77,17 +76,16 @@ interface nsIVariant : nsISupports
     [noscript] uint64_t     getAsUint64();
     [noscript] float        getAsFloat();
     [noscript] double       getAsDouble();
     [noscript] boolean      getAsBool();
     [noscript] char         getAsChar();
     [noscript] wchar        getAsWChar();
     [notxpcom] nsresult     getAsID(out nsID retval);
     [noscript] AString      getAsAString();
-    [noscript] DOMString    getAsDOMString();
     [noscript] ACString     getAsACString();
     [noscript] AUTF8String  getAsAUTF8String();
     [noscript] string       getAsString();
     [noscript] wstring      getAsWString();
     [noscript] nsISupports  getAsISupports();
     [noscript] jsval        getAsJSVal();
 
     [noscript] void getAsInterface(out nsIIDPtr iid, 
@@ -128,17 +126,16 @@ interface nsIWritableVariant : nsIVarian
     void setAsUint64(in uint64_t aValue);
     void setAsFloat(in float aValue);
     void setAsDouble(in double aValue);
     void setAsBool(in boolean aValue);
     void setAsChar(in char aValue);
     void setAsWChar(in wchar aValue);
     void setAsID(in nsIDRef aValue);
     void setAsAString(in AString aValue);
-    void setAsDOMString(in DOMString aValue);
     void setAsACString(in ACString aValue);
     void setAsAUTF8String(in AUTF8String aValue);
     void setAsString(in string aValue);
     void setAsWString(in wstring aValue);
     void setAsISupports(in nsISupports aValue);
 
     void setAsInterface(in nsIIDRef iid, 
                         [iid_is(iid)] in nsQIResult iface);
--- a/xpcom/ds/nsVariant.cpp
+++ b/xpcom/ds/nsVariant.cpp
@@ -110,17 +110,16 @@ nsDiscriminatedUnion::ToManageableNumber
     case nsIDataType::VTYPE_CHAR_STR:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
       rv = String2Double(u.str.mStringValue, &aOutData->u.mDoubleValue);
       if (NS_FAILED(rv)) {
         return rv;
       }
       aOutData->mType = nsIDataType::VTYPE_DOUBLE;
       return NS_OK;
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_ASTRING:
       rv = AString2Double(*u.mAStringValue, &aOutData->u.mDoubleValue);
       if (NS_FAILED(rv)) {
         return rv;
       }
       aOutData->mType = nsIDataType::VTYPE_DOUBLE;
       return NS_OK;
     case nsIDataType::VTYPE_UTF8STRING:
@@ -214,17 +213,16 @@ nsDiscriminatedUnion::FreeArray()
     CASE__FREE_ARRAY_PTR(VTYPE_CHAR_STR, char)
     CASE__FREE_ARRAY_PTR(VTYPE_WCHAR_STR, char16_t)
     CASE__FREE_ARRAY_IFACE(VTYPE_INTERFACE, nsISupports)
     CASE__FREE_ARRAY_IFACE(VTYPE_INTERFACE_IS, nsISupports)
 
     // The rest are illegal.
     case nsIDataType::VTYPE_VOID:
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
     case nsIDataType::VTYPE_ARRAY:
     case nsIDataType::VTYPE_EMPTY_ARRAY:
     case nsIDataType::VTYPE_EMPTY:
     default:
@@ -305,17 +303,16 @@ CloneArray(uint16_t aInType, const nsIID
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_INTERFACE:
     case nsIDataType::VTYPE_INTERFACE_IS:
       elementSize = sizeof(void*);
       break;
 
     // The rest are illegal.
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     case nsIDataType::VTYPE_VOID:
     case nsIDataType::VTYPE_ARRAY:
     case nsIDataType::VTYPE_EMPTY_ARRAY:
     case nsIDataType::VTYPE_EMPTY:
@@ -410,17 +407,16 @@ CloneArray(uint16_t aInType, const nsIID
     }
 
     // The rest are illegal.
     case nsIDataType::VTYPE_VOID:
     case nsIDataType::VTYPE_ARRAY:
     case nsIDataType::VTYPE_EMPTY_ARRAY:
     case nsIDataType::VTYPE_EMPTY:
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     default:
       NS_ERROR("bad type in array!");
       return NS_ERROR_CANNOT_CONVERT_DATA;
   }
@@ -655,17 +651,16 @@ nsDiscriminatedUnion::String2ID(nsID* aP
     case nsIDataType::VTYPE_CHAR_STR:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
       return aPid->Parse(u.str.mStringValue);
     case nsIDataType::VTYPE_CSTRING:
       return aPid->Parse(PromiseFlatCString(*u.mCStringValue).get());
     case nsIDataType::VTYPE_UTF8STRING:
       return aPid->Parse(PromiseFlatUTF8String(*u.mUTF8StringValue).get());
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       pString = u.mAStringValue;
       break;
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
       tempString.Assign(u.wstr.mWStringValue);
       pString = &tempString;
       break;
     default:
@@ -693,17 +688,16 @@ nsDiscriminatedUnion::ConvertToID(nsID* 
       return NS_OK;
     case nsIDataType::VTYPE_INTERFACE:
       *aResult = NS_GET_IID(nsISupports);
       return NS_OK;
     case nsIDataType::VTYPE_INTERFACE_IS:
       *aResult = u.iface.mInterfaceID;
       return NS_OK;
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING:
     case nsIDataType::VTYPE_CHAR_STR:
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
       if (!String2ID(&id)) {
         return NS_ERROR_CANNOT_CONVERT_DATA;
@@ -720,17 +714,16 @@ nsDiscriminatedUnion::ConvertToID(nsID* 
 nsresult
 nsDiscriminatedUnion::ToString(nsACString& aOutString) const
 {
   mozilla::SmprintfPointer pptr;
 
   switch (mType) {
     // all the stuff we don't handle...
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_UTF8STRING:
     case nsIDataType::VTYPE_CSTRING:
     case nsIDataType::VTYPE_CHAR_STR:
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_STRING_SIZE_IS:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
     case nsIDataType::VTYPE_WCHAR:
       NS_ERROR("ToString being called for a string type - screwy logic!");
@@ -811,17 +804,16 @@ nsDiscriminatedUnion::ToString(nsACStrin
   return NS_OK;
 }
 
 nsresult
 nsDiscriminatedUnion::ConvertToAString(nsAString& aResult) const
 {
   switch (mType) {
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       aResult.Assign(*u.mAStringValue);
       return NS_OK;
     case nsIDataType::VTYPE_CSTRING:
       CopyASCIItoUTF16(*u.mCStringValue, aResult);
       return NS_OK;
     case nsIDataType::VTYPE_UTF8STRING:
       CopyUTF8toUTF16(*u.mUTF8StringValue, aResult);
       return NS_OK;
@@ -854,17 +846,16 @@ nsDiscriminatedUnion::ConvertToAString(n
   }
 }
 
 nsresult
 nsDiscriminatedUnion::ConvertToACString(nsACString& aResult) const
 {
   switch (mType) {
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       LossyCopyUTF16toASCII(*u.mAStringValue, aResult);
       return NS_OK;
     case nsIDataType::VTYPE_CSTRING:
       aResult.Assign(*u.mCStringValue);
       return NS_OK;
     case nsIDataType::VTYPE_UTF8STRING:
       // XXX This is an extra copy that should be avoided
       // once Jag lands support for UTF8String and associated
@@ -897,17 +888,16 @@ nsDiscriminatedUnion::ConvertToACString(
   }
 }
 
 nsresult
 nsDiscriminatedUnion::ConvertToAUTF8String(nsAUTF8String& aResult) const
 {
   switch (mType) {
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       CopyUTF16toUTF8(*u.mAStringValue, aResult);
       return NS_OK;
     case nsIDataType::VTYPE_CSTRING:
       // XXX Extra copy, can be removed if we're sure CSTRING can
       //     only contain ASCII.
       CopyUTF16toUTF8(NS_ConvertASCIItoUTF16(*u.mCStringValue),
                       aResult);
       return NS_OK;
@@ -972,17 +962,16 @@ nsresult
 nsDiscriminatedUnion::ConvertToStringWithSize(uint32_t* aSize, char** aStr) const
 {
   nsAutoString  tempString;
   nsAutoCString tempCString;
   nsresult rv;
 
   switch (mType) {
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       *aSize = u.mAStringValue->Length();
       *aStr = ToNewCString(*u.mAStringValue);
       break;
     case nsIDataType::VTYPE_CSTRING:
       *aSize = u.mCStringValue->Length();
       *aStr = ToNewCString(*u.mCStringValue);
       break;
     case nsIDataType::VTYPE_UTF8STRING: {
@@ -1044,17 +1033,16 @@ nsresult
 nsDiscriminatedUnion::ConvertToWStringWithSize(uint32_t* aSize, char16_t** aStr) const
 {
   nsAutoString  tempString;
   nsAutoCString tempCString;
   nsresult rv;
 
   switch (mType) {
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       *aSize = u.mAStringValue->Length();
       *aStr = ToNewUnicode(*u.mAStringValue);
       break;
     case nsIDataType::VTYPE_CSTRING:
       *aSize = u.mCStringValue->Length();
       *aStr = ToNewUnicode(*u.mCStringValue);
       break;
     case nsIDataType::VTYPE_UTF8STRING: {
@@ -1241,17 +1229,16 @@ nsDiscriminatedUnion::SetFromVariant(nsI
     CASE__SET_FROM_VARIANT_TYPE(VTYPE_FLOAT,  mFloatValue,  Float)
     CASE__SET_FROM_VARIANT_TYPE(VTYPE_DOUBLE, mDoubleValue, Double)
     CASE__SET_FROM_VARIANT_TYPE(VTYPE_BOOL ,  mBoolValue,   Bool)
     CASE__SET_FROM_VARIANT_TYPE(VTYPE_CHAR,   mCharValue,   Char)
     CASE__SET_FROM_VARIANT_TYPE(VTYPE_WCHAR,  mWCharValue,  WChar)
     CASE__SET_FROM_VARIANT_TYPE(VTYPE_ID,     mIDValue,     ID)
 
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
     case nsIDataType::VTYPE_WCHAR_STR:
     case nsIDataType::VTYPE_WSTRING_SIZE_IS:
       CASE__SET_FROM_VARIANT_VTYPE_PROLOGUE(VTYPE_ASTRING);
       u.mAStringValue = new nsString();
       if (!u.mAStringValue) {
         return NS_ERROR_OUT_OF_MEMORY;
       }
       rv = aValue->GetAsAString(*u.mAStringValue);
@@ -1405,24 +1392,16 @@ void
 nsDiscriminatedUnion::SetFromAString(const nsAString& aValue)
 {
   DATA_SETTER_PROLOGUE;
   u.mAStringValue = new nsString(aValue);
   DATA_SETTER_EPILOGUE(VTYPE_ASTRING);
 }
 
 void
-nsDiscriminatedUnion::SetFromDOMString(const nsAString& aValue)
-{
-  DATA_SETTER_PROLOGUE;
-  u.mAStringValue = new nsString(aValue);
-  DATA_SETTER_EPILOGUE(VTYPE_DOMSTRING);
-}
-
-void
 nsDiscriminatedUnion::SetFromACString(const nsACString& aValue)
 {
   DATA_SETTER_PROLOGUE;
   u.mCStringValue = new nsCString(aValue);
   DATA_SETTER_EPILOGUE(VTYPE_CSTRING);
 }
 
 void
@@ -1558,17 +1537,16 @@ nsDiscriminatedUnion::Cleanup()
     case nsIDataType::VTYPE_DOUBLE:
     case nsIDataType::VTYPE_BOOL:
     case nsIDataType::VTYPE_CHAR:
     case nsIDataType::VTYPE_WCHAR:
     case nsIDataType::VTYPE_VOID:
     case nsIDataType::VTYPE_ID:
       break;
     case nsIDataType::VTYPE_ASTRING:
-    case nsIDataType::VTYPE_DOMSTRING:
       delete u.mAStringValue;
       break;
     case nsIDataType::VTYPE_CSTRING:
       delete u.mCStringValue;
       break;
     case nsIDataType::VTYPE_UTF8STRING:
       delete u.mUTF8StringValue;
       break;
@@ -1732,24 +1710,16 @@ nsVariantBase::GetAsID(nsID* aResult)
 
 NS_IMETHODIMP
 nsVariantBase::GetAsAString(nsAString& aResult)
 {
   return mData.ConvertToAString(aResult);
 }
 
 NS_IMETHODIMP
-nsVariantBase::GetAsDOMString(nsAString& aResult)
-{
-  // A DOMString maps to an AString internally, so we can re-use
-  // ConvertToAString here.
-  return mData.ConvertToAString(aResult);
-}
-
-NS_IMETHODIMP
 nsVariantBase::GetAsACString(nsACString& aResult)
 {
   return mData.ConvertToACString(aResult);
 }
 
 NS_IMETHODIMP
 nsVariantBase::GetAsAUTF8String(nsAUTF8String& aResult)
 {
@@ -1975,27 +1945,16 @@ nsVariantBase::SetAsAString(const nsAStr
   if (!mWritable) {
     return NS_ERROR_OBJECT_IS_IMMUTABLE;
   }
   mData.SetFromAString(aValue);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsVariantBase::SetAsDOMString(const nsAString& aValue)
-{
-  if (!mWritable) {
-    return NS_ERROR_OBJECT_IS_IMMUTABLE;
-  }
-
-  mData.SetFromDOMString(aValue);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsVariantBase::SetAsACString(const nsACString& aValue)
 {
   if (!mWritable) {
     return NS_ERROR_OBJECT_IS_IMMUTABLE;
   }
   mData.SetFromACString(aValue);
   return NS_OK;
 }
--- a/xpcom/ds/nsVariant.h
+++ b/xpcom/ds/nsVariant.h
@@ -87,17 +87,16 @@ public:
   void SetFromUint64(uint64_t aValue);
   void SetFromFloat(float aValue);
   void SetFromDouble(double aValue);
   void SetFromBool(bool aValue);
   void SetFromChar(char aValue);
   void SetFromWChar(char16_t aValue);
   void SetFromID(const nsID& aValue);
   void SetFromAString(const nsAString& aValue);
-  void SetFromDOMString(const nsAString& aValue);
   void SetFromAUTF8String(const nsAUTF8String& aValue);
   void SetFromACString(const nsACString& aValue);
   MOZ_MUST_USE nsresult SetFromString(const char* aValue);
   MOZ_MUST_USE nsresult SetFromWString(const char16_t* aValue);
   void SetFromISupports(nsISupports* aValue);
   void SetFromInterface(const nsIID& aIID, nsISupports* aValue);
   MOZ_MUST_USE nsresult SetFromArray(uint16_t aType, const nsIID* aIID,
                                      uint32_t aCount, void* aValue);
--- a/xpcom/reflect/xptinfo/xptinfo.h
+++ b/xpcom/reflect/xptinfo/xptinfo.h
@@ -200,22 +200,21 @@ enum nsXPTTypeTag : uint8_t
   TD_PROMISE           = 23,
   _TD_LAST_POINTER     = TD_PROMISE,
 
   // Complex Types
   //  - Require cleanup,
   //  - Always passed indirectly,
   //  - Outparams must be initialized by caller,
   //  - Supported in xptcall due to indirection.
-  TD_DOMSTRING         = 24,
-  TD_UTF8STRING        = 25,
-  TD_CSTRING           = 26,
-  TD_ASTRING           = 27,
-  TD_JSVAL             = 28,
-  TD_ARRAY             = 29,
+  TD_UTF8STRING        = 24,
+  TD_CSTRING           = 25,
+  TD_ASTRING           = 26,
+  TD_JSVAL             = 27,
+  TD_ARRAY             = 28,
   _TD_LAST_COMPLEX     = TD_ARRAY
 };
 
 static_assert(_TD_LAST_COMPLEX < 32, "nsXPTTypeTag must fit in 5 bits");
 
 
 /*
  * A nsXPTType is a union used to identify the type of a method argument or
@@ -355,17 +354,16 @@ public:
   TD_ALIAS_(T_U64               , TD_UINT64           );
   TD_ALIAS_(T_FLOAT             , TD_FLOAT            );
   TD_ALIAS_(T_DOUBLE            , TD_DOUBLE           );
   TD_ALIAS_(T_BOOL              , TD_BOOL             );
   TD_ALIAS_(T_CHAR              , TD_CHAR             );
   TD_ALIAS_(T_WCHAR             , TD_WCHAR            );
   TD_ALIAS_(T_VOID              , TD_VOID             );
   TD_ALIAS_(T_IID               , TD_PNSIID           );
-  TD_ALIAS_(T_DOMSTRING         , TD_DOMSTRING        );
   TD_ALIAS_(T_CHAR_STR          , TD_PSTRING          );
   TD_ALIAS_(T_WCHAR_STR         , TD_PWSTRING         );
   TD_ALIAS_(T_INTERFACE         , TD_INTERFACE_TYPE   );
   TD_ALIAS_(T_INTERFACE_IS      , TD_INTERFACE_IS_TYPE);
   TD_ALIAS_(T_LEGACY_ARRAY      , TD_LEGACY_ARRAY     );
   TD_ALIAS_(T_PSTRING_SIZE_IS   , TD_PSTRING_SIZE_IS  );
   TD_ALIAS_(T_PWSTRING_SIZE_IS  , TD_PWSTRING_SIZE_IS );
   TD_ALIAS_(T_UTF8STRING        , TD_UTF8STRING       );
@@ -703,17 +701,16 @@ GetString(uint32_t aIndex)
   macro(TD_INTERFACE_IS_TYPE, nsISupports*) \
   macro(TD_LEGACY_ARRAY,      void*) \
   macro(TD_PSTRING_SIZE_IS,   char*) \
   macro(TD_PWSTRING_SIZE_IS,  wchar_t*) \
   macro(TD_DOMOBJECT,         void*) \
   macro(TD_PROMISE,           mozilla::dom::Promise*)
 
 #define XPT_FOR_EACH_COMPLEX_TYPE(macro) \
-  macro(TD_DOMSTRING,  nsString) \
   macro(TD_UTF8STRING, nsCString) \
   macro(TD_CSTRING,    nsCString) \
   macro(TD_ASTRING,    nsString) \
   macro(TD_JSVAL,      JS::Value) \
   macro(TD_ARRAY,      xpt::detail::UntypedTArray)
 
 #define XPT_FOR_EACH_TYPE(macro) \
   XPT_FOR_EACH_ARITHMETIC_TYPE(macro) \