Revert bug 1025183 (revs 69373df15281, dd6d84edf08e, 728a5d18bcd9, 71babe0bc84b, c60f9054acf6) for bustage. r=me
authorBen Kelly <ben@wanderview.com>
Fri, 01 Aug 2014 14:10:40 -0400
changeset 197527 aade612e6e85b081b6451b55cde1549ca022319e
parent 197526 b3cd0f02bef6c92e482e7f1fd7fcd24f7d320673
child 197528 4422fdca39685a67cbab413d41ad57c7a239ef6d
push id27249
push userryanvm@gmail.com
push dateMon, 04 Aug 2014 20:14:35 +0000
treeherdermozilla-central@7f81be7db528 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1025183
milestone34.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
Revert bug 1025183 (revs 69373df15281, dd6d84edf08e, 728a5d18bcd9, 71babe0bc84b, c60f9054acf6) for bustage. r=me
b2g/installer/Makefile.in
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/Codegen.py
dom/bindings/parser/WebIDL.py
dom/bindings/parser/tests/test_distinguishability.py
dom/bindings/parser/tests/test_scalarvaluestring.py
dom/bindings/parser/tests/test_union.py
dom/bindings/test/TestBindingHeader.h
dom/bindings/test/TestCodeGen.webidl
dom/bindings/test/TestExampleGen.webidl
dom/bindings/test/TestInterfaceJS.js
dom/bindings/test/TestJSImplGen.webidl
dom/bindings/test/mochitest.ini
dom/bindings/test/test_scalarvaluestring.html
dom/webidl/TestInterfaceJS.webidl
mobile/android/installer/Makefile.in
xpcom/string/nsUTF8Utils.h
--- a/b2g/installer/Makefile.in
+++ b/b2g/installer/Makefile.in
@@ -24,20 +24,16 @@ DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MO
 ifdef WIN32_REDIST_DIR
 ifdef MOZ_NO_DEBUG_RTL
 DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
 DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
 DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
 endif
 endif
 
-ifdef MOZ_DEBUG
-DEFINES += -DMOZ_DEBUG=1
-endif
-
 ifdef ENABLE_MARIONETTE
 DEFINES += -DENABLE_MARIONETTE=1
 endif
 
 ifdef MOZ_PKG_MANIFEST_P
 MOZ_PKG_MANIFEST = package-manifest
 endif
 
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -20,17 +20,16 @@
 #include "jsfriendapi.h"
 #include "js/OldDebugAPI.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsIDOMGlobalPropertyInitializer.h"
 #include "nsIPermissionManager.h"
 #include "nsIPrincipal.h"
 #include "nsIXPConnect.h"
-#include "nsUTF8Utils.h"
 #include "WrapperFactory.h"
 #include "xpcprivate.h"
 #include "XPCQuickStubs.h"
 #include "XrayWrapper.h"
 #include "nsPrintfCString.h"
 #include "prprf.h"
 
 #include "mozilla/dom/ScriptSettings.h"
@@ -2157,46 +2156,16 @@ NonVoidByteStringToJsval(JSContext *cx, 
 
     if (!jsStr)
         return false;
 
     rval.setString(jsStr);
     return true;
 }
 
-
-template<typename T> static void
-NormalizeScalarValueStringInternal(JSContext* aCx, T& aString)
-{
-  char16_t* start = aString.BeginWriting();
-  // Must use const here because we can't pass char** to UTF16CharEnumerator as
-  // it expects const char**.  Unclear why this is illegal...
-  const char16_t* nextChar = start;
-  const char16_t* end = aString.Data() + aString.Length();
-  while (nextChar < end) {
-    uint32_t enumerated = UTF16CharEnumerator::NextChar(&nextChar, end);
-    if (enumerated == UCS2_REPLACEMENT_CHAR) {
-      int32_t lastCharIndex = (nextChar - start) - 1;
-      start[lastCharIndex] = static_cast<char16_t>(enumerated);
-    }
-  }
-}
-
-void
-NormalizeScalarValueString(JSContext* aCx, nsAString& aString)
-{
-  NormalizeScalarValueStringInternal(aCx, aString);
-}
-
-void
-NormalizeScalarValueString(JSContext* aCx, binding_detail::FakeString& aString)
-{
-  NormalizeScalarValueStringInternal(aCx, aString);
-}
-
 bool
 ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
                            bool nullable, nsACString& result)
 {
   JS::Rooted<JSString*> s(cx);
   if (v.isString()) {
     s = v.toString();
   } else {
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -1895,22 +1895,16 @@ ConvertJSValueToString(JSContext* cx, JS
     if (!s) {
       return false;
     }
   }
 
   return AssignJSString(cx, result, s);
 }
 
-void
-NormalizeScalarValueString(JSContext* aCx, nsAString& aString);
-
-void
-NormalizeScalarValueString(JSContext* aCx, binding_detail::FakeString& aString);
-
 bool
 ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
                            bool nullable, nsACString& result);
 
 template<typename T>
 void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq);
 template<typename T>
 void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -4562,17 +4562,17 @@ def getJSToNativeConversionInfo(type, de
             declArgs = None
         return JSToNativeConversionInfo(template,
                                         declType=declType,
                                         holderType=holderType,
                                         dealWithOptional=isOptional,
                                         declArgs=declArgs,
                                         holderArgs=holderArgs)
 
-    if type.isDOMString() or type.isScalarValueString():
+    if type.isDOMString():
         assert not isEnforceRange and not isClamp
 
         treatAs = {
             "Default": "eStringify",
             "EmptyString": "eEmpty",
             "Null": "eNull",
         }
         if type.nullable():
@@ -4580,27 +4580,21 @@ def getJSToNativeConversionInfo(type, de
             treatNullAs = "Null"
             # For nullable strings undefined also becomes a null string.
             undefinedBehavior = "eNull"
         else:
             undefinedBehavior = "eStringify"
         nullBehavior = treatAs[treatNullAs]
 
         def getConversionCode(varName):
-            normalizeCode = ""
-            if type.isScalarValueString():
-                normalizeCode = "NormalizeScalarValueString(cx, %s);\n" % varName
-
             conversionCode = (
                 "if (!ConvertJSValueToString(cx, ${val}, %s, %s, %s)) {\n"
                 "%s"
-                "}\n"
-                "%s" % (nullBehavior, undefinedBehavior, varName,
-                        exceptionCodeIndented.define(), normalizeCode))
-
+                "}\n" % (nullBehavior, undefinedBehavior, varName,
+                         exceptionCodeIndented.define()))
             if defaultValue is None:
                 return conversionCode
 
             if isinstance(defaultValue, IDLNullValue):
                 assert(type.nullable())
                 defaultCode = "%s.SetIsVoid(true)" % varName
             else:
                 defaultCode = handleDefaultStringValue(defaultValue,
@@ -5505,17 +5499,17 @@ def getWrapTemplateForType(type, descrip
             else:
                 getIID = ""
             wrap = "WrapObject(cx, %s, %s${jsvalHandle})" % (result, getIID)
             failed = None
 
         wrappingCode += wrapAndSetPtr(wrap, failed)
         return (wrappingCode, False)
 
-    if type.isDOMString() or type.isScalarValueString():
+    if type.isDOMString():
         if type.nullable():
             return (wrapAndSetPtr("xpc::StringToJsval(cx, %s, ${jsvalHandle})" % result), False)
         else:
             return (wrapAndSetPtr("xpc::NonVoidStringToJsval(cx, %s, ${jsvalHandle})" % result), False)
 
     if type.isByteString():
         if type.nullable():
             return (wrapAndSetPtr("ByteStringToJsval(cx, %s, ${jsvalHandle})" % result), False)
@@ -5783,17 +5777,17 @@ def getRetvalDeclarationForType(returnTy
     if returnType is None or returnType.isVoid():
         # Nothing to declare
         return None, None, None, None
     if returnType.isPrimitive() and returnType.tag() in builtinNames:
         result = CGGeneric(builtinNames[returnType.tag()])
         if returnType.nullable():
             result = CGTemplatedType("Nullable", result)
         return result, None, None, None
-    if returnType.isDOMString() or returnType.isScalarValueString():
+    if returnType.isDOMString():
         if isMember:
             return CGGeneric("nsString"), "ref", None, None
         return CGGeneric("DOMString"), "ref", None, None
     if returnType.isByteString():
         return CGGeneric("nsCString"), "ref", None, None
     if returnType.isEnum():
         result = CGGeneric(returnType.unroll().inner.identifier.name)
         if returnType.nullable():
@@ -8173,17 +8167,17 @@ def getUnionAccessorSignatureType(type, 
         else:
             typeName = CGWrapper(typeName, post="&")
         return typeName
 
     if type.isSpiderMonkeyInterface():
         typeName = CGGeneric(type.name)
         return CGWrapper(typeName, post=" const &")
 
-    if type.isDOMString() or type.isScalarValueString():
+    if type.isDOMString():
         return CGGeneric("const nsAString&")
 
     if type.isByteString():
         return CGGeneric("const nsCString&")
 
     if type.isEnum():
         return CGGeneric(type.inner.identifier.name)
 
@@ -11799,17 +11793,17 @@ class CGNativeMember(ClassMethod):
             result = CGGeneric(builtinNames[type.tag()])
             defaultReturnArg = "0"
             if type.nullable():
                 result = CGTemplatedType("Nullable", result)
                 defaultReturnArg = ""
             return (result.define(),
                     "%s(%s)" % (result.define(), defaultReturnArg),
                     "return ${declName};\n")
-        if type.isDOMString() or type.isScalarValueString():
+        if type.isDOMString():
             if isMember:
                 # No need for a third element in the isMember case
                 return "nsString", None, None
             # Outparam
             return "void", "", "aRetVal = ${declName};\n"
         if type.isByteString():
             if isMember:
                 # No need for a third element in the isMember case
@@ -11919,17 +11913,17 @@ class CGNativeMember(ClassMethod):
             return "void", "", ""
 
         raise TypeError("Don't know how to declare return value for %s" %
                         type)
 
     def getArgs(self, returnType, argList):
         args = [self.getArg(arg) for arg in argList]
         # Now the outparams
-        if returnType.isDOMString() or returnType.isScalarValueString():
+        if returnType.isDOMString():
             args.append(Argument("nsString&", "aRetVal"))
         elif returnType.isByteString():
             args.append(Argument("nsCString&", "aRetVal"))
         elif returnType.isSequence():
             nullable = returnType.nullable()
             if nullable:
                 returnType = returnType.inner
             # And now the actual underlying type
@@ -12045,17 +12039,17 @@ class CGNativeMember(ClassMethod):
                     False, False)
 
         if type.isSpiderMonkeyInterface():
             if self.jsObjectsArePtr:
                 return "JSObject*", False, False
 
             return type.name, True, True
 
-        if type.isDOMString() or type.isScalarValueString():
+        if type.isDOMString():
             if isMember:
                 declType = "nsString"
             else:
                 declType = "nsAString"
             return declType, True, False
 
         if type.isByteString():
             declType = "nsCString"
@@ -13848,17 +13842,17 @@ class CGEventGetter(CGNativeMember):
             raise TypeError("Event code generators does not support static attributes")
         return CGNativeMember.getArgs(self, returnType, argList)
 
     def getMethodBody(self):
         type = self.member.type
         memberName = CGDictionary.makeMemberName(self.member.identifier.name)
         if (type.isPrimitive() and type.tag() in builtinNames) or type.isEnum() or type.isGeckoInterface():
             return "return " + memberName + ";\n"
-        if type.isDOMString() or type.isByteString() or type.isScalarValueString():
+        if type.isDOMString() or type.isByteString():
             return "aRetVal = " + memberName + ";\n"
         if type.isSpiderMonkeyInterface() or type.isObject():
             return fill(
                 """
                 if (${memberName}) {
                   JS::ExposeObjectToActiveJS(${memberName});
                 }
                 aRetVal.set(${memberName});
@@ -14222,17 +14216,17 @@ class CGEventClass(CGBindingImplClass):
         if type.isPrimitive() and type.tag() in builtinNames:
             nativeType = CGGeneric(builtinNames[type.tag()])
             if type.nullable():
                 nativeType = CGTemplatedType("Nullable", nativeType)
         elif type.isEnum():
             nativeType = CGGeneric(type.unroll().inner.identifier.name)
             if type.nullable():
                 nativeType = CGTemplatedType("Nullable", nativeType)
-        elif type.isDOMString() or type.isScalarValueString():
+        elif type.isDOMString():
             nativeType = CGGeneric("nsString")
         elif type.isByteString():
             nativeType = CGGeneric("nsCString")
         elif type.isGeckoInterface():
             iface = type.unroll().inner
             nativeType = self.descriptor.getDescriptor(
                 iface.identifier.name).nativeType
             # Now trim off unnecessary namespaces
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -1374,17 +1374,16 @@ class IDLType(IDLObject):
         'float',
         'unrestricted_double',
         # "double" last primitive type to match IDLBuiltinType
         'double',
         # Other types
         'any',
         'domstring',
         'bytestring',
-        'scalarvaluestring',
         'object',
         'date',
         'void',
         # Funny stuff
         'interface',
         'dictionary',
         'enum',
         'callback',
@@ -1427,19 +1426,16 @@ class IDLType(IDLObject):
         return False
 
     def isByteString(self):
         return False
 
     def isDOMString(self):
         return False
 
-    def isScalarValueString(self):
-        return False
-
     def isVoid(self):
         return self.name == "Void"
 
     def isSequence(self):
         return False
 
     def isMozMap(self):
         return False
@@ -1607,19 +1603,16 @@ class IDLNullableType(IDLType):
         return self.inner.isString()
 
     def isByteString(self):
         return self.inner.isByteString()
 
     def isDOMString(self):
         return self.inner.isDOMString()
 
-    def isScalarValueString(self):
-        return self.inner.isScalarValueString()
-
     def isFloat(self):
         return self.inner.isFloat()
 
     def isUnrestricted(self):
         return self.inner.isUnrestricted()
 
     def includesRestrictedFloat(self):
         return self.inner.includesRestrictedFloat()
@@ -1731,19 +1724,16 @@ class IDLSequenceType(IDLType):
         return False;
 
     def isByteString(self):
         return False
 
     def isDOMString(self):
         return False
 
-    def isScalarValueString(self):
-        return False
-
     def isVoid(self):
         return False
 
     def isSequence(self):
         return True
 
     def isArray(self):
         return False
@@ -1988,19 +1978,16 @@ class IDLArrayType(IDLType):
         return False
 
     def isByteString(self):
         return False
 
     def isDOMString(self):
         return False
 
-    def isScalarValueString(self):
-        return False
-
     def isVoid(self):
         return False
 
     def isSequence(self):
         assert not self.inner.isSequence()
         return False
 
     def isArray(self):
@@ -2086,19 +2073,16 @@ class IDLTypedefType(IDLType, IDLObjectW
         return self.inner.isString()
 
     def isByteString(self):
         return self.inner.isByteString()
 
     def isDOMString(self):
         return self.inner.isDOMString()
 
-    def isScalarValueString(self):
-        return self.inner.isScalarValueString()
-
     def isVoid(self):
         return self.inner.isVoid()
 
     def isSequence(self):
         return self.inner.isSequence()
 
     def isMozMap(self):
         return self.inner.isMozMap()
@@ -2187,19 +2171,16 @@ class IDLWrapperType(IDLType):
         return False
 
     def isByteString(self):
         return False
 
     def isDOMString(self):
         return False
 
-    def isScalarValueString(self):
-        return False
-
     def isVoid(self):
         return False
 
     def isSequence(self):
         return False
 
     def isArray(self):
         return False
@@ -2326,17 +2307,16 @@ class IDLBuiltinType(IDLType):
         'float',
         'unrestricted_double',
         # IMPORTANT: "double" must be the last primitive type listed
         'double',
         # Other types
         'any',
         'domstring',
         'bytestring',
-        'scalarvaluestring',
         'object',
         'date',
         'void',
         # Funny stuff
         'ArrayBuffer',
         'ArrayBufferView',
         'Int8Array',
         'Uint8Array',
@@ -2361,17 +2341,16 @@ class IDLBuiltinType(IDLType):
             Types.boolean: IDLType.Tags.bool,
             Types.unrestricted_float: IDLType.Tags.unrestricted_float,
             Types.float: IDLType.Tags.float,
             Types.unrestricted_double: IDLType.Tags.unrestricted_double,
             Types.double: IDLType.Tags.double,
             Types.any: IDLType.Tags.any,
             Types.domstring: IDLType.Tags.domstring,
             Types.bytestring: IDLType.Tags.bytestring,
-            Types.scalarvaluestring: IDLType.Tags.scalarvaluestring,
             Types.object: IDLType.Tags.object,
             Types.date: IDLType.Tags.date,
             Types.void: IDLType.Tags.void,
             Types.ArrayBuffer: IDLType.Tags.interface,
             Types.ArrayBufferView: IDLType.Tags.interface,
             Types.Int8Array: IDLType.Tags.interface,
             Types.Uint8Array: IDLType.Tags.interface,
             Types.Uint8ClampedArray: IDLType.Tags.interface,
@@ -2394,28 +2373,24 @@ class IDLBuiltinType(IDLType):
     def isBoolean(self):
         return self._typeTag == IDLBuiltinType.Types.boolean
 
     def isNumeric(self):
         return self.isPrimitive() and not self.isBoolean()
 
     def isString(self):
         return self._typeTag == IDLBuiltinType.Types.domstring or \
-               self._typeTag == IDLBuiltinType.Types.bytestring or \
-               self._typeTag == IDLBuiltinType.Types.scalarvaluestring
+               self._typeTag == IDLBuiltinType.Types.bytestring
 
     def isByteString(self):
         return self._typeTag == IDLBuiltinType.Types.bytestring
 
     def isDOMString(self):
         return self._typeTag == IDLBuiltinType.Types.domstring
 
-    def isScalarValueString(self):
-        return self._typeTag == IDLBuiltinType.Types.scalarvaluestring
-
     def isInteger(self):
         return self._typeTag <= IDLBuiltinType.Types.unsigned_long_long
 
     def isArrayBuffer(self):
         return self._typeTag == IDLBuiltinType.Types.ArrayBuffer
 
     def isArrayBufferView(self):
         return self._typeTag == IDLBuiltinType.Types.ArrayBufferView
@@ -2558,19 +2533,16 @@ BuiltinTypes = {
           IDLBuiltinType(BuiltinLocation("<builtin type>"), "Any",
                          IDLBuiltinType.Types.any),
       IDLBuiltinType.Types.domstring:
           IDLBuiltinType(BuiltinLocation("<builtin type>"), "String",
                          IDLBuiltinType.Types.domstring),
       IDLBuiltinType.Types.bytestring:
           IDLBuiltinType(BuiltinLocation("<builtin type>"), "ByteString",
                          IDLBuiltinType.Types.bytestring),
-      IDLBuiltinType.Types.scalarvaluestring:
-          IDLBuiltinType(BuiltinLocation("<builtin type>"), "ScalarValueString",
-                         IDLBuiltinType.Types.scalarvaluestring),
       IDLBuiltinType.Types.object:
           IDLBuiltinType(BuiltinLocation("<builtin type>"), "Object",
                          IDLBuiltinType.Types.object),
       IDLBuiltinType.Types.date:
           IDLBuiltinType(BuiltinLocation("<builtin type>"), "Date",
                          IDLBuiltinType.Types.date),
       IDLBuiltinType.Types.void:
           IDLBuiltinType(BuiltinLocation("<builtin type>"), "Void",
@@ -2695,23 +2667,16 @@ class IDLValue(IDLObject):
             return self
         elif self.type.isFloat() and type.isFloat():
             if (not type.isUnrestricted() and
                 (self.value == float("inf") or self.value == float("-inf") or
                  math.isnan(self.value))):
                 raise WebIDLError("Trying to convert unrestricted value %s to non-unrestricted"
                                   % self.value, [location]);
             return self
-        elif self.type.isString() and type.isScalarValueString():
-            # Allow ScalarValueStrings to use default value just like
-            # DOMString.  No coercion is required in this case as Codegen.py
-            # treats ScalarValueString just like DOMString, but with an
-            # extra normalization step.
-            assert self.type.isDOMString()
-            return self
         raise WebIDLError("Cannot coerce type %s to type %s." %
                           (self.type, type), [location])
 
     def _getDependentObjects(self):
         return set()
 
 class IDLNullValue(IDLObject):
     def __init__(self, location):
@@ -3864,17 +3829,16 @@ class Tokenizer(object):
         "deleter": "DELETER",
         "legacycaller": "LEGACYCALLER",
         "optional": "OPTIONAL",
         "...": "ELLIPSIS",
         "::": "SCOPE",
         "Date": "DATE",
         "DOMString": "DOMSTRING",
         "ByteString": "BYTESTRING",
-        "ScalarValueString": "SCALARVALUESTRING",
         "any": "ANY",
         "boolean": "BOOLEAN",
         "byte": "BYTE",
         "double": "DOUBLE",
         "float": "FLOAT",
         "long": "LONG",
         "object": "OBJECT",
         "octet": "OCTET",
@@ -4761,17 +4725,16 @@ class Parser(Tokenizer):
                   | SEMICOLON
                   | LT
                   | EQUALS
                   | GT
                   | QUESTIONMARK
                   | DATE
                   | DOMSTRING
                   | BYTESTRING
-                  | SCALARVALUESTRING
                   | ANY
                   | ATTRIBUTE
                   | BOOLEAN
                   | BYTE
                   | LEGACYCALLER
                   | CONST
                   | CREATOR
                   | DELETER
@@ -5034,22 +4997,16 @@ class Parser(Tokenizer):
         p[0] = IDLBuiltinType.Types.domstring
 
     def p_PrimitiveOrStringTypeBytestring(self, p):
         """
             PrimitiveOrStringType : BYTESTRING
         """
         p[0] = IDLBuiltinType.Types.bytestring
 
-    def p_PrimitiveOrStringTypeScalarValueString(self, p):
-        """
-            PrimitiveOrStringType : SCALARVALUESTRING
-        """
-        p[0] = IDLBuiltinType.Types.scalarvaluestring
-
     def p_UnsignedIntegerTypeUnsigned(self, p):
         """
             UnsignedIntegerType : UNSIGNED IntegerType
         """
         p[0] = p[2] + 1 # Adding one to a given signed integer type
                         # gets you the unsigned type.
 
     def p_UnsignedIntegerType(self, p):
--- a/dom/bindings/parser/tests/test_distinguishability.py
+++ b/dom/bindings/parser/tests/test_distinguishability.py
@@ -154,29 +154,28 @@ def WebIDLTest(parser, harness):
                  "boolean?", "DOMString", "ByteString", "Enum", "Enum2",
                  "Interface", "Interface?",
                  "AncestorInterface", "UnrelatedInterface",
                  "ImplementedInterface", "CallbackInterface",
                  "CallbackInterface?", "CallbackInterface2",
                  "object", "Callback", "Callback2", "optional Dict",
                  "optional Dict2", "sequence<long>", "sequence<short>",
                  "MozMap<object>", "MozMap<Dict>", "MozMap<long>",
-                 "long[]", "short[]", "Date", "Date?", "any",
-                 "ScalarValueString" ]
+                 "long[]", "short[]", "Date", "Date?", "any" ]
     # When we can parse Date and RegExp, we need to add them here.
 
     # Try to categorize things a bit to keep list lengths down
     def allBut(list1, list2):
         return [a for a in list1 if a not in list2 and a != "any"]
     numerics = [ "long", "short", "long?", "short?" ]
     booleans = [ "boolean", "boolean?" ]
     primitives = numerics + booleans
     nonNumerics = allBut(argTypes, numerics)
     nonBooleans = allBut(argTypes, booleans)
-    strings = [ "DOMString", "ByteString", "Enum", "Enum2", "ScalarValueString" ]
+    strings = [ "DOMString", "ByteString", "Enum", "Enum2" ]
     nonStrings = allBut(argTypes, strings)
     nonObjects = primitives + strings
     objects = allBut(argTypes, nonObjects )
     interfaces = [ "Interface", "Interface?", "AncestorInterface",
                    "UnrelatedInterface", "ImplementedInterface" ]
     nullables = ["long?", "short?", "boolean?", "Interface?",
                  "CallbackInterface?", "optional Dict", "optional Dict2",
                  "Date?", "any"]
@@ -200,17 +199,16 @@ def WebIDLTest(parser, harness):
     setDistinguishable("long", nonNumerics)
     setDistinguishable("short", nonNumerics)
     setDistinguishable("long?", allBut(nonNumerics, nullables))
     setDistinguishable("short?", allBut(nonNumerics, nullables))
     setDistinguishable("boolean", nonBooleans)
     setDistinguishable("boolean?", allBut(nonBooleans, nullables))
     setDistinguishable("DOMString", nonStrings)
     setDistinguishable("ByteString", nonStrings)
-    setDistinguishable("ScalarValueString", nonStrings)
     setDistinguishable("Enum", nonStrings)
     setDistinguishable("Enum2", nonStrings)
     setDistinguishable("Interface", notRelatedInterfaces)
     setDistinguishable("Interface?", allBut(notRelatedInterfaces, nullables))
     setDistinguishable("AncestorInterface", notRelatedInterfaces)
     setDistinguishable("UnrelatedInterface",
                        allBut(argTypes, ["object", "UnrelatedInterface"]))
     setDistinguishable("ImplementedInterface", notRelatedInterfaces)
deleted file mode 100644
--- a/dom/bindings/parser/tests/test_scalarvaluestring.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# -*- coding: UTF-8 -*-
-
-import WebIDL
-
-def WebIDLTest(parser, harness):
-    parser.parse("""
-        interface TestScalarValueString {
-          attribute ScalarValueString svs;
-        };
-    """)
-
-    results = parser.finish();
-
-    harness.check(len(results), 1, "Should be one production")
-    harness.ok(isinstance(results[0], WebIDL.IDLInterface),
-               "Should be an IDLInterface")
-    iface = results[0]
-    harness.check(iface.identifier.QName(), "::TestScalarValueString",
-                  "Interface has the right QName")
-    harness.check(iface.identifier.name, "TestScalarValueString",
-                  "Interface has the right name")
-    harness.check(iface.parent, None, "Interface has no parent")
-
-    members = iface.members
-    harness.check(len(members), 1, "Should be one member")
-
-    attr = members[0]
-    harness.ok(isinstance(attr, WebIDL.IDLAttribute), "Should be an IDLAttribute")
-    harness.check(attr.identifier.QName(), "::TestScalarValueString::svs",
-                  "Attr has correct QName")
-    harness.check(attr.identifier.name, "svs", "Attr has correct name")
-    harness.check(str(attr.type), "ScalarValueString",
-                  "Attr type is the correct name")
-    harness.ok(attr.type.isScalarValueString(), "Should be ScalarValueString type")
-    harness.ok(attr.type.isString(), "Should be String collective type")
-    harness.ok(not attr.type.isDOMString(), "Should be not be DOMString type")
--- a/dom/bindings/parser/tests/test_union.py
+++ b/dom/bindings/parser/tests/test_union.py
@@ -58,17 +58,16 @@ def WebIDLTest(parser, harness):
              "unsigned long",
              "long long",
              "unsigned long long",
              "boolean",
              "byte",
              "octet",
              "DOMString",
              "ByteString",
-             "ScalarValueString",
              #"sequence<float>",
              "object",
              "ArrayBuffer",
              #"Date",
              "TestInterface1",
              "TestInterface2"]
 
     testPre = """
--- a/dom/bindings/test/TestBindingHeader.h
+++ b/dom/bindings/test/TestBindingHeader.h
@@ -461,35 +461,24 @@ public:
   // DOMString types
   void PassString(const nsAString&);
   void PassNullableString(const nsAString&);
   void PassOptionalString(const Optional<nsAString>&);
   void PassOptionalStringWithDefaultValue(const nsAString&);
   void PassOptionalNullableString(const Optional<nsAString>&);
   void PassOptionalNullableStringWithDefaultValue(const nsAString&);
   void PassVariadicString(const Sequence<nsString>&);
-  void ReceiveString(DOMString&);
 
   // ByteString types
   void PassByteString(const nsCString&);
   void PassNullableByteString(const nsCString&);
   void PassOptionalByteString(const Optional<nsCString>&);
   void PassOptionalNullableByteString(const Optional<nsCString>&);
   void PassVariadicByteString(const Sequence<nsCString>&);
 
-  // ScalarValueString types
-  void PassSVS(const nsAString&);
-  void PassNullableSVS(const nsAString&);
-  void PassOptionalSVS(const Optional<nsAString>&);
-  void PassOptionalSVSWithDefaultValue(const nsAString&);
-  void PassOptionalNullableSVS(const Optional<nsAString>&);
-  void PassOptionalNullableSVSWithDefaultValue(const nsAString&);
-  void PassVariadicSVS(const Sequence<nsString>&);
-  void ReceiveSVS(DOMString&);
-
   // Enumerated types
   void PassEnum(TestEnum);
   void PassNullableEnum(const Nullable<TestEnum>&);
   void PassOptionalEnum(const Optional<TestEnum>&);
   void PassEnumWithDefault(TestEnum);
   void PassOptionalNullableEnum(const Optional<Nullable<TestEnum> >&);
   void PassOptionalNullableEnumWithDefaultValue(const Nullable<TestEnum>&);
   void PassOptionalNullableEnumWithDefaultValue2(const Nullable<TestEnum>&);
@@ -597,17 +586,16 @@ public:
   void PassUnion20(JSContext*, const ObjectSequenceOrLong&);
   void PassUnion21(const LongMozMapOrLong&);
   void PassUnion22(JSContext*, const ObjectMozMapOrLong&);
   void PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg);
   void PassUnionWithByteString(const ByteStringOrLong&);
   void PassUnionWithMozMap(const StringMozMapOrString&);
   void PassUnionWithMozMapAndSequence(const StringMozMapOrStringSequence&);
   void PassUnionWithSequenceAndMozMap(const StringSequenceOrStringMozMap&);
-  void PassUnionWithSVS(const ScalarValueStringOrLong&);
 #endif
   void PassNullableUnion(JSContext*, const Nullable<ObjectOrLong>&);
   void PassOptionalUnion(JSContext*, const Optional<ObjectOrLong>&);
   void PassOptionalNullableUnion(JSContext*, const Optional<Nullable<ObjectOrLong> >&);
   void PassOptionalNullableUnionWithDefaultValue(JSContext*, const Nullable<ObjectOrLong>&);
   //void PassUnionWithInterfaces(const TestInterfaceOrTestExternalInterface& arg);
   //void PassUnionWithInterfacesAndNullable(const TestInterfaceOrNullOrTestExternalInterface& arg);
   void PassUnionWithArrayBuffer(const ArrayBufferOrLong&);
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -418,35 +418,24 @@ interface TestInterface {
   // DOMString types
   void passString(DOMString arg);
   void passNullableString(DOMString? arg);
   void passOptionalString(optional DOMString arg);
   void passOptionalStringWithDefaultValue(optional DOMString arg = "abc");
   void passOptionalNullableString(optional DOMString? arg);
   void passOptionalNullableStringWithDefaultValue(optional DOMString? arg = null);
   void passVariadicString(DOMString... arg);
-  DOMString receiveString();
 
   // ByteString types
   void passByteString(ByteString arg);
   void passNullableByteString(ByteString? arg);
   void passOptionalByteString(optional ByteString arg);
   void passOptionalNullableByteString(optional ByteString? arg);
   void passVariadicByteString(ByteString... arg);
 
-  // ScalarValueString types
-  void passSVS(ScalarValueString arg);
-  void passNullableSVS(ScalarValueString? arg);
-  void passOptionalSVS(optional ScalarValueString arg);
-  void passOptionalSVSWithDefaultValue(optional ScalarValueString arg = "abc");
-  void passOptionalNullableSVS(optional ScalarValueString? arg);
-  void passOptionalNullableSVSWithDefaultValue(optional ScalarValueString? arg = null);
-  void passVariadicSVS(ScalarValueString... arg);
-  ScalarValueString receiveSVS();
-
   // Enumerated types
   void passEnum(TestEnum arg);
   void passNullableEnum(TestEnum? arg);
   void passOptionalEnum(optional TestEnum arg);
   void passEnumWithDefault(optional TestEnum arg = "a");
   void passOptionalNullableEnum(optional TestEnum? arg);
   void passOptionalNullableEnumWithDefaultValue(optional TestEnum? arg = null);
   void passOptionalNullableEnumWithDefaultValue2(optional TestEnum? arg = "a");
@@ -539,17 +528,16 @@ interface TestInterface {
   void passUnion20(optional (sequence<object> or long) arg = []);
   void passUnion21((MozMap<long> or long) arg);
   void passUnion22((MozMap<object> or long) arg);
   void passUnionWithCallback((EventHandler or long) arg);
   void passUnionWithByteString((ByteString or long) arg);
   void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);
   void passUnionWithMozMapAndSequence((MozMap<DOMString> or sequence<DOMString>) arg);
   void passUnionWithSequenceAndMozMap((sequence<DOMString> or MozMap<DOMString>) arg);
-  void passUnionWithSVS((ScalarValueString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
   void passNullableUnion((object or long)? arg);
   void passOptionalUnion(optional (object or long) arg);
   void passOptionalNullableUnion(optional (object or long)? arg);
   void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   //void passUnionWithInterfaces((TestInterface or TestExternalInterface) arg);
   //void passUnionWithInterfacesAndNullable((TestInterface? or TestExternalInterface) arg);
--- a/dom/bindings/test/TestExampleGen.webidl
+++ b/dom/bindings/test/TestExampleGen.webidl
@@ -320,26 +320,16 @@ interface TestExampleInterface {
   // ByteString types
   void passByteString(ByteString arg);
   void passNullableByteString(ByteString? arg);
   void passOptionalByteString(optional ByteString arg);
   void passOptionalNullableByteString(optional ByteString? arg);
   void passVariadicByteString(ByteString... arg);
   void passUnionByteString((ByteString or long) arg);
 
-  // ScalarValueString types
-  void passSVS(ScalarValueString arg);
-  void passNullableSVS(ScalarValueString? arg);
-  void passOptionalSVS(optional ScalarValueString arg);
-  void passOptionalSVSWithDefaultValue(optional ScalarValueString arg = "abc");
-  void passOptionalNullableSVS(optional ScalarValueString? arg);
-  void passOptionalNullableSVSWithDefaultValue(optional ScalarValueString? arg = null);
-  void passVariadicSVS(ScalarValueString... arg);
-  ScalarValueString receiveSVS();
-
   // Enumerated types
   void passEnum(TestEnum arg);
   void passNullableEnum(TestEnum? arg);
   void passOptionalEnum(optional TestEnum arg);
   void passEnumWithDefault(optional TestEnum arg = "a");
   void passOptionalNullableEnum(optional TestEnum? arg);
   void passOptionalNullableEnumWithDefaultValue(optional TestEnum? arg = null);
   void passOptionalNullableEnumWithDefaultValue2(optional TestEnum? arg = "a");
@@ -426,21 +416,19 @@ interface TestExampleInterface {
   void passUnion16(optional (sequence<long> or long) arg);
   void passUnion17(optional (sequence<long>? or long) arg = 5);
   void passUnion18((sequence<object> or long) arg);
   void passUnion19(optional (sequence<object> or long) arg);
   void passUnion20(optional (sequence<object> or long) arg = []);
   void passUnion21((MozMap<long> or long) arg);
   void passUnion22((MozMap<object> or long) arg);
   void passUnionWithCallback((EventHandler or long) arg);
-  void passUnionWithByteString((ByteString or long) arg);
   void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);
   void passUnionWithMozMapAndSequence((MozMap<DOMString> or sequence<DOMString>) arg);
   void passUnionWithSequenceAndMozMap((sequence<DOMString> or MozMap<DOMString>) arg);
-  void passUnionWithSVS((ScalarValueString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
   void passNullableUnion((object or long)? arg);
   void passOptionalUnion(optional (object or long) arg);
   void passOptionalNullableUnion(optional (object or long)? arg);
   void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   //void passUnionWithInterfaces((TestInterface or TestExternalInterface) arg);
   //void passUnionWithInterfacesAndNullable((TestInterface? or TestExternalInterface) arg);
--- a/dom/bindings/test/TestInterfaceJS.js
+++ b/dom/bindings/test/TestInterfaceJS.js
@@ -40,14 +40,12 @@ TestInterfaceJS.prototype = {
   get objectArg() { return this._objectArg; },
   get anyAttr() { return this._anyAttr; },
   set anyAttr(val) { checkGlobal(val); this._anyAttr = val; },
   get objectAttr() { return this._objectAttr; },
   set objectAttr(val) { checkGlobal(val); this._objectAttr = val; },
   pingPongAny: function(any) { checkGlobal(any); return any; },
   pingPongObject: function(obj) { checkGlobal(obj); return obj; },
 
-  getCallerPrincipal: function() { return Cu.getWebIDLCallerPrincipal().origin; },
-
-  convertSVS: function(svs) { return svs; }
+  getCallerPrincipal: function() { return Cu.getWebIDLCallerPrincipal().origin; }
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestInterfaceJS])
--- a/dom/bindings/test/TestJSImplGen.webidl
+++ b/dom/bindings/test/TestJSImplGen.webidl
@@ -343,26 +343,16 @@ interface TestJSImplInterface {
   // ByteString types
   void passByteString(ByteString arg);
   void passNullableByteString(ByteString? arg);
   void passOptionalByteString(optional ByteString arg);
   void passOptionalNullableByteString(optional ByteString? arg);
   void passVariadicByteString(ByteString... arg);
   void PassUnionByteString((ByteString or long) arg);
 
-  // ScalarValueString types
-  void passSVS(ScalarValueString arg);
-  void passNullableSVS(ScalarValueString? arg);
-  void passOptionalSVS(optional ScalarValueString arg);
-  void passOptionalSVSWithDefaultValue(optional ScalarValueString arg = "abc");
-  void passOptionalNullableSVS(optional ScalarValueString? arg);
-  void passOptionalNullableSVSWithDefaultValue(optional ScalarValueString? arg = null);
-  void passVariadicSVS(ScalarValueString... arg);
-  ScalarValueString receiveSVS();
-
   // Enumerated types
   void passEnum(MyTestEnum arg);
   void passNullableEnum(MyTestEnum? arg);
   void passOptionalEnum(optional MyTestEnum arg);
   void passEnumWithDefault(optional MyTestEnum arg = "a");
   void passOptionalNullableEnum(optional MyTestEnum? arg);
   void passOptionalNullableEnumWithDefaultValue(optional MyTestEnum? arg = null);
   void passOptionalNullableEnumWithDefaultValue2(optional MyTestEnum? arg = "a");
@@ -450,21 +440,19 @@ interface TestJSImplInterface {
   void passUnion16(optional (sequence<long> or long) arg);
   void passUnion17(optional (sequence<long>? or long) arg = 5);
   void passUnion18((sequence<object> or long) arg);
   void passUnion19(optional (sequence<object> or long) arg);
   void passUnion20(optional (sequence<object> or long) arg = []);
   void passUnion21((MozMap<long> or long) arg);
   void passUnion22((MozMap<object> or long) arg);
   void passUnionWithCallback((EventHandler or long) arg);
-  void passUnionWithByteString((ByteString or long) arg);
   void passUnionWithMozMap((MozMap<DOMString> or DOMString) arg);
   void passUnionWithMozMapAndSequence((MozMap<DOMString> or sequence<DOMString>) arg);
   void passUnionWithSequenceAndMozMap((sequence<DOMString> or MozMap<DOMString>) arg);
-  void passUnionWithSVS((ScalarValueString or long) arg);
 #endif
   void passUnionWithNullable((object? or long) arg);
   void passNullableUnion((object or long)? arg);
   void passOptionalUnion(optional (object or long) arg);
   void passOptionalNullableUnion(optional (object or long)? arg);
   void passOptionalNullableUnionWithDefaultValue(optional (object or long)? arg = null);
   //void passUnionWithInterfaces((TestJSImplInterface or TestExternalInterface) arg);
   //void passUnionWithInterfacesAndNullable((TestJSImplInterface? or TestExternalInterface) arg);
--- a/dom/bindings/test/mochitest.ini
+++ b/dom/bindings/test/mochitest.ini
@@ -35,14 +35,12 @@ skip-if = true
 [test_exceptions_from_jsimplemented.html]
 skip-if = (toolkit == 'gonk' && debug) #debug-only failure; bug 926547
 [test_lenientThis.html]
 [test_lookupGetter.html]
 [test_namedNoIndexed.html]
 [test_named_getter_enumerability.html]
 [test_Object.prototype_props.html]
 [test_queryInterface.html]
-[test_scalarvaluestring.html]
-skip-if = debug == false
 [test_sequence_wrapping.html]
 [test_throwing_method_noDCE.html]
 [test_treat_non_object_as_null.html]
 [test_traceProtos.html]
deleted file mode 100644
--- a/dom/bindings/test/test_scalarvaluestring.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
-   - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test ScalarValueString</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script class="testbody" type="application/javascript">
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({set: [['dom.expose_test_interfaces', true]]}, function() {
-  var testInterfaceJS = new TestInterfaceJS();
-  ok(testInterfaceJS, "got a TestInterfaceJS object");
-  // For expected values, see algorithm definition here:
-  //  http://heycam.github.io/webidl/#dfn-obtain-unicode
-  var testList = [
-    { string:   "foo",
-      expected: "foo" },
-    { string:   "This is U+2070E: \ud841\udf0e",
-      expected: "This is U+2070E: \ud841\udf0e" },
-    { string:   "Missing low surrogate: \ud841",
-      expected: "Missing low surrogate: \ufffd" },
-    { string:   "Missing low surrogate with trailer: \ud841!!",
-      expected: "Missing low surrogate with trailer: \ufffd!!" },
-    { string:   "Missing high surrogate: \udf0e",
-      expected: "Missing high surrogate: \ufffd" },
-    { string:   "Missing high surrogate with trailer: \udf0e!!",
-      expected: "Missing high surrogate with trailer: \ufffd!!" },
-    { string:   "U+2070E after malformed: \udf0e\ud841\udf0e",
-      expected: "U+2070E after malformed: \ufffd\ud841\udf0e" }
-  ];
-  testList.forEach(function(test) {
-    is(testInterfaceJS.convertSVS(test.string), test.expected, "Convert '" + test.string + "'");
-  });
-  SimpleTest.finish();
-});
-</script>
-</body>
-</html>
--- a/dom/webidl/TestInterfaceJS.webidl
+++ b/dom/webidl/TestInterfaceJS.webidl
@@ -12,11 +12,9 @@ interface TestInterfaceJS {
   readonly attribute object objectArg;
   attribute any anyAttr;
   attribute object objectAttr;
   any pingPongAny(any arg);
   object pingPongObject(any obj);
 
   // For testing bug 968335.
   DOMString getCallerPrincipal();
-
-  DOMString convertSVS(ScalarValueString svs);
 };
--- a/mobile/android/installer/Makefile.in
+++ b/mobile/android/installer/Makefile.in
@@ -19,20 +19,16 @@ DEFINES += \
 	-DAB_CD=$(AB_CD) \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
 	-DPREF_DIR=$(PREF_DIR) \
 	$(NULL)
 
 DEFINES += -DJAREXT=
 DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
 
-ifdef MOZ_DEBUG
-DEFINES += -DMOZ_DEBUG=1
-endif
-
 ifdef MOZ_PKG_MANIFEST_P
 MOZ_PKG_MANIFEST = package-manifest
 endif
 
 MOZ_PACKAGER_MINIFY=1
 
 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
 
--- a/xpcom/string/nsUTF8Utils.h
+++ b/xpcom/string/nsUTF8Utils.h
@@ -6,17 +6,16 @@
 #ifndef nsUTF8Utils_h_
 #define nsUTF8Utils_h_
 
 // This file may be used in two ways: if MOZILLA_INTERNAL_API is defined, this
 // file will provide signatures for the Mozilla abstract string types. It will
 // use XPCOM assertion/debugging macros, etc.
 
 #include "nscore.h"
-#include "mozilla/Assertions.h"
 #include "mozilla/SSE.h"
 
 #include "nsCharTraits.h"
 
 class UTF8traits
 {
 public:
   static bool isASCII(char aChar)
@@ -163,21 +162,16 @@ private:
   }
 };
 
 
 /**
  * Extract the next UCS-4 character from the buffer and return it.  The
  * pointer passed in is advanced to the start of the next character in the
  * buffer.  If non-null, the err parameter is filled in if an error occurs.
- *
- * If an error occurs that causes UCS2_REPLACEMENT_CHAR to be returned, then
- * the buffer will be updated to move only a single UCS-2 character.
- *
- * Any other error returns 0 and does not move the buffer position.
  */
 
 
 class UTF16CharEnumerator
 {
 public:
   static uint32_t NextChar(const char16_t** aBuffer, const char16_t* aEnd,
                            bool* aErr = nullptr)
@@ -260,17 +254,20 @@ public:
       NS_WARNING("got a low Surrogate but no high surrogate");
       if (aErr) {
         *aErr = true;
       }
       *aBuffer = p;
       return 0xFFFD;
     }
 
-    MOZ_ASSERT_UNREACHABLE("Impossible UCS-2 character value.");
+    if (aErr) {
+      *aErr = true;
+    }
+    return 0;
   }
 };
 
 
 /**
  * A character sink (see |copy_string| in nsAlgorithm.h) for converting
  * UTF-8 to UTF-16
  */