Merge m-c into inbound
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 04 Jan 2014 12:14:57 -0500
changeset 162162 d4757785001e996f078f1ca1a7eeb3f20913c820
parent 162161 91a585e70f2851e73c62679823a6e24eefdee9b1 (current diff)
parent 162100 cf80c0d4f46e3526d5f80671626f27a984cf4eae (diff)
child 162163 fd8248fed936d08f34ffebf58c6bff219afc28fe
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
milestone29.0a1
Merge m-c into inbound
content/base/src/nsXMLHttpRequest.cpp
docshell/base/nsDocShell.cpp
docshell/base/nsDocShell.h
dom/base/nsLocation.cpp
dom/bindings/Codegen.py
embedding/browser/webBrowser/nsWebBrowser.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/generic/nsFrame.cpp
netwerk/protocol/http/nsHttpHandler.cpp
--- a/accessible/src/atk/nsMaiInterfaceText.cpp
+++ b/accessible/src/atk/nsMaiInterfaceText.cpp
@@ -182,17 +182,17 @@ getCharacterAtOffsetCB(AtkText* aText, g
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (!accWrap)
     return 0;
 
   HyperTextAccessible* text = accWrap->AsHyperText();
   if (!text || !text->IsTextRole())
     return 0;
 
-  // PRUnichar is unsigned short in Mozilla, gnuichar is guint32 in glib.
+  // char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib.
   return static_cast<gunichar>(text->CharAt(aOffset));
 }
 
 static gchar*
 getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
                       AtkTextBoundary aBoundaryType,
                       gint *aStartOffset, gint *aEndOffset)
 {
--- a/accessible/src/base/DocManager.cpp
+++ b/accessible/src/base/DocManager.cpp
@@ -225,17 +225,17 @@ DocManager::OnLocationChange(nsIWebProgr
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DocManager::OnStatusChange(nsIWebProgress* aWebProgress,
                            nsIRequest* aRequest, nsresult aStatus,
-                           const PRUnichar* aMessage)
+                           const char16_t* aMessage)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DocManager::OnSecurityChange(nsIWebProgress* aWebProgress,
                              nsIRequest* aRequest,
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -157,17 +157,17 @@ NS_IMPL_ISUPPORTS_INHERITED4(nsAccessibi
                              nsIObserver,
                              nsISelectionListener) // from SelectionManager
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIObserver
 
 NS_IMETHODIMP
 nsAccessibilityService::Observe(nsISupports *aSubject, const char *aTopic,
-                         const PRUnichar *aData)
+                         const char16_t *aData)
 {
   if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
     Shutdown();
 
   return NS_OK;
 }
 
 // nsIAccessibilityService
@@ -1080,17 +1080,17 @@ nsAccessibilityService::Init()
   // Add observers.
   nsCOMPtr<nsIObserverService> observerService =
     mozilla::services::GetObserverService();
   if (!observerService)
     return false;
 
   observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
 
-  static const PRUnichar kInitIndicator[] = { '1', 0 };
+  static const char16_t kInitIndicator[] = { '1', 0 };
   observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kInitIndicator);
 
 #ifdef A11Y_LOG
   logging::CheckEnv();
 #endif
 
   gApplicationAccessible = new ApplicationAccessibleWrap();
   NS_ADDREF(gApplicationAccessible); // will release in Shutdown()
@@ -1118,17 +1118,17 @@ void
 nsAccessibilityService::Shutdown()
 {
   // Remove observers.
   nsCOMPtr<nsIObserverService> observerService =
       mozilla::services::GetObserverService();
   if (observerService) {
     observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
 
-    static const PRUnichar kShutdownIndicator[] = { '0', 0 };
+    static const char16_t kShutdownIndicator[] = { '0', 0 };
     observerService->NotifyObservers(nullptr, "a11y-init-or-shutdown", kShutdownIndicator);
   }
 
   // Stop accessible document loader.
   DocManager::Shutdown();
 
   SelectionManager::Shutdown();
 
--- a/accessible/src/base/nsCoreUtils.h
+++ b/accessible/src/base/nsCoreUtils.h
@@ -302,17 +302,17 @@ public:
    * only. In contrast to nsWhitespaceTokenizer class it takes into account
    * non-breaking space (0xa0).
    */
   static bool IsWhitespaceString(const nsSubstring& aString);
 
   /**
    * Returns true if the given character is whitespace symbol.
    */
-  static bool IsWhitespace(PRUnichar aChar)
+  static bool IsWhitespace(char16_t aChar)
   {
     return aChar == ' ' || aChar == '\n' ||
       aChar == '\r' || aChar == '\t' || aChar == 0xa0;
   }
 };
 
 
 /**
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -125,33 +125,33 @@ nsTextEquivUtils::AppendTextEquivFromTex
         // If this text is inside a block level frame (as opposed to span
         // level), we need to add spaces around that block's text, so we don't
         // get words jammed together in final name.
         const nsStyleDisplay* display = frame->StyleDisplay();
         if (display->IsBlockOutsideStyle() ||
             display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
           isHTMLBlock = true;
           if (!aString->IsEmpty()) {
-            aString->Append(PRUnichar(' '));
+            aString->Append(char16_t(' '));
           }
         }
       }
     }
     
     if (aContent->TextLength() > 0) {
       nsIFrame *frame = aContent->GetPrimaryFrame();
       if (frame) {
         nsresult rv = frame->GetRenderedText(aString);
         NS_ENSURE_SUCCESS(rv, rv);
       } else {
         // If aContent is an object that is display: none, we have no a frame.
         aContent->AppendTextTo(*aString);
       }
       if (isHTMLBlock && !aString->IsEmpty()) {
-        aString->Append(PRUnichar(' '));
+        aString->Append(char16_t(' '));
       }
     }
     
     return NS_OK;
   }
   
   if (aContent->IsHTML() &&
       aContent->NodeInfo()->Equals(nsGkAtoms::br)) {
@@ -329,22 +329,22 @@ bool
 nsTextEquivUtils::AppendString(nsAString *aString,
                                const nsAString& aTextEquivalent)
 {
   if (aTextEquivalent.IsEmpty())
     return false;
 
   // Insert spaces to insure that words from controls aren't jammed together.
   if (!aString->IsEmpty() && !nsCoreUtils::IsWhitespace(aString->Last()))
-    aString->Append(PRUnichar(' '));
+    aString->Append(char16_t(' '));
 
   aString->Append(aTextEquivalent);
 
   if (!nsCoreUtils::IsWhitespace(aString->Last()))
-    aString->Append(PRUnichar(' '));
+    aString->Append(char16_t(' '));
 
   return true;
 }
 
 uint32_t 
 nsTextEquivUtils::GetRoleRule(role aRole)
 {
 #define ROLE(geckoRole, stringRole, atkRole, \
--- a/accessible/src/generic/DocAccessible.cpp
+++ b/accessible/src/generic/DocAccessible.cpp
@@ -791,17 +791,17 @@ DocAccessible::ScrollPositionDidChange(n
   mScrollPositionChangedTicks = 1;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIObserver
 
 NS_IMETHODIMP
 DocAccessible::Observe(nsISupports* aSubject, const char* aTopic,
-                       const PRUnichar* aData)
+                       const char16_t* aData)
 {
   if (!nsCRT::strcmp(aTopic,"obs_documentCreated")) {    
     // State editable will now be set, readonly is now clear
     // Normally we only fire delayed events created from the node, not an
     // accessible object. See the AccStateChangeEvent constructor for details
     // about this exceptional case.
     nsRefPtr<AccEvent> event =
       new AccStateChangeEvent(this, states::EDITABLE, true);
--- a/accessible/src/generic/HyperTextAccessible.h
+++ b/accessible/src/generic/HyperTextAccessible.h
@@ -21,19 +21,19 @@ struct DOMPoint {
   DOMPoint(nsINode* aNode, int32_t aIdx) : node(aNode), idx(aIdx) { }
 
   nsINode* node;
   int32_t idx;
 };
 
 // This character marks where in the text returned via nsIAccessibleText(),
 // that embedded object characters exist
-const PRUnichar kEmbeddedObjectChar = 0xfffc;
-const PRUnichar kImaginaryEmbeddedObjectChar = ' ';
-const PRUnichar kForcedNewLineChar = '\n';
+const char16_t kEmbeddedObjectChar = 0xfffc;
+const char16_t kImaginaryEmbeddedObjectChar = ' ';
+const char16_t kForcedNewLineChar = '\n';
 
 /**
   * Special Accessible that knows how contain both text and embedded objects
   */
 class HyperTextAccessible : public AccessibleWrap,
                             public xpcAccessibleHyperText
 {
 public:
@@ -183,27 +183,27 @@ public:
 
     if (aStartOffset && aEndOffset) {
       *aStartOffset = aOffset;
       *aEndOffset = aOffset + aChar.Length();
     }
     return true;
   }
 
-  PRUnichar CharAt(int32_t aOffset)
+  char16_t CharAt(int32_t aOffset)
   {
     nsAutoString charAtOffset;
     CharAt(aOffset, charAtOffset);
     return charAtOffset.CharAt(0);
   }
 
   /**
    * Return true if char at the given offset equals to given char.
    */
-  bool IsCharAt(int32_t aOffset, PRUnichar aChar)
+  bool IsCharAt(int32_t aOffset, char16_t aChar)
     { return CharAt(aOffset) == aChar; }
 
   /**
    * Return true if terminal char is at the given offset.
    */
   bool IsLineEndCharAt(int32_t aOffset)
     { return IsCharAt(aOffset, '\n'); }
 
--- a/accessible/src/html/HTMLElementAccessibles.cpp
+++ b/accessible/src/html/HTMLElementAccessibles.cpp
@@ -42,17 +42,17 @@ uint64_t
 HTMLBRAccessible::NativeState()
 {
   return states::READONLY;
 }
 
 ENameValueFlag
 HTMLBRAccessible::NativeName(nsString& aName)
 {
-  aName = static_cast<PRUnichar>('\n');    // Newline char
+  aName = static_cast<char16_t>('\n');    // Newline char
   return eNameOK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLLabelAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLLabelAccessible, HyperTextAccessible)
--- a/accessible/src/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/src/xpcom/xpcAccessibleHyperText.cpp
@@ -123,17 +123,17 @@ xpcAccessibleHyperText::GetTextAfterOffs
     return NS_ERROR_FAILURE;
 
   text->TextAfterOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset, aText);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetCharacterAtOffset(int32_t aOffset,
-                                             PRUnichar* aCharacter)
+                                             char16_t* aCharacter)
 {
   NS_ENSURE_ARG_POINTER(aCharacter);
   *aCharacter = L'\0';
 
   HyperTextAccessible* text = static_cast<HyperTextAccessible*>(this);
   if (text->IsDefunct())
     return NS_ERROR_FAILURE;
 
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -45,17 +45,17 @@
 #include "mozilla/WindowsDllBlocklist.h"
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
 
 #if defined(XP_WIN) && !MOZ_WINCONSOLE
-  PRUnichar msg[2048];
+  char16_t msg[2048];
   _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
   MessageBoxW(nullptr, msg, L"XULRunner", MB_OK | MB_ICONERROR);
 #else
   vfprintf(stderr, fmt, ap);
 #endif
 
   va_end(ap);
 }
--- a/browser/components/shell/src/nsMacShellService.cpp
+++ b/browser/components/shell/src/nsMacShellService.cpp
@@ -225,17 +225,17 @@ nsMacShellService::OnLocationChange(nsIW
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMacShellService::OnStatusChange(nsIWebProgress* aWebProgress,
                                   nsIRequest* aRequest,
                                   nsresult aStatus,
-                                  const PRUnichar* aMessage)
+                                  const char16_t* aMessage)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMacShellService::OnSecurityChange(nsIWebProgress* aWebProgress,
                                     nsIRequest* aRequest,
                                     uint32_t aState)
--- a/browser/components/shell/src/nsWindowsShellService.cpp
+++ b/browser/components/shell/src/nsWindowsShellService.cpp
@@ -471,17 +471,17 @@ nsWindowsShellService::IsDefaultBrowser(
         // application when setting Firefox as the default browser.
         *aIsDefaultBrowser = false;
         return NS_OK;
       }
 
       const nsString &flatValue = PromiseFlatString(valueData);
       res = ::RegSetValueExW(theKey, L"", 0, REG_SZ,
                              (const BYTE *) flatValue.get(),
-                             (flatValue.Length() + 1) * sizeof(PRUnichar));
+                             (flatValue.Length() + 1) * sizeof(char16_t));
       // Close the key that was created.
       ::RegCloseKey(theKey);
       if (REG_FAILED(res)) {
         // If updating the open command fails try to update it using the helper
         // application when setting Firefox as the default browser.
         *aIsDefaultBrowser = false;
         return NS_OK;
       }
@@ -517,33 +517,33 @@ nsWindowsShellService::IsDefaultBrowser(
       }
 
       ::ZeroMemory(currValue, sizeof(currValue));
       DWORD len = sizeof currValue;
       res = ::RegQueryValueExW(theKey, L"", nullptr, nullptr,
                                (LPBYTE)currValue, &len);
       // Close the key that was opened.
       ::RegCloseKey(theKey);
-      if (REG_FAILED(res) || PRUnichar('\0') != *currValue) {
+      if (REG_FAILED(res) || char16_t('\0') != *currValue) {
         // Key wasn't set or was set to something other than our registry entry.
         // Delete the key along with all of its childrean and then recreate it.
         const nsString &flatName = PromiseFlatString(keyName);
         ::SHDeleteKeyW(HKEY_CURRENT_USER, flatName.get());
         res = ::RegCreateKeyExW(HKEY_CURRENT_USER, flatName.get(), 0, nullptr,
                                 REG_OPTION_NON_VOLATILE, KEY_SET_VALUE,
                                 nullptr, &theKey, nullptr);
         if (REG_FAILED(res)) {
           // If disabling DDE fails try to disable it using the helper
           // application when setting Firefox as the default browser.
           *aIsDefaultBrowser = false;
           return NS_OK;
         }
 
         res = ::RegSetValueExW(theKey, L"", 0, REG_SZ, (const BYTE *) L"",
-                               sizeof(PRUnichar));
+                               sizeof(char16_t));
         // Close the key that was created.
         ::RegCloseKey(theKey);
         if (REG_FAILED(res)) {
           // If disabling DDE fails try to disable it using the helper
           // application when setting Firefox as the default browser.
           *aIsDefaultBrowser = false;
           return NS_OK;
         }
@@ -577,17 +577,17 @@ nsWindowsShellService::IsDefaultBrowser(
       return NS_OK;
     }
 
     NS_ConvertUTF8toUTF16 valueData(VAL_OPEN);
     valueData.Replace(offset, 9, appLongPath);
     const nsString &flatValue = PromiseFlatString(valueData);
     res = ::RegSetValueExW(theKey, L"", 0, REG_SZ,
                            (const BYTE *) flatValue.get(),
-                           (flatValue.Length() + 1) * sizeof(PRUnichar));
+                           (flatValue.Length() + 1) * sizeof(char16_t));
     // Close the key that was created.
     ::RegCloseKey(theKey);
     // If updating the FTP protocol handlers shell open command fails try to
     // update it using the helper application when setting Firefox as the
     // default browser.
     if (REG_FAILED(res)) {
       *aIsDefaultBrowser = false;
     }
--- a/caps/src/nsScriptSecurityManager.cpp
+++ b/caps/src/nsScriptSecurityManager.cpp
@@ -88,17 +88,17 @@ nsScriptSecurityManager::SubjectIsPrivil
     bool isSystem = false;
     return NS_SUCCEEDED(SubjectPrincipalIsSystem(&isSystem)) && isSystem;
 }
 
 ///////////////////////////
 // Convenience Functions //
 ///////////////////////////
 // Result of this function should not be freed.
-static inline const PRUnichar *
+static inline const char16_t *
 IDToString(JSContext *cx, jsid id_)
 {
     JS::RootedId id(cx, id_);
     if (JSID_IS_STRING(id))
         return JS_GetInternedStringChars(JSID_TO_STRING(id));
 
     JS::Rooted<JS::Value> idval(cx);
     if (!JS_IdToValue(cx, id, idval.address()))
@@ -173,17 +173,17 @@ GetPrincipalDomainOrigin(nsIPrincipal* a
   return GetOriginFromURI(uri, aOrigin);
 }
 
 inline void SetPendingException(JSContext *cx, const char *aMsg)
 {
     JS_ReportError(cx, "%s", aMsg);
 }
 
-inline void SetPendingException(JSContext *cx, const PRUnichar *aMsg)
+inline void SetPendingException(JSContext *cx, const char16_t *aMsg)
 {
     JS_ReportError(cx, "%hs", aMsg);
 }
 
 // Helper class to get stuff from the ClassInfo and not waste extra time with
 // virtual method calls for things it has already gotten
 class ClassInfoData
 {
@@ -699,17 +699,17 @@ nsScriptSecurityManager::CheckPropertyAc
             if (domain) {
                 GetOriginFromURI(domain, objectDomain);
             }
         }
         NS_ConvertUTF8toUTF16 objectOriginUnicode(objectOrigin);
         NS_ConvertUTF8toUTF16 objectDomainUnicode(objectDomain);
 
         nsXPIDLString errorMsg;
-        const PRUnichar *formatStrings[] =
+        const char16_t *formatStrings[] =
         {
             subjectOriginUnicode.get(),
             className.get(),
             IDToString(cx, property),
             objectOriginUnicode.get(),
             subjectDomainUnicode.get(),
             objectDomainUnicode.get()
         };
@@ -1173,17 +1173,17 @@ nsScriptSecurityManager::CheckLoadURIWit
     // error and treat unflagged handlers as URI_DANGEROUS_TO_LOAD.
     rv = NS_URIChainHasFlags(targetBaseURI,
                              nsIProtocolHandler::URI_LOADABLE_BY_ANYONE,
                              &hasFlags);
     NS_ENSURE_SUCCESS(rv, rv);
     if (!hasFlags) {
         nsXPIDLString message;
         NS_ConvertASCIItoUTF16 ucsTargetScheme(targetScheme);
-        const PRUnichar* formatStrings[] = { ucsTargetScheme.get() };
+        const char16_t* formatStrings[] = { ucsTargetScheme.get() };
         rv = sStrBundle->
             FormatStringFromName(MOZ_UTF16("ProtocolFlagError"),
                                  formatStrings,
                                  ArrayLength(formatStrings),
                                  getter_Copies(message));
         if (NS_SUCCEEDED(rv)) {
             nsCOMPtr<nsIConsoleService> console(
               do_GetService("@mozilla.org/consoleservice;1"));
@@ -1212,17 +1212,17 @@ nsScriptSecurityManager::ReportError(JSC
     nsAutoCString targetSpec;
     rv = aTarget->GetAsciiSpec(targetSpec);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Localize the error message
     nsXPIDLString message;
     NS_ConvertASCIItoUTF16 ucsSourceSpec(sourceSpec);
     NS_ConvertASCIItoUTF16 ucsTargetSpec(targetSpec);
-    const PRUnichar *formatStrings[] = { ucsSourceSpec.get(), ucsTargetSpec.get() };
+    const char16_t *formatStrings[] = { ucsSourceSpec.get(), ucsTargetSpec.get() };
     rv = sStrBundle->FormatStringFromName(PromiseFlatString(messageTag).get(),
                                           formatStrings,
                                           ArrayLength(formatStrings),
                                           getter_Copies(message));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // If a JS context was passed in, set a JS exception.
     // Otherwise, print the error message directly to the JS console
@@ -1547,17 +1547,17 @@ nsScriptSecurityManager::CanCreateWrappe
         nsAutoCString origin;
         nsresult rv2;
         nsIPrincipal* subjectPrincipal = doGetSubjectPrincipal(&rv2);
         if (NS_SUCCEEDED(rv2) && subjectPrincipal) {
             GetPrincipalDomainOrigin(subjectPrincipal, origin);
         }
         NS_ConvertUTF8toUTF16 originUnicode(origin);
         NS_ConvertUTF8toUTF16 className(objClassInfo.GetName());
-        const PRUnichar* formatStrings[] = {
+        const char16_t* formatStrings[] = {
             className.get(),
             originUnicode.get()
         };
         uint32_t length = ArrayLength(formatStrings);
         if (originUnicode.IsEmpty()) {
             --length;
         } else {
             strName.AppendLiteral("ForOrigin");
@@ -1738,17 +1738,17 @@ static const char* kObservedPrefs[] = {
   sJSEnabledPrefName,
   sFileOriginPolicyPrefName,
   nullptr
 };
 
 
 NS_IMETHODIMP
 nsScriptSecurityManager::Observe(nsISupports* aObject, const char* aTopic,
-                                 const PRUnichar* aMessage)
+                                 const char16_t* aMessage)
 {
     nsresult rv = NS_OK;
     NS_ConvertUTF16toUTF8 messageStr(aMessage);
     const char *message = messageStr.get();
 
     static const char jsPrefix[] = "javascript.";
     static const char securityPrefix[] = "security.";
     if ((PL_strncmp(message, jsPrefix, sizeof(jsPrefix)-1) == 0) ||
--- a/chrome/src/nsChromeRegistryChrome.cpp
+++ b/chrome/src/nsChromeRegistryChrome.cpp
@@ -322,17 +322,17 @@ nsChromeRegistryChrome::SelectLocaleFrom
   if (NS_FAILED(rv))
     NS_ERROR("Couldn't select locale from pref!");
 
   return rv;
 }
 
 NS_IMETHODIMP
 nsChromeRegistryChrome::Observe(nsISupports *aSubject, const char *aTopic,
-                                const PRUnichar *someData)
+                                const char16_t *someData)
 {
   nsresult rv = NS_OK;
 
   if (!strcmp(NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, aTopic)) {
     nsCOMPtr<nsIPrefBranch> prefs (do_QueryInterface(aSubject));
     NS_ASSERTION(prefs, "Bad observer call!");
 
     NS_ConvertUTF16toUTF8 pref(someData);
--- a/chrome/src/nsChromeRegistryChrome.h
+++ b/chrome/src/nsChromeRegistryChrome.h
@@ -31,17 +31,17 @@ class nsChromeRegistryChrome : public ns
   NS_IMETHOD CheckForOSAccessibility() MOZ_OVERRIDE;
   NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
                                   nsIUTF8StringEnumerator* *aResult) MOZ_OVERRIDE;
   NS_IMETHOD IsLocaleRTL(const nsACString& package,
                          bool *aResult) MOZ_OVERRIDE;
   NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
                                nsACString& aLocale) MOZ_OVERRIDE;
   NS_IMETHOD Observe(nsISupports *aSubject, const char *aTopic,
-                     const PRUnichar *someData) MOZ_OVERRIDE;
+                     const char16_t *someData) MOZ_OVERRIDE;
 
 #ifdef MOZ_XUL
   NS_IMETHOD GetXULOverlays(nsIURI *aURI,
                             nsISimpleEnumerator **_retval) MOZ_OVERRIDE;
   NS_IMETHOD GetStyleOverlays(nsIURI *aURI,
                               nsISimpleEnumerator **_retval) MOZ_OVERRIDE;
 #endif
   
--- a/chrome/src/nsChromeRegistryContent.cpp
+++ b/chrome/src/nsChromeRegistryContent.cpp
@@ -217,17 +217,17 @@ nsChromeRegistryContent::GetSelectedLoca
     return NS_ERROR_NOT_AVAILABLE;
   }
   aLocale = mLocale;
   return NS_OK;
 }
   
 NS_IMETHODIMP
 nsChromeRegistryContent::Observe(nsISupports* aSubject, const char* aTopic,
-                                 const PRUnichar* aData)
+                                 const char16_t* aData)
 {
   CONTENT_NOT_IMPLEMENTED();
 }
 
 NS_IMETHODIMP
 nsChromeRegistryContent::GetStyleOverlays(nsIURI *aChromeURL,
                                           nsISimpleEnumerator **aResult)
 {
--- a/chrome/src/nsChromeRegistryContent.h
+++ b/chrome/src/nsChromeRegistryContent.h
@@ -23,17 +23,17 @@ class nsChromeRegistryContent : public n
                             const InfallibleTArray<OverrideMapping>& aOverrides,
                             const nsACString& aLocale);
 
   NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
                                   nsIUTF8StringEnumerator* *aResult) MOZ_OVERRIDE;
   NS_IMETHOD CheckForNewChrome() MOZ_OVERRIDE;
   NS_IMETHOD CheckForOSAccessibility() MOZ_OVERRIDE;
   NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
-                     const PRUnichar* aData) MOZ_OVERRIDE;
+                     const char16_t* aData) MOZ_OVERRIDE;
   NS_IMETHOD IsLocaleRTL(const nsACString& package,
                          bool *aResult) MOZ_OVERRIDE;
   NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
                                nsACString& aLocale) MOZ_OVERRIDE;
   NS_IMETHOD GetStyleOverlays(nsIURI *aChromeURL,
                               nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
   NS_IMETHOD GetXULOverlays(nsIURI *aChromeURL,
                             nsISimpleEnumerator **aResult) MOZ_OVERRIDE;
--- a/content/base/public/DirectionalityUtils.h
+++ b/content/base/public/DirectionalityUtils.h
@@ -78,17 +78,17 @@ void WalkDescendantsSetDirAuto(mozilla::
  */
 void WalkDescendantsClearAncestorDirAuto(mozilla::dom::Element* aElement);
 
 /**
  * When the contents of a text node have changed, deal with any elements whose
  * directionality needs to change
  */
 void SetDirectionFromChangedTextNode(nsIContent* aTextNode, uint32_t aOffset,
-                                     const PRUnichar* aBuffer, uint32_t aLength,
+                                     const char16_t* aBuffer, uint32_t aLength,
                                      bool aNotify);
 
 /**
  * When a text node is appended to an element, find any ancestors with dir=auto
  * whose directionality will be determined by the text node
  */
 void SetDirectionFromNewTextNode(nsIContent* aTextNode);
 
--- a/content/base/public/FragmentOrElement.h
+++ b/content/base/public/FragmentOrElement.h
@@ -184,24 +184,24 @@ public:
   virtual void GetTextContentInternal(nsAString& aTextContent) MOZ_OVERRIDE;
   virtual void SetTextContentInternal(const nsAString& aTextContent,
                                       mozilla::ErrorResult& aError) MOZ_OVERRIDE;
 
   // nsIContent interface methods
   virtual already_AddRefed<nsINodeList> GetChildren(uint32_t aFilter) MOZ_OVERRIDE;
   virtual const nsTextFragment *GetText() MOZ_OVERRIDE;
   virtual uint32_t TextLength() const MOZ_OVERRIDE;
-  virtual nsresult SetText(const PRUnichar* aBuffer, uint32_t aLength,
+  virtual nsresult SetText(const char16_t* aBuffer, uint32_t aLength,
                            bool aNotify) MOZ_OVERRIDE;
   // Need to implement this here too to avoid hiding.
   nsresult SetText(const nsAString& aStr, bool aNotify)
   {
     return SetText(aStr.BeginReading(), aStr.Length(), aNotify);
   }
-  virtual nsresult AppendText(const PRUnichar* aBuffer, uint32_t aLength,
+  virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                               bool aNotify) MOZ_OVERRIDE;
   virtual bool TextIsOnlyWhitespace() MOZ_OVERRIDE;
   virtual void AppendTextTo(nsAString& aResult) MOZ_OVERRIDE;
   virtual nsIContent *GetBindingParent() const MOZ_OVERRIDE;
   virtual nsXBLBinding *GetXBLBinding() const MOZ_OVERRIDE;
   virtual void SetXBLBinding(nsXBLBinding* aBinding,
                              nsBindingManager* aOldBindingManager = nullptr) MOZ_OVERRIDE;
   virtual ShadowRoot *GetShadowRoot() const MOZ_OVERRIDE;
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -314,26 +314,26 @@ public:
    * @return  The reversed document position flags.
    *
    * @see nsIDOMNode
    */
   static uint16_t ReverseDocumentPosition(uint16_t aDocumentPosition);
 
   static uint32_t CopyNewlineNormalizedUnicodeTo(const nsAString& aSource,
                                                  uint32_t aSrcOffset,
-                                                 PRUnichar* aDest,
+                                                 char16_t* aDest,
                                                  uint32_t aLength,
                                                  bool& aLastCharCR);
 
-  static uint32_t CopyNewlineNormalizedUnicodeTo(nsReadingIterator<PRUnichar>& aSrcStart, const nsReadingIterator<PRUnichar>& aSrcEnd, nsAString& aDest);
+  static uint32_t CopyNewlineNormalizedUnicodeTo(nsReadingIterator<char16_t>& aSrcStart, const nsReadingIterator<char16_t>& aSrcEnd, nsAString& aDest);
 
   static const nsDependentSubstring TrimCharsInSet(const char* aSet,
                                                    const nsAString& aValue);
 
-  template<bool IsWhitespace(PRUnichar)>
+  template<bool IsWhitespace(char16_t)>
   static const nsDependentSubstring TrimWhitespace(const nsAString& aStr,
                                                    bool aTrimTrailing = true);
 
   /**
    * Returns true if aChar is of class Ps, Pi, Po, Pf, or Pe.
    */
   static bool IsFirstLetterPunctuation(uint32_t aChar);
   static bool IsFirstLetterPunctuationAt(const nsTextFragment* aFrag, uint32_t aOffset);
@@ -347,23 +347,23 @@ public:
   /*
    * Is the character an HTML whitespace character?
    *
    * We define whitespace using the list in HTML5 and css3-selectors:
    * U+0009, U+000A, U+000C, U+000D, U+0020
    *
    * HTML 4.01 also lists U+200B (zero-width space).
    */
-  static bool IsHTMLWhitespace(PRUnichar aChar);
+  static bool IsHTMLWhitespace(char16_t aChar);
 
   /*
    * Returns whether the character is an HTML whitespace (see IsHTMLWhitespace)
    * or a nbsp character (U+00A0).
    */
-  static bool IsHTMLWhitespaceOrNBSP(PRUnichar aChar);
+  static bool IsHTMLWhitespaceOrNBSP(char16_t aChar);
 
   /**
    * Is the HTML local name a block element?
    */
   static bool IsHTMLBlock(nsIAtom* aLocalName);
 
   /**
    * Is the HTML local name a void element?
@@ -525,29 +525,29 @@ public:
    * @param aCharset empty if not found
    * @return boolean indicating whether a BOM was detected.
    */
   static bool CheckForBOM(const unsigned char* aBuffer, uint32_t aLength,
                           nsACString& aCharset);
 
   static nsresult CheckQName(const nsAString& aQualifiedName,
                              bool aNamespaceAware = true,
-                             const PRUnichar** aColon = nullptr);
+                             const char16_t** aColon = nullptr);
 
   static nsresult SplitQName(const nsIContent* aNamespaceResolver,
                              const nsAFlatString& aQName,
                              int32_t *aNamespace, nsIAtom **aLocalName);
 
   static nsresult GetNodeInfoFromQName(const nsAString& aNamespaceURI,
                                        const nsAString& aQualifiedName,
                                        nsNodeInfoManager* aNodeInfoManager,
                                        uint16_t aNodeType,
                                        nsINodeInfo** aNodeInfo);
 
-  static void SplitExpatName(const PRUnichar *aExpatName, nsIAtom **aPrefix,
+  static void SplitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix,
                              nsIAtom **aTagName, int32_t *aNameSpaceID);
 
   // Get a permission-manager setting for the given principal and type.
   // If the pref doesn't exist or if it isn't ALLOW_ACTION, false is
   // returned, otherwise true is returned. Always returns true for the
   // system principal, and false for a null principal.
   static bool IsSitePermAllow(nsIPrincipal* aPrincipal, const char* aType);
 
@@ -809,17 +809,17 @@ public:
     eSECURITY_PROPERTIES,
     PropertiesFile_COUNT
   };
   static nsresult ReportToConsole(uint32_t aErrorFlags,
                                   const nsACString& aCategory,
                                   nsIDocument* aDocument,
                                   PropertiesFile aFile,
                                   const char *aMessageName,
-                                  const PRUnichar **aParams = nullptr,
+                                  const char16_t **aParams = nullptr,
                                   uint32_t aParamsLength = 0,
                                   nsIURI* aURI = nullptr,
                                   const nsAFlatString& aSourceLine
                                     = EmptyString(),
                                   uint32_t aLineNumber = 0,
                                   uint32_t aColumnNumber = 0);
 
   /**
@@ -841,25 +841,25 @@ public:
 
   /**
    * Fill (with the parameters given) the localized string named |aKey| in
    * properties file |aFile|.
    */
 private:
   static nsresult FormatLocalizedString(PropertiesFile aFile,
                                         const char* aKey,
-                                        const PRUnichar** aParams,
+                                        const char16_t** aParams,
                                         uint32_t aParamsLength,
                                         nsXPIDLString& aResult);
   
 public:
   template<uint32_t N>
   static nsresult FormatLocalizedString(PropertiesFile aFile,
                                         const char* aKey,
-                                        const PRUnichar* (&aParams)[N],
+                                        const char16_t* (&aParams)[N],
                                         nsXPIDLString& aResult)
   {
     return FormatLocalizedString(aFile, aKey, aParams, N, aResult);
   }
 
   /**
    * Returns true if aDocument is a chrome document
    */
--- a/content/base/public/nsIContent.h
+++ b/content/base/public/nsIContent.h
@@ -500,25 +500,25 @@ public:
     return false;
   }
 
   /**
    * Set the text to the given value. If aNotify is true then
    * the document is notified of the content change.
    * NOTE: For elements this always ASSERTS and returns NS_ERROR_FAILURE
    */
-  virtual nsresult SetText(const PRUnichar* aBuffer, uint32_t aLength,
+  virtual nsresult SetText(const char16_t* aBuffer, uint32_t aLength,
                            bool aNotify) = 0;
 
   /**
    * Append the given value to the current text. If aNotify is true then
    * the document is notified of the content change.
    * NOTE: For elements this always ASSERTS and returns NS_ERROR_FAILURE
    */
-  virtual nsresult AppendText(const PRUnichar* aBuffer, uint32_t aLength,
+  virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                               bool aNotify) = 0;
 
   /**
    * Set the text to the given value. If aNotify is true then
    * the document is notified of the content change.
    * NOTE: For elements this always asserts and returns NS_ERROR_FAILURE
    */
   nsresult SetText(const nsAString& aStr, bool aNotify)
--- a/content/base/public/nsIDocument.h
+++ b/content/base/public/nsIDocument.h
@@ -1171,18 +1171,18 @@ public:
   nsIDocShell* GetDocShell() const;
 
   /**
    * Set and get XML declaration. If aVersion is null there is no declaration.
    * aStandalone takes values -1, 0 and 1 indicating respectively that there
    * was no standalone parameter in the declaration, that it was given as no,
    * or that it was given as yes.
    */
-  virtual void SetXMLDeclaration(const PRUnichar *aVersion,
-                                 const PRUnichar *aEncoding,
+  virtual void SetXMLDeclaration(const char16_t *aVersion,
+                                 const char16_t *aEncoding,
                                  const int32_t aStandalone) = 0;
   virtual void GetXMLDeclaration(nsAString& aVersion,
                                  nsAString& aEncoding,
                                  nsAString& Standalone) = 0;
 
   bool IsHTML() const
   {
     return mIsRegularHTML;
--- a/content/base/public/nsINode.h
+++ b/content/base/public/nsINode.h
@@ -51,17 +51,17 @@ class nsXPCClassInfo;
 class nsDOMMutationObserver;
 
 namespace mozilla {
 namespace dom {
 /**
  * @return true if aChar is what the DOM spec defines as 'space character'.
  * http://dom.spec.whatwg.org/#space-character
  */
-inline bool IsSpaceCharacter(PRUnichar aChar) {
+inline bool IsSpaceCharacter(char16_t aChar) {
   return aChar == ' ' || aChar == '\t' || aChar == '\n' || aChar == '\r' ||
          aChar == '\f';
 }
 inline bool IsSpaceCharacter(char aChar) {
   return aChar == ' ' || aChar == '\t' || aChar == '\n' || aChar == '\r' ||
          aChar == '\f';
 }
 class Element;
--- a/content/base/public/nsLineBreaker.h
+++ b/content/base/public/nsLineBreaker.h
@@ -60,27 +60,27 @@ public:
  * for text-transform:capitalize. This is a good place to handle that because
  * we have all the context we need.
  */
 class nsLineBreaker {
 public:
   nsLineBreaker();
   ~nsLineBreaker();
   
-  static inline bool IsSpace(PRUnichar u) { return NS_IsSpace(u); }
+  static inline bool IsSpace(char16_t u) { return NS_IsSpace(u); }
 
-  static inline bool IsComplexASCIIChar(PRUnichar u)
+  static inline bool IsComplexASCIIChar(char16_t u)
   {
     return !((0x0030 <= u && u <= 0x0039) ||
              (0x0041 <= u && u <= 0x005A) ||
              (0x0061 <= u && u <= 0x007A) ||
              (0x000a == u));
   }
 
-  static inline bool IsComplexChar(PRUnichar u)
+  static inline bool IsComplexChar(char16_t u)
   {
     return IsComplexASCIIChar(u) ||
            NS_NeedsPlatformNativeHandling(u) ||
            (0x1100 <= u && u <= 0x11ff) || // Hangul Jamo
            (0x2000 <= u && u <= 0x21ff) || // Punctuations and Symbols
            (0x2e80 <= u && u <= 0xd7ff) || // several CJK blocks
            (0xf900 <= u && u <= 0xfaff) || // CJK Compatibility Idographs
            (0xff00 <= u && u <= 0xffef);   // Halfwidth and Fullwidth Forms
@@ -142,17 +142,17 @@ public:
   nsresult AppendInvisibleWhitespace(uint32_t aFlags);
 
   /**
    * Feed Unicode text into the linebreaker for analysis. aLength must be
    * nonzero.
    * @param aSink can be null if the breaks are not actually needed (we may
    * still be setting up state for later breaks)
    */
-  nsresult AppendText(nsIAtom* aHyphenationLanguage, const PRUnichar* aText, uint32_t aLength,
+  nsresult AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText, uint32_t aLength,
                       uint32_t aFlags, nsILineBreakSink* aSink);
   /**
    * Feed 8-bit text into the linebreaker for analysis. aLength must be nonzero.
    * @param aSink can be null if the breaks are not actually needed (we may
    * still be setting up state for later breaks)
    */
   nsresult AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, uint32_t aLength,
                       uint32_t aFlags, nsILineBreakSink* aSink);
@@ -196,21 +196,21 @@ private:
   // When the current word ends, this computes the linebreak opportunities
   // *inside* the word (excluding either end) and sets them through the
   // appropriate sink(s). Then we clear the current word state.
   nsresult FlushCurrentWord();
 
   void UpdateCurrentWordLanguage(nsIAtom *aHyphenationLanguage);
 
   void FindHyphenationPoints(nsHyphenator *aHyphenator,
-                             const PRUnichar *aTextStart,
-                             const PRUnichar *aTextLimit,
+                             const char16_t *aTextStart,
+                             const char16_t *aTextLimit,
                              uint8_t *aBreakState);
 
-  nsAutoTArray<PRUnichar,100> mCurrentWord;
+  nsAutoTArray<char16_t,100> mCurrentWord;
   // All the items that contribute to mCurrentWord
   nsAutoTArray<TextItem,2>    mTextItems;
   nsIAtom*                    mCurrentWordLanguage;
   bool                        mCurrentWordContainsMixedLang;
   bool                        mCurrentWordContainsComplexChar;
 
   // True if the previous character was breakable whitespace
   bool                        mAfterBreakableSpace;
--- a/content/base/src/DOMImplementation.cpp
+++ b/content/base/src/DOMImplementation.cpp
@@ -100,17 +100,17 @@ DOMImplementation::CreateDocument(const 
                                   nsIDOMDocument** aDOMDocument)
 {
   *aDocument = nullptr;
   *aDOMDocument = nullptr;
 
   nsresult rv;
   if (!aQualifiedName.IsEmpty()) {
     const nsAFlatString& qName = PromiseFlatString(aQualifiedName);
-    const PRUnichar *colon;
+    const char16_t *colon;
     rv = nsContentUtils::CheckQName(qName, true, &colon);
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (colon &&
         (DOMStringIsNull(aNamespaceURI) ||
          (Substring(qName.get(), colon).EqualsLiteral("xml") &&
           !aNamespaceURI.EqualsLiteral("http://www.w3.org/XML/1998/namespace")))) {
       return NS_ERROR_DOM_NAMESPACE_ERR;
--- a/content/base/src/DOMParser.cpp
+++ b/content/base/src/DOMParser.cpp
@@ -57,17 +57,17 @@ DOMParser::ParseFromString(const nsAStri
   rv = ParseFromString(aStr,
                        StringFromSupportedType(aType),
                        getter_AddRefs(domDocument));
   nsCOMPtr<nsIDocument> document(do_QueryInterface(domDocument));
   return document.forget();
 }
 
 NS_IMETHODIMP 
-DOMParser::ParseFromString(const PRUnichar *str, 
+DOMParser::ParseFromString(const char16_t *str, 
                            const char *contentType,
                            nsIDOMDocument **aResult)
 {
   NS_ENSURE_ARG(str);
   // Converting a string to an enum value manually is a bit of a pain,
   // so let's just use a helper that takes a content-type string.
   return ParseFromString(nsDependentString(str), contentType, aResult);
 }
--- a/content/base/src/DirectionalityUtils.cpp
+++ b/content/base/src/DirectionalityUtils.cpp
@@ -298,21 +298,21 @@ inline static bool NodeAffectsDirAutoAnc
  * first-strong algorithm defined in http://unicode.org/reports/tr9/#P2
  *
  * @param[out] aFirstStrong the offset to the first character in the string with
  *             strong directionality, or UINT32_MAX if there is none (return
                value is eDir_NotSet).
  * @return the directionality of the string
  */
 static Directionality
-GetDirectionFromText(const PRUnichar* aText, const uint32_t aLength,
+GetDirectionFromText(const char16_t* aText, const uint32_t aLength,
                      uint32_t* aFirstStrong = nullptr)
 {
-  const PRUnichar* start = aText;
-  const PRUnichar* end = aText + aLength;
+  const char16_t* start = aText;
+  const char16_t* end = aText + aLength;
 
   while (start < end) {
     uint32_t current = start - aText;
     uint32_t ch = *start++;
 
     if (NS_IS_HIGH_SURROGATE(ch) &&
         start < end &&
         NS_IS_LOW_SURROGATE(*start)) {
@@ -820,17 +820,17 @@ void SetAncestorDirectionIfAuto(nsINode*
       return;
     }
     parent = parent->GetParentElement();
   }
 }
 
 void
 SetDirectionFromChangedTextNode(nsIContent* aTextNode, uint32_t aOffset,
-                                const PRUnichar* aBuffer, uint32_t aLength,
+                                const char16_t* aBuffer, uint32_t aLength,
                                 bool aNotify)
 {
   if (!NodeAffectsDirAutoAncestor(aTextNode)) {
     nsTextNodeDirectionalityMap::EnsureMapIsClearFor(aTextNode);
     return;
   }
 
   uint32_t firstStrong;
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -2088,18 +2088,18 @@ Element::ListAttributes(FILE* out) const
     // name
     mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(buffer);
 
     // value
     buffer.AppendLiteral("=\"");
     nsAutoString value;
     mAttrsAndChildren.AttrAt(index)->ToString(value);
     for (int i = value.Length(); i >= 0; --i) {
-      if (value[i] == PRUnichar('"'))
-        value.Insert(PRUnichar('\\'), uint32_t(i));
+      if (value[i] == char16_t('"'))
+        value.Insert(char16_t('\\'), uint32_t(i));
     }
     buffer.Append(value);
     buffer.AppendLiteral("\"");
 
     fputs(" ", out);
     fputs(NS_LossyConvertUTF16toASCII(buffer).get(), out);
   }
 }
--- a/content/base/src/EventSource.cpp
+++ b/content/base/src/EventSource.cpp
@@ -35,22 +35,22 @@
 #include "nsWrapperCacheInlines.h"
 #include "nsDOMEventTargetHelper.h"
 #include "mozilla/Attributes.h"
 #include "nsError.h"
 
 namespace mozilla {
 namespace dom {
 
-#define REPLACEMENT_CHAR     (PRUnichar)0xFFFD
-#define BOM_CHAR             (PRUnichar)0xFEFF
-#define SPACE_CHAR           (PRUnichar)0x0020
-#define CR_CHAR              (PRUnichar)0x000D
-#define LF_CHAR              (PRUnichar)0x000A
-#define COLON_CHAR           (PRUnichar)0x003A
+#define REPLACEMENT_CHAR     (char16_t)0xFFFD
+#define BOM_CHAR             (char16_t)0xFEFF
+#define SPACE_CHAR           (char16_t)0x0020
+#define CR_CHAR              (char16_t)0x000D
+#define LF_CHAR              (char16_t)0x000A
+#define COLON_CHAR           (char16_t)0x003A
 
 #define DEFAULT_BUFFER_SIZE 4096
 
 // Reconnection time related values in milliseconds. The default one is equal
 // to the default value of the pref dom.server-events.default-reconnection-time
 #define MIN_RECONNECTION_TIME_VALUE       500
 #define DEFAULT_RECONNECTION_TIME_VALUE   5000
 #define MAX_RECONNECTION_TIME_VALUE       PR_IntervalToMilliseconds(DELAY_INTERVAL_LIMIT)
@@ -294,17 +294,17 @@ EventSource::Constructor(const GlobalObj
 
 //-----------------------------------------------------------------------------
 // EventSource::nsIObserver
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 EventSource::Observe(nsISupports* aSubject,
                      const char* aTopic,
-                     const PRUnichar* aData)
+                     const char16_t* aData)
 {
   if (mReadyState == CLOSED) {
     return NS_OK;
   }
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aSubject);
   if (!GetOwner() || window != GetOwner()) {
     return NS_OK;
@@ -400,17 +400,17 @@ EventSource::StreamReaderFunc(nsIInputSt
   if (!thisObject || !aWriteCount) {
     NS_WARNING("EventSource cannot read from stream: no aClosure or aWriteCount");
     return NS_ERROR_FAILURE;
   }
 
   *aWriteCount = 0;
 
   int32_t srcCount, outCount;
-  PRUnichar out[2];
+  char16_t out[2];
   nsresult rv;
 
   const char *p = aFromRawSegment,
              *end = aFromRawSegment + aCount;
 
   do {
     srcCount = aCount - (p - aFromRawSegment);
     outCount = 2;
@@ -923,18 +923,18 @@ EventSource::SetReconnectionTimeout()
                                              nsITimer::TYPE_ONE_SHOT);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 nsresult
 EventSource::PrintErrorOnConsole(const char *aBundleURI,
-                                 const PRUnichar *aError,
-                                 const PRUnichar **aFormatStrings,
+                                 const char16_t *aError,
+                                 const char16_t **aFormatStrings,
                                  uint32_t aFormatStringsLen)
 {
   nsCOMPtr<nsIStringBundleService> bundleService =
     mozilla::services::GetStringBundleService();
   NS_ENSURE_STATE(bundleService);
 
   nsCOMPtr<nsIStringBundle> strBundle;
   nsresult rv =
@@ -978,17 +978,17 @@ EventSource::PrintErrorOnConsole(const c
 nsresult
 EventSource::ConsoleError()
 {
   nsAutoCString targetSpec;
   nsresult rv = mSrc->GetSpec(targetSpec);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ConvertUTF8toUTF16 specUTF16(targetSpec);
-  const PRUnichar *formatStrings[] = { specUTF16.get() };
+  const char16_t *formatStrings[] = { specUTF16.get() };
 
   if (mReadyState == CONNECTING && !mInterrupted) {
     rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
                              MOZ_UTF16("connectionFailure"),
                              formatStrings, ArrayLength(formatStrings));
   } else {
     rv = PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
                              MOZ_UTF16("netInterrupt"),
@@ -1309,57 +1309,57 @@ EventSource::ClearFields()
 nsresult
 EventSource::SetFieldAndClear()
 {
   if (mLastFieldName.IsEmpty()) {
     mLastFieldValue.Truncate();
     return NS_OK;
   }
 
-  PRUnichar first_char;
+  char16_t first_char;
   first_char = mLastFieldName.CharAt(0);
 
   switch (first_char)  // with no case folding performed
   {
-    case PRUnichar('d'):
+    case char16_t('d'):
       if (mLastFieldName.EqualsLiteral("data")) {
         // If the field name is "data" append the field value to the data
         // buffer, then append a single U+000A LINE FEED (LF) character
         // to the data buffer.
         mCurrentMessage.mData.Append(mLastFieldValue);
         mCurrentMessage.mData.Append(LF_CHAR);
       }
       break;
 
-    case PRUnichar('e'):
+    case char16_t('e'):
       if (mLastFieldName.EqualsLiteral("event")) {
         mCurrentMessage.mEventName.Assign(mLastFieldValue);
       }
       break;
 
-    case PRUnichar('i'):
+    case char16_t('i'):
       if (mLastFieldName.EqualsLiteral("id")) {
         mCurrentMessage.mLastEventID.Assign(mLastFieldValue);
       }
       break;
 
-    case PRUnichar('r'):
+    case char16_t('r'):
       if (mLastFieldName.EqualsLiteral("retry")) {
         uint32_t newValue=0;
         uint32_t i = 0;  // we must ensure that there are only digits
         bool assign = true;
         for (i = 0; i < mLastFieldValue.Length(); ++i) {
-          if (mLastFieldValue.CharAt(i) < (PRUnichar)'0' ||
-              mLastFieldValue.CharAt(i) > (PRUnichar)'9') {
+          if (mLastFieldValue.CharAt(i) < (char16_t)'0' ||
+              mLastFieldValue.CharAt(i) > (char16_t)'9') {
             assign = false;
             break;
           }
           newValue = newValue*10 +
                      (((uint32_t)mLastFieldValue.CharAt(i))-
-                       ((uint32_t)((PRUnichar)'0')));
+                       ((uint32_t)((char16_t)'0')));
         }
 
         if (assign) {
           if (newValue < MIN_RECONNECTION_TIME_VALUE) {
             mReconnectionTime = MIN_RECONNECTION_TIME_VALUE;
           } else if (newValue > MAX_RECONNECTION_TIME_VALUE) {
             mReconnectionTime = MAX_RECONNECTION_TIME_VALUE;
           } else {
@@ -1394,17 +1394,17 @@ EventSource::CheckHealthOfRequestCallbac
     NS_WARNING("wrong channel from request callback");
     return NS_ERROR_ABORT;
   }
 
   return NS_OK;
 }
 
 nsresult
-EventSource::ParseCharacter(PRUnichar aChr)
+EventSource::ParseCharacter(char16_t aChr)
 {
   nsresult rv;
 
   if (mReadyState == CLOSED) {
     return NS_ERROR_ABORT;
   }
 
   switch (mStatus)
--- a/content/base/src/EventSource.h
+++ b/content/base/src/EventSource.h
@@ -128,32 +128,32 @@ protected:
   void FailConnection();
 
   nsresult Thaw();
   nsresult Freeze();
 
   static void TimerCallback(nsITimer *aTimer, void *aClosure);
 
   nsresult PrintErrorOnConsole(const char       *aBundleURI,
-                               const PRUnichar  *aError,
-                               const PRUnichar **aFormatStrings,
+                               const char16_t  *aError,
+                               const char16_t **aFormatStrings,
                                uint32_t          aFormatStringsLen);
   nsresult ConsoleError();
 
   static NS_METHOD StreamReaderFunc(nsIInputStream *aInputStream,
                                     void           *aClosure,
                                     const char     *aFromRawSegment,
                                     uint32_t        aToOffset,
                                     uint32_t        aCount,
                                     uint32_t       *aWriteCount);
   nsresult SetFieldAndClear();
   nsresult ClearFields();
   nsresult ResetEvent();
   nsresult DispatchCurrentMessageEvent();
-  nsresult ParseCharacter(PRUnichar aChr);
+  nsresult ParseCharacter(char16_t aChr);
   bool CheckCanRequestSrc(nsIURI* aSrc = nullptr);  // if null, it tests mSrc
   nsresult CheckHealthOfRequestCallback(nsIRequest *aRequestCallback);
   nsresult OnRedirectVerifyCallback(nsresult result);
 
   nsCOMPtr<nsIURI> mSrc;
 
   nsString mLastEventID;
   uint32_t mReconnectionTime;  // in ms
--- a/content/base/src/FragmentOrElement.cpp
+++ b/content/base/src/FragmentOrElement.cpp
@@ -1732,17 +1732,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     }
 
     nsAutoString classes;
     const nsAttrValue* classAttrValue = tmp->GetClasses();
     if (classAttrValue) {
       classes.AppendLiteral(" class='");
       nsAutoString classString;
       classAttrValue->ToString(classString);
-      classString.ReplaceChar(PRUnichar('\n'), PRUnichar(' '));
+      classString.ReplaceChar(char16_t('\n'), char16_t(' '));
       classes.Append(classString);
       classes.AppendLiteral("'");
     }
 
     const char* nsuri = nsid < ArrayLength(kNSURIs) ? kNSURIs[nsid] : "";
     PR_snprintf(name, sizeof(name), "FragmentOrElement%s %s%s%s %s",
                 nsuri,
                 localName.get(),
@@ -1861,26 +1861,26 @@ FragmentOrElement::TextLength() const
   // We can remove this assertion if it turns out to be useful to be able
   // to depend on this returning 0
   NS_NOTREACHED("called FragmentOrElement::TextLength");
 
   return 0;
 }
 
 nsresult
-FragmentOrElement::SetText(const PRUnichar* aBuffer, uint32_t aLength,
+FragmentOrElement::SetText(const char16_t* aBuffer, uint32_t aLength,
                           bool aNotify)
 {
   NS_ERROR("called FragmentOrElement::SetText");
 
   return NS_ERROR_FAILURE;
 }
 
 nsresult
-FragmentOrElement::AppendText(const PRUnichar* aBuffer, uint32_t aLength,
+FragmentOrElement::AppendText(const char16_t* aBuffer, uint32_t aLength,
                              bool aNotify)
 {
   NS_ERROR("called FragmentOrElement::AppendText");
 
   return NS_ERROR_FAILURE;
 }
 
 bool
@@ -2109,18 +2109,18 @@ private:
   {
     MOZ_COUNT_CTOR(StringBuilder);
     aFirst->mLast->mNext = this;
     aFirst->mLast = this;
   }
 
   void EncodeAttrString(const nsAutoString& aValue, nsAString& aOut)
   {
-    const PRUnichar* c = aValue.BeginReading();
-    const PRUnichar* end = aValue.EndReading();
+    const char16_t* c = aValue.BeginReading();
+    const char16_t* end = aValue.EndReading();
     while (c < end) {
       switch (*c) {
       case '"':
         aOut.AppendLiteral("&quot;");
         break;
       case '&':
         aOut.AppendLiteral("&amp;");
         break;
@@ -2134,19 +2134,19 @@ private:
       ++c;
     }
   }
 
   void EncodeTextFragment(const nsTextFragment* aValue, nsAString& aOut)
   {
     uint32_t len = aValue->GetLength();
     if (aValue->Is2b()) {
-      const PRUnichar* data = aValue->Get2b();
+      const char16_t* data = aValue->Get2b();
       for (uint32_t i = 0; i < len; ++i) {
-        const PRUnichar c = data[i];
+        const char16_t c = data[i];
         switch (c) {
           case '<':
             aOut.AppendLiteral("&lt;");
             break;
           case '>':
             aOut.AppendLiteral("&gt;");
             break;
           case '&':
@@ -2195,19 +2195,19 @@ private:
 } // anonymous namespace
 
 static void
 AppendEncodedCharacters(const nsTextFragment* aText, StringBuilder& aBuilder)
 {
   uint32_t extraSpaceNeeded = 0;
   uint32_t len = aText->GetLength();
   if (aText->Is2b()) {
-    const PRUnichar* data = aText->Get2b();
+    const char16_t* data = aText->Get2b();
     for (uint32_t i = 0; i < len; ++i) {
-      const PRUnichar c = data[i];
+      const char16_t c = data[i];
       switch (c) {
         case '<':
           extraSpaceNeeded += ArrayLength("&lt;") - 2;
           break;
         case '>':
           extraSpaceNeeded += ArrayLength("&gt;") - 2;
           break;
         case '&':
@@ -2248,18 +2248,18 @@ AppendEncodedCharacters(const nsTextFrag
   } else {
     aBuilder.Append(aText);
   }
 }
 
 static void
 AppendEncodedAttributeValue(nsAutoString* aValue, StringBuilder& aBuilder)
 {
-  const PRUnichar* c = aValue->BeginReading();
-  const PRUnichar* end = aValue->EndReading();
+  const char16_t* c = aValue->BeginReading();
+  const char16_t* end = aValue->EndReading();
 
   uint32_t extraSpaceNeeded = 0;
   while (c < end) {
     switch (*c) {
       case '"':
         extraSpaceNeeded += ArrayLength("&quot;") - 2;
         break;
       case '&':
@@ -2355,17 +2355,17 @@ StartElement(Element* aContent, StringBu
   if (aContent->IsHTML()) {
     if (localName == nsGkAtoms::pre || localName == nsGkAtoms::textarea ||
         localName == nsGkAtoms::listing) {
       nsIContent* fc = aContent->GetFirstChild();
       if (fc &&
           (fc->NodeType() == nsIDOMNode::TEXT_NODE ||
            fc->NodeType() == nsIDOMNode::CDATA_SECTION_NODE)) {
         const nsTextFragment* text = fc->GetText();
-        if (text && text->GetLength() && text->CharAt(0) == PRUnichar('\n')) {
+        if (text && text->GetLength() && text->CharAt(0) == char16_t('\n')) {
           aBuilder.Append("\n");
         }
       }
     }
   }*/
 }
 
 static inline bool
@@ -2613,25 +2613,25 @@ FragmentOrElement::GetMarkup(bool aInclu
   }
 }
 
 static bool
 ContainsMarkup(const nsAString& aStr)
 {
   // Note: we can't use FindCharInSet because null is one of the characters we
   // want to search for.
-  const PRUnichar* start = aStr.BeginReading();
-  const PRUnichar* end = aStr.EndReading();
+  const char16_t* start = aStr.BeginReading();
+  const char16_t* end = aStr.EndReading();
 
   while (start != end) {
-    PRUnichar c = *start;
-    if (c == PRUnichar('<') ||
-        c == PRUnichar('&') ||
-        c == PRUnichar('\r') ||
-        c == PRUnichar('\0')) {
+    char16_t c = *start;
+    if (c == char16_t('<') ||
+        c == char16_t('&') ||
+        c == char16_t('\r') ||
+        c == char16_t('\0')) {
       return true;
     }
     ++start;
   }
 
   return false;
 }
 
--- a/content/base/src/Link.cpp
+++ b/content/base/src/Link.cpp
@@ -296,17 +296,17 @@ Link::GetProtocol(nsAString &_protocol)
   if (!uri) {
     _protocol.AssignLiteral("http");
   }
   else {
     nsAutoCString scheme;
     (void)uri->GetScheme(scheme);
     CopyASCIItoUTF16(scheme, _protocol);
   }
-  _protocol.Append(PRUnichar(':'));
+  _protocol.Append(char16_t(':'));
   return;
 }
 
 void
 Link::GetUsername(nsAString& aUsername)
 {
   aUsername.Truncate();
 
@@ -446,17 +446,17 @@ Link::GetHash(nsAString &_hash)
     // string.
     return;
   }
 
   nsAutoCString ref;
   nsresult rv = uri->GetRef(ref);
   if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
     NS_UnescapeURL(ref); // XXX may result in random non-ASCII bytes!
-    _hash.Assign(PRUnichar('#'));
+    _hash.Assign(char16_t('#'));
     AppendUTF8toUTF16(ref, _hash);
   }
 }
 
 void
 Link::ResetLinkState(bool aNotify, bool aHasHref)
 {
   nsLinkState defaultState;
--- a/content/base/src/WebSocket.cpp
+++ b/content/base/src/WebSocket.cpp
@@ -44,17 +44,17 @@
 #include "nsDOMEventTargetHelper.h"
 #include "nsIObserverService.h"
 #include "nsIWebSocketChannel.h"
 #include "GeneratedEvents.h"
 
 namespace mozilla {
 namespace dom {
 
-#define UTF_8_REPLACEMENT_CHAR    static_cast<PRUnichar>(0xFFFD)
+#define UTF_8_REPLACEMENT_CHAR    static_cast<char16_t>(0xFFFD)
 
 class CallDispatchConnectionCloseEvents: public nsRunnable
 {
 public:
 CallDispatchConnectionCloseEvents(WebSocket* aWebSocket)
   : mWebSocket(aWebSocket)
   {}
 
@@ -69,18 +69,18 @@ private:
 };
 
 //-----------------------------------------------------------------------------
 // WebSocket
 //-----------------------------------------------------------------------------
 
 nsresult
 WebSocket::PrintErrorOnConsole(const char *aBundleURI,
-                               const PRUnichar *aError,
-                               const PRUnichar **aFormatStrings,
+                               const char16_t *aError,
+                               const char16_t **aFormatStrings,
                                uint32_t aFormatStringsLen)
 {
   NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
 
   nsresult rv;
   nsCOMPtr<nsIStringBundleService> bundleService =
     do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -167,17 +167,17 @@ WebSocket::ConsoleError()
   NS_ABORT_IF_FALSE(NS_IsMainThread(), "Not running on main thread");
 
   nsAutoCString targetSpec;
   nsresult rv = mURI->GetSpec(targetSpec);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get targetSpec");
   } else {
     NS_ConvertUTF8toUTF16 specUTF16(targetSpec);
-    const PRUnichar* formatStrings[] = { specUTF16.get() };
+    const char16_t* formatStrings[] = { specUTF16.get() };
 
     if (mReadyState < WebSocket::OPEN) {
       PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
                           MOZ_UTF16("connectionFailure"),
                           formatStrings, ArrayLength(formatStrings));
     } else {
       PrintErrorOnConsole("chrome://global/locale/appstrings.properties",
                           MOZ_UTF16("netInterrupt"),
@@ -698,18 +698,18 @@ WebSocket::Init(JSContext* aCx,
     if (originDoc && originDoc->GetSecurityInfo()) {
       return NS_ERROR_DOM_SECURITY_ERR;
     }
   }
 
   // Assign the sub protocol list and scan it for illegal values
   for (uint32_t index = 0; index < aProtocolArray.Length(); ++index) {
     for (uint32_t i = 0; i < aProtocolArray[index].Length(); ++i) {
-      if (aProtocolArray[index][i] < static_cast<PRUnichar>(0x0021) ||
-          aProtocolArray[index][i] > static_cast<PRUnichar>(0x007E))
+      if (aProtocolArray[index][i] < static_cast<char16_t>(0x0021) ||
+          aProtocolArray[index][i] > static_cast<char16_t>(0x007E))
         return NS_ERROR_DOM_SYNTAX_ERR;
     }
 
     if (!mRequestedProtocolList.IsEmpty()) {
       mRequestedProtocolList.Append(NS_LITERAL_CSTRING(", "));
     }
 
     AppendUTF16toUTF8(aProtocolArray[index], mRequestedProtocolList);
@@ -1025,18 +1025,18 @@ WebSocket::ParseURL(const nsString& aURL
   mResource = filePath;
   if (!query.IsEmpty()) {
     mResource.AppendLiteral("?");
     mResource.Append(query);
   }
   uint32_t length = mResource.Length();
   uint32_t i;
   for (i = 0; i < length; ++i) {
-    if (mResource[i] < static_cast<PRUnichar>(0x0021) ||
-        mResource[i] > static_cast<PRUnichar>(0x007E)) {
+    if (mResource[i] < static_cast<char16_t>(0x0021) ||
+        mResource[i] > static_cast<char16_t>(0x007E)) {
       return NS_ERROR_DOM_SYNTAX_ERR;
     }
   }
 
   mOriginalURL = aURL;
   mURI = parsedURL;
   return NS_OK;
 }
@@ -1327,17 +1327,17 @@ WebSocket::Close(const Optional<uint16_t
 
 //-----------------------------------------------------------------------------
 // WebSocket::nsIObserver
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 WebSocket::Observe(nsISupports* aSubject,
                    const char* aTopic,
-                   const PRUnichar* aData)
+                   const char16_t* aData)
 {
   if ((mReadyState == WebSocket::CLOSING) ||
       (mReadyState == WebSocket::CLOSED)) {
     return NS_OK;
   }
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aSubject);
   if (!GetOwner() || window != GetOwner()) {
--- a/content/base/src/WebSocket.h
+++ b/content/base/src/WebSocket.h
@@ -163,18 +163,18 @@ protected:
   void FailConnection(uint16_t reasonCode,
                       const nsACString& aReasonString = EmptyCString());
   nsresult CloseConnection(uint16_t reasonCode,
                            const nsACString& aReasonString = EmptyCString());
   nsresult Disconnect();
 
   nsresult ConsoleError();
   nsresult PrintErrorOnConsole(const char* aBundleURI,
-                               const PRUnichar* aError,
-                               const PRUnichar** aFormatStrings,
+                               const char16_t* aError,
+                               const char16_t** aFormatStrings,
                                uint32_t aFormatStringsLen);
 
   nsresult DoOnMessageAvailable(const nsACString& aMsg,
                                 bool isBinary);
 
   // ConnectionCloseEvents: 'error' event if needed, then 'close' event.
   // - These must not be dispatched while we are still within an incoming call
   //   from JS (ex: close()).  Set 'sync' to false in that case to dispatch in a
--- a/content/base/src/nsAttrValue.cpp
+++ b/content/base/src/nsAttrValue.cpp
@@ -45,17 +45,17 @@ MiscContainer::GetString(nsAString& aStr
   if (static_cast<nsAttrValue::ValueBaseType>(mStringBits &
                                               NS_ATTRVALUE_BASETYPE_MASK) ==
       nsAttrValue::eStringBase) {
     nsStringBuffer* buffer = static_cast<nsStringBuffer*>(ptr);
     if (!buffer) {
       return false;
     }
 
-    buffer->ToString(buffer->StorageSize() / sizeof(PRUnichar) - 1, aString);
+    buffer->ToString(buffer->StorageSize() / sizeof(char16_t) - 1, aString);
     return true;
   }
 
   nsIAtom* atom = static_cast<nsIAtom*>(ptr);
   if (!atom) {
     return false;
   }
 
@@ -585,17 +585,17 @@ nsAttrValue::ToString(nsAString& aResult
     }
   }
 
   switch(Type()) {
     case eString:
     {
       nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr());
       if (str) {
-        str->ToString(str->StorageSize()/sizeof(PRUnichar) - 1, aResult);
+        str->ToString(str->StorageSize()/sizeof(char16_t) - 1, aResult);
       }
       else {
         aResult.Truncate();
       }
       break;
     }
     case eAtom:
     {
@@ -835,18 +835,18 @@ nsAttrValue::AtomAt(int32_t aIndex) cons
 uint32_t
 nsAttrValue::HashValue() const
 {
   switch(BaseType()) {
     case eStringBase:
     {
       nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr());
       if (str) {
-        uint32_t len = str->StorageSize()/sizeof(PRUnichar) - 1;
-        return HashString(static_cast<PRUnichar*>(str->Data()), len);
+        uint32_t len = str->StorageSize()/sizeof(char16_t) - 1;
+        return HashString(static_cast<char16_t*>(str->Data()), len);
       }
 
       return 0;
     }
     case eOtherBase:
     {
       break;
     }
@@ -1059,18 +1059,18 @@ bool
 nsAttrValue::Equals(const nsAString& aValue,
                     nsCaseTreatment aCaseSensitive) const
 {
   switch (BaseType()) {
     case eStringBase:
     {
       nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr());
       if (str) {
-        nsDependentString dep(static_cast<PRUnichar*>(str->Data()),
-                              str->StorageSize()/sizeof(PRUnichar) - 1);
+        nsDependentString dep(static_cast<char16_t*>(str->Data()),
+                              str->StorageSize()/sizeof(char16_t) - 1);
         return aCaseSensitive == eCaseMatters ? aValue.Equals(dep) :
           nsContentUtils::EqualsIgnoreASCIICase(aValue, dep);
       }
       return aValue.IsEmpty();
     }
     case eAtomBase:
       if (aCaseSensitive == eCaseMatters) {
         return static_cast<nsIAtom*>(GetPtr())->Equals(aValue);
@@ -1098,18 +1098,18 @@ nsAttrValue::Equals(nsIAtom* aValue, nsC
     return Equals(value, aCaseSensitive);
   }
   
   switch (BaseType()) {
     case eStringBase:
     {
       nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr());
       if (str) {
-        nsDependentString dep(static_cast<PRUnichar*>(str->Data()),
-                              str->StorageSize()/sizeof(PRUnichar) - 1);
+        nsDependentString dep(static_cast<char16_t*>(str->Data()),
+                              str->StorageSize()/sizeof(char16_t) - 1);
         return aValue->Equals(dep);
       }
       return aValue == nsGkAtoms::_empty;
     }
     case eAtomBase:
     {
       return static_cast<nsIAtom*>(GetPtr()) == aValue;
     }
@@ -1859,27 +1859,27 @@ already_AddRefed<nsStringBuffer>
 nsAttrValue::GetStringBuffer(const nsAString& aValue) const
 {
   uint32_t len = aValue.Length();
   if (!len) {
     return nullptr;
   }
 
   nsRefPtr<nsStringBuffer> buf = nsStringBuffer::FromString(aValue);
-  if (buf && (buf->StorageSize()/sizeof(PRUnichar) - 1) == len) {
+  if (buf && (buf->StorageSize()/sizeof(char16_t) - 1) == len) {
     return buf.forget();
   }
 
-  buf = nsStringBuffer::Alloc((len + 1) * sizeof(PRUnichar));
+  buf = nsStringBuffer::Alloc((len + 1) * sizeof(char16_t));
   if (!buf) {
     return nullptr;
   }
-  PRUnichar *data = static_cast<PRUnichar*>(buf->Data());
+  char16_t *data = static_cast<char16_t*>(buf->Data());
   CopyUnicodeTo(aValue, 0, data, len);
-  data[len] = PRUnichar(0);
+  data[len] = char16_t(0);
   return buf.forget();
 }
 
 int32_t
 nsAttrValue::StringToInteger(const nsAString& aValue, bool* aStrict,
                              nsresult* aErrorCode,
                              bool aCanBePercent,
                              bool* aIsPercent) const
@@ -1899,40 +1899,40 @@ nsAttrValue::StringToInteger(const nsASt
     ++iter;
   }
 
   if (iter == end) {
     return 0;
   }
 
   bool negate = false;
-  if (*iter == PRUnichar('-')) {
+  if (*iter == char16_t('-')) {
     negate = true;
     ++iter;
-  } else if (*iter == PRUnichar('+')) {
+  } else if (*iter == char16_t('+')) {
     *aStrict = false;
     ++iter;
   }
 
   int32_t value = 0;
   int32_t pValue = 0; // Previous value, used to check integer overflow
   while (iter != end) {
-    if (*iter >= PRUnichar('0') && *iter <= PRUnichar('9')) {
-      value = (value * 10) + (*iter - PRUnichar('0'));
+    if (*iter >= char16_t('0') && *iter <= char16_t('9')) {
+      value = (value * 10) + (*iter - char16_t('0'));
       ++iter;
       // Checking for integer overflow.
       if (pValue > value) {
         *aStrict = false;
         *aErrorCode = NS_ERROR_ILLEGAL_VALUE;
         break;
       } else {
         pValue = value;
         *aErrorCode = NS_OK;
       }
-    } else if (aCanBePercent && *iter == PRUnichar('%')) {
+    } else if (aCanBePercent && *iter == char16_t('%')) {
       ++iter;
       *aIsPercent = true;
       if (iter != end) {
         *aStrict = false;
         break;
       }
     } else {
       *aStrict = false;
--- a/content/base/src/nsAttrValue.h
+++ b/content/base/src/nsAttrValue.h
@@ -65,17 +65,17 @@ struct ImageValue;
  * it has any unused storage space, then that will result in bogus characters
  * at the end of our nsCheapString.
  */
 class nsCheapString : public nsString {
 public:
   nsCheapString(nsStringBuffer* aBuf)
   {
     if (aBuf)
-      aBuf->ToString(aBuf->StorageSize()/sizeof(PRUnichar) - 1, *this);
+      aBuf->ToString(aBuf->StorageSize()/sizeof(char16_t) - 1, *this);
   }
 };
 
 class nsAttrValue {
   friend struct MiscContainer;
 public:
   typedef nsTArray< nsCOMPtr<nsIAtom> > AtomArray;
 
@@ -479,17 +479,17 @@ nsAttrValue::IsEmptyString() const
 inline void
 nsAttrValue::ToString(mozilla::dom::DOMString& aResult) const
 {
   switch (Type()) {
     case eString:
     {
       nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr());
       if (str) {
-        aResult.SetStringBuffer(str, str->StorageSize()/sizeof(PRUnichar) - 1);
+        aResult.SetStringBuffer(str, str->StorageSize()/sizeof(char16_t) - 1);
       }
       // else aResult is already empty
       return;
     }
     case eAtom:
     {
       nsIAtom *atom = static_cast<nsIAtom*>(GetPtr());
       aResult.SetStringBuffer(atom->GetStringBuffer(), atom->GetLength());
--- a/content/base/src/nsCCUncollectableMarker.cpp
+++ b/content/base/src/nsCCUncollectableMarker.cpp
@@ -304,17 +304,17 @@ MarkWindowList(nsISimpleEnumerator* aWin
 
       MarkDocShell(rootDocShell, aCleanupJS, aPrepareForCC);
     }
   }
 }
 
 nsresult
 nsCCUncollectableMarker::Observe(nsISupports* aSubject, const char* aTopic,
-                                 const PRUnichar* aData)
+                                 const char16_t* aData)
 {
   if (!strcmp(aTopic, "xpcom-shutdown")) {
     Element::ClearContentUnbinder();
 
     nsCOMPtr<nsIObserverService> obs =
       mozilla::services::GetObserverService();
     if (!obs)
       return NS_ERROR_FAILURE;
--- a/content/base/src/nsCSPService.cpp
+++ b/content/base/src/nsCSPService.cpp
@@ -358,17 +358,17 @@ CSPService::AsyncOnChannelRedirect(nsICh
       return NS_OK;
     }
   }
 
   // The redirecting channel isn't a writable property bag, we won't be able
   // to enforce the load policy if it redirects again, so we stop it now.
   nsAutoCString newUriSpec;
   rv = newUri->GetSpec(newUriSpec);
-  const PRUnichar *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() };
+  const char16_t *formatParams[] = { NS_ConvertUTF8toUTF16(newUriSpec).get() };
   if (NS_SUCCEEDED(rv)) {
     nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                     NS_LITERAL_CSTRING("Redirect Error"), nullptr,
                                     nsContentUtils::eDOM_PROPERTIES,
                                     "InvalidRedirectChannelWarning",
                                     formatParams, 1);
   }
 
--- a/content/base/src/nsContentSink.cpp
+++ b/content/base/src/nsContentSink.cpp
@@ -399,18 +399,18 @@ nsContentSink::Decode5987Format(nsAStrin
   nsresult rv;
   nsCOMPtr<nsIMIMEHeaderParam> mimehdrpar =
   do_GetService(NS_MIMEHEADERPARAM_CONTRACTID, &rv);
   if (NS_FAILED(rv))
     return false;
 
   nsAutoCString asciiValue;
 
-  const PRUnichar* encstart = aEncoded.BeginReading();
-  const PRUnichar* encend = aEncoded.EndReading();
+  const char16_t* encstart = aEncoded.BeginReading();
+  const char16_t* encend = aEncoded.EndReading();
 
   // create a plain ASCII string, aborting if we can't do that
   // converted form is always shorter than input
   while (encstart != encend) {
     if (*encstart > 0 && *encstart < 128) {
       asciiValue.Append((char)*encstart);
     } else {
       return false;
@@ -447,47 +447,47 @@ nsContentSink::ProcessLinkHeader(const n
   nsAutoString anchor;
 
   // copy to work buffer
   nsAutoString stringList(aLinkData);
 
   // put an extra null at the end
   stringList.Append(kNullCh);
 
-  PRUnichar* start = stringList.BeginWriting();
-  PRUnichar* end   = start;
-  PRUnichar* last  = start;
-  PRUnichar  endCh;
+  char16_t* start = stringList.BeginWriting();
+  char16_t* end   = start;
+  char16_t* last  = start;
+  char16_t  endCh;
 
   while (*start != kNullCh) {
     // skip leading space
     while ((*start != kNullCh) && nsCRT::IsAsciiSpace(*start)) {
       ++start;
     }
 
     end = start;
     last = end - 1;
 
     bool wasQuotedString = false;
     
     // look for semicolon or comma
     while (*end != kNullCh && *end != kSemicolon && *end != kComma) {
-      PRUnichar ch = *end;
+      char16_t ch = *end;
 
       if (ch == kQuote || ch == kLessThan) {
         // quoted string
 
-        PRUnichar quote = ch;
+        char16_t quote = ch;
         if (quote == kLessThan) {
           quote = kGreaterThan;
         }
         
         wasQuotedString = (ch == kQuote);
         
-        PRUnichar* closeQuote = (end + 1);
+        char16_t* closeQuote = (end + 1);
 
         // seek closing quote
         while (*closeQuote != kNullCh && quote != *closeQuote) {
           // in quoted-string, "\" is an escape character
           if (wasQuotedString && *closeQuote == kBackSlash && *(closeQuote + 1) != kNullCh) {
             ++closeQuote;
           }
 
@@ -535,42 +535,42 @@ nsContentSink::ProcessLinkHeader(const n
 
         // first instance of <...> wins
         // also, do not allow hrefs after the first param was seen
         if (href.IsEmpty() && !seenParameters) {
           href = (start + 1);
           href.StripWhitespace();
         }
       } else {
-        PRUnichar* equals = start;
+        char16_t* equals = start;
         seenParameters = true;
 
         while ((*equals != kNullCh) && (*equals != kEqual)) {
           equals++;
         }
 
         if (*equals != kNullCh) {
           *equals = kNullCh;
           nsAutoString  attr(start);
           attr.StripWhitespace();
 
-          PRUnichar* value = ++equals;
+          char16_t* value = ++equals;
           while (nsCRT::IsAsciiSpace(*value)) {
             value++;
           }
 
           if ((*value == kQuote) && (*value == *last)) {
             *last = kNullCh;
             value++;
           }
 
           if (wasQuotedString) {
             // unescape in-place
-            PRUnichar* unescaped = value;
-            PRUnichar *src = value;
+            char16_t* unescaped = value;
+            char16_t *src = value;
             
             while (*src != kNullCh) {
               if (*src == kBackSlash && *(src + 1) != kNullCh) {
                 src++;
               }
               *unescaped++ = *src++;
             }
 
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -174,17 +174,17 @@
 #include "HTMLSplitOnSpacesTokenizer.h"
 #include "nsContentTypeParser.h"
 
 #ifdef IBMBIDI
 #include "nsIBidiKeyboard.h"
 #endif
 
 extern "C" int MOZ_XMLTranslateEntity(const char* ptr, const char* end,
-                                      const char** next, PRUnichar* result);
+                                      const char** next, char16_t* result);
 extern "C" int MOZ_XMLCheckQName(const char* ptr, const char* end,
                                  int ns_aware, const char** colon);
 
 class imgLoader;
 
 using namespace mozilla::dom;
 using namespace mozilla::layers;
 using namespace mozilla::widget;
@@ -621,29 +621,29 @@ nsContentUtils::InitializeTouchEventTabl
                              touchEventArray[i]);
     }
   }
 }
 
 static bool
 Is8bit(const nsAString& aString)
 {
-  static const PRUnichar EIGHT_BIT = PRUnichar(~0x00FF);
+  static const char16_t EIGHT_BIT = char16_t(~0x00FF);
 
   nsAString::const_iterator done_reading;
   aString.EndReading(done_reading);
 
   // for each chunk of |aString|...
   uint32_t fragmentLength = 0;
   nsAString::const_iterator iter;
   for (aString.BeginReading(iter); iter != done_reading;
        iter.advance(int32_t(fragmentLength))) {
     fragmentLength = uint32_t(iter.size_forward());
-    const PRUnichar* c = iter.get();
-    const PRUnichar* fragmentEnd = c + fragmentLength;
+    const char16_t* c = iter.get();
+    const char16_t* fragmentEnd = c + fragmentLength;
 
     // for each character in this chunk...
     while (c < fragmentEnd) {
       if (*c++ & EIGHT_BIT) {
         return false;
       }
     }
   }
@@ -667,18 +667,18 @@ nsresult
 nsContentUtils::Atob(const nsAString& aAsciiBase64String,
                      nsAString& aBinaryData)
 {
   if (!Is8bit(aAsciiBase64String)) {
     aBinaryData.Truncate();
     return NS_ERROR_DOM_INVALID_CHARACTER_ERR;
   }
 
-  const PRUnichar* start = aAsciiBase64String.BeginReading();
-  const PRUnichar* end = aAsciiBase64String.EndReading();
+  const char16_t* start = aAsciiBase64String.BeginReading();
+  const char16_t* end = aAsciiBase64String.EndReading();
   nsString trimmedString;
   if (!trimmedString.SetCapacity(aAsciiBase64String.Length(), fallible_t())) {
     return NS_ERROR_DOM_INVALID_CHARACTER_ERR;
   }
   while (start < end) {
     if (!nsContentUtils::IsHTMLWhitespace(*start)) {
       trimmedString.Append(*start);
     }
@@ -727,19 +727,19 @@ nsContentUtils::IsAutocompleteEnabled(ns
   }
 
 bool
 nsContentUtils::GetPseudoAttributeValue(const nsString& aSource, nsIAtom *aName,
                                         nsAString& aValue)
 {
   aValue.Truncate();
 
-  const PRUnichar *start = aSource.get();
-  const PRUnichar *end = start + aSource.Length();
-  const PRUnichar *iter;
+  const char16_t *start = aSource.get();
+  const char16_t *end = start + aSource.Length();
+  const char16_t *iter;
 
   while (start != end) {
     SKIP_WHITESPACE(start, end, false)
     iter = start;
     SKIP_ATTR_NAME(iter, end)
 
     if (start == iter) {
       return false;
@@ -755,17 +755,17 @@ nsContentUtils::GetPseudoAttributeValue(
       // No '=', so this is not a name="value" pair.  We don't know
       // what it is, and we have no way to handle it.
       return false;
     }
 
     // Have to skip the value.
     ++start;
     SKIP_WHITESPACE(start, end, false)
-    PRUnichar q = *start;
+    char16_t q = *start;
     if (q != kQuote && q != kApostrophe) {
       // Not a valid quoted value, so bail.
       return false;
     }
 
     ++start;  // Point to the first char of the value.
     iter = start;
 
@@ -780,32 +780,32 @@ nsContentUtils::GetPseudoAttributeValue(
 
     // At this point attrName holds the name of the "attribute" and
     // the value is between start and iter.
 
     if (aName->Equals(attrName)) {
       // We'll accumulate as many characters as possible (until we hit either
       // the end of the string or the beginning of an entity). Chunks will be
       // delimited by start and chunkEnd.
-      const PRUnichar *chunkEnd = start;
+      const char16_t *chunkEnd = start;
       while (chunkEnd != iter) {
         if (*chunkEnd == kLessThan) {
           aValue.Truncate();
 
           return false;
         }
 
         if (*chunkEnd == kAmpersand) {
           aValue.Append(start, chunkEnd - start);
 
           // Point to first character after the ampersand.
           ++chunkEnd;
 
-          const PRUnichar *afterEntity = nullptr;
-          PRUnichar result[2];
+          const char16_t *afterEntity = nullptr;
+          char16_t result[2];
           uint32_t count =
             MOZ_XMLTranslateEntity(reinterpret_cast<const char*>(chunkEnd),
                                   reinterpret_cast<const char*>(iter),
                                   reinterpret_cast<const char**>(&afterEntity),
                                   result);
           if (count == 0) {
             aValue.Truncate();
 
@@ -873,17 +873,17 @@ nsContentUtils::ParseJavascriptVersion(c
 }
 
 void
 nsContentUtils::SplitMimeType(const nsAString& aValue, nsString& aType,
                               nsString& aParams)
 {
   aType.Truncate();
   aParams.Truncate();
-  int32_t semiIndex = aValue.FindChar(PRUnichar(';'));
+  int32_t semiIndex = aValue.FindChar(char16_t(';'));
   if (-1 != semiIndex) {
     aType = Substring(aValue, 0, semiIndex);
     aParams = Substring(aValue, semiIndex + 1,
                        aValue.Length() - (semiIndex + 1));
     aParams.StripWhitespace();
   }
   else {
     aType = aValue;
@@ -1077,37 +1077,37 @@ class CopyNormalizeNewlines
     OutputIterator* mDestination;
     uint32_t mWritten;
 };
 
 // static
 uint32_t
 nsContentUtils::CopyNewlineNormalizedUnicodeTo(const nsAString& aSource,
                                                uint32_t aSrcOffset,
-                                               PRUnichar* aDest,
+                                               char16_t* aDest,
                                                uint32_t aLength,
                                                bool& aLastCharCR)
 {
-  typedef NormalizeNewlinesCharTraits<PRUnichar*> sink_traits;
+  typedef NormalizeNewlinesCharTraits<char16_t*> sink_traits;
 
   sink_traits dest_traits(aDest);
   CopyNormalizeNewlines<sink_traits> normalizer(&dest_traits,aLastCharCR);
-  nsReadingIterator<PRUnichar> fromBegin, fromEnd;
+  nsReadingIterator<char16_t> fromBegin, fromEnd;
   copy_string(aSource.BeginReading(fromBegin).advance( int32_t(aSrcOffset) ),
               aSource.BeginReading(fromEnd).advance( int32_t(aSrcOffset+aLength) ),
               normalizer);
   aLastCharCR = normalizer.IsLastCharCR();
   return normalizer.GetCharsWritten();
 }
 
 // static
 uint32_t
-nsContentUtils::CopyNewlineNormalizedUnicodeTo(nsReadingIterator<PRUnichar>& aSrcStart, const nsReadingIterator<PRUnichar>& aSrcEnd, nsAString& aDest)
-{
-  typedef nsWritingIterator<PRUnichar> WritingIterator;
+nsContentUtils::CopyNewlineNormalizedUnicodeTo(nsReadingIterator<char16_t>& aSrcStart, const nsReadingIterator<char16_t>& aSrcEnd, nsAString& aDest)
+{
+  typedef nsWritingIterator<char16_t> WritingIterator;
   typedef NormalizeNewlinesCharTraits<WritingIterator> sink_traits;
 
   WritingIterator iter;
   aDest.BeginWriting(iter);
   sink_traits dest_traits(iter);
   CopyNormalizeNewlines<sink_traits> normalizer(&dest_traits);
   copy_string(aSrcStart, aSrcEnd, normalizer);
   return normalizer.GetCharsWritten();
@@ -1132,22 +1132,22 @@ nsContentUtils::IsFirstLetterPunctuation
           cat == HB_UNICODE_GENERAL_CATEGORY_FINAL_PUNCTUATION ||    // Pf
           cat == HB_UNICODE_GENERAL_CATEGORY_OTHER_PUNCTUATION);     // Po
 }
 
 // static
 bool
 nsContentUtils::IsFirstLetterPunctuationAt(const nsTextFragment* aFrag, uint32_t aOffset)
 {
-  PRUnichar h = aFrag->CharAt(aOffset);
+  char16_t h = aFrag->CharAt(aOffset);
   if (!IS_SURROGATE(h)) {
     return IsFirstLetterPunctuation(h);
   }
   if (NS_IS_HIGH_SURROGATE(h) && aOffset + 1 < aFrag->GetLength()) {
-    PRUnichar l = aFrag->CharAt(aOffset + 1);
+    char16_t l = aFrag->CharAt(aOffset + 1);
     if (NS_IS_LOW_SURROGATE(l)) {
       return IsFirstLetterPunctuation(SURROGATE_TO_UCS4(h, l));
     }
   }
   return false;
 }
 
 // static
@@ -1156,45 +1156,45 @@ bool nsContentUtils::IsAlphanumeric(uint
   nsIUGenCategory::nsUGenCategory cat = mozilla::unicode::GetGenCategory(aChar);
 
   return (cat == nsIUGenCategory::kLetter || cat == nsIUGenCategory::kNumber);
 }
  
 // static
 bool nsContentUtils::IsAlphanumericAt(const nsTextFragment* aFrag, uint32_t aOffset)
 {
-  PRUnichar h = aFrag->CharAt(aOffset);
+  char16_t h = aFrag->CharAt(aOffset);
   if (!IS_SURROGATE(h)) {
     return IsAlphanumeric(h);
   }
   if (NS_IS_HIGH_SURROGATE(h) && aOffset + 1 < aFrag->GetLength()) {
-    PRUnichar l = aFrag->CharAt(aOffset + 1);
+    char16_t l = aFrag->CharAt(aOffset + 1);
     if (NS_IS_LOW_SURROGATE(l)) {
       return IsAlphanumeric(SURROGATE_TO_UCS4(h, l));
     }
   }
   return false;
 }
 
 /* static */
 bool
-nsContentUtils::IsHTMLWhitespace(PRUnichar aChar)
-{
-  return aChar == PRUnichar(0x0009) ||
-         aChar == PRUnichar(0x000A) ||
-         aChar == PRUnichar(0x000C) ||
-         aChar == PRUnichar(0x000D) ||
-         aChar == PRUnichar(0x0020);
+nsContentUtils::IsHTMLWhitespace(char16_t aChar)
+{
+  return aChar == char16_t(0x0009) ||
+         aChar == char16_t(0x000A) ||
+         aChar == char16_t(0x000C) ||
+         aChar == char16_t(0x000D) ||
+         aChar == char16_t(0x0020);
 }
 
 /* static */
 bool
-nsContentUtils::IsHTMLWhitespaceOrNBSP(PRUnichar aChar)
-{
-  return IsHTMLWhitespace(aChar) || aChar == PRUnichar(0xA0);
+nsContentUtils::IsHTMLWhitespaceOrNBSP(char16_t aChar)
+{
+  return IsHTMLWhitespace(aChar) || aChar == char16_t(0xA0);
 }
 
 /* static */
 bool
 nsContentUtils::IsHTMLBlock(nsIAtom* aLocalName)
 {
   return
     (aLocalName == nsGkAtoms::address) ||
@@ -1319,34 +1319,34 @@ nsContentUtils::ParseLegacyFontSize(cons
   }
 
   if (iter == end) {
     return 0;
   }
 
   bool relative = false;
   bool negate = false;
-  if (*iter == PRUnichar('-')) {
+  if (*iter == char16_t('-')) {
     relative = true;
     negate = true;
     ++iter;
-  } else if (*iter == PRUnichar('+')) {
+  } else if (*iter == char16_t('+')) {
     relative = true;
     ++iter;
   }
 
-  if (*iter < PRUnichar('0') || *iter > PRUnichar('9')) {
+  if (*iter < char16_t('0') || *iter > char16_t('9')) {
     return 0;
   }
 
   // We don't have to worry about overflow, since we can bail out as soon as
   // we're bigger than 7.
   int32_t value = 0;
-  while (iter != end && *iter >= PRUnichar('0') && *iter <= PRUnichar('9')) {
-    value = 10*value + (*iter - PRUnichar('0'));
+  while (iter != end && *iter >= char16_t('0') && *iter <= char16_t('9')) {
+    value = 10*value + (*iter - char16_t('0'));
     if (value >= 7) {
       break;
     }
     ++iter;
   }
 
   if (relative) {
     if (negate) {
@@ -2087,21 +2087,21 @@ nsContentUtils::ComparePoints(nsIDOMNode
   nsCOMPtr<nsINode> parent1 = do_QueryInterface(aParent1);
   nsCOMPtr<nsINode> parent2 = do_QueryInterface(aParent2);
   NS_ENSURE_TRUE(parent1 && parent2, -1);
   return ComparePoints(parent1, aOffset1, parent2, aOffset2);
 }
 
 inline bool
 IsCharInSet(const char* aSet,
-            const PRUnichar aChar)
-{
-  PRUnichar ch;
+            const char16_t aChar)
+{
+  char16_t ch;
   while ((ch = *aSet)) {
-    if (aChar == PRUnichar(ch)) {
+    if (aChar == char16_t(ch)) {
       return true;
     }
     ++aSet;
   }
   return false;
 }
 
 /**
@@ -2140,17 +2140,17 @@ nsContentUtils::TrimCharsInSet(const cha
   return Substring(valueCurrent, valueEnd);
 }
 
 /**
  * This method strips leading and trailing whitespace from a string.
  */
 
 // static
-template<bool IsWhitespace(PRUnichar)>
+template<bool IsWhitespace(char16_t)>
 const nsDependentSubstring
 nsContentUtils::TrimWhitespace(const nsAString& aStr, bool aTrimTrailing)
 {
   nsAString::const_iterator start, end;
 
   aStr.BeginReading(start);
   aStr.EndReading(end);
 
@@ -2421,29 +2421,29 @@ nsContentUtils::NewURIWithDocumentCharse
                    aDocument ? aDocument->GetDocumentCharacterSet().get() : nullptr,
                    aBaseURI, sIOService);
 }
 
 // static
 nsresult
 nsContentUtils::CheckQName(const nsAString& aQualifiedName,
                            bool aNamespaceAware,
-                           const PRUnichar** aColon)
+                           const char16_t** aColon)
 {
   const char* colon = nullptr;
-  const PRUnichar* begin = aQualifiedName.BeginReading();
-  const PRUnichar* end = aQualifiedName.EndReading();
+  const char16_t* begin = aQualifiedName.BeginReading();
+  const char16_t* end = aQualifiedName.EndReading();
   
   int result = MOZ_XMLCheckQName(reinterpret_cast<const char*>(begin),
                                  reinterpret_cast<const char*>(end),
                                  aNamespaceAware, &colon);
 
   if (!result) {
     if (aColon) {
-      *aColon = reinterpret_cast<const PRUnichar*>(colon);
+      *aColon = reinterpret_cast<const char16_t*>(colon);
     }
 
     return NS_OK;
   }
 
   // MOZ_EXPAT_EMPTY_QNAME || MOZ_EXPAT_INVALID_CHARACTER
   if (result == (1 << 0) || result == (1 << 1)) {
     return NS_ERROR_DOM_INVALID_CHARACTER_ERR;
@@ -2453,22 +2453,22 @@ nsContentUtils::CheckQName(const nsAStri
 }
 
 //static
 nsresult
 nsContentUtils::SplitQName(const nsIContent* aNamespaceResolver,
                            const nsAFlatString& aQName,
                            int32_t *aNamespace, nsIAtom **aLocalName)
 {
-  const PRUnichar* colon;
+  const char16_t* colon;
   nsresult rv = nsContentUtils::CheckQName(aQName, true, &colon);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (colon) {
-    const PRUnichar* end;
+    const char16_t* end;
     aQName.EndReading(end);
     nsAutoString nameSpace;
     rv = aNamespaceResolver->LookupNamespaceURIInternal(Substring(aQName.get(),
                                                                   colon),
                                                         nameSpace);
     NS_ENSURE_SUCCESS(rv, rv);
 
     *aNamespace = NameSpaceManager()->GetNameSpaceID(nameSpace);
@@ -2489,24 +2489,24 @@ nsContentUtils::SplitQName(const nsICont
 nsresult
 nsContentUtils::GetNodeInfoFromQName(const nsAString& aNamespaceURI,
                                      const nsAString& aQualifiedName,
                                      nsNodeInfoManager* aNodeInfoManager,
                                      uint16_t aNodeType,
                                      nsINodeInfo** aNodeInfo)
 {
   const nsAFlatString& qName = PromiseFlatString(aQualifiedName);
-  const PRUnichar* colon;
+  const char16_t* colon;
   nsresult rv = nsContentUtils::CheckQName(qName, true, &colon);
   NS_ENSURE_SUCCESS(rv, rv);
 
   int32_t nsID;
   sNameSpaceManager->RegisterNameSpace(aNamespaceURI, nsID);
   if (colon) {
-    const PRUnichar* end;
+    const char16_t* end;
     qName.EndReading(end);
 
     nsCOMPtr<nsIAtom> prefix = do_GetAtom(Substring(qName.get(), colon));
 
     rv = aNodeInfoManager->GetNodeInfo(Substring(colon + 1, end), prefix,
                                        nsID, aNodeType, aNodeInfo);
   }
   else {
@@ -2518,57 +2518,57 @@ nsContentUtils::GetNodeInfoFromQName(con
   return nsContentUtils::IsValidNodeName((*aNodeInfo)->NameAtom(),
                                          (*aNodeInfo)->GetPrefixAtom(),
                                          (*aNodeInfo)->NamespaceID()) ?
          NS_OK : NS_ERROR_DOM_NAMESPACE_ERR;
 }
 
 // static
 void
-nsContentUtils::SplitExpatName(const PRUnichar *aExpatName, nsIAtom **aPrefix,
+nsContentUtils::SplitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix,
                                nsIAtom **aLocalName, int32_t* aNameSpaceID)
 {
   /**
    *  Expat can send the following:
    *    localName
    *    namespaceURI<separator>localName
    *    namespaceURI<separator>localName<separator>prefix
    *
    *  and we use 0xFFFF for the <separator>.
    *
    */
 
-  const PRUnichar *uriEnd = nullptr;
-  const PRUnichar *nameEnd = nullptr;
-  const PRUnichar *pos;
+  const char16_t *uriEnd = nullptr;
+  const char16_t *nameEnd = nullptr;
+  const char16_t *pos;
   for (pos = aExpatName; *pos; ++pos) {
     if (*pos == 0xFFFF) {
       if (uriEnd) {
         nameEnd = pos;
       }
       else {
         uriEnd = pos;
       }
     }
   }
 
-  const PRUnichar *nameStart;
+  const char16_t *nameStart;
   if (uriEnd) {
     if (sNameSpaceManager) {
       sNameSpaceManager->RegisterNameSpace(nsDependentSubstring(aExpatName,
                                                                 uriEnd),
                                            *aNameSpaceID);
     }
     else {
       *aNameSpaceID = kNameSpaceID_Unknown;
     }
 
     nameStart = (uriEnd + 1);
     if (nameEnd)  {
-      const PRUnichar *prefixStart = nameEnd + 1;
+      const char16_t *prefixStart = nameEnd + 1;
       *aPrefix = NS_NewAtom(Substring(prefixStart, pos)).get();
     }
     else {
       nameEnd = pos;
       *aPrefix = nullptr;
     }
   }
   else {
@@ -2998,17 +2998,17 @@ nsresult nsContentUtils::GetLocalizedStr
 
   return bundle->GetStringFromName(NS_ConvertASCIItoUTF16(aKey).get(),
                                    getter_Copies(aResult));
 }
 
 /* static */
 nsresult nsContentUtils::FormatLocalizedString(PropertiesFile aFile,
                                                const char* aKey,
-                                               const PRUnichar **aParams,
+                                               const char16_t **aParams,
                                                uint32_t aParamsLength,
                                                nsXPIDLString& aResult)
 {
   nsresult rv = EnsureStringBundle(aFile);
   NS_ENSURE_SUCCESS(rv, rv);
   nsIStringBundle *bundle = sStringBundles[aFile];
 
   return bundle->FormatStringFromName(NS_ConvertASCIItoUTF16(aKey).get(),
@@ -3035,17 +3035,17 @@ nsContentUtils::LogSimpleConsoleError(co
 }
 
 /* static */ nsresult
 nsContentUtils::ReportToConsole(uint32_t aErrorFlags,
                                 const nsACString& aCategory,
                                 nsIDocument* aDocument,
                                 PropertiesFile aFile,
                                 const char *aMessageName,
-                                const PRUnichar **aParams,
+                                const char16_t **aParams,
                                 uint32_t aParamsLength,
                                 nsIURI* aURI,
                                 const nsAFlatString& aSourceLine,
                                 uint32_t aLineNumber,
                                 uint32_t aColumnNumber)
 {
   NS_ASSERTION((aParams && aParamsLength) || (!aParams && !aParamsLength),
                "Supply either both parameters and their number or no"
@@ -3240,17 +3240,17 @@ nsContentUtils::GetContentPolicy()
 
   return sContentPolicyService;
 }
 
 // static
 bool
 nsContentUtils::IsEventAttributeName(nsIAtom* aName, int32_t aType)
 {
-  const PRUnichar* name = aName->GetUTF16String();
+  const char16_t* name = aName->GetUTF16String();
   if (name[0] != 'o' || name[1] != 'n')
     return false;
 
   EventNameMapping mapping;
   return (sAtomEventTable->Get(aName, &mapping) && mapping.mType & aType);
 }
 
 // static
@@ -3884,17 +3884,17 @@ nsContentUtils::CreateContextualFragment
       for (index = 0; index < count; index++) {
         const nsAttrName* name = content->GetAttrNameAt(index);
         if (name->NamespaceEquals(kNameSpaceID_XMLNS)) {
           content->GetAttr(kNameSpaceID_XMLNS, name->LocalName(), uriStr);
 
           // really want something like nsXMLContentSerializer::SerializeAttr
           tagName.Append(NS_LITERAL_STRING(" xmlns")); // space important
           if (name->GetPrefix()) {
-            tagName.Append(PRUnichar(':'));
+            tagName.Append(char16_t(':'));
             name->LocalName()->ToString(nameStr);
             tagName.Append(nameStr);
           } else {
             setDefaultNamespace = true;
           }
           tagName.Append(NS_LITERAL_STRING("=\"") + uriStr +
             NS_LITERAL_STRING("\""));
         }
@@ -4490,24 +4490,24 @@ nsContentUtils::GetTopLevelWidget(nsIWid
 
   return aWidget->GetTopLevelWidget();
 }
 
 /* static */
 const nsDependentString
 nsContentUtils::GetLocalizedEllipsis()
 {
-  static PRUnichar sBuf[4] = { 0, 0, 0, 0 };
+  static char16_t sBuf[4] = { 0, 0, 0, 0 };
   if (!sBuf[0]) {
     nsAdoptingString tmp = Preferences::GetLocalizedString("intl.ellipsis");
     uint32_t len = std::min(uint32_t(tmp.Length()),
                           uint32_t(ArrayLength(sBuf) - 1));
     CopyUnicodeTo(tmp, 0, sBuf, len);
     if (!sBuf[0])
-      sBuf[0] = PRUnichar(0x2026);
+      sBuf[0] = char16_t(0x2026);
   }
   return nsDependentString(sBuf);
 }
 
 static bool
 HasASCIIDigit(const nsTArray<nsShortcutCandidate>& aCandidates)
 {
   for (uint32_t i = 0; i < aCandidates.Length(); ++i) {
@@ -4518,24 +4518,24 @@ HasASCIIDigit(const nsTArray<nsShortcutC
   return false;
 }
 
 static bool
 CharsCaseInsensitiveEqual(uint32_t aChar1, uint32_t aChar2)
 {
   return aChar1 == aChar2 ||
          (IS_IN_BMP(aChar1) && IS_IN_BMP(aChar2) &&
-          ToLowerCase(PRUnichar(aChar1)) == ToLowerCase(PRUnichar(aChar2)));
+          ToLowerCase(char16_t(aChar1)) == ToLowerCase(char16_t(aChar2)));
 }
 
 static bool
 IsCaseChangeableChar(uint32_t aChar)
 {
   return IS_IN_BMP(aChar) &&
-         ToLowerCase(PRUnichar(aChar)) != ToUpperCase(PRUnichar(aChar));
+         ToLowerCase(char16_t(aChar)) != ToUpperCase(char16_t(aChar));
 }
 
 /* static */
 void
 nsContentUtils::GetAccelKeyCandidates(nsIDOMKeyEvent* aDOMKeyEvent,
                   nsTArray<nsShortcutCandidate>& aCandidates)
 {
   NS_PRECONDITION(aCandidates.IsEmpty(), "aCandidates must be empty");
@@ -4645,29 +4645,29 @@ nsContentUtils::GetAccessKeyCandidates(W
 
   // return the lower cased charCode candidates for access keys.
   // the priority of the charCodes are:
   //   0: charCode, 1: unshiftedCharCodes[0], 2: shiftedCharCodes[0]
   //   3: unshiftedCharCodes[1], 4: shiftedCharCodes[1],...
   if (aNativeKeyEvent->charCode) {
     uint32_t ch = aNativeKeyEvent->charCode;
     if (IS_IN_BMP(ch))
-      ch = ToLowerCase(PRUnichar(ch));
+      ch = ToLowerCase(char16_t(ch));
     aCandidates.AppendElement(ch);
   }
   for (uint32_t i = 0;
        i < aNativeKeyEvent->alternativeCharCodes.Length(); ++i) {
     uint32_t ch[2] =
       { aNativeKeyEvent->alternativeCharCodes[i].mUnshiftedCharCode,
         aNativeKeyEvent->alternativeCharCodes[i].mShiftedCharCode };
     for (uint32_t j = 0; j < 2; ++j) {
       if (!ch[j])
         continue;
       if (IS_IN_BMP(ch[j]))
-        ch[j] = ToLowerCase(PRUnichar(ch[j]));
+        ch[j] = ToLowerCase(char16_t(ch[j]));
       // Don't append the charCode that was already appended.
       if (aCandidates.IndexOf(ch[j]) == aCandidates.NoIndex)
         aCandidates.AppendElement(ch[j]);
     }
   }
   return;
 }
 
@@ -5178,90 +5178,90 @@ nsContentUtils::GetCurrentJSContextForTh
     return workers::GetCurrentThreadJSContext();
   }
 }
 
 /* static */
 nsresult
 nsContentUtils::ASCIIToLower(nsAString& aStr)
 {
-  PRUnichar* iter = aStr.BeginWriting();
-  PRUnichar* end = aStr.EndWriting();
+  char16_t* iter = aStr.BeginWriting();
+  char16_t* end = aStr.EndWriting();
   if (MOZ_UNLIKELY(!iter || !end)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
   while (iter != end) {
-    PRUnichar c = *iter;
+    char16_t c = *iter;
     if (c >= 'A' && c <= 'Z') {
       *iter = c + ('a' - 'A');
     }
     ++iter;
   }
   return NS_OK;
 }
 
 /* static */
 nsresult
 nsContentUtils::ASCIIToLower(const nsAString& aSource, nsAString& aDest)
 {
   uint32_t len = aSource.Length();
   aDest.SetLength(len);
   if (aDest.Length() == len) {
-    PRUnichar* dest = aDest.BeginWriting();
+    char16_t* dest = aDest.BeginWriting();
     if (MOZ_UNLIKELY(!dest)) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
-    const PRUnichar* iter = aSource.BeginReading();
-    const PRUnichar* end = aSource.EndReading();
+    const char16_t* iter = aSource.BeginReading();
+    const char16_t* end = aSource.EndReading();
     while (iter != end) {
-      PRUnichar c = *iter;
+      char16_t c = *iter;
       *dest = (c >= 'A' && c <= 'Z') ?
          c + ('a' - 'A') : c;
       ++iter;
       ++dest;
     }
     return NS_OK;
   }
   return NS_ERROR_OUT_OF_MEMORY;
 }
 
 /* static */
 nsresult
 nsContentUtils::ASCIIToUpper(nsAString& aStr)
 {
-  PRUnichar* iter = aStr.BeginWriting();
-  PRUnichar* end = aStr.EndWriting();
+  char16_t* iter = aStr.BeginWriting();
+  char16_t* end = aStr.EndWriting();
   if (MOZ_UNLIKELY(!iter || !end)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
   while (iter != end) {
-    PRUnichar c = *iter;
+    char16_t c = *iter;
     if (c >= 'a' && c <= 'z') {
       *iter = c + ('A' - 'a');
     }
     ++iter;
   }
   return NS_OK;
 }
 
 /* static */
 nsresult
 nsContentUtils::ASCIIToUpper(const nsAString& aSource, nsAString& aDest)
 {
   uint32_t len = aSource.Length();
   aDest.SetLength(len);
   if (aDest.Length() == len) {
-    PRUnichar* dest = aDest.BeginWriting();
+    char16_t* dest = aDest.BeginWriting();
     if (MOZ_UNLIKELY(!dest)) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
-    const PRUnichar* iter = aSource.BeginReading();
-    const PRUnichar* end = aSource.EndReading();
+    const char16_t* iter = aSource.BeginReading();
+    const char16_t* end = aSource.EndReading();
     while (iter != end) {
-      PRUnichar c = *iter;
+      char16_t c = *iter;
       *dest = (c >= 'a' && c <= 'z') ?
          c + ('A' - 'a') : c;
       ++iter;
       ++dest;
     }
     return NS_OK;
   }
   return NS_ERROR_OUT_OF_MEMORY;
@@ -5272,52 +5272,52 @@ bool
 nsContentUtils::EqualsIgnoreASCIICase(const nsAString& aStr1,
                                       const nsAString& aStr2)
 {
   uint32_t len = aStr1.Length();
   if (len != aStr2.Length()) {
     return false;
   }
 
-  const PRUnichar* str1 = aStr1.BeginReading();
-  const PRUnichar* str2 = aStr2.BeginReading();
-  const PRUnichar* end = str1 + len;
+  const char16_t* str1 = aStr1.BeginReading();
+  const char16_t* str2 = aStr2.BeginReading();
+  const char16_t* end = str1 + len;
 
   while (str1 < end) {
-    PRUnichar c1 = *str1++;
-    PRUnichar c2 = *str2++;
+    char16_t c1 = *str1++;
+    char16_t c2 = *str2++;
 
     // First check if any bits other than the 0x0020 differs
     if ((c1 ^ c2) & 0xffdf) {
       return false;
     }
 
     // We know they can only differ in the 0x0020 bit.
     // Likely the two chars are the same, so check that first
     if (c1 != c2) {
       // They do differ, but since it's only in the 0x0020 bit, check if it's
       // the same ascii char, but just differing in case
-      PRUnichar c1Upper = c1 & 0xffdf;
+      char16_t c1Upper = c1 & 0xffdf;
       if (!('A' <= c1Upper && c1Upper <= 'Z')) {
         return false;
       }
     }
   }
 
   return true;
 }
 
 /* static */
 bool
 nsContentUtils::StringContainsASCIIUpper(const nsAString& aStr)
 {
-  const PRUnichar* iter = aStr.BeginReading();
-  const PRUnichar* end = aStr.EndReading();
+  const char16_t* iter = aStr.BeginReading();
+  const char16_t* end = aStr.EndReading();
   while (iter != end) {
-    PRUnichar c = *iter;
+    char16_t c = *iter;
     if (c >= 'A' && c <= 'Z') {
       return true;
     }
     ++iter;
   }
 
   return false;
 }
@@ -5905,41 +5905,41 @@ void nsContentUtils::RemoveNewlines(nsSt
   // strip CR/LF and null
   static const char badChars[] = {'\r', '\n', 0};
   aString.StripChars(badChars);
 }
 
 void
 nsContentUtils::PlatformToDOMLineBreaks(nsString &aString)
 {
-  if (aString.FindChar(PRUnichar('\r')) != -1) {
+  if (aString.FindChar(char16_t('\r')) != -1) {
     // Windows linebreaks: Map CRLF to LF:
     aString.ReplaceSubstring(MOZ_UTF16("\r\n"),
                              MOZ_UTF16("\n"));
 
     // Mac linebreaks: Map any remaining CR to LF:
     aString.ReplaceSubstring(MOZ_UTF16("\r"),
                              MOZ_UTF16("\n"));
   }
 }
 
 void
 nsContentUtils::PopulateStringFromStringBuffer(nsStringBuffer* aBuf,
                                                nsAString& aResultString)
 {
   MOZ_ASSERT(aBuf, "Expecting a non-null string buffer");
 
-  uint32_t stringLen = NS_strlen(static_cast<PRUnichar*>(aBuf->Data()));
+  uint32_t stringLen = NS_strlen(static_cast<char16_t*>(aBuf->Data()));
 
   // SANITY CHECK: In case the nsStringBuffer isn't correctly
   // null-terminated, let's clamp its length using the allocated size, to be
   // sure the resulting string doesn't sample past the end of the the buffer.
   // (Note that StorageSize() is in units of bytes, so we have to convert that
   // to units of PRUnichars, and subtract 1 for the null-terminator.)
-  uint32_t allocStringLen = (aBuf->StorageSize() / sizeof(PRUnichar)) - 1;
+  uint32_t allocStringLen = (aBuf->StorageSize() / sizeof(char16_t)) - 1;
   MOZ_ASSERT(stringLen <= allocStringLen,
              "string buffer lacks null terminator!");
   stringLen = std::min(stringLen, allocStringLen);
 
   aBuf->ToString(stringLen, aResultString);
 }
 
 nsIPresShell*
--- a/content/base/src/nsCopySupport.cpp
+++ b/content/base/src/nsCopySupport.cpp
@@ -477,17 +477,17 @@ static nsresult AppendString(nsITransfer
 
   rv = data->SetData(aString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = aTransferable->AddDataFlavor(aFlavor);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return aTransferable->SetTransferData(aFlavor, data,
-                                        aString.Length() * sizeof(PRUnichar));
+                                        aString.Length() * sizeof(char16_t));
 }
 
 static nsresult AppendDOMNode(nsITransferable *aTransferable,
                               nsIDOMNode *aDOMNode)
 {
   nsresult rv;
   
   // selializer
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -602,17 +602,17 @@ nsDOMFileFile::GetInternalStream(nsIInpu
     NS_NewPartialLocalFileInputStream(aStream, mFile, mStart, mLength,
                                       -1, -1, sFileStreamFlags);
 }
 
 void
 nsDOMFileFile::SetPath(const nsAString& aPath)
 {
   MOZ_ASSERT(aPath.IsEmpty() ||
-             aPath[aPath.Length() - 1] == PRUnichar('/'),
+             aPath[aPath.Length() - 1] == char16_t('/'),
              "Path must end with a path separator");
   mPath = aPath;
 }
 
 ////////////////////////////////////////////////////////////////////////////
 // nsDOMMemoryFile implementation
 
 already_AddRefed<nsIDOMBlob>
--- a/content/base/src/nsDOMFileReader.cpp
+++ b/content/base/src/nsDOMFileReader.cpp
@@ -291,18 +291,18 @@ static
 NS_METHOD
 ReadFuncBinaryString(nsIInputStream* in,
                      void* closure,
                      const char* fromRawSegment,
                      uint32_t toOffset,
                      uint32_t count,
                      uint32_t *writeCount)
 {
-  PRUnichar* dest = static_cast<PRUnichar*>(closure) + toOffset;
-  PRUnichar* end = dest + count;
+  char16_t* dest = static_cast<char16_t*>(closure) + toOffset;
+  char16_t* end = dest + count;
   const unsigned char* source = (const unsigned char*)fromRawSegment;
   while (dest != end) {
     *dest = *source;
     ++dest;
     ++source;
   }
   *writeCount = count;
 
@@ -319,17 +319,17 @@ nsDOMFileReader::DoOnDataAvailable(nsIRe
   if (mDataFormat == FILE_AS_BINARY) {
     //Continuously update our binary string as data comes in
     NS_ASSERTION(mResult.Length() == aOffset,
                  "unexpected mResult length");
     uint32_t oldLen = mResult.Length();
     if (uint64_t(oldLen) + aCount > UINT32_MAX)
       return NS_ERROR_OUT_OF_MEMORY;
 
-    PRUnichar *buf = nullptr;
+    char16_t *buf = nullptr;
     mResult.GetMutableData(&buf, oldLen + aCount, fallible_t());
     NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
 
     uint32_t bytesRead = 0;
     aInputStream->ReadSegments(ReadFuncBinaryString, buf + oldLen, aCount,
                                &bytesRead);
     NS_ASSERTION(bytesRead == aCount, "failed to read data");
   }
--- a/content/base/src/nsDOMTokenList.cpp
+++ b/content/base/src/nsDOMTokenList.cpp
@@ -230,17 +230,17 @@ nsDOMTokenList::RemoveInternal(const nsA
       copyStart = iter;
       lastTokenRemoved = true;
 
     } else {
 
       if (lastTokenRemoved && !output.IsEmpty()) {
         NS_ABORT_IF_FALSE(!nsContentUtils::IsHTMLWhitespace(
           output.Last()), "Invalid last output token");
-        output.Append(PRUnichar(' '));
+        output.Append(char16_t(' '));
       }
       lastTokenRemoved = false;
       output.Append(Substring(copyStart, iter));
       copyStart = iter;
     }
   }
 
   mElement->SetAttr(kNameSpaceID_None, mAttrAtom, output, true);
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -4957,17 +4957,17 @@ nsDocument::CreateElement(const nsAStrin
   NS_ENSURE_FALSE(rv.Failed(), rv.ErrorCode());
   return CallQueryInterface(element, aReturn);
 }
 
 bool IsLowercaseASCII(const nsAString& aValue)
 {
   int32_t len = aValue.Length();
   for (int32_t i = 0; i < len; ++i) {
-    PRUnichar c = aValue[i];
+    char16_t c = aValue[i];
     if (!(0x0061 <= (c) && ((c) <= 0x007a))) {
       return false;
     }
   }
   return true;
 }
 
 already_AddRefed<Element>
@@ -7224,18 +7224,18 @@ nsDocument::FlushExternalResources(mozFl
   EnumerateExternalResources(Copy, &resources);
 
   for (uint32_t i = 0; i < resources.Length(); i++) {
     resources[i]->FlushPendingNotifications(aType);
   }
 }
 
 void
-nsDocument::SetXMLDeclaration(const PRUnichar *aVersion,
-                              const PRUnichar *aEncoding,
+nsDocument::SetXMLDeclaration(const char16_t *aVersion,
+                              const char16_t *aEncoding,
                               const int32_t aStandalone)
 {
   if (!aVersion || *aVersion == '\0') {
     mXMLDeclarationBits = 0;
     return;
   }
 
   mXMLDeclarationBits = XML_DECLARATION_BITS_DECLARATION_EXISTS;
@@ -10865,17 +10865,17 @@ void
 nsDocument::SetApprovedForFullscreen(bool aIsApproved)
 {
   mIsApprovedForFullscreen = aIsApproved;
 }
 
 nsresult
 nsDocument::Observe(nsISupports *aSubject,
                     const char *aTopic,
-                    const PRUnichar *aData)
+                    const char16_t *aData)
 {
   if (strcmp("fullscreen-approved", aTopic) == 0) {
     nsCOMPtr<nsIDocument> subject(do_QueryInterface(aSubject));
     if (subject != this) {
       return NS_OK;
     }
     SetApprovedForFullscreen(true);
     if (gPendingPointerLockRequest) {
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -674,18 +674,18 @@ public:
                                 nsIStyleRule* aNewStyleRule) MOZ_OVERRIDE;
   virtual void StyleRuleAdded(nsIStyleSheet* aStyleSheet,
                               nsIStyleRule* aStyleRule) MOZ_OVERRIDE;
   virtual void StyleRuleRemoved(nsIStyleSheet* aStyleSheet,
                                 nsIStyleRule* aStyleRule) MOZ_OVERRIDE;
 
   virtual void FlushPendingNotifications(mozFlushType aType) MOZ_OVERRIDE;
   virtual void FlushExternalResources(mozFlushType aType) MOZ_OVERRIDE;
-  virtual void SetXMLDeclaration(const PRUnichar *aVersion,
-                                 const PRUnichar *aEncoding,
+  virtual void SetXMLDeclaration(const char16_t *aVersion,
+                                 const char16_t *aEncoding,
                                  const int32_t aStandalone) MOZ_OVERRIDE;
   virtual void GetXMLDeclaration(nsAString& aVersion,
                                  nsAString& aEncoding,
                                  nsAString& Standalone) MOZ_OVERRIDE;
   virtual bool IsScriptEnabled() MOZ_OVERRIDE;
 
   virtual void OnPageShow(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) MOZ_OVERRIDE;
   virtual void OnPageHide(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) MOZ_OVERRIDE;
--- a/content/base/src/nsDocumentEncoder.cpp
+++ b/content/base/src/nsDocumentEncoder.cpp
@@ -546,17 +546,17 @@ ConvertAndWrite(const nsAString& aString
                 nsIOutputStream* aStream,
                 nsIUnicodeEncoder* aEncoder)
 {
   NS_ENSURE_ARG_POINTER(aStream);
   NS_ENSURE_ARG_POINTER(aEncoder);
   nsresult rv;
   int32_t charLength, startCharLength;
   const nsPromiseFlatString& flat = PromiseFlatString(aString);
-  const PRUnichar* unicodeBuf = flat.get();
+  const char16_t* unicodeBuf = flat.get();
   int32_t unicodeLength = aString.Length();
   int32_t startLength = unicodeLength;
 
   rv = aEncoder->GetMaxLength(unicodeBuf, unicodeLength, &charLength);
   startCharLength = charLength;
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString charXferString;
@@ -1018,17 +1018,17 @@ nsDocumentEncoder::EncodeToString(nsAStr
 
   nsString output;
   static const size_t bufferSize = 2048;
   if (!mCachedBuffer) {
     mCachedBuffer = nsStringBuffer::Alloc(bufferSize).get();
   }
   NS_ASSERTION(!mCachedBuffer->IsReadonly(),
                "DocumentEncoder shouldn't keep reference to non-readonly buffer!");
-  static_cast<PRUnichar*>(mCachedBuffer->Data())[0] = PRUnichar(0);
+  static_cast<char16_t*>(mCachedBuffer->Data())[0] = char16_t(0);
   mCachedBuffer->ToString(0, output, true);
   // output owns the buffer now!
   mCachedBuffer = nullptr;
   
 
   if (!mSerializer) {
     nsAutoCString progId(NS_CONTENTSERIALIZER_CONTRACTID_PREFIX);
     AppendUTF16toUTF8(mMimeType, progId);
@@ -1480,17 +1480,17 @@ nsHTMLCopyEncoder::EncodeToStringWithCon
     SerializeNodeEnd(node, aContextString);
   }
 
   // encode range info : the start and end depth of the selection, where the depth is 
   // distance down in the parent hierarchy.  Later we will need to add leading/trailing
   // whitespace info to this.
   nsAutoString infoString;
   infoString.AppendInt(mStartDepth);
-  infoString.Append(PRUnichar(','));
+  infoString.Append(char16_t(','));
   infoString.AppendInt(mEndDepth);
   aInfoString = infoString;
   
   return NS_OK;
 }
 
 
 bool
--- a/content/base/src/nsFormData.cpp
+++ b/content/base/src/nsFormData.cpp
@@ -83,17 +83,17 @@ nsFormData::Append(const nsAString& aNam
     nsCOMPtr<nsIDOMBlob> domBlob = do_QueryInterface(supports);
     if (domBlob) {
       Optional<nsAString> temp;
       Append(aName, domBlob, temp);
       return NS_OK;
     }
   }
 
-  PRUnichar* stringData = nullptr;
+  char16_t* stringData = nullptr;
   uint32_t stringLen = 0;
   rv = aValue->GetAsWStringWithSize(&stringLen, &stringData);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsString valAsString;
   valAsString.Adopt(stringData, stringLen);
 
   Append(aName, valAsString);
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -479,17 +479,17 @@ nsFrameMessageManager::GetDelayedFrameSc
 
   return NS_OK;
 }
 
 static bool
 JSONCreator(const jschar* aBuf, uint32_t aLen, void* aData)
 {
   nsAString* result = static_cast<nsAString*>(aData);
-  result->Append(static_cast<const PRUnichar*>(aBuf),
+  result->Append(static_cast<const char16_t*>(aBuf),
                  static_cast<uint32_t>(aLen));
   return true;
 }
 
 static bool
 GetParamsForMessage(JSContext* aCx,
                     const JS::Value& aJSON,
                     JSAutoStructuredCloneBuffer& aBuffer,
--- a/content/base/src/nsFrameMessageManager.h
+++ b/content/base/src/nsFrameMessageManager.h
@@ -373,16 +373,16 @@ class nsScriptCacheCleaner MOZ_FINAL : p
   {
     nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
     if (obsSvc)
       obsSvc->AddObserver(this, "xpcom-shutdown", false);
   }
 
   NS_IMETHODIMP Observe(nsISupports *aSubject,
                         const char *aTopic,
-                        const PRUnichar *aData)
+                        const char16_t *aData)
   {
     nsFrameScriptExecutor::Shutdown();
     return NS_OK;
   }
 };
 
 #endif
--- a/content/base/src/nsGenericDOMDataNode.cpp
+++ b/content/base/src/nsGenericDOMDataNode.cpp
@@ -253,17 +253,17 @@ nsGenericDOMDataNode::ReplaceData(uint32
                                   const nsAString& aData)
 {
   return SetTextInternal(aOffset, aCount, aData.BeginReading(),
                          aData.Length(), true);
 }
 
 nsresult
 nsGenericDOMDataNode::SetTextInternal(uint32_t aOffset, uint32_t aCount,
-                                      const PRUnichar* aBuffer,
+                                      const char16_t* aBuffer,
                                       uint32_t aLength, bool aNotify,
                                       CharacterDataChangeInfo::Details* aDetails)
 {
   NS_PRECONDITION(aBuffer || !aLength,
                   "Null buffer passed to SetTextInternal!");
 
   // sanitize arguments
   uint32_t textLength = mText.GetLength();
@@ -321,25 +321,25 @@ nsGenericDOMDataNode::SetTextInternal(ui
     bool ok = mText.Append(aBuffer, aLength, !document || !document->GetBidiEnabled());
     NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);
   }
   else {
     // Merging old and new
 
     // Allocate new buffer
     int32_t newLength = textLength - aCount + aLength;
-    PRUnichar* to = new PRUnichar[newLength];
+    char16_t* to = new char16_t[newLength];
     NS_ENSURE_TRUE(to, NS_ERROR_OUT_OF_MEMORY);
 
     // Copy over appropriate data
     if (aOffset) {
       mText.CopyTo(to, 0, aOffset);
     }
     if (aLength) {
-      memcpy(to + aOffset, aBuffer, aLength * sizeof(PRUnichar));
+      memcpy(to + aOffset, aBuffer, aLength * sizeof(char16_t));
     }
     if (endOffset != textLength) {
       mText.CopyTo(to + aOffset + aLength, endOffset, textLength - endOffset);
     }
 
     bool ok = mText.SetTo(to, newLength, !document || !document->GetBidiEnabled());
 
     delete [] to;
@@ -389,21 +389,21 @@ nsGenericDOMDataNode::SetTextInternal(ui
 // Implementation of nsIContent
 
 #ifdef DEBUG
 void
 nsGenericDOMDataNode::ToCString(nsAString& aBuf, int32_t aOffset,
                                 int32_t aLen) const
 {
   if (mText.Is2b()) {
-    const PRUnichar* cp = mText.Get2b() + aOffset;
-    const PRUnichar* end = cp + aLen;
+    const char16_t* cp = mText.Get2b() + aOffset;
+    const char16_t* end = cp + aLen;
 
     while (cp < end) {
-      PRUnichar ch = *cp++;
+      char16_t ch = *cp++;
       if (ch == '&') {
         aBuf.AppendLiteral("&amp;");
       } else if (ch == '<') {
         aBuf.AppendLiteral("&lt;");
       } else if (ch == '>') {
         aBuf.AppendLiteral("&gt;");
       } else if ((ch < ' ') || (ch >= 127)) {
         char buf[10];
@@ -413,17 +413,17 @@ nsGenericDOMDataNode::ToCString(nsAStrin
         aBuf.Append(ch);
       }
     }
   } else {
     unsigned char* cp = (unsigned char*)mText.Get1b() + aOffset;
     const unsigned char* end = cp + aLen;
 
     while (cp < end) {
-      PRUnichar ch = *cp++;
+      char16_t ch = *cp++;
       if (ch == '&') {
         aBuf.AppendLiteral("&amp;");
       } else if (ch == '<') {
         aBuf.AppendLiteral("&lt;");
       } else if (ch == '>') {
         aBuf.AppendLiteral("&gt;");
       } else if ((ch < ' ') || (ch >= 127)) {
         char buf[10];
@@ -917,25 +917,25 @@ nsGenericDOMDataNode::GetText()
 
 uint32_t
 nsGenericDOMDataNode::TextLength() const
 {
   return mText.GetLength();
 }
 
 nsresult
-nsGenericDOMDataNode::SetText(const PRUnichar* aBuffer,
+nsGenericDOMDataNode::SetText(const char16_t* aBuffer,
                               uint32_t aLength,
                               bool aNotify)
 {
   return SetTextInternal(0, mText.GetLength(), aBuffer, aLength, aNotify);
 }
 
 nsresult
-nsGenericDOMDataNode::AppendText(const PRUnichar* aBuffer,
+nsGenericDOMDataNode::AppendText(const char16_t* aBuffer,
                                  uint32_t aLength,
                                  bool aNotify)
 {
   return SetTextInternal(mText.GetLength(), 0, aBuffer, aLength, aNotify);
 }
 
 bool
 nsGenericDOMDataNode::TextIsOnlyWhitespace()
--- a/content/base/src/nsGenericDOMDataNode.h
+++ b/content/base/src/nsGenericDOMDataNode.h
@@ -130,24 +130,24 @@ public:
                            nsIAtom* aPrefix, const nsAString& aValue,
                            bool aNotify) MOZ_OVERRIDE;
   virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                              bool aNotify) MOZ_OVERRIDE;
   virtual const nsAttrName* GetAttrNameAt(uint32_t aIndex) const MOZ_OVERRIDE;
   virtual uint32_t GetAttrCount() const MOZ_OVERRIDE;
   virtual const nsTextFragment *GetText() MOZ_OVERRIDE;
   virtual uint32_t TextLength() const MOZ_OVERRIDE;
-  virtual nsresult SetText(const PRUnichar* aBuffer, uint32_t aLength,
+  virtual nsresult SetText(const char16_t* aBuffer, uint32_t aLength,
                            bool aNotify) MOZ_OVERRIDE;
   // Need to implement this here too to avoid hiding.
   nsresult SetText(const nsAString& aStr, bool aNotify)
   {
     return SetText(aStr.BeginReading(), aStr.Length(), aNotify);
   }
-  virtual nsresult AppendText(const PRUnichar* aBuffer, uint32_t aLength,
+  virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                               bool aNotify) MOZ_OVERRIDE;
   virtual bool TextIsOnlyWhitespace() MOZ_OVERRIDE;
   virtual void AppendTextTo(nsAString& aResult) MOZ_OVERRIDE;
   virtual void DestroyContent() MOZ_OVERRIDE;
   virtual void SaveSubtreeState() MOZ_OVERRIDE;
 
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const MOZ_OVERRIDE;
@@ -286,17 +286,17 @@ protected:
   static int32_t FirstLogicallyAdjacentTextNode(nsIContent* aParent,
                                                 int32_t aIndex);
 
   static int32_t LastLogicallyAdjacentTextNode(nsIContent* aParent,
                                                int32_t aIndex,
                                                uint32_t aCount);
 
   nsresult SetTextInternal(uint32_t aOffset, uint32_t aCount,
-                           const PRUnichar* aBuffer, uint32_t aLength,
+                           const char16_t* aBuffer, uint32_t aLength,
                            bool aNotify,
                            CharacterDataChangeInfo::Details* aDetails = nullptr);
 
   /**
    * Method to clone this node. This needs to be overriden by all derived
    * classes. If aCloneText is true the text content will be cloned too.
    *
    * @param aOwnerDocument the ownerDocument of the clone
--- a/content/base/src/nsHTMLContentSerializer.cpp
+++ b/content/base/src/nsHTMLContentSerializer.cpp
@@ -198,22 +198,22 @@ nsHTMLContentSerializer::AppendElementSt
     }
     else {
       MaybeAddNewlineForRootNode(aStr);
     }
     if (!mColPos) {
       AppendIndentation(aStr);
     }
     else if (mAddSpace) {
-      AppendToString(PRUnichar(' '), aStr);
+      AppendToString(char16_t(' '), aStr);
       mAddSpace = false;
     }
   }
   else if (mAddSpace) {
-    AppendToString(PRUnichar(' '), aStr);
+    AppendToString(char16_t(' '), aStr);
     mAddSpace = false;
   }
   else {
     MaybeAddNewlineForRootNode(aStr);
   }
   // Always reset to avoid false newlines in case MaybeAddNewlineForRootNode wasn't
   // called
   mAddNewlineForRootNode = false;
@@ -357,22 +357,22 @@ nsHTMLContentSerializer::AppendElementEn
 
     if (mColPos && lineBreakBeforeClose) {
       AppendNewLineToString(aStr);
     }
     if (!mColPos) {
       AppendIndentation(aStr);
     }
     else if (mAddSpace) {
-      AppendToString(PRUnichar(' '), aStr);
+      AppendToString(char16_t(' '), aStr);
       mAddSpace = false;
     }
   }
   else if (mAddSpace) {
-    AppendToString(PRUnichar(' '), aStr);
+    AppendToString(char16_t(' '), aStr);
     mAddSpace = false;
   }
 
   AppendToString(kEndTag, aStr);
   AppendToString(nsDependentAtomString(name), aStr);
   AppendToString(kGreaterThan, aStr);
 
   MaybeLeaveFromPreContent(content);
@@ -437,17 +437,17 @@ uint32_t FindNextBasicEntity(const nsASt
                              const uint32_t aLen,
                              uint32_t aIndex,
                              const char** aEntityTable,
                              const char** aEntity)
 {
   for (; aIndex < aLen; ++aIndex) {
     // for each character in this chunk, check if it
     // needs to be replaced
-    PRUnichar val = aStr[aIndex];
+    char16_t val = aStr[aIndex];
     if (val <= kValNBSP && aEntityTable[val]) {
       *aEntity = aEntityTable[val];
       return aIndex;
     }
   }
   return aIndex;
 }
 
@@ -490,44 +490,44 @@ nsHTMLContentSerializer::AppendAndTransl
   } else if (nonBasicEntities) {
     nsIParserService* parserService = nsContentUtils::GetParserService();
 
     if (!parserService) {
       NS_ERROR("Can't get parser service");
       return;
     }
 
-    nsReadingIterator<PRUnichar> done_reading;
+    nsReadingIterator<char16_t> done_reading;
     aStr.EndReading(done_reading);
 
     // for each chunk of |aString|...
     uint32_t advanceLength = 0;
-    nsReadingIterator<PRUnichar> iter;
+    nsReadingIterator<char16_t> iter;
 
     const char **entityTable = mInAttribute ? kAttrEntities : kEntities;
     nsAutoCString entityReplacement;
 
     for (aStr.BeginReading(iter);
          iter != done_reading;
          iter.advance(int32_t(advanceLength))) {
       uint32_t fragmentLength = iter.size_forward();
       uint32_t lengthReplaced = 0; // the number of UTF-16 codepoints
                                     //  replaced by a particular entity
-      const PRUnichar* c = iter.get();
-      const PRUnichar* fragmentStart = c;
-      const PRUnichar* fragmentEnd = c + fragmentLength;
+      const char16_t* c = iter.get();
+      const char16_t* fragmentStart = c;
+      const char16_t* fragmentEnd = c + fragmentLength;
       const char* entityText = nullptr;
       const char* fullConstEntityText = nullptr;
       char* fullEntityText = nullptr;
 
       advanceLength = 0;
       // for each character in this chunk, check if it
       // needs to be replaced
       for (; c < fragmentEnd; c++, advanceLength++) {
-        PRUnichar val = *c;
+        char16_t val = *c;
         if (val <= kValNBSP && entityTable[val]) {
           fullConstEntityText = entityTable[val];
           break;
         } else if (val > 127 &&
                   ((val < 256 &&
                     mFlags & nsIDocumentEncoder::OutputEncodeLatin1Entities) ||
                     mFlags & nsIDocumentEncoder::OutputEncodeHTMLEntities)) {
           entityReplacement.Truncate();
@@ -560,19 +560,19 @@ nsHTMLContentSerializer::AppendAndTransl
             lengthReplaced = 1;
             break;
           }
         }
       }
 
       aOutputStr.Append(fragmentStart, advanceLength);
       if (entityText) {
-        aOutputStr.Append(PRUnichar('&'));
+        aOutputStr.Append(char16_t('&'));
         AppendASCIItoUTF16(entityText, aOutputStr);
-        aOutputStr.Append(PRUnichar(';'));
+        aOutputStr.Append(char16_t(';'));
         advanceLength++;
       }
       else if (fullConstEntityText) {
         aOutputStr.AppendASCII(fullConstEntityText);
         ++advanceLength;
       }
       // if it comes from nsIEntityConverter, it already has '&' and ';'
       else if (fullEntityText) {
--- a/content/base/src/nsLineBreaker.cpp
+++ b/content/base/src/nsLineBreaker.cpp
@@ -21,17 +21,17 @@ nsLineBreaker::nsLineBreaker()
 }
 
 nsLineBreaker::~nsLineBreaker()
 {
   NS_ASSERTION(mCurrentWord.Length() == 0, "Should have Reset() before destruction!");
 }
 
 static void
-SetupCapitalization(const PRUnichar* aWord, uint32_t aLength,
+SetupCapitalization(const char16_t* aWord, uint32_t aLength,
                     bool* aCapitalization)
 {
   // Capitalize the first alphanumeric character after a space or start
   // of the word.
   // The only space character a word can contain is NBSP.
   bool capitalizeNextChar = true;
   for (uint32_t i = 0; i < aLength; ++i) {
     uint32_t ch = aWord[i];
@@ -141,17 +141,17 @@ nsLineBreaker::FlushCurrentWord()
   mTextItems.Clear();
   mCurrentWordContainsComplexChar = false;
   mCurrentWordContainsMixedLang = false;
   mCurrentWordLanguage = nullptr;
   return NS_OK;
 }
 
 nsresult
-nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const PRUnichar* aText, uint32_t aLength,
+nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText, uint32_t aLength,
                           uint32_t aFlags, nsILineBreakSink* aSink)
 {
   NS_ASSERTION(aLength > 0, "Appending empty text...");
 
   uint32_t offset = 0;
 
   // Continue the current word
   if (mCurrentWord.Length() > 0) {
@@ -214,17 +214,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
   nsRefPtr<nsHyphenator> hyphenator;
   if ((aFlags & BREAK_USE_AUTO_HYPHENATION) &&
       !(aFlags & BREAK_SUPPRESS_INSIDE) &&
       aHyphenationLanguage) {
     hyphenator = nsHyphenationManager::Instance()->GetHyphenator(aHyphenationLanguage);
   }
 
   for (;;) {
-    PRUnichar ch = aText[offset];
+    char16_t ch = aText[offset];
     bool isSpace = IsSpace(ch);
     bool isBreakableSpace = isSpace && !(aFlags & BREAK_SUPPRESS_INSIDE);
 
     if (aSink) {
       breakState[offset] =
         mBreakHere || (mAfterBreakableSpace && !isBreakableSpace) ||
         (mWordBreak == nsILineBreaker::kWordBreak_BreakAll)  ?
           gfxTextRun::CompressedGlyph::FLAG_BREAK_TYPE_NORMAL :
@@ -266,20 +266,20 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
       if (!wordHasComplexChar && IsComplexChar(ch)) {
         wordHasComplexChar = true;
       }
       ++offset;
       if (offset >= aLength) {
         // Save this word
         mCurrentWordContainsComplexChar = wordHasComplexChar;
         uint32_t len = offset - wordStart;
-        PRUnichar* elems = mCurrentWord.AppendElements(len);
+        char16_t* elems = mCurrentWord.AppendElements(len);
         if (!elems)
           return NS_ERROR_OUT_OF_MEMORY;
-        memcpy(elems, aText + wordStart, sizeof(PRUnichar)*len);
+        memcpy(elems, aText + wordStart, sizeof(char16_t)*len);
         mTextItems.AppendElement(TextItem(aSink, wordStart, len, aFlags));
         // Ensure that the break-before for this word is written out
         offset = wordStart + 1;
         UpdateCurrentWordLanguage(aHyphenationLanguage);
         break;
       }
     }
   }
@@ -292,18 +292,18 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
                                capitalizationState.Elements() + start);
     }
   }
   return NS_OK;
 }
 
 void
 nsLineBreaker::FindHyphenationPoints(nsHyphenator *aHyphenator,
-                                     const PRUnichar *aTextStart,
-                                     const PRUnichar *aTextLimit,
+                                     const char16_t *aTextStart,
+                                     const char16_t *aTextLimit,
                                      uint8_t *aBreakState)
 {
   nsDependentSubstring string(aTextStart, aTextLimit);
   nsAutoTArray<bool,200> hyphens;
   if (NS_SUCCEEDED(aHyphenator->Hyphenate(string, hyphens))) {
     for (uint32_t i = 0; i + 1 < string.Length(); ++i) {
       if (hyphens[i]) {
         aBreakState[i + 1] =
@@ -422,17 +422,17 @@ nsLineBreaker::AppendText(nsIAtom* aHyph
       if (!wordHasComplexChar && IsComplexASCIIChar(ch)) {
         wordHasComplexChar = true;
       }
       ++offset;
       if (offset >= aLength) {
         // Save this word
         mCurrentWordContainsComplexChar = wordHasComplexChar;
         uint32_t len = offset - wordStart;
-        PRUnichar* elems = mCurrentWord.AppendElements(len);
+        char16_t* elems = mCurrentWord.AppendElements(len);
         if (!elems)
           return NS_ERROR_OUT_OF_MEMORY;
         uint32_t i;
         for (i = wordStart; i < offset; ++i) {
           elems[i - wordStart] = aText[i];
         }
         mTextItems.AppendElement(TextItem(aSink, wordStart, len, aFlags));
         // Ensure that the break-before for this word is written out
--- a/content/base/src/nsMixedContentBlocker.cpp
+++ b/content/base/src/nsMixedContentBlocker.cpp
@@ -179,17 +179,17 @@ LogMixedContentMessage(MixedContentTypes
       messageLookupKey.AssignLiteral("LoadingMixedActiveContent");
     }
   }
 
   nsAutoCString locationSpec;
   aContentLocation->GetSpec(locationSpec);
   NS_ConvertUTF8toUTF16 locationSpecUTF16(locationSpec);
 
-  const PRUnichar* strings[] = { locationSpecUTF16.get() };
+  const char16_t* strings[] = { locationSpecUTF16.get() };
   nsContentUtils::ReportToConsole(severityFlag, messageCategory, aRootDoc,
                                   nsContentUtils::eSECURITY_PROPERTIES,
                                   messageLookupKey.get(), strings, ArrayLength(strings));
 }
 
 NS_IMETHODIMP
 nsMixedContentBlocker::ShouldLoad(uint32_t aContentType,
                                   nsIURI* aContentLocation,
--- a/content/base/src/nsPlainTextSerializer.cpp
+++ b/content/base/src/nsPlainTextSerializer.cpp
@@ -35,22 +35,22 @@ static const  int32_t kIndentSizeHeaders
                                                 is derived from that.
                                                 XXX center h1? */
 static const  int32_t kIndentIncrementHeaders = 2;  /* If mHeaderStrategy = 1,
                                                 indent h(x+1) this many
                                                 columns more than h(x) */
 static const  int32_t kIndentSizeList = kTabSize;
                                // Indention of non-first lines of ul and ol
 static const  int32_t kIndentSizeDD = kTabSize;  // Indention of <dd>
-static const  PRUnichar  kNBSP = 160;
-static const  PRUnichar kSPACE = ' ';
+static const  char16_t  kNBSP = 160;
+static const  char16_t kSPACE = ' ';
 
 static int32_t HeaderLevel(nsIAtom* aTag);
-static int32_t GetUnicharWidth(PRUnichar ucs);
-static int32_t GetUnicharStringWidth(const PRUnichar* pwcs, int32_t n);
+static int32_t GetUnicharWidth(char16_t ucs);
+static int32_t GetUnicharStringWidth(const char16_t* pwcs, int32_t n);
 
 // Someday may want to make this non-const:
 static const uint32_t TagStackSize = 500;
 static const uint32_t OLStackSize = 100;
 
 nsresult NS_NewPlainTextSerializer(nsIContentSerializer** aSerializer)
 {
   nsPlainTextSerializer* it = new nsPlainTextSerializer();
@@ -146,21 +146,21 @@ nsPlainTextSerializer::Init(uint32_t aFl
   // Set the line break character:
   if ((mFlags & nsIDocumentEncoder::OutputCRLineBreak)
       && (mFlags & nsIDocumentEncoder::OutputLFLineBreak)) {
     // Windows
     mLineBreak.AssignLiteral("\r\n");
   }
   else if (mFlags & nsIDocumentEncoder::OutputCRLineBreak) {
     // Mac
-    mLineBreak.Assign(PRUnichar('\r'));
+    mLineBreak.Assign(char16_t('\r'));
   }
   else if (mFlags & nsIDocumentEncoder::OutputLFLineBreak) {
     // Unix/DOM
-    mLineBreak.Assign(PRUnichar('\n'));
+    mLineBreak.Assign(char16_t('\n'));
   }
   else {
     // Platform/default
     mLineBreak.AssignLiteral(NS_LINEBREAK);
   }
 
   mLineBreakDue = false;
   mFloatingLines = -1;
@@ -619,30 +619,30 @@ nsPlainTextSerializer::DoOpenContainer(n
           int32_t valueAttrVal = valueAttr.ToInteger(&rv);
           if (NS_SUCCEEDED(rv))
             mOLStack[mOLStackIndex-1] = valueAttrVal;
         }
         // This is what nsBulletFrame does for OLs:
         mInIndentString.AppendInt(mOLStack[mOLStackIndex-1]++, 10);
       }
       else {
-        mInIndentString.Append(PRUnichar('#'));
+        mInIndentString.Append(char16_t('#'));
       }
 
-      mInIndentString.Append(PRUnichar('.'));
+      mInIndentString.Append(char16_t('.'));
 
     }
     else {
       static char bulletCharArray[] = "*o+#";
       uint32_t index = mULCount > 0 ? (mULCount - 1) : 3;
       char bulletChar = bulletCharArray[index % 4];
-      mInIndentString.Append(PRUnichar(bulletChar));
+      mInIndentString.Append(char16_t(bulletChar));
     }
 
-    mInIndentString.Append(PRUnichar(' '));
+    mInIndentString.Append(char16_t(' '));
   }
   else if (aTag == nsGkAtoms::dl) {
     EnsureVerticalSpace(1);
   }
   else if (aTag == nsGkAtoms::dt) {
     EnsureVerticalSpace(0);
   }
   else if (aTag == nsGkAtoms::dd) {
@@ -703,19 +703,19 @@ nsPlainTextSerializer::DoOpenContainer(n
       for (i = level + 1; i <= 6; i++) {
         mHeaderCounter[i] = 0;
       }
 
       // Construct numbers
       nsAutoString leadup;
       for (i = 1; i <= level; i++) {
         leadup.AppendInt(mHeaderCounter[i]);
-        leadup.Append(PRUnichar('.'));
+        leadup.Append(char16_t('.'));
       }
-      leadup.Append(PRUnichar(' '));
+      leadup.Append(char16_t(' '));
       Write(leadup);
     }
     else if (mHeaderStrategy == 1) { // indent increasingly
       mIndent += kIndentSizeHeaders;
       for (int32_t i = HeaderLevel(aTag); i > 1; i--) {
            // for h(x), run x-1 times
         mIndent += kIndentIncrementHeaders;
       }
@@ -928,17 +928,17 @@ nsPlainTextSerializer::DoCloseContainer(
       }
     }
     EnsureVerticalSpace(1);
   }
   else if (aTag == nsGkAtoms::a && !currentNodeIsConverted && !mURL.IsEmpty()) {
     nsAutoString temp; 
     temp.AssignLiteral(" <");
     temp += mURL;
-    temp.Append(PRUnichar('>'));
+    temp.Append(char16_t('>'));
     Write(temp);
     mURL.Truncate();
   }
   else if ((aTag == nsGkAtoms::sup || aTag == nsGkAtoms::sub)
            && mStructs && !currentNodeIsConverted) {
     Write(kSpace);
   }
   else if (aTag == nsGkAtoms::code && mStructs && !currentNodeIsConverted) {
@@ -1062,17 +1062,17 @@ nsPlainTextSerializer::DoAddLeaf(nsIAtom
            (mFlags & nsIDocumentEncoder::OutputFormatted)) {
     EnsureVerticalSpace(0);
 
     // Make a line of dashes as wide as the wrap width
     // XXX honoring percentage would be nice
     nsAutoString line;
     uint32_t width = (mWrapColumn > 0 ? mWrapColumn : 25);
     while (line.Length() < width) {
-      line.Append(PRUnichar('-'));
+      line.Append(char16_t('-'));
     }
     Write(line);
 
     EnsureVerticalSpace(0);
   }
   else if (mFlags & nsIDocumentEncoder::OutputNonTextContentAsPlaceholder) {
     Write(NS_LITERAL_STRING("\xFFFC"));
   }
@@ -1165,33 +1165,33 @@ nsPlainTextSerializer::Output(nsString& 
     // First, replace all nbsp characters with spaces,
     // which the unicode encoder won't do for us.
     aString.ReplaceChar(kNBSP, kSPACE);
   }
   mOutputString->Append(aString);
 }
 
 static bool
-IsSpaceStuffable(const PRUnichar *s)
+IsSpaceStuffable(const char16_t *s)
 {
   if (s[0] == '>' || s[0] == ' ' || s[0] == kNBSP ||
       nsCRT::strncmp(s, MOZ_UTF16("From "), 5) == 0)
     return true;
   else
     return false;
 }
 
 /**
  * This function adds a piece of text to the current stored line. If we are
  * wrapping text and the stored line will become too long, a suitable
  * location to wrap will be found and the line that's complete will be
  * output.
  */
 void
-nsPlainTextSerializer::AddToLine(const PRUnichar * aLineFragment, 
+nsPlainTextSerializer::AddToLine(const char16_t * aLineFragment, 
                                  int32_t aLineFragmentLength)
 {
   uint32_t prefixwidth = (mCiteQuoteLevel > 0 ? mCiteQuoteLevel + 1:0)+mIndent;
   
   if (mLineBreakDue)
     EnsureVerticalSpace(mFloatingLines);
 
   int32_t linelength = mCurrentLine.Length();
@@ -1202,17 +1202,17 @@ nsPlainTextSerializer::AddToLine(const P
     }
 
     if (mFlags & nsIDocumentEncoder::OutputFormatFlowed) {
       if (IsSpaceStuffable(aLineFragment)
          && mCiteQuoteLevel == 0  // We space-stuff quoted lines anyway
          )
         {
           // Space stuffing a la RFC 2646 (format=flowed).
-          mCurrentLine.Append(PRUnichar(' '));
+          mCurrentLine.Append(char16_t(' '));
           
           if (MayWrap()) {
             mCurrentLineWidth += GetUnicharWidth(' ');
 #ifdef DEBUG_wrapping
             NS_ASSERTION(GetUnicharStringWidth(mCurrentLine.get(),
                                                mCurrentLine.Length()) ==
                          (int32_t)mCurrentLineWidth,
                          "mCurrentLineWidth and reality out of sync!");
@@ -1322,17 +1322,17 @@ nsPlainTextSerializer::AddToLine(const P
         mCurrentLine.Truncate();
         // Space stuff new line?
         if (mFlags & nsIDocumentEncoder::OutputFormatFlowed) {
           if (!restOfLine.IsEmpty() && IsSpaceStuffable(restOfLine.get())
               && mCiteQuoteLevel == 0  // We space-stuff quoted lines anyway
             )
           {
             // Space stuffing a la RFC 2646 (format=flowed).
-            mCurrentLine.Append(PRUnichar(' '));
+            mCurrentLine.Append(char16_t(' '));
             //XXX doesn't seem to work correctly for ' '
           }
         }
         mCurrentLine.Append(restOfLine);
         mCurrentLineWidth = GetUnicharStringWidth(mCurrentLine.get(),
                                                   mCurrentLine.Length());
         linelength = mCurrentLine.Length();
         mEmptyLines = -1;
@@ -1390,17 +1390,17 @@ nsPlainTextSerializer::EndLine(bool aSof
     // We only do this when there is no indentation since format=flowed
     // lines and indentation doesn't work well together.
 
     // If breaker character is ASCII space with RFC 3676 support (delsp=yes),
     // add twice space.
     if ((mFlags & nsIDocumentEncoder::OutputFormatDelSp) && aBreakBySpace)
       mCurrentLine.Append(NS_LITERAL_STRING("  "));
     else
-      mCurrentLine.Append(PRUnichar(' '));
+      mCurrentLine.Append(char16_t(' '));
   }
 
   if (aSoftlinebreak) {
     mEmptyLines=0;
   } 
   else {
     // Hard break
     if (!mCurrentLine.IsEmpty() || !mInIndentString.IsEmpty()) {
@@ -1438,39 +1438,39 @@ void
 nsPlainTextSerializer::OutputQuotesAndIndent(bool stripTrailingSpaces /* = false */)
 {
   nsAutoString stringToOutput;
   
   // Put the mail quote "> " chars in, if appropriate:
   if (mCiteQuoteLevel > 0) {
     nsAutoString quotes;
     for(int i=0; i < mCiteQuoteLevel; i++) {
-      quotes.Append(PRUnichar('>'));
+      quotes.Append(char16_t('>'));
     }
     if (!mCurrentLine.IsEmpty()) {
       /* Better don't output a space here, if the line is empty,
          in case a receiving f=f-aware UA thinks, this were a flowed line,
          which it isn't - it's just empty.
          (Flowed lines may be joined with the following one,
          so the empty line may be lost completely.) */
-      quotes.Append(PRUnichar(' '));
+      quotes.Append(char16_t(' '));
     }
     stringToOutput = quotes;
     mAtFirstColumn = false;
   }
   
   // Indent if necessary
   int32_t indentwidth = mIndent - mInIndentString.Length();
   if (indentwidth > 0
       && (!mCurrentLine.IsEmpty() || !mInIndentString.IsEmpty())
       // Don't make empty lines look flowed
       ) {
     nsAutoString spaces;
     for (int i=0; i < indentwidth; ++i)
-      spaces.Append(PRUnichar(' '));
+      spaces.Append(char16_t(' '));
     stringToOutput += spaces;
     mAtFirstColumn = false;
   }
   
   if (!mInIndentString.IsEmpty()) {
     stringToOutput += mInIndentString;
     mAtFirstColumn = false;
     mInIndentString.Truncate();
@@ -1515,32 +1515,32 @@ nsPlainTextSerializer::Write(const nsASt
 
   // If the string is empty, do nothing:
   if (totLen <= 0) return;
 
   // For Flowed text change nbsp-ses to spaces at end of lines to allow them
   // to be cut off along with usual spaces if required. (bug #125928)
   if (mFlags & nsIDocumentEncoder::OutputFormatFlowed) {
     for (int32_t i = totLen-1; i >= 0; i--) {
-      PRUnichar c = str[i];
+      char16_t c = str[i];
       if ('\n' == c || '\r' == c || ' ' == c || '\t' == c)
         continue;
       if (kNBSP == c)
         str.Replace(i, 1, ' ');
       else
         break;
     }
   }
 
   // We have two major codepaths here. One that does preformatted text and one
   // that does normal formatted text. The one for preformatted text calls
   // Output directly while the other code path goes through AddToLine.
   if ((mPreFormatted && !mWrapColumn) || IsInPre()
       || ((mSpanLevel > 0 || mDontWrapAnyQuotes)
-          && mEmptyLines >= 0 && str.First() == PRUnichar('>'))) {
+          && mEmptyLines >= 0 && str.First() == char16_t('>'))) {
     // No intelligent wrapping.
 
     // This mustn't be mixed with intelligent wrapping without clearing
     // the mCurrentLine buffer before!!!
     NS_ASSERTION(mCurrentLine.IsEmpty(),
                  "Mixed wrapping data and nonwrapping data on the same line");
     if (!mCurrentLine.IsEmpty()) {
       FlushLine();
@@ -1573,17 +1573,17 @@ nsPlainTextSerializer::Write(const nsASt
       }
 
       // Done searching
       nsAutoString stringpart;
       if (newline == kNotFound) {
         // No new lines.
         stringpart.Assign(Substring(str, bol, totLen - bol));
         if (!stringpart.IsEmpty()) {
-          PRUnichar lastchar = stringpart[stringpart.Length()-1];
+          char16_t lastchar = stringpart[stringpart.Length()-1];
           if ((lastchar == '\t') || (lastchar == ' ') ||
              (lastchar == '\r') ||(lastchar == '\n')) {
             mInWhitespace = true;
           } 
           else {
             mInWhitespace = false;
           }
         }
@@ -1609,17 +1609,17 @@ nsPlainTextSerializer::Write(const nsASt
 
       mCurrentLine.AssignLiteral("");
       if (mFlags & nsIDocumentEncoder::OutputFormatFlowed) {
         if ((outputLineBreak || !spacesOnly) && // bugs 261467,125928
             !stringpart.EqualsLiteral("-- ") &&
             !stringpart.EqualsLiteral("- -- "))
           stringpart.Trim(" ", false, true, true);
         if (IsSpaceStuffable(stringpart.get()) && stringpart[0] != '>')
-          mCurrentLine.Append(PRUnichar(' '));
+          mCurrentLine.Append(char16_t(' '));
       }
       mCurrentLine.Append(stringpart);
 
       if (outputQuotes) {
         // Note: this call messes with mAtFirstColumn
         OutputQuotesAndIndent();
       }
 
@@ -1639,17 +1639,17 @@ nsPlainTextSerializer::Write(const nsASt
 #endif
     return;
   }
 
   // Intelligent handling of text
   // If needed, strip out all "end of lines"
   // and multiple whitespace between words
   int32_t nextpos;
-  const PRUnichar * offsetIntoBuffer = nullptr;
+  const char16_t * offsetIntoBuffer = nullptr;
   
   while (bol < totLen) {    // Loop over lines
     // Find a place where we may have to do whitespace compression
     nextpos = str.FindCharInSet(" \t\n\r", bol);
 #ifdef DEBUG_wrapping
     nsAutoString remaining;
     str.Right(remaining, totLen - bol);
     foo = ToNewCString(remaining);
@@ -1860,17 +1860,17 @@ int32_t HeaderLevel(nsIAtom* aTag)
  *    - All remaining characters (including all printable
  *      ISO 8859-1 and WGL4 characters, Unicode control characters,
  *      etc.) have a column width of 1.
  *
  * This implementation assumes that wchar_t characters are encoded
  * in ISO 10646.
  */
 
-int32_t GetUnicharWidth(PRUnichar ucs)
+int32_t GetUnicharWidth(char16_t ucs)
 {
   /* sorted list of non-overlapping intervals of non-spacing characters */
   static const struct interval {
     uint16_t first;
     uint16_t last;
   } combining[] = {
     { 0x0300, 0x034E }, { 0x0360, 0x0362 }, { 0x0483, 0x0486 },
     { 0x0488, 0x0489 }, { 0x0591, 0x05A1 }, { 0x05A3, 0x05B9 },
@@ -1942,17 +1942,17 @@ int32_t GetUnicharWidth(PRUnichar ucs)
      (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */
      (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */
      (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */
      (ucs >= 0xff00 && ucs <= 0xff5f) || /* Fullwidth Forms */
      (ucs >= 0xffe0 && ucs <= 0xffe6));
 }
 
 
-int32_t GetUnicharStringWidth(const PRUnichar* pwcs, int32_t n)
+int32_t GetUnicharStringWidth(const char16_t* pwcs, int32_t n)
 {
   int32_t w, width = 0;
 
   for (;*pwcs && n-- > 0; pwcs++)
     if ((w = GetUnicharWidth(*pwcs)) < 0)
       ++width; // Taking 1 as the width of non-printable character, for bug# 94475.
     else
       width += w;
--- a/content/base/src/nsPlainTextSerializer.h
+++ b/content/base/src/nsPlainTextSerializer.h
@@ -63,17 +63,17 @@ public:
                               nsAString& aStr) MOZ_OVERRIDE;
   NS_IMETHOD Flush(nsAString& aStr) MOZ_OVERRIDE;
 
   NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
                                  nsAString& aStr) MOZ_OVERRIDE;
 
 protected:
   nsresult GetAttributeValue(nsIAtom* aName, nsString& aValueRet);
-  void AddToLine(const PRUnichar* aStringToAdd, int32_t aLength);
+  void AddToLine(const char16_t* aStringToAdd, int32_t aLength);
   void EndLine(bool softlinebreak, bool aBreakBySpace = false);
   void EnsureVerticalSpace(int32_t noOfRows);
   void FlushLine();
   void OutputQuotesAndIndent(bool stripTrailingSpaces=false);
   void Output(nsString& aString);
   void Write(const nsAString& aString);
   bool IsInPre();
   bool IsInOL();
--- a/content/base/src/nsReferencedElement.cpp
+++ b/content/base/src/nsReferencedElement.cpp
@@ -218,17 +218,17 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsReference
                              nsRunnable)
 
 NS_IMPL_ISUPPORTS1(nsReferencedElement::DocumentLoadNotification,
                    nsIObserver)
 
 NS_IMETHODIMP
 nsReferencedElement::DocumentLoadNotification::Observe(nsISupports* aSubject,
                                                        const char* aTopic,
-                                                       const PRUnichar* aData)
+                                                       const char16_t* aData)
 {
   NS_ASSERTION(PL_strcmp(aTopic, "external-resource-document-created") == 0,
                "Unexpected topic");
   if (mTarget) {
     nsCOMPtr<nsIDocument> doc = do_QueryInterface(aSubject);
     mTarget->mPendingNotification = nullptr;
     NS_ASSERTION(!mTarget->mElement, "Why do we have content here?");
     // If we got here, that means we had Reset() called with aWatch ==
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -1230,17 +1230,17 @@ nsScriptLoader::ConvertToUTF16(nsIChanne
     unicodeDecoder->GetMaxLength(reinterpret_cast<const char*>(aData),
                                  aLength, &unicodeLength);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!aString.SetLength(unicodeLength, fallible_t())) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  PRUnichar *ustr = aString.BeginWriting();
+  char16_t *ustr = aString.BeginWriting();
 
   rv = unicodeDecoder->Convert(reinterpret_cast<const char*>(aData),
                                (int32_t *) &aLength, ustr,
                                &unicodeLength);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
   aString.SetLength(unicodeLength);
   return rv;
 }
--- a/content/base/src/nsTextFragment.cpp
+++ b/content/base/src/nsTextFragment.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * A class which represents a fragment of text (eg inside a text
  * node); if only codepoints below 256 are used, the text is stored as
- * a char*; otherwise the text is stored as a PRUnichar*
+ * a char*; otherwise the text is stored as a char16_t*
  */
 
 #include "nsTextFragment.h"
 #include "nsCRT.h"
 #include "nsReadableUtils.h"
 #include "nsMemory.h"
 #include "nsBidiUtils.h"
 #include "nsUnicharUtils.h"
@@ -100,52 +100,52 @@ nsTextFragment::operator=(const nsTextFr
   ReleaseText();
 
   if (aOther.mState.mLength) {
     if (!aOther.mState.mInHeap) {
       m1b = aOther.m1b; // This will work even if aOther is using m2b
     }
     else {
       size_t m2bSize = aOther.mState.mLength *
-        (aOther.mState.mIs2b ? sizeof(PRUnichar) : sizeof(char));
+        (aOther.mState.mIs2b ? sizeof(char16_t) : sizeof(char));
 
-      m2b = static_cast<PRUnichar*>(moz_malloc(m2bSize));
+      m2b = static_cast<char16_t*>(moz_malloc(m2bSize));
       if (m2b) {
         memcpy(m2b, aOther.m2b, m2bSize);
       } else {
         // allocate a buffer for a single REPLACEMENT CHARACTER
-        m2b = static_cast<PRUnichar*>(moz_xmalloc(sizeof(PRUnichar)));
+        m2b = static_cast<char16_t*>(moz_xmalloc(sizeof(char16_t)));
         m2b[0] = 0xFFFD; // REPLACEMENT CHARACTER
         mState.mIs2b = true;
         mState.mInHeap = true;
         mState.mLength = 1;
       }
     }
 
     if (m1b) {
       mAllBits = aOther.mAllBits;
     }
   }
 
   return *this;
 }
 
 static inline int32_t
-FirstNon8BitUnvectorized(const PRUnichar *str, const PRUnichar *end)
+FirstNon8BitUnvectorized(const char16_t *str, const char16_t *end)
 {
   typedef Non8BitParameters<sizeof(size_t)> p;
   const size_t mask = p::mask();
   const uint32_t alignMask = p::alignMask();
   const uint32_t numUnicharsPerWord = p::numUnicharsPerWord();
   const int32_t len = end - str;
   int32_t i = 0;
 
   // Align ourselves to a word boundary.
   int32_t alignLen =
-    std::min(len, int32_t(((-NS_PTR_TO_INT32(str)) & alignMask) / sizeof(PRUnichar)));
+    std::min(len, int32_t(((-NS_PTR_TO_INT32(str)) & alignMask) / sizeof(char16_t)));
   for (; i < alignLen; i++) {
     if (str[i] > 255)
       return i;
   }
 
   // Check one word at a time.
   const int32_t wordWalkEnd = ((len - i) / numUnicharsPerWord) * numUnicharsPerWord;
   for (; i < wordWalkEnd; i += numUnicharsPerWord) {
@@ -161,76 +161,76 @@ FirstNon8BitUnvectorized(const PRUnichar
   }
 
   return -1;
 }
 
 #ifdef MOZILLA_MAY_SUPPORT_SSE2
 namespace mozilla {
   namespace SSE2 {
-    int32_t FirstNon8Bit(const PRUnichar *str, const PRUnichar *end);
+    int32_t FirstNon8Bit(const char16_t *str, const char16_t *end);
   }
 }
 #endif
 
 /*
  * This function returns -1 if all characters in str are 8 bit characters.
  * Otherwise, it returns a value less than or equal to the index of the first
  * non-8bit character in str. For example, if first non-8bit character is at
  * position 25, it may return 25, or for example 24, or 16. But it guarantees
  * there is no non-8bit character before returned value.
  */
 static inline int32_t
-FirstNon8Bit(const PRUnichar *str, const PRUnichar *end)
+FirstNon8Bit(const char16_t *str, const char16_t *end)
 {
 #ifdef MOZILLA_MAY_SUPPORT_SSE2
   if (mozilla::supports_sse2()) {
     return mozilla::SSE2::FirstNon8Bit(str, end);
   }
 #endif
 
   return FirstNon8BitUnvectorized(str, end);
 }
 
 bool
-nsTextFragment::SetTo(const PRUnichar* aBuffer, int32_t aLength, bool aUpdateBidi)
+nsTextFragment::SetTo(const char16_t* aBuffer, int32_t aLength, bool aUpdateBidi)
 {
   ReleaseText();
 
   if (aLength == 0) {
     return true;
   }
   
-  PRUnichar firstChar = *aBuffer;
+  char16_t firstChar = *aBuffer;
   if (aLength == 1 && firstChar < 256) {
     m1b = sSingleCharSharedString + firstChar;
     mState.mInHeap = false;
     mState.mIs2b = false;
     mState.mLength = 1;
 
     return true;
   }
 
-  const PRUnichar *ucp = aBuffer;
-  const PRUnichar *uend = aBuffer + aLength;
+  const char16_t *ucp = aBuffer;
+  const char16_t *uend = aBuffer + aLength;
 
   // Check if we can use a shared string
   if (aLength <= 1 + TEXTFRAG_WHITE_AFTER_NEWLINE + TEXTFRAG_MAX_NEWLINES &&
      (firstChar == ' ' || firstChar == '\n' || firstChar == '\t')) {
     if (firstChar == ' ') {
       ++ucp;
     }
 
-    const PRUnichar* start = ucp;
+    const char16_t* start = ucp;
     while (ucp < uend && *ucp == '\n') {
       ++ucp;
     }
-    const PRUnichar* endNewLine = ucp;
+    const char16_t* endNewLine = ucp;
 
-    PRUnichar space = ucp < uend && *ucp == '\t' ? '\t' : ' ';
+    char16_t space = ucp < uend && *ucp == '\t' ? '\t' : ' ';
     while (ucp < uend && *ucp == space) {
       ++ucp;
     }
 
     if (ucp == uend &&
         endNewLine - start <= TEXTFRAG_MAX_NEWLINES &&
         ucp - endNewLine <= TEXTFRAG_WHITE_AFTER_NEWLINE) {
       char** strings = space == ' ' ? sSpaceSharedString : sTabSharedString;
@@ -249,18 +249,18 @@ nsTextFragment::SetTo(const PRUnichar* a
     }
   }
 
   // See if we need to store the data in ucs2 or not
   int32_t first16bit = FirstNon8Bit(ucp, uend);
 
   if (first16bit != -1) { // aBuffer contains no non-8bit character
     // Use ucs2 storage because we have to
-    size_t m2bSize = aLength * sizeof(PRUnichar);
-    m2b = (PRUnichar *)moz_malloc(m2bSize);
+    size_t m2bSize = aLength * sizeof(char16_t);
+    m2b = (char16_t *)moz_malloc(m2bSize);
     if (!m2b) {
       return false;
     }
     memcpy(m2b, aBuffer, m2bSize);
 
     mState.mIs2b = true;
     if (aUpdateBidi) {
       UpdateBidiFlag(aBuffer + first16bit, aLength - first16bit);
@@ -283,87 +283,87 @@ nsTextFragment::SetTo(const PRUnichar* a
   // Setup our fields
   mState.mInHeap = true;
   mState.mLength = aLength;
 
   return true;
 }
 
 void
-nsTextFragment::CopyTo(PRUnichar *aDest, int32_t aOffset, int32_t aCount)
+nsTextFragment::CopyTo(char16_t *aDest, int32_t aOffset, int32_t aCount)
 {
   NS_ASSERTION(aOffset >= 0, "Bad offset passed to nsTextFragment::CopyTo()!");
   NS_ASSERTION(aCount >= 0, "Bad count passed to nsTextFragment::CopyTo()!");
 
   if (aOffset < 0) {
     aOffset = 0;
   }
 
   if (uint32_t(aOffset + aCount) > GetLength()) {
     aCount = mState.mLength - aOffset;
   }
 
   if (aCount != 0) {
     if (mState.mIs2b) {
-      memcpy(aDest, m2b + aOffset, sizeof(PRUnichar) * aCount);
+      memcpy(aDest, m2b + aOffset, sizeof(char16_t) * aCount);
     } else {
       const char *cp = m1b + aOffset;
       const char *end = cp + aCount;
       LossyConvertEncoding8to16 converter(aDest);
       copy_string(cp, end, converter);
     }
   }
 }
 
 bool
-nsTextFragment::Append(const PRUnichar* aBuffer, uint32_t aLength, bool aUpdateBidi)
+nsTextFragment::Append(const char16_t* aBuffer, uint32_t aLength, bool aUpdateBidi)
 {
   // This is a common case because some callsites create a textnode
   // with a value by creating the node and then calling AppendData.
   if (mState.mLength == 0) {
     return SetTo(aBuffer, aLength, aUpdateBidi);
   }
 
   // Should we optimize for aData.Length() == 0?
 
   if (mState.mIs2b) {
     // Already a 2-byte string so the result will be too
-    PRUnichar* buff = (PRUnichar*)moz_realloc(m2b, (mState.mLength + aLength) * sizeof(PRUnichar));
+    char16_t* buff = (char16_t*)moz_realloc(m2b, (mState.mLength + aLength) * sizeof(char16_t));
     if (!buff) {
       return false;
     }
 
-    memcpy(buff + mState.mLength, aBuffer, aLength * sizeof(PRUnichar));
+    memcpy(buff + mState.mLength, aBuffer, aLength * sizeof(char16_t));
     mState.mLength += aLength;
     m2b = buff;
 
     if (aUpdateBidi) {
       UpdateBidiFlag(aBuffer, aLength);
     }
 
     return true;
   }
 
   // Current string is a 1-byte string, check if the new data fits in one byte too.
   int32_t first16bit = FirstNon8Bit(aBuffer, aBuffer + aLength);
 
   if (first16bit != -1) { // aBuffer contains no non-8bit character
     // The old data was 1-byte, but the new is not so we have to expand it
     // all to 2-byte
-    PRUnichar* buff = (PRUnichar*)moz_malloc((mState.mLength + aLength) *
-                                                  sizeof(PRUnichar));
+    char16_t* buff = (char16_t*)moz_malloc((mState.mLength + aLength) *
+                                                  sizeof(char16_t));
     if (!buff) {
       return false;
     }
 
     // Copy data into buff
     LossyConvertEncoding8to16 converter(buff);
     copy_string(m1b, m1b+mState.mLength, converter);
 
-    memcpy(buff + mState.mLength, aBuffer, aLength * sizeof(PRUnichar));
+    memcpy(buff + mState.mLength, aBuffer, aLength * sizeof(char16_t));
     mState.mLength += aLength;
     mState.mIs2b = true;
 
     if (mState.mInHeap) {
       moz_free(m2b);
     }
     m2b = buff;
 
@@ -417,28 +417,28 @@ nsTextFragment::SizeOfExcludingThis(mozi
   }
 
   return 0;
 }
 
 // To save time we only do this when we really want to know, not during
 // every allocation
 void
-nsTextFragment::UpdateBidiFlag(const PRUnichar* aBuffer, uint32_t aLength)
+nsTextFragment::UpdateBidiFlag(const char16_t* aBuffer, uint32_t aLength)
 {
   if (mState.mIs2b && !mState.mIsBidi) {
-    const PRUnichar* cp = aBuffer;
-    const PRUnichar* end = cp + aLength;
+    const char16_t* cp = aBuffer;
+    const char16_t* end = cp + aLength;
     while (cp < end) {
-      PRUnichar ch1 = *cp++;
+      char16_t ch1 = *cp++;
       uint32_t utf32Char = ch1;
       if (NS_IS_HIGH_SURROGATE(ch1) &&
           cp < end &&
           NS_IS_LOW_SURROGATE(*cp)) {
-        PRUnichar ch2 = *cp++;
+        char16_t ch2 = *cp++;
         utf32Char = SURROGATE_TO_UCS4(ch1, ch2);
       }
       if (UTF32_CHAR_IS_BIDI(utf32Char) || IsBidiControl(utf32Char)) {
         mState.mIsBidi = true;
         break;
       }
     }
   }
--- a/content/base/src/nsTextFragment.h
+++ b/content/base/src/nsTextFragment.h
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * A class which represents a fragment of text (eg inside a text
  * node); if only codepoints below 256 are used, the text is stored as
- * a char*; otherwise the text is stored as a PRUnichar*
+ * a char*; otherwise the text is stored as a char16_t*
  */
 
 #ifndef nsTextFragment_h___
 #define nsTextFragment_h___
 
 #include "mozilla/Attributes.h"
 #include "mozilla/MemoryReporting.h"
 
@@ -53,17 +53,17 @@ public:
 
   /**
    * Change the contents of this fragment to be a copy of the
    * the argument fragment, or to "" if unable to allocate enough memory.
    */
   nsTextFragment& operator=(const nsTextFragment& aOther);
 
   /**
-   * Return true if this fragment is represented by PRUnichar data
+   * Return true if this fragment is represented by char16_t data
    */
   bool Is2b() const
   {
     return mState.mIs2b;
   }
 
   /**
    * Return true if this fragment contains Bidi text
@@ -71,19 +71,19 @@ public:
    * setting the aUpdateBidi argument on SetTo or Append to true).
    */
   bool IsBidi() const
   {
     return mState.mIsBidi;
   }
 
   /**
-   * Get a pointer to constant PRUnichar data.
+   * Get a pointer to constant char16_t data.
    */
-  const PRUnichar *Get2b() const
+  const char16_t *Get2b() const
   {
     NS_ASSERTION(Is2b(), "not 2b text"); 
     return m2b;
   }
 
   /**
    * Get a pointer to constant char data.
    */
@@ -107,24 +107,24 @@ public:
     return n < (1 << 29) && mState.mLength + n < (1 << 29);
   }
 
   /**
    * Change the contents of this fragment to be a copy of the given
    * buffer. If aUpdateBidi is true, contents of the fragment will be scanned,
    * and mState.mIsBidi will be turned on if it includes any Bidi characters.
    */
-  bool SetTo(const PRUnichar* aBuffer, int32_t aLength, bool aUpdateBidi);
+  bool SetTo(const char16_t* aBuffer, int32_t aLength, bool aUpdateBidi);
 
   /**
    * Append aData to the end of this fragment. If aUpdateBidi is true, contents
    * of the fragment will be scanned, and mState.mIsBidi will be turned on if
    * it includes any Bidi characters.
    */
-  bool Append(const PRUnichar* aBuffer, uint32_t aLength, bool aUpdateBidi);
+  bool Append(const char16_t* aBuffer, uint32_t aLength, bool aUpdateBidi);
 
   /**
    * Append the contents of this string fragment to aString
    */
   void AppendTo(nsAString& aString) const {
     if (mState.mIs2b) {
       aString.Append(m2b, mState.mLength);
     } else {
@@ -146,23 +146,23 @@ public:
   }
 
   /**
    * Make a copy of the fragments contents starting at offset for
    * count characters. The offset and count will be adjusted to
    * lie within the fragments data. The fragments data is converted if
    * necessary.
    */
-  void CopyTo(PRUnichar *aDest, int32_t aOffset, int32_t aCount);
+  void CopyTo(char16_t *aDest, int32_t aOffset, int32_t aCount);
 
   /**
    * Return the character in the text-fragment at the given
-   * index. This always returns a PRUnichar.
+   * index. This always returns a char16_t.
    */
-  PRUnichar CharAt(int32_t aIndex) const
+  char16_t CharAt(int32_t aIndex) const
   {
     NS_ASSERTION(uint32_t(aIndex) < mState.mLength, "bad index");
     return mState.mIs2b ? m2b[aIndex] : static_cast<unsigned char>(m1b[aIndex]);
   }
 
   struct FragmentBits {
     // uint32_t to ensure that the values are unsigned, because we
     // want 0/1, not 0/-1!
@@ -179,20 +179,20 @@ public:
 
 private:
   void ReleaseText();
 
   /**
    * Scan the contents of the fragment and turn on mState.mIsBidi if it
    * includes any Bidi characters.
    */
-  void UpdateBidiFlag(const PRUnichar* aBuffer, uint32_t aLength);
+  void UpdateBidiFlag(const char16_t* aBuffer, uint32_t aLength);
  
   union {
-    PRUnichar *m2b;
+    char16_t *m2b;
     const char *m1b; // This is const since it can point to shared data
   };
 
   union {
     uint32_t mAllBits;
     FragmentBits mState;
   };
 };
--- a/content/base/src/nsTextFragmentSSE2.cpp
+++ b/content/base/src/nsTextFragmentSSE2.cpp
@@ -17,29 +17,29 @@ namespace SSE2 {
 static inline bool
 is_zero (__m128i x)
 {
   return
     _mm_movemask_epi8(_mm_cmpeq_epi8(x, _mm_setzero_si128())) == 0xffff;
 }
 
 int32_t
-FirstNon8Bit(const PRUnichar *str, const PRUnichar *end)
+FirstNon8Bit(const char16_t *str, const char16_t *end)
 {
   const uint32_t numUnicharsPerVector = 8;
   typedef Non8BitParameters<sizeof(size_t)> p;
   const size_t mask = p::mask();
   const uint32_t numUnicharsPerWord = p::numUnicharsPerWord();
   const int32_t len = end - str;
   int32_t i = 0;
 
   // Align ourselves to a 16-byte boundary, as required by _mm_load_si128
   // (i.e. MOVDQA).
   int32_t alignLen =
-    std::min(len, int32_t(((-NS_PTR_TO_INT32(str)) & 0xf) / sizeof(PRUnichar)));
+    std::min(len, int32_t(((-NS_PTR_TO_INT32(str)) & 0xf) / sizeof(char16_t)));
   for (; i < alignLen; i++) {
     if (str[i] > 255)
       return i;
   }
 
   // Check one XMM register (16 bytes) at a time.
   const int32_t vectWalkEnd = ((len - i) / numUnicharsPerVector) * numUnicharsPerVector;
   const uint16_t shortMask = 0xff00;
--- a/content/base/src/nsTextNode.cpp
+++ b/content/base/src/nsTextNode.cpp
@@ -117,17 +117,17 @@ nsTextNode::CloneDataNode(nsINodeInfo *a
   if (it && aCloneText) {
     it->mText = mText;
   }
 
   return it;
 }
 
 nsresult
-nsTextNode::AppendTextForNormalize(const PRUnichar* aBuffer, uint32_t aLength,
+nsTextNode::AppendTextForNormalize(const char16_t* aBuffer, uint32_t aLength,
                                    bool aNotify, nsIContent* aNextSibling)
 {
   CharacterDataChangeInfo::Details details = {
     CharacterDataChangeInfo::Details::eMerge, aNextSibling
   };
   return SetTextInternal(mText.GetLength(), 0, aBuffer, aLength, aNotify, &details);
 }
 
--- a/content/base/src/nsTextNode.h
+++ b/content/base/src/nsTextNode.h
@@ -65,17 +65,17 @@ public:
                                               bool aCloneText) const MOZ_OVERRIDE;
 
   virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                               nsIContent* aBindingParent,
                               bool aCompileEventHandlers) MOZ_OVERRIDE;
   virtual void UnbindFromTree(bool aDeep = true,
                               bool aNullParent = true) MOZ_OVERRIDE;
 
-  nsresult AppendTextForNormalize(const PRUnichar* aBuffer, uint32_t aLength,
+  nsresult AppendTextForNormalize(const char16_t* aBuffer, uint32_t aLength,
                                   bool aNotify, nsIContent* aNextSibling);
 
   virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
 
 #ifdef DEBUG
   virtual void List(FILE* out, int32_t aIndent) const MOZ_OVERRIDE;
   virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const MOZ_OVERRIDE;
 #endif
--- a/content/base/src/nsTreeSanitizer.cpp
+++ b/content/base/src/nsTreeSanitizer.cpp
@@ -1223,17 +1223,17 @@ nsTreeSanitizer::SanitizeAttributes(mozi
              aElement->IsHTML(nsGkAtoms::meta)))) {
         // name="" and rel="" are whitelisted, but treat them as blacklisted
         // for <meta name> (fragment case) and <link rel> (all cases) to avoid
         // document-wide metadata or styling overrides with non-conforming
         // <meta name itemprop> or
         // <link rel itemprop>
         continue;
       }
-      const PRUnichar* localStr = attrLocal->GetUTF16String();
+      const char16_t* localStr = attrLocal->GetUTF16String();
       // Allow underscore to cater to the MCE editor library.
       // Allow data-* on SVG and MathML, too, as a forward-compat measure.
       if (*localStr == '_' || (attrLocal->GetLength() > 5 && localStr[0] == 'd'
           && localStr[1] == 'a' && localStr[2] == 't' && localStr[3] == 'a'
           && localStr[4] == '-')) {
         continue;
       }
       // else not allowed
--- a/content/base/src/nsXMLContentSerializer.cpp
+++ b/content/base/src/nsXMLContentSerializer.cpp
@@ -146,17 +146,17 @@ nsXMLContentSerializer::AppendTextData(n
 
   if (length <= 0) {
     // XXX Zero is a legal value, maybe non-zero values should be an
     // error.
     return NS_OK;
   }
     
   if (frag->Is2b()) {
-    const PRUnichar *strStart = frag->Get2b() + aStartOffset;
+    const char16_t *strStart = frag->Get2b() + aStartOffset;
     if (aTranslateEntities) {
       AppendAndTranslateEntities(Substring(strStart, strStart + length), aStr);
     }
     else {
       aStr.Append(Substring(strStart, strStart + length));
     }
   }
   else {
@@ -271,17 +271,17 @@ nsXMLContentSerializer::AppendProcessing
   else if (mDoWrap) {
     AppendToStringWrapped(start, aStr);
   }
   else {
     AppendToString(start, aStr);
   }
 
   if (!data.IsEmpty()) {
-    AppendToString(PRUnichar(' '), aStr);
+    AppendToString(char16_t(' '), aStr);
     AppendToStringConvertLF(data, aStr);
   }
   AppendToString(NS_LITERAL_STRING("?>"), aStr);
 
   MaybeFlagNewlineForRootNode(aPI);
 
   return NS_OK;
 }
@@ -357,59 +357,59 @@ nsXMLContentSerializer::AppendDoctype(ns
   rv = docType->GetInternalSubset(internalSubset);
   if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
 
   MaybeAddNewlineForRootNode(aStr);
 
   AppendToString(NS_LITERAL_STRING("<!DOCTYPE "), aStr);
   AppendToString(name, aStr);
 
-  PRUnichar quote;
+  char16_t quote;
   if (!publicId.IsEmpty()) {
     AppendToString(NS_LITERAL_STRING(" PUBLIC "), aStr);
-    if (publicId.FindChar(PRUnichar('"')) == -1) {
-      quote = PRUnichar('"');
+    if (publicId.FindChar(char16_t('"')) == -1) {
+      quote = char16_t('"');
     }
     else {
-      quote = PRUnichar('\'');
+      quote = char16_t('\'');
     }
     AppendToString(quote, aStr);
     AppendToString(publicId, aStr);
     AppendToString(quote, aStr);
 
     if (!systemId.IsEmpty()) {
-      AppendToString(PRUnichar(' '), aStr);
-      if (systemId.FindChar(PRUnichar('"')) == -1) {
-        quote = PRUnichar('"');
+      AppendToString(char16_t(' '), aStr);
+      if (systemId.FindChar(char16_t('"')) == -1) {
+        quote = char16_t('"');
       }
       else {
-        quote = PRUnichar('\'');
+        quote = char16_t('\'');
       }
       AppendToString(quote, aStr);
       AppendToString(systemId, aStr);
       AppendToString(quote, aStr);
     }
   }
   else if (!systemId.IsEmpty()) {
-    if (systemId.FindChar(PRUnichar('"')) == -1) {
-      quote = PRUnichar('"');
+    if (systemId.FindChar(char16_t('"')) == -1) {
+      quote = char16_t('"');
     }
     else {
-      quote = PRUnichar('\'');
+      quote = char16_t('\'');
     }
     AppendToString(NS_LITERAL_STRING(" SYSTEM "), aStr);
     AppendToString(quote, aStr);
     AppendToString(systemId, aStr);
     AppendToString(quote, aStr);
   }
   
   if (!internalSubset.IsEmpty()) {
     AppendToString(NS_LITERAL_STRING(" ["), aStr);
     AppendToString(internalSubset, aStr);
-    AppendToString(PRUnichar(']'), aStr);
+    AppendToString(char16_t(']'), aStr);
   }
     
   AppendToString(kGreaterThan, aStr);
   MaybeFlagNewlineForRootNode(aDocType);
 
   return NS_OK;
 }
 
@@ -609,33 +609,33 @@ nsXMLContentSerializer::SerializeAttr(co
                                       bool aDoEscapeEntities)
 {
   nsAutoString attrString_;
   // For innerHTML we can do faster appending without
   // temporary strings.
   bool rawAppend = mDoRaw && aDoEscapeEntities;
   nsAString& attrString = (rawAppend) ? aStr : attrString_;
 
-  attrString.Append(PRUnichar(' '));
+  attrString.Append(char16_t(' '));
   if (!aPrefix.IsEmpty()) {
     attrString.Append(aPrefix);
-    attrString.Append(PRUnichar(':'));
+    attrString.Append(char16_t(':'));
   }
   attrString.Append(aName);
 
   if (aDoEscapeEntities) {
     // if problem characters are turned into character entity references
     // then there will be no problem with the value delimiter characters
     attrString.AppendLiteral("=\"");
 
     mInAttribute = true;
     AppendAndTranslateEntities(aValue, attrString);
     mInAttribute = false;
 
-    attrString.Append(PRUnichar('"'));
+    attrString.Append(char16_t('"'));
     if (rawAppend) {
       return;
     }
   }
   else {
     // Depending on whether the attribute value contains quotes or apostrophes we
     // need to select the delimiter character and escape characters using
     // character entity references, ignoring the value of aDoEscapeEntities.
@@ -645,43 +645,43 @@ nsXMLContentSerializer::SerializeAttr(co
     
     bool bIncludesSingle = false;
     bool bIncludesDouble = false;
     nsAString::const_iterator iCurr, iEnd;
     uint32_t uiSize, i;
     aValue.BeginReading(iCurr);
     aValue.EndReading(iEnd);
     for ( ; iCurr != iEnd; iCurr.advance(uiSize) ) {
-      const PRUnichar * buf = iCurr.get();
+      const char16_t * buf = iCurr.get();
       uiSize = iCurr.size_forward();
       for ( i = 0; i < uiSize; i++, buf++ ) {
-        if ( *buf == PRUnichar('\'') )
+        if ( *buf == char16_t('\'') )
         {
           bIncludesSingle = true;
           if ( bIncludesDouble ) break;
         }
-        else if ( *buf == PRUnichar('"') )
+        else if ( *buf == char16_t('"') )
         {
           bIncludesDouble = true;
           if ( bIncludesSingle ) break;
         }
       }
       // if both have been found we don't need to search further
       if ( bIncludesDouble && bIncludesSingle ) break;
     }
 
     // Delimiter and escaping is according to the following table
     //    bIncludesDouble     bIncludesSingle     Delimiter       Escape Double Quote
     //    FALSE               FALSE               "               FALSE
     //    FALSE               TRUE                "               FALSE
     //    TRUE                FALSE               '               FALSE
     //    TRUE                TRUE                "               TRUE
-    PRUnichar cDelimiter = 
-        (bIncludesDouble && !bIncludesSingle) ? PRUnichar('\'') : PRUnichar('"');
-    attrString.Append(PRUnichar('='));
+    char16_t cDelimiter = 
+        (bIncludesDouble && !bIncludesSingle) ? char16_t('\'') : char16_t('"');
+    attrString.Append(char16_t('='));
     attrString.Append(cDelimiter);
     nsAutoString sValue(aValue);
     sValue.ReplaceSubstring(NS_LITERAL_STRING("&"),
                             NS_LITERAL_STRING("&amp;"));
     if (bIncludesDouble && bIncludesSingle) {
       sValue.ReplaceSubstring(NS_LITERAL_STRING("\""),
                               NS_LITERAL_STRING("&quot;"));
     }
@@ -899,22 +899,22 @@ nsXMLContentSerializer::AppendElementSta
     }
     else {
       MaybeAddNewlineForRootNode(aStr);
     }
     if (!mColPos) {
       AppendIndentation(aStr);
     }
     else if (mAddSpace) {
-      AppendToString(PRUnichar(' '), aStr);
+      AppendToString(char16_t(' '), aStr);
       mAddSpace = false;
     }
   }
   else if (mAddSpace) {
-    AppendToString(PRUnichar(' '), aStr);
+    AppendToString(char16_t(' '), aStr);
     mAddSpace = false;
   }
   else {
     MaybeAddNewlineForRootNode(aStr);
   }
 
   // Always reset to avoid false newlines in case MaybeAddNewlineForRootNode wasn't
   // called
@@ -1010,22 +1010,22 @@ nsXMLContentSerializer::AppendElementEnd
 
     if (mColPos && lineBreakBeforeClose) {
       AppendNewLineToString(aStr);
     }
     if (!mColPos) {
       AppendIndentation(aStr);
     }
     else if (mAddSpace) {
-      AppendToString(PRUnichar(' '), aStr);
+      AppendToString(char16_t(' '), aStr);
       mAddSpace = false;
     }
   }
   else if (mAddSpace) {
-    AppendToString(PRUnichar(' '), aStr);
+    AppendToString(char16_t(' '), aStr);
     mAddSpace = false;
   }
 
   AppendToString(kEndTag, aStr);
   if (!tagPrefix.IsEmpty()) {
     AppendToString(tagPrefix, aStr);
     AppendToString(NS_LITERAL_STRING(":"), aStr);
   }
@@ -1102,17 +1102,17 @@ nsXMLContentSerializer::CheckElementEnd(
                                         nsAString& aStr)
 {
   // We don't output a separate end tag for empty element
   aForceFormat = false;
   return aContent->GetChildCount() > 0;
 }
 
 void 
-nsXMLContentSerializer::AppendToString(const PRUnichar aChar,
+nsXMLContentSerializer::AppendToString(const char16_t aChar,
                                        nsAString& aOutputStr)
 {
   if (mBodyOnly && !mInBody) {
     return;
   }
   mColPos += 1;
   aOutputStr.Append(aChar);
 }
@@ -1149,39 +1149,39 @@ static const char* kAttrEntities[] = {
   "", "", "", "", "", "", "", "", "", "",
   "&lt;", "", "&gt;"
 };
 
 void
 nsXMLContentSerializer::AppendAndTranslateEntities(const nsAString& aStr,
                                                    nsAString& aOutputStr)
 {
-  nsReadingIterator<PRUnichar> done_reading;
+  nsReadingIterator<char16_t> done_reading;
   aStr.EndReading(done_reading);
 
   // for each chunk of |aString|...
   uint32_t advanceLength = 0;
-  nsReadingIterator<PRUnichar> iter;
+  nsReadingIterator<char16_t> iter;
 
   const char **entityTable = mInAttribute ? kAttrEntities : kEntities;
 
   for (aStr.BeginReading(iter);
        iter != done_reading;
        iter.advance(int32_t(advanceLength))) {
     uint32_t fragmentLength = iter.size_forward();
-    const PRUnichar* c = iter.get();
-    const PRUnichar* fragmentStart = c;
-    const PRUnichar* fragmentEnd = c + fragmentLength;
+    const char16_t* c = iter.get();
+    const char16_t* fragmentStart = c;
+    const char16_t* fragmentEnd = c + fragmentLength;
     const char* entityText = nullptr;
 
     advanceLength = 0;
     // for each character in this chunk, check if it
     // needs to be replaced
     for (; c < fragmentEnd; c++, advanceLength++) {
-      PRUnichar val = *c;
+      char16_t val = *c;
       if ((val <= kGTVal) && (entityTable[val][0] != 0)) {
         entityText = entityTable[val];
         break;
       }
     }
 
     aOutputStr.Append(fragmentStart, advanceLength);
     if (entityText) {
@@ -1467,17 +1467,17 @@ nsXMLContentSerializer::AppendWrapped_No
     }
 
     if (aPos == aEnd || foundWhitespaceInLoop) {
       // there is enough room for the complete block we found
       if (mDoFormat && !mColPos) {
         AppendIndentation(aOutputStr);
       }
       else if (mAddSpace) {
-        aOutputStr.Append(PRUnichar(' '));
+        aOutputStr.Append(char16_t(' '));
         mAddSpace = false;
       }
 
       mColPos += length;
       aOutputStr.Append(aSequenceStart, aPos - aSequenceStart);
 
       // We have not yet reached the max column, we will continue to
       // fill the current line in the next outer loop iteration
@@ -1522,17 +1522,17 @@ nsXMLContentSerializer::AppendWrapped_No
           }
         }
 
         if (foundWrapPosition) {
           if (!mColPos && mDoFormat) {
             AppendIndentation(aOutputStr);
           }
           else if (mAddSpace) {
-            aOutputStr.Append(PRUnichar(' '));
+            aOutputStr.Append(char16_t(' '));
             mAddSpace = false;
           }
           aOutputStr.Append(aSequenceStart, wrapPosition);
 
           AppendNewLineToString(aOutputStr);
           aPos = aSequenceStart + wrapPosition;
           aMayIgnoreStartOfLineWhitespaceSequence = true;
         }
@@ -1551,17 +1551,17 @@ nsXMLContentSerializer::AppendWrapped_No
               break;
             }
 
             ++aPos;
             ++mColPos;
           } while (aPos < aEnd);
 
           if (mAddSpace) {
-            aOutputStr.Append(PRUnichar(' '));
+            aOutputStr.Append(char16_t(' '));
             mAddSpace = false;
           }
           aOutputStr.Append(aSequenceStart, aPos - aSequenceStart);
         }
       }
       aSequenceStartAfterAWhiteSpace = false;
     }
   } while (onceAgainBecauseWeAddedBreakInFront);
--- a/content/base/src/nsXMLContentSerializer.h
+++ b/content/base/src/nsXMLContentSerializer.h
@@ -65,19 +65,19 @@ class nsXMLContentSerializer : public ns
   NS_IMETHOD Flush(nsAString& aStr) MOZ_OVERRIDE { return NS_OK; }
 
   NS_IMETHOD AppendDocumentStart(nsIDocument *aDocument,
                                  nsAString& aStr) MOZ_OVERRIDE;
 
  protected:
 
   /**
-   * Appends a PRUnichar character and increments the column position
+   * Appends a char16_t character and increments the column position
    */
-  void AppendToString(const PRUnichar aChar,
+  void AppendToString(const char16_t aChar,
                       nsAString& aOutputStr);
 
   /**
    * Appends a nsAString string and increments the column position
    */
   void AppendToString(const nsAString& aStr,
                       nsAString& aOutputStr);
 
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -186,47 +186,47 @@ XMLHttpRequestAuthPrompt::XMLHttpRequest
 }
 
 XMLHttpRequestAuthPrompt::~XMLHttpRequestAuthPrompt()
 {
   MOZ_COUNT_DTOR(XMLHttpRequestAuthPrompt);
 }
 
 NS_IMETHODIMP
-XMLHttpRequestAuthPrompt::Prompt(const PRUnichar* aDialogTitle,
-                                 const PRUnichar* aText,
-                                 const PRUnichar* aPasswordRealm,
+XMLHttpRequestAuthPrompt::Prompt(const char16_t* aDialogTitle,
+                                 const char16_t* aText,
+                                 const char16_t* aPasswordRealm,
                                  uint32_t aSavePassword,
-                                 const PRUnichar* aDefaultText,
-                                 PRUnichar** aResult,
+                                 const char16_t* aDefaultText,
+                                 char16_t** aResult,
                                  bool* aRetval)
 {
   *aRetval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-XMLHttpRequestAuthPrompt::PromptUsernameAndPassword(const PRUnichar* aDialogTitle,
-                                                    const PRUnichar* aDialogText,
-                                                    const PRUnichar* aPasswordRealm,
+XMLHttpRequestAuthPrompt::PromptUsernameAndPassword(const char16_t* aDialogTitle,
+                                                    const char16_t* aDialogText,
+                                                    const char16_t* aPasswordRealm,
                                                     uint32_t aSavePassword,
-                                                    PRUnichar** aUser,
-                                                    PRUnichar** aPwd,
+                                                    char16_t** aUser,
+                                                    char16_t** aPwd,
                                                     bool* aRetval)
 {
   *aRetval = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-XMLHttpRequestAuthPrompt::PromptPassword(const PRUnichar* aDialogTitle,
-                                         const PRUnichar* aText,
-                                         const PRUnichar* aPasswordRealm,
+XMLHttpRequestAuthPrompt::PromptPassword(const char16_t* aDialogTitle,
+                                         const char16_t* aText,
+                                         const char16_t* aPasswordRealm,
                                          uint32_t aSavePassword,
-                                         PRUnichar** aPwd,
+                                         char16_t** aPwd,
                                          bool* aRetval)
 {
   *aRetval = false;
   return NS_OK;
 }
 
 /////////////////////////////////////////////
 
@@ -648,17 +648,17 @@ nsXMLHttpRequest::AppendToResponseText(c
   nsresult rv = mDecoder->GetMaxLength(aSrcBuffer, aSrcBufferLen,
                                        &destBufferLen);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!mResponseText.SetCapacity(mResponseText.Length() + destBufferLen, fallible_t())) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  PRUnichar* destBuffer = mResponseText.BeginWriting() + mResponseText.Length();
+  char16_t* destBuffer = mResponseText.BeginWriting() + mResponseText.Length();
 
   int32_t totalChars = mResponseText.Length();
 
   // This code here is basically a copy of a similar thing in
   // nsScanner::Append(const char* aBuffer, uint32_t aLen).
   int32_t srclen = (int32_t)aSrcBufferLen;
   int32_t destlen = (int32_t)destBufferLen;
   rv = mDecoder->Convert(aSrcBuffer,
@@ -2418,17 +2418,17 @@ GetRequestBody(nsIVariant* aBody, nsIInp
     // Makes us act as if !aBody, don't upload anything
     aContentType.AssignLiteral("text/plain");
     aCharset.AssignLiteral("UTF-8");
     *aContentLength = 0;
 
     return NS_OK;
   }
 
-  PRUnichar* data = nullptr;
+  char16_t* data = nullptr;
   uint32_t len = 0;
   rv = aBody->GetAsWStringWithSize(&len, &data);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsString string;
   string.Adopt(data, len);
 
   return GetRequestBody(string, aResult, aContentLength, aContentType, aCharset);
@@ -3473,17 +3473,17 @@ nsXMLHttpRequest::OnProgress(nsIRequest 
     mProgressEventSink->OnProgress(aRequest, aContext, aProgress,
                                    aProgressMax);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXMLHttpRequest::OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const PRUnichar *aStatusArg)
+nsXMLHttpRequest::OnStatus(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatus, const char16_t *aStatusArg)
 {
   if (mProgressEventSink) {
     mProgressEventSink->OnStatus(aRequest, aContext, aStatus, aStatusArg);
   }
 
   return NS_OK;
 }
 
--- a/content/canvas/public/nsICanvasRenderingContextInternal.h
+++ b/content/canvas/public/nsICanvasRenderingContextInternal.h
@@ -76,17 +76,17 @@ public:
 
   // Gives you a stream containing the image represented by this context.
   // The format is given in aMimeTime, for example "image/png".
   //
   // If the image format does not support transparency or aIncludeTransparency
   // is false, alpha will be discarded and the result will be the image
   // composited on black.
   NS_IMETHOD GetInputStream(const char *aMimeType,
-                            const PRUnichar *aEncoderOptions,
+                            const char16_t *aEncoderOptions,
                             nsIInputStream **aStream) = 0;
 
   // If this canvas context can be represented with a simple Thebes surface,
   // return the surface.  Otherwise returns an error.
   NS_IMETHOD GetThebesSurface(gfxASurface **surface) = 0;
   
   // This gets an Azure SourceSurface for the canvas, this will be a snapshot
   // of the canvas at the time it was called.
--- a/content/canvas/src/CanvasImageCache.cpp
+++ b/content/canvas/src/CanvasImageCache.cpp
@@ -189,17 +189,17 @@ CanvasImageCache::Lookup(Element* aImage
   return entry->mData->mSourceSurface;
 }
 
 NS_IMPL_ISUPPORTS1(CanvasImageCacheShutdownObserver, nsIObserver)
 
 NS_IMETHODIMP
 CanvasImageCacheShutdownObserver::Observe(nsISupports *aSubject,
                                           const char *aTopic,
-                                          const PRUnichar *aData)
+                                          const char16_t *aData)
 {
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     delete gImageCache;
     gImageCache = nullptr;
 
     nsContentUtils::UnregisterShutdownObserver(this);
   }
 
--- a/content/canvas/src/CanvasRenderingContext2D.cpp
+++ b/content/canvas/src/CanvasRenderingContext2D.cpp
@@ -1101,17 +1101,17 @@ CanvasRenderingContext2D::GetImageBuffer
   }
 
   *aImageBuffer = SurfaceToPackedBGRA(data);
   *aFormat = imgIEncoder::INPUT_FORMAT_HOSTARGB;
 }
 
 NS_IMETHODIMP
 CanvasRenderingContext2D::GetInputStream(const char *aMimeType,
-                                         const PRUnichar *aEncoderOptions,
+                                         const char16_t *aEncoderOptions,
                                          nsIInputStream **aStream)
 {
   nsCString enccid("@mozilla.org/image/encoder;2?type=");
   enccid += aMimeType;
   nsCOMPtr<imgIEncoder> encoder = do_CreateInstance(enccid.get());
   if (!encoder) {
     return NS_ERROR_FAILURE;
   }
@@ -2328,17 +2328,17 @@ CanvasRenderingContext2D::GetTextBaselin
  * with U+0020 SPACE. The whitespace characters are defined as U+0020 SPACE,
  * U+0009 CHARACTER TABULATION (tab), U+000A LINE FEED (LF), U+000B LINE
  * TABULATION, U+000C FORM FEED (FF), and U+000D CARRIAGE RETURN (CR).
  * @param str The string whose whitespace characters to replace.
  */
 static inline void
 TextReplaceWhitespaceCharacters(nsAutoString& str)
 {
-  str.ReplaceChar("\x09\x0A\x0B\x0C\x0D", PRUnichar(' '));
+  str.ReplaceChar("\x09\x0A\x0B\x0C\x0D", char16_t(' '));
 }
 
 void
 CanvasRenderingContext2D::FillText(const nsAString& text, double x,
                                    double y,
                                    const Optional<double>& maxWidth,
                                    ErrorResult& error)
 {
@@ -2370,17 +2370,17 @@ CanvasRenderingContext2D::MeasureText(co
 
 /**
  * Used for nsBidiPresUtils::ProcessText
  */
 struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcessor
 {
   typedef CanvasRenderingContext2D::ContextState ContextState;
 
-  virtual void SetText(const PRUnichar* text, int32_t length, nsBidiDirection direction)
+  virtual void SetText(const char16_t* text, int32_t length, nsBidiDirection direction)
   {
     mFontgrp->UpdateFontList(); // ensure user font generation is current
     mTextRun = mFontgrp->MakeTextRun(text,
                                      length,
                                      mThebes,
                                      mAppUnitsPerDevPixel,
                                      direction==NSBIDI_RTL ? gfxTextRunFactory::TEXT_IS_RTL : 0);
   }
--- a/content/canvas/src/CanvasRenderingContext2D.h
+++ b/content/canvas/src/CanvasRenderingContext2D.h
@@ -390,17 +390,17 @@ public:
   // nsICanvasRenderingContextInternal
   NS_IMETHOD SetDimensions(int32_t width, int32_t height) MOZ_OVERRIDE;
   NS_IMETHOD InitializeWithSurface(nsIDocShell *shell, gfxASurface *surface, int32_t width, int32_t height) MOZ_OVERRIDE;
 
   NS_IMETHOD Render(gfxContext *ctx,
                     GraphicsFilter aFilter,
                     uint32_t aFlags = RenderFlagPremultAlpha) MOZ_OVERRIDE;
   NS_IMETHOD GetInputStream(const char* aMimeType,
-                            const PRUnichar* aEncoderOptions,
+                            const char16_t* aEncoderOptions,
                             nsIInputStream **aStream) MOZ_OVERRIDE;
   NS_IMETHOD GetThebesSurface(gfxASurface **surface) MOZ_OVERRIDE;
 
   mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot() MOZ_OVERRIDE
   { EnsureTarget(); return mTarget->Snapshot(); }
 
   NS_IMETHOD SetIsOpaque(bool isOpaque) MOZ_OVERRIDE;
   NS_IMETHOD Reset() MOZ_OVERRIDE;
--- a/content/canvas/src/ImageEncoder.cpp
+++ b/content/canvas/src/ImageEncoder.cpp
@@ -230,17 +230,17 @@ ImageEncoder::ExtractDataAsync(nsAString
 }
 
 /*static*/ nsresult
 ImageEncoder::GetInputStream(int32_t aWidth,
                              int32_t aHeight,
                              uint8_t* aImageBuffer,
                              int32_t aFormat,
                              imgIEncoder* aEncoder,
-                             const PRUnichar* aEncoderOptions,
+                             const char16_t* aEncoderOptions,
                              nsIInputStream** aStream)
 {
   nsresult rv =
     aEncoder->InitFromData(aImageBuffer,
                            aWidth * aHeight * 4, aWidth, aHeight, aWidth * 4,
                            aFormat,
                            nsDependentString(aEncoderOptions));
   NS_ENSURE_SUCCESS(rv, rv);
--- a/content/canvas/src/ImageEncoder.h
+++ b/content/canvas/src/ImageEncoder.h
@@ -56,17 +56,17 @@ public:
   // Gives you a stream containing the image represented by aImageBuffer.
   // The format is given in aFormat, for example
   // imgIEncoder::INPUT_FORMAT_HOSTARGB.
   static nsresult GetInputStream(int32_t aWidth,
                                  int32_t aHeight,
                                  uint8_t* aImageBuffer,
                                  int32_t aFormat,
                                  imgIEncoder* aEncoder,
-                                 const PRUnichar* aEncoderOptions,
+                                 const char16_t* aEncoderOptions,
                                  nsIInputStream** aStream);
 
 private:
   // When called asynchronously, aContext is null.
   static nsresult
   ExtractDataInternal(const nsAString& aType,
                       const nsAString& aOptions,
                       uint8_t* aImageBuffer,
--- a/content/canvas/src/WebGLContext.cpp
+++ b/content/canvas/src/WebGLContext.cpp
@@ -68,17 +68,17 @@ using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::gl;
 using namespace mozilla::layers;
 
 NS_IMETHODIMP
 WebGLMemoryPressureObserver::Observe(nsISupports* aSubject,
                                      const char* aTopic,
-                                     const PRUnichar* aSomeData)
+                                     const char16_t* aSomeData)
 {
     if (strcmp(aTopic, "memory-pressure"))
         return NS_OK;
 
     bool wantToLoseContext = true;
 
     if (!mContext->mCanLoseContextInForeground &&
         ProcessPriorityManager::CurrentProcessIsForeground())
@@ -784,17 +784,17 @@ WebGLContext::GetImageBuffer(uint8_t** a
     memcpy(imageBuffer, imgsurf->Data(), mWidth * mHeight * 4);
 
     *aImageBuffer = imageBuffer;
     *aFormat = format;
 }
 
 NS_IMETHODIMP
 WebGLContext::GetInputStream(const char* aMimeType,
-                             const PRUnichar* aEncoderOptions,
+                             const char16_t* aEncoderOptions,
                              nsIInputStream **aStream)
 {
     NS_ASSERTION(gl, "GetInputStream on invalid context?");
     if (!gl)
         return NS_ERROR_FAILURE;
 
     nsCString enccid("@mozilla.org/image/encoder;2?type=");
     enccid += aMimeType;
--- a/content/canvas/src/WebGLContext.h
+++ b/content/canvas/src/WebGLContext.h
@@ -166,17 +166,17 @@ public:
         { return NS_ERROR_NOT_IMPLEMENTED; }
     NS_IMETHOD Reset() MOZ_OVERRIDE
         { /* (InitializeWithSurface) */ return NS_ERROR_NOT_IMPLEMENTED; }
     NS_IMETHOD Render(gfxContext *ctx,
                       GraphicsFilter f,
                       uint32_t aFlags = RenderFlagPremultAlpha) MOZ_OVERRIDE;
     virtual void GetImageBuffer(uint8_t** aImageBuffer, int32_t* aFormat);
     NS_IMETHOD GetInputStream(const char* aMimeType,
-                              const PRUnichar* aEncoderOptions,
+                              const char16_t* aEncoderOptions,
                               nsIInputStream **aStream) MOZ_OVERRIDE;
     NS_IMETHOD GetThebesSurface(gfxASurface **surface) MOZ_OVERRIDE;
     mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot() MOZ_OVERRIDE;
 
     NS_IMETHOD SetIsOpaque(bool b) MOZ_OVERRIDE { return NS_OK; };
     NS_IMETHOD SetContextOptions(JSContext* aCx,
                                  JS::Handle<JS::Value> aOptions) MOZ_OVERRIDE;
 
@@ -949,17 +949,17 @@ protected:
     bool ValidateFaceEnum(GLenum face, const char *info);
     bool ValidateTexFormatAndType(GLenum format, GLenum type, int jsArrayType,
                                       uint32_t *texelSize, const char *info);
     bool ValidateDrawModeEnum(GLenum mode, const char *info);
     bool ValidateAttribIndex(GLuint index, const char *info);
     bool ValidateStencilParamsForDrawCall();
     
     bool ValidateGLSLVariableName(const nsAString& name, const char *info);
-    bool ValidateGLSLCharacter(PRUnichar c);
+    bool ValidateGLSLCharacter(char16_t c);
     bool ValidateGLSLString(const nsAString& string, const char *info);
     bool ValidateTexImage2DFormat(GLenum format, const char* info);
     bool ValidateTexImage2DTarget(GLenum target, GLsizei width, GLsizei height, const char* info);
     bool ValidateCompressedTextureSize(GLenum target, GLint level, GLenum format, GLsizei width, GLsizei height, uint32_t byteLength, const char* info);
     bool ValidateLevelWidthHeightForTarget(GLenum target, GLint level, GLsizei width, GLsizei height, const char* info);
 
     static uint32_t GetBitsPerTexel(GLenum format, GLenum type);
 
--- a/content/canvas/src/WebGLValidateStrings.h
+++ b/content/canvas/src/WebGLValidateStrings.h
@@ -31,17 +31,17 @@
 
 namespace mozilla {
 
 // The following code was taken from the WebKit WebGL implementation,
 // which can be found here:
 // http://trac.webkit.org/browser/trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp?rev=93625#L121
 // Note that some modifications were done to adapt it to Mozilla.
 /****** BEGIN CODE TAKEN FROM WEBKIT ******/
-    bool WebGLContext::ValidateGLSLCharacter(PRUnichar c)
+    bool WebGLContext::ValidateGLSLCharacter(char16_t c)
     {
         // Printing characters are valid except " $ ` @ \ ' DEL.
         if (c >= 32 && c <= 126 &&
             c != '"' && c != '$' && c != '`' && c != '@' && c != '\\' && c != '\'')
         {
              return true;
         }
 
@@ -63,17 +63,17 @@ namespace mozilla {
             , m_end(str.EndReading())
             , m_current(str.BeginReading())
             , m_position(0)
         {
             m_result.SetLength(str.Length());
             parse();
         }
 
-        const nsTArray<PRUnichar>& result()
+        const nsTArray<char16_t>& result()
         {
             return m_result;
         }
 
         size_t length()
         {
             return m_position;
         }
@@ -89,44 +89,44 @@ namespace mozilla {
             while (hasMoreCharacters()) {
                 process(current());
                 // process() might advance the position.
                 if (hasMoreCharacters())
                     advance();
             }
         }
 
-        void process(PRUnichar);
+        void process(char16_t);
 
-        bool peek(PRUnichar& character)
+        bool peek(char16_t& character)
         {
             if (m_current + 1 >= m_end)
                 return false;
             character = *(m_current + 1);
             return true;
         }
 
-        PRUnichar current()
+        char16_t current()
         {
             //ASSERT(m_position < m_length);
             return *m_current;
         }
 
         void advance()
         {
             ++m_current;
         }
 
-        bool isNewline(PRUnichar character)
+        bool isNewline(char16_t character)
         {
             // Don't attempt to canonicalize newline related characters.
             return (character == '\n' || character == '\r');
         }
 
-        void emit(PRUnichar character)
+        void emit(char16_t character)
         {
             m_result[m_position++] = character;
         }
 
         enum ParseState {
             // Have not seen an ASCII non-whitespace character yet on
             // this line. Possible that we might see a preprocessor
             // directive.
@@ -146,36 +146,36 @@ namespace mozilla {
             InSingleLineComment,
 
             // Handling a multi-line comment. Newlines are passed
             // through to preserve line numbers.
             InMultiLineComment
         };
 
         ParseState m_parseState;
-        const PRUnichar* m_end;
-        const PRUnichar* m_current;
+        const char16_t* m_end;
+        const char16_t* m_current;
         size_t m_position;
-        nsTArray<PRUnichar> m_result;
+        nsTArray<char16_t> m_result;
     };
 
-    void StripComments::process(PRUnichar c)
+    void StripComments::process(char16_t c)
     {
         if (isNewline(c)) {
             // No matter what state we are in, pass through newlines
             // so we preserve line numbers.
             emit(c);
 
             if (m_parseState != InMultiLineComment)
                 m_parseState = BeginningOfLine;
 
             return;
         }
 
-        PRUnichar temp = 0;
+        char16_t temp = 0;
         switch (m_parseState) {
         case BeginningOfLine:
             // If it's an ASCII space.
             if (c <= ' ' && (c == ' ' || (c <= 0xD && c >= 0x9))) {
                 emit(c);
                 break;
             }
 
--- a/content/events/src/nsContentEventHandler.cpp
+++ b/content/events/src/nsContentEventHandler.cpp
@@ -364,17 +364,17 @@ static nsresult GenerateFlatTextContent(
       if (content == startNode)
         AppendSubString(aString, content, aRange->StartOffset(),
                         content->TextLength() - aRange->StartOffset());
       else if (content == endNode)
         AppendSubString(aString, content, 0, aRange->EndOffset());
       else
         AppendString(aString, content);
     } else if (IsContentBR(content))
-        aString.Append(PRUnichar('\n'));
+        aString.Append(char16_t('\n'));
   }
   ConvertToNativeNewlines(aString);
   return NS_OK;
 }
 
 nsresult
 nsContentEventHandler::ExpandToClusterBoundary(nsIContent* aContent,
                                                bool aForward,
--- a/content/events/src/nsDOMDataTransfer.cpp
+++ b/content/events/src/nsDOMDataTransfer.cpp
@@ -800,17 +800,17 @@ nsDOMDataTransfer::ConvertFromVariant(ns
       NS_ADDREF(*aSupports = ptrSupports);
 
       *aLength = sizeof(nsISupportsInterfacePointer *);
     }
 
     return true;
   }
 
-  PRUnichar* chrs;
+  char16_t* chrs;
   uint32_t len = 0;
   nsresult rv = aVariant->GetAsWStringWithSize(&len, &chrs);
   if (NS_FAILED(rv))
     return false;
 
   nsAutoString str;
   str.Adopt(chrs, len);
 
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -938,17 +938,17 @@ nsEventStateManager::Shutdown()
 {
   m_haveShutdown = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsEventStateManager::Observe(nsISupports *aSubject,
                              const char *aTopic,
-                             const PRUnichar *someData)
+                             const char16_t *someData)
 {
   if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
     Shutdown();
   }
 
   return NS_OK;
 }
 
--- a/content/html/content/public/HTMLMediaElement.h
+++ b/content/html/content/public/HTMLMediaElement.h
@@ -586,17 +586,17 @@ protected:
 
   /**
    * Logs a warning message to the web console to report various failures.
    * aMsg is the localized message identifier, aParams is the parameters to
    * be substituted into the localized message, and aParamCount is the number
    * of parameters in aParams.
    */
   void ReportLoadError(const char* aMsg,
-                       const PRUnichar** aParams = nullptr,
+                       const char16_t** aParams = nullptr,
                        uint32_t aParamCount = 0);
 
   /**
    * Changes mHasPlayedOrSeeked to aValue. If mHasPlayedOrSeeked changes
    * we'll force a reflow so that the video frame gets reflowed to reflect
    * the poster hiding or showing immediately.
    */
   void SetPlayedOrSeeked(bool aValue);
--- a/content/html/content/src/HTMLFormElement.cpp
+++ b/content/html/content/src/HTMLFormElement.cpp
@@ -1946,17 +1946,17 @@ HTMLFormElement::OnLocationChange(nsIWeb
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLFormElement::OnStatusChange(nsIWebProgress* aWebProgress,
                                 nsIRequest* aRequest,
                                 nsresult aStatus,
-                                const PRUnichar* aMessage)
+                                const char16_t* aMessage)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HTMLFormElement::OnSecurityChange(nsIWebProgress* aWebProgress,
                                   nsIRequest* aRequest,
--- a/content/html/content/src/HTMLFrameSetElement.cpp
+++ b/content/html/content/src/HTMLFrameSetElement.cpp
@@ -207,19 +207,19 @@ HTMLFrameSetElement::ParseRowCol(const n
                                  nsFramesetSpec** aSpecs) 
 {
   if (aValue.IsEmpty()) {
     aNumSpecs = 0;
     *aSpecs = nullptr;
     return NS_OK;
   }
 
-  static const PRUnichar sAster('*');
-  static const PRUnichar sPercent('%');
-  static const PRUnichar sComma(',');
+  static const char16_t sAster('*');
+  static const char16_t sPercent('%');
+  static const char16_t sComma(',');
 
   nsAutoString spec(aValue);
   // remove whitespace (Bug 33699) and quotation marks (bug 224598)
   // also remove leading/trailing commas (bug 31482)
   spec.StripChars(" \n\r\t\"\'");
   spec.Trim(",");
   
   // Count the commas. Don't count more than X commas (bug 576447).
@@ -257,17 +257,17 @@ HTMLFrameSetElement::ParseRowCol(const n
 
     // Note: If end == start then it means that the token has no
     // data in it other than a terminating comma (or the end of the spec).
     // So default to a fixed width of 0.
     specs[i].mUnit = eFramesetUnit_Fixed;
     specs[i].mValue = 0;
     if (end > start) {
       int32_t numberEnd = end;
-      PRUnichar ch = spec.CharAt(numberEnd - 1);
+      char16_t ch = spec.CharAt(numberEnd - 1);
       if (sAster == ch) {
         specs[i].mUnit = eFramesetUnit_Relative;
         numberEnd--;
       } else if (sPercent == ch) {
         specs[i].mUnit = eFramesetUnit_Percent;
         numberEnd--;
         // check for "*%"
         if (numberEnd > start) {
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -1071,17 +1071,17 @@ UploadLastDir::StoreLastUsedDirectory(ns
     return NS_ERROR_OUT_OF_MEMORY;
   prefValue->SetAsAString(unicodePath);
 
   nsCOMPtr<nsILoadContext> loadContext = aDoc->GetLoadContext();
   return contentPrefService->Set(spec, CPS_PREF_NAME, prefValue, loadContext, nullptr);
 }
 
 NS_IMETHODIMP
-UploadLastDir::Observe(nsISupports* aSubject, char const* aTopic, PRUnichar const* aData)
+UploadLastDir::Observe(nsISupports* aSubject, char const* aTopic, char16_t const* aData)
 {
   if (strcmp(aTopic, "browser:purge-session-history") == 0) {
     nsCOMPtr<nsIContentPrefService2> contentPrefService =
       do_GetService(NS_CONTENT_PREF_SERVICE_CONTRACTID);
     if (contentPrefService)
       contentPrefService->RemoveByName(CPS_PREF_NAME, nullptr, nullptr);
   }
   return NS_OK;
@@ -2204,30 +2204,30 @@ HTMLInputElement::MozGetFileNameArray(ns
     nsString str;
     mFiles[i]->GetMozFullPathInternal(str);
     aArray.AppendElement(str);
   }
 }
 
 
 NS_IMETHODIMP
-HTMLInputElement::MozGetFileNameArray(uint32_t* aLength, PRUnichar*** aFileNames)
+HTMLInputElement::MozGetFileNameArray(uint32_t* aLength, char16_t*** aFileNames)
 {
   if (!nsContentUtils::IsCallerChrome()) {
     // Since this function returns full paths it's important that normal pages
     // can't call it.
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   nsTArray<nsString> array;
   MozGetFileNameArray(array);
 
   *aLength = array.Length();
-  PRUnichar** ret =
-    static_cast<PRUnichar**>(NS_Alloc(*aLength * sizeof(PRUnichar*)));
+  char16_t** ret =
+    static_cast<char16_t**>(NS_Alloc(*aLength * sizeof(char16_t*)));
   if (!ret) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   for (uint32_t i = 0; i < *aLength; ++i) {
     ret[i] = NS_strdup(array[i].get());
   }
 
@@ -2264,17 +2264,17 @@ HTMLInputElement::MozSetFileNameArray(co
     }
 
   }
 
   SetFiles(files, true);
 }
 
 NS_IMETHODIMP
-HTMLInputElement::MozSetFileNameArray(const PRUnichar** aFileNames, uint32_t aLength)
+HTMLInputElement::MozSetFileNameArray(const char16_t** aFileNames, uint32_t aLength)
 {
   if (!nsContentUtils::IsCallerChrome()) {
     // setting the value of a "FILE" input widget requires chrome privilege
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   Sequence<nsString> list;
   for (uint32_t i = 0; i < aLength; ++i) {
@@ -2479,17 +2479,17 @@ HTMLInputElement::GetDisplayFileName(nsA
     } else {
       nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
                                          "NoFileSelected", value);
     }
   } else {
     nsString count;
     count.AppendInt(mFiles.Length());
 
-    const PRUnichar* params[] = { count.get() };
+    const char16_t* params[] = { count.get() };
     nsContentUtils::FormatLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
                                           "XFilesSelected", params, value);
   }
 
   aValue = value;
 }
 
 void
@@ -4434,24 +4434,24 @@ HTMLInputElement::SanitizeValue(nsAStrin
   NS_ASSERTION(!mParserCreating, "The element parsing should be finished!");
 
   switch (mType) {
     case NS_FORM_INPUT_TEXT:
     case NS_FORM_INPUT_SEARCH:
     case NS_FORM_INPUT_TEL:
     case NS_FORM_INPUT_PASSWORD:
       {
-        PRUnichar crlf[] = { PRUnichar('\r'), PRUnichar('\n'), 0 };
+        char16_t crlf[] = { char16_t('\r'), char16_t('\n'), 0 };
         aValue.StripChars(crlf);
       }
       break;
     case NS_FORM_INPUT_EMAIL:
     case NS_FORM_INPUT_URL:
       {
-        PRUnichar crlf[] = { PRUnichar('\r'), PRUnichar('\n'), 0 };
+        char16_t crlf[] = { char16_t('\r'), char16_t('\n'), 0 };
         aValue.StripChars(crlf);
 
         aValue = nsContentUtils::TrimWhitespace<nsContentUtils::IsHTMLWhitespace>(aValue);
       }
       break;
     case NS_FORM_INPUT_NUMBER:
       {
         Decimal value;
@@ -6550,17 +6550,17 @@ HTMLInputElement::GetValidationMessage(n
       nsAutoString strMaxLength;
       nsAutoString strTextLength;
 
       GetTextLength(&textLength);
 
       strMaxLength.AppendInt(maxLength);
       strTextLength.AppendInt(textLength);
 
-      const PRUnichar* params[] = { strMaxLength.get(), strTextLength.get() };
+      const char16_t* params[] = { strMaxLength.get(), strTextLength.get() };
       rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                  "FormValidationTextTooLong",
                                                  params, message);
       aValidationMessage = message;
       break;
     }
     case VALIDITY_STATE_VALUE_MISSING:
     {
@@ -6609,17 +6609,17 @@ HTMLInputElement::GetValidationMessage(n
       if (title.IsEmpty()) {
         rv = nsContentUtils::GetLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                 "FormValidationPatternMismatch",
                                                 message);
       } else {
         if (title.Length() > nsIConstraintValidation::sContentSpecifiedMaxLengthMessage) {
           title.Truncate(nsIConstraintValidation::sContentSpecifiedMaxLengthMessage);
         }
-        const PRUnichar* params[] = { title.get() };
+        const char16_t* params[] = { title.get() };
         rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                    "FormValidationPatternMismatchWithTitle",
                                                    params, message);
       }
       aValidationMessage = message;
       break;
     }
     case VALIDITY_STATE_RANGE_OVERFLOW:
@@ -6638,17 +6638,17 @@ HTMLInputElement::GetValidationMessage(n
         maxStr.AssignASCII(buf);
         MOZ_ASSERT(ok, "buf not big enough");
       } else if (mType == NS_FORM_INPUT_DATE || mType == NS_FORM_INPUT_TIME) {
         GetAttr(kNameSpaceID_None, nsGkAtoms::max, maxStr);
       } else {
         NS_NOTREACHED("Unexpected input type");
       }
 
-      const PRUnichar* params[] = { maxStr.get() };
+      const char16_t* params[] = { maxStr.get() };
       rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                  "FormValidationRangeOverflow",
                                                  params, message);
       aValidationMessage = message;
       break;
     }
     case VALIDITY_STATE_RANGE_UNDERFLOW:
     {
@@ -6665,17 +6665,17 @@ HTMLInputElement::GetValidationMessage(n
         minStr.AssignASCII(buf);
         MOZ_ASSERT(ok, "buf not big enough");
       } else if (mType == NS_FORM_INPUT_DATE || mType == NS_FORM_INPUT_TIME) {
         GetAttr(kNameSpaceID_None, nsGkAtoms::min, minStr);
       } else {
         NS_NOTREACHED("Unexpected input type");
       }
 
-      const PRUnichar* params[] = { minStr.get() };
+      const char16_t* params[] = { minStr.get() };
       rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                  "FormValidationRangeUnderflow",
                                                  params, message);
       aValidationMessage = message;
       break;
     }
     case VALIDITY_STATE_STEP_MISMATCH:
     {
@@ -6705,31 +6705,31 @@ HTMLInputElement::GetValidationMessage(n
       Decimal maximum = GetMaximum();
 
       if (maximum.isNaN() || valueHigh <= maximum) {
         nsAutoString valueLowStr, valueHighStr;
         ConvertNumberToString(valueLow, valueLowStr);
         ConvertNumberToString(valueHigh, valueHighStr);
 
         if (valueLowStr.Equals(valueHighStr)) {
-          const PRUnichar* params[] = { valueLowStr.get() };
+          const char16_t* params[] = { valueLowStr.get() };
           rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                      "FormValidationStepMismatchOneValue",
                                                      params, message);
         } else {
-          const PRUnichar* params[] = { valueLowStr.get(), valueHighStr.get() };
+          const char16_t* params[] = { valueLowStr.get(), valueHighStr.get() };
           rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                      "FormValidationStepMismatch",
                                                      params, message);
         }
       } else {
         nsAutoString valueLowStr;
         ConvertNumberToString(valueLow, valueLowStr);
 
-        const PRUnichar* params[] = { valueLowStr.get() };
+        const char16_t* params[] = { valueLowStr.get() };
         rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                    "FormValidationStepMismatchOneValue",
                                                    params, message);
       }
 
       aValidationMessage = message;
       break;
     }
@@ -6802,17 +6802,17 @@ HTMLInputElement::IsValidEmailAddress(co
 
     length = value.Length();
   } else {
     NS_ERROR("nsIIDNService isn't present!");
   }
 
   // Parsing the username.
   for (; i < atPos; ++i) {
-    PRUnichar c = value[i];
+    char16_t c = value[i];
 
     // The username characters have to be in this list to be valid.
     if (!(nsCRT::IsAsciiAlpha(c) || nsCRT::IsAsciiDigit(c) ||
           c == '.' || c == '!' || c == '#' || c == '$' || c == '%' ||
           c == '&' || c == '\''|| c == '*' || c == '+' || c == '-' ||
           c == '/' || c == '=' || c == '?' || c == '^' || c == '_' ||
           c == '`' || c == '{' || c == '|' || c == '}' || c == '~' )) {
       return false;
@@ -6824,17 +6824,17 @@ HTMLInputElement::IsValidEmailAddress(co
 
   // The domain name can't begin with a dot or a dash.
   if (value[i] == '.' || value[i] == '-') {
     return false;
   }
 
   // Parsing the domain name.
   for (; i < length; ++i) {
-    PRUnichar c = value[i];
+    char16_t c = value[i];
 
     if (c == '.') {
       // A dot can't follow a dot or a dash.
       if (value[i-1] == '.' || value[i-1] == '-') {
         return false;
       }
     } else if (c == '-'){
       // A dash can't follow a dot.
--- a/content/html/content/src/HTMLInputElement.h
+++ b/content/html/content/src/HTMLInputElement.h
@@ -1186,17 +1186,17 @@ protected:
    *
    * Accessing the mState member should be done using the GetEditorState function,
    * which returns null if the state is not present.
    */
   union InputData {
     /**
      * The current value of the input if it has been changed from the default
      */
-    PRUnichar*               mValue;
+    char16_t*               mValue;
     /**
      * The state of the text editor associated with the text/password input
      */
     nsTextEditorState*       mState;
   } mInputData;
   /**
    * The value of the input if it is a file input. This is the list of filenames
    * used when uploading a file. It is vital that this is kept separate from
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -266,27 +266,27 @@ private:
 };
 
 NS_IMPL_ISUPPORTS5(HTMLMediaElement::MediaLoadListener, nsIRequestObserver,
                    nsIStreamListener, nsIChannelEventSink,
                    nsIInterfaceRequestor, nsIObserver)
 
 NS_IMETHODIMP
 HTMLMediaElement::MediaLoadListener::Observe(nsISupports* aSubject,
-                                             const char* aTopic, const PRUnichar* aData)
+                                             const char* aTopic, const char16_t* aData)
 {
   nsContentUtils::UnregisterShutdownObserver(this);
 
   // Clear mElement to break cycle so we don't leak on shutdown
   mElement = nullptr;
   return NS_OK;
 }
 
 void HTMLMediaElement::ReportLoadError(const char* aMsg,
-                                       const PRUnichar** aParams,
+                                       const char16_t** aParams,
                                        uint32_t aParamCount)
 {
   nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                   NS_LITERAL_CSTRING("Media"),
                                   OwnerDoc(),
                                   nsContentUtils::eDOM_PROPERTIES,
                                   aMsg,
                                   aParams,
@@ -330,17 +330,17 @@ NS_IMETHODIMP HTMLMediaElement::MediaLoa
   if (hc && NS_SUCCEEDED(hc->GetRequestSucceeded(&succeeded)) && !succeeded) {
     element->NotifyLoadError();
     uint32_t responseStatus = 0;
     hc->GetResponseStatus(&responseStatus);
     nsAutoString code;
     code.AppendInt(responseStatus);
     nsAutoString src;
     element->GetCurrentSrc(src);
-    const PRUnichar* params[] = { code.get(), src.get() };
+    const char16_t* params[] = { code.get(), src.get() };
     element->ReportLoadError("MediaLoadHttpError", params, ArrayLength(params));
     return NS_BINDING_ABORTED;
   }
 
   nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
   if (channel &&
       element &&
       NS_SUCCEEDED(rv = element->InitializeDecoderForChannel(channel, getter_AddRefs(mNextListener))) &&
@@ -814,17 +814,17 @@ void HTMLMediaElement::SelectResource()
         return;
       }
 
       rv = LoadResource();
       if (NS_SUCCEEDED(rv)) {
         return;
       }
     } else {
-      const PRUnichar* params[] = { src.get() };
+      const char16_t* params[] = { src.get() };
       ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
     }
     NoSupportedMediaSourceError();
   } else {
     // Otherwise, the source elements will be used.
     mIsLoadingFromSourceChildren = true;
     LoadFromSourceChildren();
   }
@@ -896,42 +896,42 @@ void HTMLMediaElement::LoadFromSourceChi
       continue;
     }
 
     // If we have a type attribute, it must be a supported type.
     nsAutoString type;
     if (child->GetAttr(kNameSpaceID_None, nsGkAtoms::type, type) &&
         GetCanPlay(type) == CANPLAY_NO) {
       DispatchAsyncSourceError(child);
-      const PRUnichar* params[] = { type.get(), src.get() };
+      const char16_t* params[] = { type.get(), src.get() };
       ReportLoadError("MediaLoadUnsupportedTypeAttribute", params, ArrayLength(params));
       continue;
     }
     nsAutoString media;
     if (child->GetAttr(kNameSpaceID_None, nsGkAtoms::media, media) && !media.IsEmpty()) {
       nsCSSParser cssParser;
       nsRefPtr<nsMediaList> mediaList(new nsMediaList());
       cssParser.ParseMediaList(media, nullptr, 0, mediaList, false);
       nsIPresShell* presShell = OwnerDoc()->GetShell();
       if (presShell && !mediaList->Matches(presShell->GetPresContext(), nullptr)) {
         DispatchAsyncSourceError(child);
-        const PRUnichar* params[] = { media.get(), src.get() };
+        const char16_t* params[] = { media.get(), src.get() };
         ReportLoadError("MediaLoadSourceMediaNotMatched", params, ArrayLength(params));
         continue;
       }
     }
     LOG(PR_LOG_DEBUG, ("%p Trying load from <source>=%s type=%s media=%s", this,
       NS_ConvertUTF16toUTF8(src).get(), NS_ConvertUTF16toUTF8(type).get(),
       NS_ConvertUTF16toUTF8(media).get()));
 
     nsCOMPtr<nsIURI> uri;
     NewURIFromString(src, getter_AddRefs(uri));
     if (!uri) {
       DispatchAsyncSourceError(child);
-      const PRUnichar* params[] = { src.get() };
+      const char16_t* params[] = { src.get() };
       ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
       continue;
     }
 
     mLoadingSrc = uri;
     NS_ASSERTION(mNetworkState == nsIDOMHTMLMediaElement::NETWORK_LOADING,
                  "Network state should be loading");
 
@@ -1116,32 +1116,32 @@ nsresult HTMLMediaElement::LoadResource(
 
   if (IsMediaStreamURI(mLoadingSrc)) {
     nsCOMPtr<nsIDOMMediaStream> stream;
     rv = NS_GetStreamForMediaStreamURI(mLoadingSrc, getter_AddRefs(stream));
     if (NS_FAILED(rv)) {
       nsCString specUTF8;
       mLoadingSrc->GetSpec(specUTF8);
       NS_ConvertUTF8toUTF16 spec(specUTF8);
-      const PRUnichar* params[] = { spec.get() };
+      const char16_t* params[] = { spec.get() };
       ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
       return rv;
     }
     SetupSrcMediaStreamPlayback(static_cast<DOMMediaStream*>(stream.get()));
     return NS_OK;
   }
 
   if (IsMediaSourceURI(mLoadingSrc)) {
     nsRefPtr<MediaSource> source;
     rv = NS_GetSourceForMediaSourceURI(mLoadingSrc, getter_AddRefs(source));
     if (NS_FAILED(rv)) {
       nsCString specUTF8;
       mLoadingSrc->GetSpec(specUTF8);
       NS_ConvertUTF8toUTF16 spec(specUTF8);
-      const PRUnichar* params[] = { spec.get() };
+      const char16_t* params[] = { spec.get() };
       ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
       return rv;
     }
     nsRefPtr<MediaSourceDecoder> decoder = new MediaSourceDecoder(this);
     if (!source->Attach(decoder)) {
       // TODO: Handle failure: run "If the media data cannot be fetched at
       // all, due to network errors, causing the user agent to give up
       // trying to fetch the resource" section of resource fetch algorithm.
@@ -2543,17 +2543,17 @@ nsresult HTMLMediaElement::InitializeDec
   aChannel->GetContentType(mimeType);
   NS_ASSERTION(!mimeType.IsEmpty(), "We should have the Content-Type.");
 
   nsRefPtr<MediaDecoder> decoder = DecoderTraits::CreateDecoder(mimeType, this);
   if (!decoder) {
     nsAutoString src;
     GetCurrentSrc(src);
     NS_ConvertUTF8toUTF16 mimeUTF16(mimeType);
-    const PRUnichar* params[] = { mimeUTF16.get(), src.get() };
+    const char16_t* params[] = { mimeUTF16.get(), src.get() };
     ReportLoadError("MediaLoadUnsupportedMimeType", params, ArrayLength(params));
     return NS_ERROR_FAILURE;
   }
 
   LOG(PR_LOG_DEBUG, ("%p Created decoder %p for type %s", this, decoder.get(), mimeType.get()));
 
   nsRefPtr<MediaResource> resource = MediaResource::Create(decoder, aChannel);
   if (!resource)
@@ -2916,17 +2916,17 @@ void HTMLMediaElement::NetworkError()
 {
   Error(nsIDOMMediaError::MEDIA_ERR_NETWORK);
 }
 
 void HTMLMediaElement::DecodeError()
 {
   nsAutoString src;
   GetCurrentSrc(src);
-  const PRUnichar* params[] = { src.get() };
+  const char16_t* params[] = { src.get() };
   ReportLoadError("MediaLoadDecodeError", params, ArrayLength(params));
 
   if (mDecoder) {
     ShutdownDecoder();
   }
   mLoadingSrc = nullptr;
   if (mIsLoadingFromSourceChildren) {
     mError = nullptr;
@@ -3455,17 +3455,17 @@ void HTMLMediaElement::AddRemoveSelfRefe
 void HTMLMediaElement::DoRemoveSelfReference()
 {
   // We don't need the shutdown observer anymore. Unregistering releases
   // its reference to us, which we were using as our self-reference.
   nsContentUtils::UnregisterShutdownObserver(this);
 }
 
 nsresult HTMLMediaElement::Observe(nsISupports* aSubject,
-                                   const char* aTopic, const PRUnichar* aData)
+                                   const char* aTopic, const char16_t* aData)
 {
   NS_ENSURE_TRUE(nsContentUtils::IsCallerChrome(), NS_ERROR_NOT_AVAILABLE);
 
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     mShuttingDown = true;
     AddRemoveSelfReference();
   }
   return NS_OK;
--- a/content/html/content/src/HTMLTextAreaElement.cpp
+++ b/content/html/content/src/HTMLTextAreaElement.cpp
@@ -1385,17 +1385,17 @@ HTMLTextAreaElement::GetValidationMessag
         nsAutoString strTextLength;
 
         GetMaxLength(&maxLength);
         GetTextLength(&textLength);
 
         strMaxLength.AppendInt(maxLength);
         strTextLength.AppendInt(textLength);
 
-        const PRUnichar* params[] = { strMaxLength.get(), strTextLength.get() };
+        const char16_t* params[] = { strMaxLength.get(), strTextLength.get() };
         rv = nsContentUtils::FormatLocalizedString(nsContentUtils::eDOM_PROPERTIES,
                                                    "FormValidationTextTooLong",
                                                    params, message);
         aValidationMessage = message;
       }
       break;
     case VALIDITY_STATE_VALUE_MISSING:
       {
--- a/content/html/content/src/nsDOMStringMap.cpp
+++ b/content/html/content/src/nsDOMStringMap.cpp
@@ -178,32 +178,32 @@ bool nsDOMStringMap::DataPropToAttr(cons
   // storage there for most cases, probably.
   aResult.AppendLiteral("data-");
 
   // Iterate property by character to form attribute name.
   // Return syntax error if there is a sequence of "-" followed by a character
   // in the range "a" to "z".
   // Replace capital characters with "-" followed by lower case character.
   // Otherwise, simply append character to attribute name.
-  const PRUnichar* start = aProp.BeginReading();
-  const PRUnichar* end = aProp.EndReading();
-  const PRUnichar* cur = start;
+  const char16_t* start = aProp.BeginReading();
+  const char16_t* end = aProp.EndReading();
+  const char16_t* cur = start;
   for (; cur < end; ++cur) {
-    const PRUnichar* next = cur + 1;
-    if (PRUnichar('-') == *cur && next < end &&
-        PRUnichar('a') <= *next && *next <= PRUnichar('z')) {
+    const char16_t* next = cur + 1;
+    if (char16_t('-') == *cur && next < end &&
+        char16_t('a') <= *next && *next <= char16_t('z')) {
       // Syntax error if character following "-" is in range "a" to "z".
       return false;
     }
 
-    if (PRUnichar('A') <= *cur && *cur <= PRUnichar('Z')) {
+    if (char16_t('A') <= *cur && *cur <= char16_t('Z')) {
       // Append the characters in the range [start, cur)
       aResult.Append(start, cur - start);
       // Uncamel-case characters in the range of "A" to "Z".
-      aResult.Append(PRUnichar('-'));
+      aResult.Append(char16_t('-'));
       aResult.Append(*cur - 'A' + 'a');
       start = next; // We've already appended the thing at *cur
     }
   }
 
   aResult.Append(start, cur - start);
 
   return true;
@@ -218,30 +218,30 @@ bool nsDOMStringMap::AttrToDataProp(cons
 {
   // If the attribute name does not begin with "data-" then it can not be
   // a data attribute.
   if (!StringBeginsWith(aAttr, NS_LITERAL_STRING("data-"))) {
     return false;
   }
 
   // Start reading attribute from first character after "data-".
-  const PRUnichar* cur = aAttr.BeginReading() + 5;
-  const PRUnichar* end = aAttr.EndReading();
+  const char16_t* cur = aAttr.BeginReading() + 5;
+  const char16_t* end = aAttr.EndReading();
 
   // Don't try to mess with aResult's capacity: the probably-no-op SetCapacity()
   // call is not that fast.
 
   // Iterate through attrName by character to form property name.
   // If there is a sequence of "-" followed by a character in the range "a" to
   // "z" then replace with upper case letter.
   // Otherwise append character to property name.
   for (; cur < end; ++cur) {
-    const PRUnichar* next = cur + 1;
-    if (PRUnichar('-') == *cur && next < end && 
-        PRUnichar('a') <= *next && *next <= PRUnichar('z')) {
+    const char16_t* next = cur + 1;
+    if (char16_t('-') == *cur && next < end && 
+        char16_t('a') <= *next && *next <= char16_t('z')) {
       // Upper case the lower case letters that follow a "-".
       aResult.Append(*next - 'a' + 'A');
       // Consume character to account for "-" character.
       ++cur;
     } else {
       // Simply append character if camel case is not necessary.
       aResult.Append(*cur);
     }
--- a/content/html/content/src/nsFormSubmission.cpp
+++ b/content/html/content/src/nsFormSubmission.cpp
@@ -40,17 +40,17 @@
 #include "mozilla/dom/EncodingUtils.h"
 
 using namespace mozilla;
 using mozilla::dom::EncodingUtils;
 
 static void
 SendJSWarning(nsIDocument* aDocument,
               const char* aWarningName,
-              const PRUnichar** aWarningArgs, uint32_t aWarningArgsLen)
+              const char16_t** aWarningArgs, uint32_t aWarningArgsLen)
 {
   nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                   NS_LITERAL_CSTRING("HTML"), aDocument,
                                   nsContentUtils::eFORMS_PROPERTIES,
                                   aWarningName,
                                   aWarningArgs, aWarningArgsLen);
 }
 
@@ -227,17 +227,17 @@ HandleMailtoSubject(nsCString& aPath) {
 
     // Get the default subject
     nsXPIDLString brandName;
     nsresult rv =
       nsContentUtils::GetLocalizedString(nsContentUtils::eBRAND_PROPERTIES,
                                          "brandShortName", brandName);
     if (NS_FAILED(rv))
       return;
-    const PRUnichar *formatStrings[] = { brandName.get() };
+    const char16_t *formatStrings[] = { brandName.get() };
     nsXPIDLString subjectStr;
     rv = nsContentUtils::FormatLocalizedString(
                                            nsContentUtils::eFORMS_PROPERTIES,
                                            "DefaultFormSubject",
                                            formatStrings,
                                            subjectStr);
     if (NS_FAILED(rv))
       return;
@@ -349,17 +349,17 @@ nsFSURLEncoded::GetEncodedSubmission(nsI
   return rv;
 }
 
 // i18n helper routines
 nsresult
 nsFSURLEncoded::URLEncode(const nsAString& aStr, nsCString& aEncoded)
 {
   // convert to CRLF breaks
-  PRUnichar* convertedBuf =
+  char16_t* convertedBuf =
     nsLinebreakConverter::ConvertUnicharLineBreaks(PromiseFlatString(aStr).get(),
                                                    nsLinebreakConverter::eLinebreakAny,
                                                    nsLinebreakConverter::eLinebreakNet);
   NS_ENSURE_TRUE(convertedBuf, NS_ERROR_OUT_OF_MEMORY);
 
   nsAutoCString encodedBuf;
   nsresult rv = EncodeVal(nsDependentString(convertedBuf), encodedBuf, false);
   nsMemory::Free(convertedBuf);
@@ -707,17 +707,17 @@ nsEncodingFormSubmission::nsEncodingForm
   // canonical name is passed so that we just have to check against
   // *our* canonical names listed in charsetaliases.properties
   if (charset.EqualsLiteral("ISO-8859-1")) {
     charset.AssignLiteral("windows-1252");
   }
 
   if (!(charset.EqualsLiteral("UTF-8") || charset.EqualsLiteral("gb18030"))) {
     NS_ConvertUTF8toUTF16 charsetUtf16(charset);
-    const PRUnichar* charsetPtr = charsetUtf16.get();
+    const char16_t* charsetPtr = charsetUtf16.get();
     SendJSWarning(aOriginatingElement ? aOriginatingElement->GetOwnerDocument()
                                       : nullptr,
                   "CannotEncodeAllUnicode",
                   &charsetPtr,
                   1);
   }
 
   mEncoder = do_CreateInstance(NS_SAVEASCHARSET_CONTRACTID);
@@ -779,17 +779,17 @@ GetSubmitCharset(nsGenericHTMLElement* a
                  acceptCharsetValue);
 
   int32_t charsetLen = acceptCharsetValue.Length();
   if (charsetLen > 0) {
     int32_t offset=0;
     int32_t spPos=0;
     // get charset from charsets one by one
     do {
-      spPos = acceptCharsetValue.FindChar(PRUnichar(' '), offset);
+      spPos = acceptCharsetValue.FindChar(char16_t(' '), offset);
       int32_t cnt = ((-1==spPos)?(charsetLen-offset):(spPos-offset));
       if (cnt > 0) {
         nsAutoString uCharset;
         acceptCharsetValue.Mid(uCharset, offset, cnt);
 
         if (EncodingUtils::FindEncodingForLabel(uCharset, oCharset))
           return;
       }
@@ -869,17 +869,17 @@ GetSubmissionFromForm(nsGenericHTMLEleme
       if (aOriginatingElement &&
           aOriginatingElement->HasAttr(kNameSpaceID_None,
                                        nsGkAtoms::formenctype)) {
         aOriginatingElement->GetAttr(kNameSpaceID_None, nsGkAtoms::formenctype,
                                      enctypeStr);
       } else {
         aForm->GetAttr(kNameSpaceID_None, nsGkAtoms::enctype, enctypeStr);
       }
-      const PRUnichar* enctypeStrPtr = enctypeStr.get();
+      const char16_t* enctypeStrPtr = enctypeStr.get();
       SendJSWarning(doc, "ForgotPostWarning",
                     &enctypeStrPtr, 1);
     }
     *aFormSubmission = new nsFSURLEncoded(charset, method, doc,
                                           aOriginatingElement);
   }
   NS_ENSURE_TRUE(*aFormSubmission, NS_ERROR_OUT_OF_MEMORY);
 
--- a/content/html/content/src/nsGenericHTMLElement.cpp
+++ b/content/html/content/src/nsGenericHTMLElement.cpp
@@ -133,17 +133,17 @@ void GEUS_ElementCreated(nsINodeInfo *aN
 
   count++;
 
   sGEUS_ElementCounts.Put(&key, (void *)count);
 }
 
 bool GEUS_enum_func(nsHashKey *aKey, void *aData, void *aClosure)
 {
-  const PRUnichar *name_chars = ((nsStringKey *)aKey)->GetString();
+  const char16_t *name_chars = ((nsStringKey *)aKey)->GetString();
   NS_ConvertUTF16toUTF8 name(name_chars);
 
   printf ("%s %d\n", name.get(), aData);
 
   return true;
 }
 
 void GEUS_DumpElementCounts()
@@ -1833,28 +1833,28 @@ nsGenericHTMLElement::GetURIListAttr(nsI
   nsAutoString value;
   if (!GetAttr(kNameSpaceID_None, aAttr, value))
     return NS_OK;
 
   nsIDocument* doc = OwnerDoc(); 
   nsCOMPtr<nsIURI> baseURI = GetBaseURI();
 
   // Value contains relative URIs split on spaces (U+0020)
-  const PRUnichar *start = value.BeginReading();
-  const PRUnichar *end   = value.EndReading();
-  const PRUnichar *iter  = start;
+  const char16_t *start = value.BeginReading();
+  const char16_t *end   = value.EndReading();
+  const char16_t *iter  = start;
   for (;;) {
     if (iter < end && *iter != ' ') {
       ++iter;
     } else {  // iter is pointing at either end or a space
       while (*start == ' ' && start < iter)
         ++start;
       if (iter != start) {
         if (!aResult.IsEmpty())
-          aResult.Append(PRUnichar(' '));
+          aResult.Append(char16_t(' '));
         const nsSubstring& uriPart = Substring(start, iter);
         nsCOMPtr<nsIURI> attrURI;
         nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(attrURI),
                                                   uriPart, doc, baseURI);
         if (attrURI) {
           nsAutoCString spec;
           attrURI->GetSpec(spec);
           AppendUTF8toUTF16(spec, aResult);
--- a/content/html/content/src/nsHTMLDNSPrefetch.cpp
+++ b/content/html/content/src/nsHTMLDNSPrefetch.cpp
@@ -422,17 +422,17 @@ nsHTMLDNSPrefetch::nsDeferrals::OnLocati
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsHTMLDNSPrefetch::nsDeferrals::OnStatusChange(nsIWebProgress* aWebProgress,
                                                nsIRequest* aRequest,
                                                nsresult aStatus,
-                                               const PRUnichar* aMessage)
+                                               const char16_t* aMessage)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsHTMLDNSPrefetch::nsDeferrals::OnSecurityChange(nsIWebProgress *aWebProgress, 
                                                  nsIRequest *aRequest, 
                                                  uint32_t state)
@@ -440,15 +440,15 @@ nsHTMLDNSPrefetch::nsDeferrals::OnSecuri
   return NS_OK;
 }
 
 //////////// nsIObserver method
 
 NS_IMETHODIMP
 nsHTMLDNSPrefetch::nsDeferrals::Observe(nsISupports *subject,
                                         const char *topic,
-                                        const PRUnichar *data)
+                                        const char16_t *data)
 {
   if (!strcmp(topic, "xpcom-shutdown"))
     Flush();
   
   return NS_OK;
 }
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -1836,17 +1836,17 @@ nsTextEditorState::SetValue(const nsAStr
     {
       ValueSetter valueSetter(mEditor);
 
       // \r is an illegal character in the dom, but people use them,
       // so convert windows and mac platform linebreaks to \n:
       // Unfortunately aValue is declared const, so we have to copy
       // in order to do this substitution.
       nsString newValue(aValue);
-      if (aValue.FindChar(PRUnichar('\r')) != -1) {
+      if (aValue.FindChar(char16_t('\r')) != -1) {
         nsContentUtils::PlatformToDOMLineBreaks(newValue);
       }
 
       nsCOMPtr<nsIDOMDocument> domDoc;
       mEditor->GetDocument(getter_AddRefs(domDoc));
       if (!domDoc) {
         NS_WARNING("Why don't we have a document?");
         return;
--- a/content/html/document/src/ImageDocument.cpp
+++ b/content/html/document/src/ImageDocument.cpp
@@ -532,17 +532,17 @@ ImageDocument::OnStopRequest(imgIRequest
 {
   UpdateTitleAndCharset();
 
   // mImageContent can be null if the document is already destroyed
   if (NS_FAILED(aStatus) && mStringBundle && mImageContent) {
     nsAutoCString src;
     mDocumentURI->GetSpec(src);
     NS_ConvertUTF8toUTF16 srcString(src);
-    const PRUnichar* formatString[] = { srcString.get() };
+    const char16_t* formatString[] = { srcString.get() };
     nsXPIDLString errorMsg;
     NS_NAMED_LITERAL_STRING(str, "InvalidImage");
     mStringBundle->FormatStringFromName(str.get(), formatString, 1,
                                         getter_Copies(errorMsg));
 
     mImageContent->SetAttr(kNameSpaceID_None, nsGkAtoms::alt, errorMsg, false);
   }
 
@@ -738,17 +738,17 @@ ImageDocument::UpdateTitleAndCharset()
     }
   }
 
   nsXPIDLString status;
   if (mImageIsResized) {
     nsAutoString ratioStr;
     ratioStr.AppendInt(NSToCoordFloor(GetRatio() * 100));
 
-    const PRUnichar* formatString[1] = { ratioStr.get() };
+    const char16_t* formatString[1] = { ratioStr.get() };
     mStringBundle->FormatStringFromName(MOZ_UTF16("ScaledImage"),
                                         formatString, 1,
                                         getter_Copies(status));
   }
 
   static const char* const formatNames[4] = 
   {
     "ImageTitleWithNeitherDimensionsNorFile",
--- a/content/html/document/src/MediaDocument.cpp
+++ b/content/html/document/src/MediaDocument.cpp
@@ -346,55 +346,55 @@ MediaDocument::UpdateTitleAndCharset(con
     // if we got a valid size (not all media have a size)
     if (aWidth != 0 && aHeight != 0) {
       nsAutoString widthStr;
       nsAutoString heightStr;
       widthStr.AppendInt(aWidth);
       heightStr.AppendInt(aHeight);
       // If we got a filename, display it
       if (!fileStr.IsEmpty()) {
-        const PRUnichar *formatStrings[4]  = {fileStr.get(), typeStr.get(), 
+        const char16_t *formatStrings[4]  = {fileStr.get(), typeStr.get(), 
           widthStr.get(), heightStr.get()};
         NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithDimAndFile]);
         mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 4,
                                             getter_Copies(title));
       } 
       else {
-        const PRUnichar *formatStrings[3]  = {typeStr.get(), widthStr.get(), 
+        const char16_t *formatStrings[3]  = {typeStr.get(), widthStr.get(), 
           heightStr.get()};
         NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithDim]);
         mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 3,
                                             getter_Copies(title));
       }
     } 
     else {
     // If we got a filename, display it
       if (!fileStr.IsEmpty()) {
-        const PRUnichar *formatStrings[2] = {fileStr.get(), typeStr.get()};
+        const char16_t *formatStrings[2] = {fileStr.get(), typeStr.get()};
         NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithFile]);
         mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 2,
                                             getter_Copies(title));
       }
       else {
-        const PRUnichar *formatStrings[1] = {typeStr.get()};
+        const char16_t *formatStrings[1] = {typeStr.get()};
         NS_ConvertASCIItoUTF16 fmtName(aFormatNames[eWithNoInfo]);
         mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 1,
                                             getter_Copies(title));
       }
     }
   } 
 
   // set it on the document
   if (aStatus.IsEmpty()) {
     SetTitle(title);
   }
   else {
     nsXPIDLString titleWithStatus;
     const nsPromiseFlatString& status = PromiseFlatString(aStatus);
-    const PRUnichar *formatStrings[2] = {title.get(), status.get()};
+    const char16_t *formatStrings[2] = {title.get(), status.get()};
     NS_NAMED_LITERAL_STRING(fmtName, "TitleWithStatus");
     mStringBundle->FormatStringFromName(fmtName.get(), formatStrings, 2,
                                         getter_Copies(titleWithStatus));
     SetTitle(titleWithStatus);
   }
 }
 
 void 
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -3078,18 +3078,18 @@ ConvertToMidasInternalCommandInner(const
     outParam.Truncate();
 
     return true;
   }
 
   // String parameter -- see if we need to convert it (necessary for
   // cmd_paragraphState and cmd_fontSize)
   if (outCommandID.EqualsLiteral("cmd_paragraphState")) {
-    const PRUnichar* start = inParam.BeginReading();
-    const PRUnichar* end = inParam.EndReading();
+    const char16_t* start = inParam.BeginReading();
+    const char16_t* end = inParam.EndReading();
     if (start != end && *start == '<' && *(end - 1) == '>') {
       ++start;
       --end;
     }
 
     NS_ConvertUTF16toUTF8 convertedParam(Substring(start, end));
     uint32_t j;
     for (j = 0; j < ArrayLength(gBlocks); ++j) {
--- a/content/mathml/content/src/nsMathMLElement.cpp
+++ b/content/mathml/content/src/nsMathMLElement.cpp
@@ -29,45 +29,45 @@ using namespace mozilla::dom;
 
 //----------------------------------------------------------------------
 // nsISupports methods:
 
 NS_IMPL_ISUPPORTS_INHERITED3(nsMathMLElement, nsMathMLElementBase,
                              nsIDOMElement, nsIDOMNode, Link)
 
 static nsresult
-WarnDeprecated(const PRUnichar* aDeprecatedAttribute, 
-               const PRUnichar* aFavoredAttribute, nsIDocument* aDocument)
+WarnDeprecated(const char16_t* aDeprecatedAttribute, 
+               const char16_t* aFavoredAttribute, nsIDocument* aDocument)
 {
-  const PRUnichar *argv[] = 
+  const char16_t *argv[] = 
     { aDeprecatedAttribute, aFavoredAttribute };
   return nsContentUtils::
           ReportToConsole(nsIScriptError::warningFlag,
                           NS_LITERAL_CSTRING("MathML"), aDocument,
                           nsContentUtils::eMATHML_PROPERTIES,
                           "DeprecatedSupersededBy", argv, 2);
 }
 
 static nsresult 
 ReportLengthParseError(const nsString& aValue, nsIDocument* aDocument)
 {
-  const PRUnichar *arg = aValue.get();
+  const char16_t *arg = aValue.get();
   return nsContentUtils::
          ReportToConsole(nsIScriptError::errorFlag,
                          NS_LITERAL_CSTRING("MathML"), aDocument,
                          nsContentUtils::eMATHML_PROPERTIES,
                          "LengthParsingError", &arg, 1);
 }
 
 static nsresult
 ReportParseErrorNoTag(const nsString& aValue, 
                       nsIAtom*        aAtom,
                       nsIDocument*    aDocument)
 {
-  const PRUnichar *argv[] = 
+  const char16_t *argv[] = 
     { aValue.get(), aAtom->GetUTF16String() };
   return nsContentUtils::
          ReportToConsole(nsIScriptError::errorFlag,
                          NS_LITERAL_CSTRING("MathML"), aDocument,
                          nsContentUtils::eMATHML_PROPERTIES,
                          "AttributeParsingErrorNoTag", argv, 2);
 }
 
@@ -372,17 +372,17 @@ nsMathMLElement::ParseNumericValue(const
   if (ParseNamedSpaceValue(aString, aCSSValue, aFlags)) {
     return true;
   }
 
   nsAutoString number, unit;
 
   // see if the negative sign is there
   int32_t i = 0;
-  PRUnichar c = str[0];
+  char16_t c = str[0];
   if (c == '-') {
     number.Append(c);
     i++;
   }
 
   // Gather up characters that make up the number
   bool gotDot = false;
   for ( ; i < stringLength; i++) {
@@ -553,17 +553,17 @@ nsMathMLElement::MapMathMLAttributesInto
       if (str.Length() > 0) {
         nsresult errorCode;
         int32_t intValue = str.ToInteger(&errorCode);
         if (NS_SUCCEEDED(errorCode)) {
           // This is kind of cheesy ... if the scriptlevel has a sign,
           // then it's a relative value and we store the nsCSSValue as an
           // Integer to indicate that. Otherwise we store it as a Number
           // to indicate that the scriptlevel is absolute.
-          PRUnichar ch = str.CharAt(0);
+          char16_t ch = str.CharAt(0);
           if (ch == '+' || ch == '-') {
             scriptLevel->SetIntValue(intValue, eCSSUnit_Integer);
           } else {
             scriptLevel->SetFloatValue(intValue, eCSSUnit_Number);
           }
         } else {
           ReportParseErrorNoTag(str,
                                 nsGkAtoms::scriptlevel_,
--- a/content/media/Latency.cpp
+++ b/content/media/Latency.cpp
@@ -175,17 +175,17 @@ void AsyncLatencyLogger::Init()
 void AsyncLatencyLogger::GetStartTime(TimeStamp &aStart)
 {
   MutexAutoLock lock(mMutex);
   aStart = mStart;
 }
 
 nsresult
 AsyncLatencyLogger::Observe(nsISupports* aSubject, const char* aTopic,
-                            const PRUnichar* aData)
+                            const char16_t* aData)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     Shutdown();
   }
   return NS_OK;
 }
 
--- a/content/media/MediaCache.cpp
+++ b/content/media/MediaCache.cpp
@@ -349,17 +349,17 @@ protected:
   // True if an event to run Update() has been queued but not processed
   bool            mUpdateQueued;
 #ifdef DEBUG
   bool            mInUpdate;
 #endif
 };
 
 NS_IMETHODIMP
-MediaCacheFlusher::Observe(nsISupports *aSubject, char const *aTopic, PRUnichar const *aData)
+MediaCacheFlusher::Observe(nsISupports *aSubject, char const *aTopic, char16_t const *aData)
 {
   if (strcmp(aTopic, "last-pb-context-exited") == 0) {
     MediaCache::Flush();
   }
   if (strcmp(aTopic, "network-clear-cache-stored-anywhere") == 0) {
     MediaCache::Flush();
   }
   return NS_OK;
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -976,17 +976,17 @@ void MediaDecoder::PlaybackEnded()
   // to fire the required durationchange.
   if (IsInfinite()) {
     SetInfinite(false);
   }
 }
 
 NS_IMETHODIMP MediaDecoder::Observe(nsISupports *aSubjet,
                                         const char *aTopic,
-                                        const PRUnichar *someData)
+                                        const char16_t *someData)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     Shutdown();
   }
 
   return NS_OK;
 }
--- a/content/media/MediaRecorder.cpp
+++ b/content/media/MediaRecorder.cpp
@@ -365,17 +365,17 @@ private:
     }
 
     if (mTrackUnionStream.get()) {
       mTrackUnionStream->Destroy();
       mTrackUnionStream = nullptr;
     }
   }
 
-  NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
+  NS_IMETHODIMP Observe(nsISupports *aSubject, const char *aTopic, const char16_t *aData)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
       // Force stop Session to terminate Read Thread.
       Stop();
     }
 
--- a/content/media/MediaShutdownManager.cpp
+++ b/content/media/MediaShutdownManager.cpp
@@ -148,17 +148,17 @@ MediaShutdownManager::Unregister(MediaDe
     mDecoders.RemoveEntry(aDecoder);
     EnsureCorrectShutdownObserverState();
   }
 }
 
 NS_IMETHODIMP
 MediaShutdownManager::Observe(nsISupports *aSubjet,
                               const char *aTopic,
-                              const PRUnichar *someData)
+                              const char16_t *someData)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     Shutdown();
   }
   return NS_OK;
 }
 
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -2413,17 +2413,17 @@ MediaStreamGraphImpl::MediaStreamGraphIm
 
 NS_IMPL_ISUPPORTS1(MediaStreamGraphShutdownObserver, nsIObserver)
 
 static bool gShutdownObserverRegistered = false;
 
 NS_IMETHODIMP
 MediaStreamGraphShutdownObserver::Observe(nsISupports *aSubject,
                                           const char *aTopic,
-                                          const PRUnichar *aData)
+                                          const char16_t *aData)
 {
   if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
     if (gGraph) {
       gGraph->ForceShutDown();
     }
     nsContentUtils::UnregisterShutdownObserver(this);
     gShutdownObserverRegistered = false;
   }
--- a/content/media/webrtc/LoadMonitor.cpp
+++ b/content/media/webrtc/LoadMonitor.cpp
@@ -58,17 +58,17 @@ LoadMonitor::LoadMonitor()
 LoadMonitor::~LoadMonitor()
 {
   Shutdown();
 }
 
 NS_IMETHODIMP
 LoadMonitor::Observe(nsISupports* /* aSubject */,
                      const char*  aTopic,
-                     const PRUnichar* /* aData */)
+                     const char16_t* /* aData */)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");
   MOZ_ASSERT(!strcmp("xpcom-shutdown-threads", aTopic), "Bad topic!");
   Shutdown();
   return NS_OK;
 }
 
 class LoadMonitorAddObserver : public nsRunnable
--- a/content/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/content/media/webspeech/recognition/SpeechRecognition.cpp
@@ -556,17 +556,17 @@ SpeechRecognition::StopRecording()
   mEndpointer.EndSession();
   DispatchTrustedEvent(NS_LITERAL_STRING("audioend"));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 SpeechRecognition::Observe(nsISupports* aSubject, const char* aTopic,
-                           const PRUnichar* aData)
+                           const char16_t* aData)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Observer invoked off the main thread");
 
   if (!strcmp(aTopic, NS_TIMER_CALLBACK_TOPIC) &&
       StateBetween(STATE_IDLE, STATE_WAITING_FOR_SPEECH)) {
 
     DispatchError(SpeechRecognition::EVENT_AUDIO_ERROR,
                   SpeechRecognitionErrorCode::No_speech,
--- a/content/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
+++ b/content/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
@@ -53,17 +53,17 @@ FakeSpeechRecognitionService::SoundEnd()
 
 NS_IMETHODIMP
 FakeSpeechRecognitionService::Abort()
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-FakeSpeechRecognitionService::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aData)
+FakeSpeechRecognitionService::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aData)
 {
   MOZ_ASSERT(mRecognition->mTestConfig.mFakeRecognitionService,
              "Got request to fake recognition service event, but "
              TEST_PREFERENCE_FAKE_RECOGNITION_SERVICE " is not set");
 
   if (!strcmp(aTopic, SPEECH_RECOGNITION_TEST_END_TOPIC)) {
     nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
     obs->RemoveObserver(this, SPEECH_RECOGNITION_TEST_EVENT_REQUEST_TOPIC);
--- a/content/media/wmf/WMFUtils.cpp
+++ b/content/media/wmf/WMFUtils.cpp
@@ -191,17 +191,17 @@ nsCString GetGUIDName(const GUID& guid)
     }
   }
 
   WCHAR* name = nullptr;
   HRESULT hr = StringFromCLSID(guid , &name);
   if (FAILED(hr)) {
     return nsDependentCString("GuidUnknown");
   }
-  nsCString name_u8(NS_ConvertUTF16toUTF8(nsDependentString((PRUnichar*)(name))));
+  nsCString name_u8(NS_ConvertUTF16toUTF8(nsDependentString((char16_t*)(name))));
   CoTaskMemFree(name);
   return name_u8;
 }
 
 bool
 SourceReaderHasStream(IMFSourceReader* aReader, const DWORD aIndex)
 {
   RefPtr<IMFMediaType> nativeType;
--- a/content/smil/nsSMILParserUtils.cpp
+++ b/content/smil/nsSMILParserUtils.cpp
@@ -27,52 +27,52 @@ const uint32_t MSEC_PER_MIN  = 1000 * 60
 const uint32_t MSEC_PER_HOUR = 1000 * 60 * 60;
 
 #define ACCESSKEY_PREFIX_LC NS_LITERAL_STRING("accesskey(") // SMIL2+
 #define ACCESSKEY_PREFIX_CC NS_LITERAL_STRING("accessKey(") // SVG/SMIL ANIM
 #define REPEAT_PREFIX    NS_LITERAL_STRING("repeat(")
 #define WALLCLOCK_PREFIX NS_LITERAL_STRING("wallclock(")
 
 inline bool
-SkipWhitespace(RangedPtr<const PRUnichar>& aIter,
-               const RangedPtr<const PRUnichar>& aEnd)
+SkipWhitespace(RangedPtr<const char16_t>& aIter,
+               const RangedPtr<const char16_t>& aEnd)
 {
   while (aIter != aEnd) {
     if (!IsSVGWhitespace(*aIter)) {
       return true;
     }
     ++aIter;
   }
   return false;
 }
 
 inline bool
-ParseColon(RangedPtr<const PRUnichar>& aIter,
-           const RangedPtr<const PRUnichar>& aEnd)
+ParseColon(RangedPtr<const char16_t>& aIter,
+           const RangedPtr<const char16_t>& aEnd)
 {
   if (aIter == aEnd || *aIter != ':') {
     return false;
   }
   ++aIter;
   return true;
 }
 
 /*
  * Exactly two digits in the range 00 - 59 are expected.
  */
 bool
-ParseSecondsOrMinutes(RangedPtr<const PRUnichar>& aIter,
-                      const RangedPtr<const PRUnichar>& aEnd,
+ParseSecondsOrMinutes(RangedPtr<const char16_t>& aIter,
+                      const RangedPtr<const char16_t>& aEnd,
                       uint32_t& aValue)
 {
   if (aIter == aEnd || !SVGContentUtils::IsDigit(*aIter)) {
     return false;
   }
 
-  RangedPtr<const PRUnichar> iter(aIter);
+  RangedPtr<const char16_t> iter(aIter);
 
   if (++iter == aEnd || !SVGContentUtils::IsDigit(*iter)) {
      return false;
   }
 
   uint32_t value = 10 * SVGContentUtils::DecimalDigitValue(*aIter) +
                    SVGContentUtils::DecimalDigitValue(*iter);
   if (value > 59) {
@@ -83,18 +83,18 @@ ParseSecondsOrMinutes(RangedPtr<const PR
   }
 
   aValue = value;
   aIter = iter;
   return true;
 }
 
 inline bool
-ParseClockMetric(RangedPtr<const PRUnichar>& aIter,
-                 const RangedPtr<const PRUnichar>& aEnd,
+ParseClockMetric(RangedPtr<const char16_t>& aIter,
+                 const RangedPtr<const char16_t>& aEnd,
                  uint32_t& aMultiplier)
 {
   if (aIter == aEnd) {
     aMultiplier = MSEC_PER_SEC;
     return true;
   }
 
   switch (*aIter) {
@@ -127,18 +127,18 @@ ParseClockMetric(RangedPtr<const PRUnich
   }
   return false;
 }
 
 /**
  * See http://www.w3.org/TR/SVG/animate.html#ClockValueSyntax
  */
 bool
-ParseClockValue(RangedPtr<const PRUnichar>& aIter,
-                const RangedPtr<const PRUnichar>& aEnd,
+ParseClockValue(RangedPtr<const char16_t>& aIter,
+                const RangedPtr<const char16_t>& aEnd,
                 nsSMILTimeValue* aResult)
 {
   if (aIter == aEnd) {
     return false;
   }
 
   // TIMECOUNT_VALUE     ::= Timecount ("." Fraction)? (Metric)?
   // PARTIAL_CLOCK_VALUE ::= Minutes ":" Seconds ("." Fraction)?
@@ -146,17 +146,17 @@ ParseClockValue(RangedPtr<const PRUnicha
   enum ClockType {
     TIMECOUNT_VALUE,
     PARTIAL_CLOCK_VALUE,
     FULL_CLOCK_VALUE
   };
 
   int32_t clockType = TIMECOUNT_VALUE;
 
-  RangedPtr<const PRUnichar> iter(aIter);
+  RangedPtr<const char16_t> iter(aIter);
 
   // Determine which type of clock value we have by counting the number
   // of colons in the string.
   do {
     switch (*iter) {
     case ':':
        if (clockType == FULL_CLOCK_VALUE) {
          return false;
@@ -220,21 +220,21 @@ ParseClockValue(RangedPtr<const PRUnicha
       aIter = iter;
       return true;
   }
 
   return false;
 }
 
 bool
-ParseOffsetValue(RangedPtr<const PRUnichar>& aIter,
-                 const RangedPtr<const PRUnichar>& aEnd,
+ParseOffsetValue(RangedPtr<const char16_t>& aIter,
+                 const RangedPtr<const char16_t>& aEnd,
                  nsSMILTimeValue* aResult)
 {
-  RangedPtr<const PRUnichar> iter(aIter);
+  RangedPtr<const char16_t> iter(aIter);
 
   int32_t sign;
   if (!SVGContentUtils::ParseOptionalSign(iter, aEnd, sign) ||
       !SkipWhitespace(iter, aEnd) ||
       !ParseClockValue(iter, aEnd, aResult)) {
     return false;
   }
   if (sign == -1) {
@@ -243,25 +243,25 @@ ParseOffsetValue(RangedPtr<const PRUnich
   aIter = iter;
   return true;
 }
 
 bool
 ParseOffsetValue(const nsAString& aSpec,
                  nsSMILTimeValue* aResult)
 {
-  RangedPtr<const PRUnichar> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
-  const RangedPtr<const PRUnichar> end(SVGContentUtils::GetEndRangedPtr(aSpec));
+  RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
+  const RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   return ParseOffsetValue(iter, end, aResult) && iter == end;
 }
 
 bool
-ParseOptionalOffset(RangedPtr<const PRUnichar>& aIter,
-                    const RangedPtr<const PRUnichar>& aEnd,
+ParseOptionalOffset(RangedPtr<const char16_t>& aIter,
+                    const RangedPtr<const char16_t>& aEnd,
                     nsSMILTimeValue* aResult)
 {
   if (aIter == aEnd) {
     aResult->SetMillis(0L);
     return true;
   }
 
   return SkipWhitespace(aIter, aEnd) &&
@@ -277,18 +277,18 @@ ParseAccessKey(const nsAString& aSpec, n
 
   nsSMILTimeValueSpecParams result;
   result.mType = nsSMILTimeValueSpecParams::ACCESSKEY;
 
   NS_ABORT_IF_FALSE(
       ACCESSKEY_PREFIX_LC.Length() == ACCESSKEY_PREFIX_CC.Length(),
       "Case variations for accesskey prefix differ in length");
 
-  RangedPtr<const PRUnichar> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
-  RangedPtr<const PRUnichar> end(SVGContentUtils::GetEndRangedPtr(aSpec));
+  RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
+  RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   iter += ACCESSKEY_PREFIX_LC.Length();
 
   // Expecting at least <accesskey> + ')'
   if (end - iter < 2)
     return false;
 
   uint32_t c = *iter++;
@@ -314,18 +314,18 @@ ParseAccessKey(const nsAString& aSpec, n
   if (!ParseOptionalOffset(iter, end, &result.mOffset) || iter != end) {
     return false;
   }
   aResult = result;
   return true;
 }
 
 void
-MoveToNextToken(RangedPtr<const PRUnichar>& aIter,
-                const RangedPtr<const PRUnichar>& aEnd,
+MoveToNextToken(RangedPtr<const char16_t>& aIter,
+                const RangedPtr<const char16_t>& aEnd,
                 bool aBreakOnDot,
                 bool& aIsAnyCharEscaped)
 {
   aIsAnyCharEscaped = false;
 
   bool isCurrentCharEscaped = false;
 
   while (aIter != aEnd && !IsSVGWhitespace(*aIter)) {
@@ -360,19 +360,19 @@ ConvertTokenToAtom(const nsAString& aTok
 {
   // Unescaping involves making a copy of the string which we'd like to avoid if possible
   if (!aUnescapeToken) {
     return ConvertUnescapedTokenToAtom(aToken);
   }
 
   nsAutoString token(aToken);
 
-  const PRUnichar* read = token.BeginReading();
-  const PRUnichar* const end = token.EndReading();
-  PRUnichar* write = token.BeginWriting();
+  const char16_t* read = token.BeginReading();
+  const char16_t* const end = token.EndReading();
+  char16_t* write = token.BeginWriting();
   bool escape = false;
 
   while (read != end) {
     NS_ABORT_IF_FALSE(write <= read, "Writing past where we've read");
     if (!escape && *read == '\\') {
       escape = true;
       ++read;
     } else {
@@ -399,24 +399,24 @@ ParseElementBaseTimeValueSpec(const nsAS
   // event-name
   // element-name.repeat(3)
   // event\.name
   //
   // Technically `repeat(3)' is permitted but the behaviour in this case is not
   // defined (for SMIL Animation) so we don't support it here.
   //
 
-  RangedPtr<const PRUnichar> start(SVGContentUtils::GetStartRangedPtr(aSpec));
-  RangedPtr<const PRUnichar> end(SVGContentUtils::GetEndRangedPtr(aSpec));
+  RangedPtr<const char16_t> start(SVGContentUtils::GetStartRangedPtr(aSpec));
+  RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   if (start == end) {
     return false;
   }
 
-  RangedPtr<const PRUnichar> tokenEnd(start);
+  RangedPtr<const char16_t> tokenEnd(start);
 
   bool requiresUnescaping;
   MoveToNextToken(tokenEnd, end, true, requiresUnescaping);
 
   nsRefPtr<nsIAtom> atom =
     ConvertTokenToAtom(Substring(start.get(), tokenEnd.get()),
                        requiresUnescaping);
   if (atom == nullptr) {
@@ -692,18 +692,18 @@ nsSMILParserUtils::ParseTimeValueSpecPar
   // event, syncbase, or repeat
   return ParseElementBaseTimeValueSpec(spec, aResult);
 }
 
 bool
 nsSMILParserUtils::ParseClockValue(const nsAString& aSpec,
                                    nsSMILTimeValue* aResult)
 {
-  RangedPtr<const PRUnichar> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
-  RangedPtr<const PRUnichar> end(SVGContentUtils::GetEndRangedPtr(aSpec));
+  RangedPtr<const char16_t> iter(SVGContentUtils::GetStartRangedPtr(aSpec));
+  RangedPtr<const char16_t> end(SVGContentUtils::GetEndRangedPtr(aSpec));
 
   return ::ParseClockValue(iter, end, aResult) && iter == end;
 }
 
 int32_t
 nsSMILParserUtils::CheckForNegativeNumber(const nsAString& aStr)
 {
   int32_t absValLocation = -1;
--- a/content/svg/content/src/SVGContentUtils.cpp
+++ b/content/svg/content/src/SVGContentUtils.cpp
@@ -134,17 +134,17 @@ SVGContentUtils::GetFontXHeight(nsStyleC
 
   nscoord xHeight = fontMetrics->XHeight();
   return nsPresContext::AppUnitsToFloatCSSPixels(xHeight) /
          presContext->TextZoom();
 }
 nsresult
 SVGContentUtils::ReportToConsole(nsIDocument* doc,
                                  const char* aWarning,
-                                 const PRUnichar **aParams,
+                                 const char16_t **aParams,
                                  uint32_t aParamsLength)
 {
   return nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                          NS_LITERAL_CSTRING("SVG"), doc,
                                          nsContentUtils::eSVG_PROPERTIES,
                                          aWarning,
                                          aParams, aParamsLength);
 }
@@ -365,18 +365,18 @@ SVGContentUtils::GetViewBoxTransform(flo
 
   if (aViewboxX) e += -a * aViewboxX;
   if (aViewboxY) f += -d * aViewboxY;
 
   return gfx::Matrix(a, 0.0f, 0.0f, d, e, f);
 }
 
 static bool
-ParseNumber(RangedPtr<const PRUnichar>& aIter,
-            const RangedPtr<const PRUnichar>& aEnd,
+ParseNumber(RangedPtr<const char16_t>& aIter,
+            const RangedPtr<const char16_t>& aEnd,
             double& aValue)
 {
   int32_t sign;
   if (!SVGContentUtils::ParseOptionalSign(aIter, aEnd, sign)) {
     return false;
   }
 
   // Absolute value of the integer part of the mantissa.
@@ -420,17 +420,17 @@ ParseNumber(RangedPtr<const PRUnichar>& 
   }
 
   bool gotE = false;
   int32_t exponent = 0;
   int32_t expSign;
 
   if (aIter != aEnd && (*aIter == 'e' || *aIter == 'E')) {
 
-    RangedPtr<const PRUnichar> expIter(aIter);
+    RangedPtr<const char16_t> expIter(aIter);
 
     ++expIter;
     if (expIter != aEnd) {
       expSign = *expIter == '-' ? -1 : 1;
       if (*expIter == '-' || *expIter == '+') {
         ++expIter;
       }
       if (expIter != aEnd && SVGContentUtils::IsDigit(*expIter)) {
@@ -454,83 +454,83 @@ ParseNumber(RangedPtr<const PRUnichar>& 
   if (gotE) {
     aValue *= pow(10.0, expSign * exponent);
   }
   return true;
 }
 
 template<class floatType>
 bool
-SVGContentUtils::ParseNumber(RangedPtr<const PRUnichar>& aIter,
-                             const RangedPtr<const PRUnichar>& aEnd,
+SVGContentUtils::ParseNumber(RangedPtr<const char16_t>& aIter,
+                             const RangedPtr<const char16_t>& aEnd,
                              floatType& aValue)
 {
-  RangedPtr<const PRUnichar> iter(aIter);
+  RangedPtr<const char16_t> iter(aIter);
 
   double value;
   if (!::ParseNumber(iter, aEnd, value)) {
     return false;
   }
   floatType floatValue = floatType(value);
   if (!NS_finite(floatValue)) {
     return false;
   }
   aValue = floatValue;
   aIter = iter;
   return true;
 }
 
 template bool
-SVGContentUtils::ParseNumber<float>(RangedPtr<const PRUnichar>& aIter,
-                                    const RangedPtr<const PRUnichar>& aEnd,
+SVGContentUtils::ParseNumber<float>(RangedPtr<const char16_t>& aIter,
+                                    const RangedPtr<const char16_t>& aEnd,
                                     float& aValue);
 
 template bool
-SVGContentUtils::ParseNumber<double>(RangedPtr<const PRUnichar>& aIter,
-                                     const RangedPtr<const PRUnichar>& aEnd,
+SVGContentUtils::ParseNumber<double>(RangedPtr<const char16_t>& aIter,
+                                     const RangedPtr<const char16_t>& aEnd,
                                      double& aValue);
 
-RangedPtr<const PRUnichar>
+RangedPtr<const char16_t>
 SVGContentUtils::GetStartRangedPtr(const nsAString& aString)
 {
-  return RangedPtr<const PRUnichar>(aString.Data(), aString.Length());
+  return RangedPtr<const char16_t>(aString.Data(), aString.Length());
 }
 
-RangedPtr<const PRUnichar>
+RangedPtr<const char16_t>
 SVGContentUtils::GetEndRangedPtr(const nsAString& aString)
 {
-  return RangedPtr<const PRUnichar>(aString.Data() + aString.Length(),
+  return RangedPtr<const char16_t>(aString.Data() + aString.Length(),
                                     aString.Data(), aString.Length());
 }
 
 template<class floatType>
 bool
 SVGContentUtils::ParseNumber(const nsAString& aString, 
                              floatType& aValue)
 {
-  RangedPtr<const PRUnichar> iter = GetStartRangedPtr(aString);
-  const RangedPtr<const PRUnichar> end = GetEndRangedPtr(aString);
+  RangedPtr<const char16_t> iter = GetStartRangedPtr(aString);
+  const RangedPtr<const char16_t> end = GetEndRangedPtr(aString);
 
   return ParseNumber(iter, end, aValue) && iter == end;
 }
 
 template bool
 SVGContentUtils::ParseNumber<float>(const nsAString& aString, 
                                     float& aValue);
 template bool
 SVGContentUtils::ParseNumber<double>(const nsAString& aString, 
                                      double& aValue);
 
 /* static */
 bool
-SVGContentUtils::ParseInteger(RangedPtr<const PRUnichar>& aIter,
-                              const RangedPtr<const PRUnichar>& aEnd,
+SVGContentUtils::ParseInteger(RangedPtr<const char16_t>& aIter,
+                              const RangedPtr<const char16_t>& aEnd,
                               int32_t& aValue)
 {
-  RangedPtr<const PRUnichar> iter(aIter);
+  RangedPtr<const char16_t> iter(aIter);
 
   int32_t sign;
   if (!ParseOptionalSign(iter, aEnd, sign)) {
     return false;
   }
 
   if (!IsDigit(*iter)) {
     return false;
@@ -552,18 +552,18 @@ SVGContentUtils::ParseInteger(RangedPtr<
   return true;
 }
 
 /* static */
 bool
 SVGContentUtils::ParseInteger(const nsAString& aString,
                               int32_t& aValue)
 {
-  RangedPtr<const PRUnichar> iter = GetStartRangedPtr(aString);
-  const RangedPtr<const PRUnichar> end = GetEndRangedPtr(aString);
+  RangedPtr<const char16_t> iter = GetStartRangedPtr(aString);
+  const RangedPtr<const char16_t> end = GetEndRangedPtr(aString);
 
   return ParseInteger(iter, end, aValue) && iter == end;
 }
 
 float
 SVGContentUtils::CoordToFloat(nsPresContext *aPresContext,
                               nsSVGElement *aContent,
                               const nsStyleCoord &aCoord)
--- a/content/svg/content/src/SVGContentUtils.h
+++ b/content/svg/content/src/SVGContentUtils.h
@@ -37,20 +37,20 @@ class Matrix;
 inline bool
 IsSVGWhitespace(char aChar)
 {
   return aChar == '\x20' || aChar == '\x9' ||
          aChar == '\xD'  || aChar == '\xA';
 }
 
 inline bool
-IsSVGWhitespace(PRUnichar aChar)
+IsSVGWhitespace(char16_t aChar)
 {
-  return aChar == PRUnichar('\x20') || aChar == PRUnichar('\x9') ||
-         aChar == PRUnichar('\xD')  || aChar == PRUnichar('\xA');
+  return aChar == char16_t('\x20') || aChar == char16_t('\x9') ||
+         aChar == char16_t('\xD')  || aChar == char16_t('\xA');
 }
 
 /**
  * Functions generally used by SVG Content classes. Functions here
  * should not generally depend on layout methods/classes e.g. nsSVGUtils
  */
 class SVGContentUtils
 {
@@ -94,17 +94,17 @@ public:
   static float GetFontXHeight(nsIFrame *aFrame);
   static float GetFontXHeight(nsStyleContext *aStyleContext);
 
   /*
    * Report a localized error message to the error console.
    */
   static nsresult ReportToConsole(nsIDocument* doc,
                                   const char* aWarning,
-                                  const PRUnichar **aParams,
+                                  const char16_t **aParams,
                                   uint32_t aParamsLength);
 
   static mozilla::gfx::Matrix GetCTM(nsSVGElement *aElement, bool aScreenCTM);
 
   /**
    * Check if this is one of the SVG elements that SVG 1.1 Full says
    * establishes a viewport: svg, symbol, image or foreignObject.
    */
@@ -134,57 +134,57 @@ public:
                       const SVGAnimatedPreserveAspectRatio &aPreserveAspectRatio);
 
   static mozilla::gfx::Matrix
   GetViewBoxTransform(float aViewportWidth, float aViewportHeight,
                       float aViewboxX, float aViewboxY,
                       float aViewboxWidth, float aViewboxHeight,
                       const SVGPreserveAspectRatio &aPreserveAspectRatio);
 
-  static mozilla::RangedPtr<const PRUnichar>
+  static mozilla::RangedPtr<const char16_t>
   GetStartRangedPtr(const nsAString& aString);
 
-  static mozilla::RangedPtr<const PRUnichar>
+  static mozilla::RangedPtr<const char16_t>
   GetEndRangedPtr(const nsAString& aString);
 
   /**
    * True if 'aCh' is a decimal digit.
    */
-  static inline bool IsDigit(PRUnichar aCh)
+  static inline bool IsDigit(char16_t aCh)
   {
     return aCh >= '0' && aCh <= '9';
   }
 
  /**
   * Assuming that 'aCh' is a decimal digit, return its numeric value.
   */
-  static inline uint32_t DecimalDigitValue(PRUnichar aCh)
+  static inline uint32_t DecimalDigitValue(char16_t aCh)
   {
     MOZ_ASSERT(IsDigit(aCh), "Digit expected");
     return aCh - '0';
   }
 
   /**
    * Parses the sign (+ or -) of a number and moves aIter to the next
    * character if a sign is found.
    * @param aSignMultiplier [outparam] -1 if the sign is negative otherwise 1
    * @return false if we hit the end of the string (i.e. if aIter is initially
    *         at aEnd, or if we reach aEnd right after the sign character).
    */
   static inline bool
-  ParseOptionalSign(mozilla::RangedPtr<const PRUnichar>& aIter,
-                    const mozilla::RangedPtr<const PRUnichar>& aEnd,
+  ParseOptionalSign(mozilla::RangedPtr<const char16_t>& aIter,
+                    const mozilla::RangedPtr<const char16_t>& aEnd,
                     int32_t& aSignMultiplier)
   {
     if (aIter == aEnd) {
       return false;
     }
     aSignMultiplier = *aIter == '-' ? -1 : 1;
 
-    mozilla::RangedPtr<const PRUnichar> iter(aIter);
+    mozilla::RangedPtr<const char16_t> iter(aIter);
 
     if (*iter == '-' || *iter == '+') {
       ++iter;
       if (iter == aEnd) {
         return false;
       }
     }
     aIter = iter;
@@ -195,18 +195,18 @@ public:
    * Parse a number of the form:
    * number ::= integer ([Ee] integer)? | [+-]? [0-9]* "." [0-9]+ ([Ee] integer)?
    * Parsing fails if the number cannot be represented by a floatType.
    * If parsing succeeds, aIter is updated so that it points to the character
    * after the end of the number, otherwise it is left unchanged
    */
   template<class floatType>
   static bool
-  ParseNumber(mozilla::RangedPtr<const PRUnichar>& aIter,
-              const mozilla::RangedPtr<const PRUnichar>& aEnd,
+  ParseNumber(mozilla::RangedPtr<const char16_t>& aIter,
+              const mozilla::RangedPtr<const char16_t>& aEnd,
               floatType& aValue);
 
   /**
    * Parse a number of the form:
    * number ::= integer ([Ee] integer)? | [+-]? [0-9]* "." [0-9]+ ([Ee] integer)?
    * Parsing fails if there is anything left over after the number,
    * or the number cannot be represented by a floatType.
    */
@@ -216,18 +216,18 @@ public:
 
   /**
    * Parse an integer of the form:
    * integer ::= [+-]? [0-9]+
    * The returned number is clamped to an int32_t if outside that range.
    * If parsing succeeds, aIter is updated so that it points to the character
    * after the end of the number, otherwise it is left unchanged
    */
-  static bool ParseInteger(mozilla::RangedPtr<const PRUnichar>& aIter,
-                           const mozilla::RangedPtr<const PRUnichar>& aEnd,
+  static bool ParseInteger(mozilla::RangedPtr<const char16_t>& aIter,
+                           const mozilla::RangedPtr<const char16_t>& aEnd,
                            int32_t& aValue);
 
   /**
    * Parse an integer of the form:
    * integer ::= [+-]? [0-9]+
    * The returned number is clamped to an int32_t if outside that range.
    * Parsing fails if there is anything left over after the number.
    */
--- a/content/svg/content/src/SVGFragmentIdentifier.cpp
+++ b/content/svg/content/src/SVGFragmentIdentifier.cpp
@@ -19,17 +19,17 @@ IsMatchingParameter(const nsAString& aSt
   // The first two tests ensure aString.Length() > aParameterName.Length()
   // so it's then safe to do the third test
   return StringBeginsWith(aString, aParameterName) &&
          aString.Last() == ')' &&
          aString.CharAt(aParameterName.Length()) == '(';
 }
 
 inline bool
-IgnoreWhitespace(PRUnichar aChar)
+IgnoreWhitespace(char16_t aChar)
 {
   return false;
 }
 
 static dom::SVGViewElement*
 GetViewElement(nsIDocument* aDocument, const nsAString& aId)
 {
   dom::Element* element = aDocument->GetElementById(aId);
--- a/content/svg/content/src/SVGLength.cpp
+++ b/content/svg/content/src/SVGLength.cpp
@@ -17,33 +17,33 @@ namespace mozilla {
 
 // Declare some helpers defined below:
 static void GetUnitString(nsAString& unit, uint16_t unitType);
 static uint16_t GetUnitTypeForString(const nsAString& unitStr);
 
 void
 SVGLength::GetValueAsString(nsAString &aValue) const
 {
-  PRUnichar buf[24];
-  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+  char16_t buf[24];
+  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
                             MOZ_UTF16("%g"),
                             (double)mValue);
   aValue.Assign(buf);
 
   nsAutoString unitString;
   GetUnitString(unitString, mUnit);
   aValue.Append(unitString);
 }
 
 bool
 SVGLength::SetValueFromString(const nsAString &aString)
 {
-  RangedPtr<const PRUnichar> iter =
+  RangedPtr<const char16_t> iter =
     SVGContentUtils::GetStartRangedPtr(aString);
-  const RangedPtr<const PRUnichar> end =
+  const RangedPtr<const char16_t> end =
     SVGContentUtils::GetEndRangedPtr(aString);
 
   float value;
 
   if (!SVGContentUtils::ParseNumber(iter, end, value)) {
     return false;
   }
 
--- a/content/svg/content/src/SVGNumberList.cpp
+++ b/content/svg/content/src/SVGNumberList.cpp
@@ -23,17 +23,17 @@ SVGNumberList::CopyFrom(const SVGNumberL
   mNumbers = rhs.mNumbers;
   return NS_OK;
 }
 
 void
 SVGNumberList::GetValueAsString(nsAString& aValue) const
 {
   aValue.Truncate();
-  PRUnichar buf[24];
+  char16_t buf[24];
   uint32_t last = mNumbers.Length() - 1;
   for (uint32_t i = 0; i < mNumbers.Length(); ++i) {
     // Would like to use aValue.AppendPrintf("%f", mNumbers[i]), but it's not
     // possible to always avoid trailing zeros.
     nsTextFormatter::snprintf(buf, ArrayLength(buf),
                               MOZ_UTF16("%g"),
                               double(mNumbers[i]));
     // We ignore OOM, since it's not useful for us to return an error.
--- a/content/svg/content/src/SVGPathSegUtils.cpp
+++ b/content/svg/content/src/SVGPathSegUtils.cpp
@@ -24,17 +24,17 @@ SVGPathSegUtils::GetValueAsString(const 
   // Adding new seg type? Is the formatting below acceptable for the new types?
   static_assert(NS_SVG_PATH_SEG_LAST_VALID_TYPE ==
                 PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,
                 "Update GetValueAsString for the new value.");
   static_assert(NS_SVG_PATH_SEG_MAX_ARGS == 7,
                 "Add another case to the switch below.");
 
   uint32_t type = DecodeType(aSeg[0]);
-  PRUnichar typeAsChar = GetPathSegTypeAsLetter(type);
+  char16_t typeAsChar = GetPathSegTypeAsLetter(type);
 
   // Special case arcs:
   if (IsArcType(type)) {
     bool largeArcFlag = aSeg[4] != 0.0f;
     bool sweepFlag = aSeg[5] != 0.0f;
     nsTextFormatter::ssprintf(aValue,
                               MOZ_UTF16("%c%g,%g %g %d,%d %g,%g"),
                               typeAsChar, aSeg[1], aSeg[2], aSeg[3],
@@ -75,17 +75,17 @@ SVGPathSegUtils::GetValueAsString(const 
     }
   }
   
   // nsTextFormatter::ssprintf is one of the nsTextFormatter methods that
   // randomly appends '\0' to its output string, which means that the length
   // of the output string is one too long. We need to manually remove that '\0'
   // until nsTextFormatter is fixed.
   //
-  if (aValue[aValue.Length() - 1] == PRUnichar('\0')) {
+  if (aValue[aValue.Length() - 1] == char16_t('\0')) {
     aValue.SetLength(aValue.Length() - 1);
   }
 }
 
 
 static float
 CalcDistanceBetweenPoints(const Point& aP1, const Point& aP2)
 {
--- a/content/svg/content/src/SVGPathSegUtils.h
+++ b/content/svg/content/src/SVGPathSegUtils.h
@@ -122,40 +122,40 @@ public:
 
   static uint32_t DecodeType(float aType) {
     static_assert(sizeof(uint32_t) == sizeof(float), "sizeof uint32_t and float must be the same");
     uint32_t type = *(reinterpret_cast<uint32_t*>(&aType));
     NS_ABORT_IF_FALSE(IsValidType(type), "Seg type not recognized");
     return type;
   }
 
-  static PRUnichar GetPathSegTypeAsLetter(uint32_t aType) {
+  static char16_t GetPathSegTypeAsLetter(uint32_t aType) {
     NS_ABORT_IF_FALSE(IsValidType(aType), "Seg type not recognized");
 
-    static const PRUnichar table[] = {
-      PRUnichar('x'),  //  0 == PATHSEG_UNKNOWN
-      PRUnichar('z'),  //  1 == PATHSEG_CLOSEPATH
-      PRUnichar('M'),  //  2 == PATHSEG_MOVETO_ABS
-      PRUnichar('m'),  //  3 == PATHSEG_MOVETO_REL
-      PRUnichar('L'),  //  4 == PATHSEG_LINETO_ABS
-      PRUnichar('l'),  //  5 == PATHSEG_LINETO_REL
-      PRUnichar('C'),  //  6 == PATHSEG_CURVETO_CUBIC_ABS
-      PRUnichar('c'),  //  7 == PATHSEG_CURVETO_CUBIC_REL
-      PRUnichar('Q'),  //  8 == PATHSEG_CURVETO_QUADRATIC_ABS
-      PRUnichar('q'),  //  9 == PATHSEG_CURVETO_QUADRATIC_REL
-      PRUnichar('A'),  // 10 == PATHSEG_ARC_ABS
-      PRUnichar('a'),  // 11 == PATHSEG_ARC_REL
-      PRUnichar('H'),  // 12 == PATHSEG_LINETO_HORIZONTAL_ABS
-      PRUnichar('h'),  // 13 == PATHSEG_LINETO_HORIZONTAL_REL
-      PRUnichar('V'),  // 14 == PATHSEG_LINETO_VERTICAL_ABS
-      PRUnichar('v'),  // 15 == PATHSEG_LINETO_VERTICAL_REL
-      PRUnichar('S'),  // 16 == PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
-      PRUnichar('s'),  // 17 == PATHSEG_CURVETO_CUBIC_SMOOTH_REL
-      PRUnichar('T'),  // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
-      PRUnichar('t')   // 19 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
+    static const char16_t table[] = {
+      char16_t('x'),  //  0 == PATHSEG_UNKNOWN
+      char16_t('z'),  //  1 == PATHSEG_CLOSEPATH
+      char16_t('M'),  //  2 == PATHSEG_MOVETO_ABS
+      char16_t('m'),  //  3 == PATHSEG_MOVETO_REL
+      char16_t('L'),  //  4 == PATHSEG_LINETO_ABS
+      char16_t('l'),  //  5 == PATHSEG_LINETO_REL
+      char16_t('C'),  //  6 == PATHSEG_CURVETO_CUBIC_ABS
+      char16_t('c'),  //  7 == PATHSEG_CURVETO_CUBIC_REL
+      char16_t('Q'),  //  8 == PATHSEG_CURVETO_QUADRATIC_ABS
+      char16_t('q'),  //  9 == PATHSEG_CURVETO_QUADRATIC_REL
+      char16_t('A'),  // 10 == PATHSEG_ARC_ABS
+      char16_t('a'),  // 11 == PATHSEG_ARC_REL
+      char16_t('H'),  // 12 == PATHSEG_LINETO_HORIZONTAL_ABS
+      char16_t('h'),  // 13 == PATHSEG_LINETO_HORIZONTAL_REL
+      char16_t('V'),  // 14 == PATHSEG_LINETO_VERTICAL_ABS
+      char16_t('v'),  // 15 == PATHSEG_LINETO_VERTICAL_REL
+      char16_t('S'),  // 16 == PATHSEG_CURVETO_CUBIC_SMOOTH_ABS
+      char16_t('s'),  // 17 == PATHSEG_CURVETO_CUBIC_SMOOTH_REL
+      char16_t('T'),  // 18 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS
+      char16_t('t')   // 19 == PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL
     };
     static_assert(NS_ARRAY_LENGTH(table) == NS_SVG_PATH_SEG_TYPE_COUNT, "Unexpected table size");
 
     return table[aType];
   }
 
   static uint32_t ArgCountForType(uint32_t aType) {
     NS_ABORT_IF_FALSE(IsValidType(aType), "Seg type not recognized");
--- a/content/svg/content/src/SVGPointList.cpp
+++ b/content/svg/content/src/SVGPointList.cpp
@@ -22,17 +22,17 @@ SVGPointList::CopyFrom(const SVGPointLis
   mItems = rhs.mItems;
   return NS_OK;
 }
 
 void
 SVGPointList::GetValueAsString(nsAString& aValue) const
 {
   aValue.Truncate();
-  PRUnichar buf[50];
+  char16_t buf[50];
   uint32_t last = mItems.Length() - 1;
   for (uint32_t i = 0; i < mItems.Length(); ++i) {
     // Would like to use aValue.AppendPrintf("%f,%f", item.mX, item.mY),
     // but it's not possible to always avoid trailing zeros.
     nsTextFormatter::snprintf(buf, ArrayLength(buf),
                               MOZ_UTF16("%g,%g"),
                               double(mItems[i].mX), double(mItems[i].mY));
     // We ignore OOM, since it's not useful for us to return an error.
@@ -57,19 +57,19 @@ SVGPointList::SetValueFromString(const n
 
   nsCharSeparatedTokenizerTemplate<IsSVGWhitespace>
     tokenizer(aValue, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
 
   while (tokenizer.hasMoreTokens()) {
 
     const nsAString& token = tokenizer.nextToken();
 
-    RangedPtr<const PRUnichar> iter =
+    RangedPtr<const char16_t> iter =
       SVGContentUtils::GetStartRangedPtr(token);
-    const RangedPtr<const PRUnichar> end =
+    const RangedPtr<const char16_t> end =
       SVGContentUtils::GetEndRangedPtr(token);
 
     float x;
     if (!SVGContentUtils::ParseNumber(iter, end, x)) {
       rv = NS_ERROR_DOM_SYNTAX_ERR;
       break;
     }
 
--- a/content/svg/content/src/SVGTransformListParser.cpp
+++ b/content/svg/content/src/SVGTransformListParser.cpp
@@ -49,17 +49,17 @@ SVGTransformListParser::ParseTransforms(
     }
   }
   return true;
 }
 
 bool
 SVGTransformListParser::ParseTransform()
 {
-  RangedPtr<const PRUnichar> start(mIter);
+  RangedPtr<const char16_t> start(mIter);
   while (IsAlpha(*mIter)) {
     ++mIter;
     if (mIter == mEnd) {
       return false;
     }
   }
 
   if (start == mIter) {
--- a/content/svg/content/src/nsSVGAngle.cpp
+++ b/content/svg/content/src/nsSVGAngle.cpp
@@ -77,35 +77,35 @@ GetUnitTypeForString(const nsAString& un
   }
 
   return SVG_ANGLETYPE_UNKNOWN;
 }
 
 static void
 GetValueString(nsAString &aValueAsString, float aValue, uint16_t aUnitType)
 {
-  PRUnichar buf[24];
-  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+  char16_t buf[24];
+  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
                             MOZ_UTF16("%g"),
                             (double)aValue);
   aValueAsString.Assign(buf);
 
   nsAutoString unitString;
   GetUnitString(unitString, aUnitType);
   aValueAsString.Append(unitString);
 }
 
 static bool
 GetValueFromString(const nsAString& aString,
                    float& aValue,
                    uint16_t* aUnitType)
 {
-  RangedPtr<const PRUnichar> iter =
+  RangedPtr<const char16_t> iter =
     SVGContentUtils::GetStartRangedPtr(aString);
-  const RangedPtr<const PRUnichar> end =
+  const RangedPtr<const char16_t> end =
     SVGContentUtils::GetEndRangedPtr(aString);
 
   if (!SVGContentUtils::ParseNumber(iter, end, aValue)) {
     return false;
   }
 
   const nsAString& units = Substring(iter.get(), end.get());
   *aUnitType = GetUnitTypeForString(units);
--- a/content/svg/content/src/nsSVGDataParser.h
+++ b/content/svg/content/src/nsSVGDataParser.h
@@ -14,25 +14,25 @@
 // for path and transform values.
 // 
 class nsSVGDataParser
 {
 public:
   nsSVGDataParser(const nsAString& aValue);
 
 protected:
-  static bool IsAlpha(PRUnichar aCh) {
+  static bool IsAlpha(char16_t aCh) {
     // Exclude non-ascii characters before calling isalpha
     return (aCh & 0x7f) == aCh && isalpha(aCh);
   }
 
   // Returns true if there are more characters to read, false otherwise.
   bool SkipCommaWsp();
 
   // Returns true if there are more characters to read, false otherwise.
   bool SkipWsp();
 
-  mozilla::RangedPtr<const PRUnichar> mIter;
-  const mozilla::RangedPtr<const PRUnichar> mEnd;
+  mozilla::RangedPtr<const char16_t> mIter;
+  const mozilla::RangedPtr<const char16_t> mEnd;
 };
 
 
 #endif // __NS_SVGDATAPARSER_H__
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -2495,17 +2495,17 @@ nsSVGElement::StringListAttributesInfo::
 }
 
 nsresult
 nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument,
                                           nsIAtom* aAttribute,
                                           const nsAString& aValue)
 {
   const nsAFlatString& attributeValue = PromiseFlatString(aValue);
-  const PRUnichar *strings[] = { aAttribute->GetUTF16String(),
+  const char16_t *strings[] = { aAttribute->GetUTF16String(),
                                  attributeValue.get() };
   return SVGContentUtils::ReportToConsole(aDocument,
                                           "AttributeParseWarning",
                                           strings, ArrayLength(strings));
 }
 
 void
 nsSVGElement::RecompileScriptEventListeners()
--- a/content/svg/content/src/nsSVGLength2.cpp
+++ b/content/svg/content/src/nsSVGLength2.cpp
@@ -105,35 +105,35 @@ GetUnitTypeForString(const nsAString& un
   }
 
   return nsIDOMSVGLength::SVG_LENGTHTYPE_UNKNOWN;
 }
 
 static void
 GetValueString(nsAString &aValueAsString, float aValue, uint16_t aUnitType)
 {
-  PRUnichar buf[24];
-  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+  char16_t buf[24];
+  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
                             MOZ_UTF16("%g"),
                             (double)aValue);
   aValueAsString.Assign(buf);
 
   nsAutoString unitString;
   GetUnitString(unitString, aUnitType);
   aValueAsString.Append(unitString);
 }
 
 static bool
 GetValueFromString(const nsAString& aString,
                    float& aValue,
                    uint16_t* aUnitType)
 {
-  RangedPtr<const PRUnichar> iter =
+  RangedPtr<const char16_t> iter =
     SVGContentUtils::GetStartRangedPtr(aString);
-  const RangedPtr<const PRUnichar> end =
+  const RangedPtr<const char16_t> end =
     SVGContentUtils::GetEndRangedPtr(aString);
 
   if (!SVGContentUtils::ParseNumber(iter, end, aValue)) {
     return false;
   }
   const nsAString& units = Substring(iter.get(), end.get());
   *aUnitType = GetUnitTypeForString(units);
   return IsValidUnitType(*aUnitType);
--- a/content/svg/content/src/nsSVGNumber2.cpp
+++ b/content/svg/content/src/nsSVGNumber2.cpp
@@ -20,19 +20,19 @@ using namespace mozilla::dom;
 static nsSVGAttrTearoffTable<nsSVGNumber2, nsSVGNumber2::DOMAnimatedNumber>
   sSVGAnimatedNumberTearoffTable;
 
 static bool
 GetValueFromString(const nsAString& aString,
                    bool aPercentagesAllowed,
                    float& aValue)
 {
-  RangedPtr<const PRUnichar> iter =
+  RangedPtr<const char16_t> iter =
     SVGContentUtils::GetStartRangedPtr(aString);
-  const RangedPtr<const PRUnichar> end =
+  const RangedPtr<const char16_t> end =
     SVGContentUtils::GetEndRangedPtr(aString);
 
   if (!SVGContentUtils::ParseNumber(iter, end, aValue)) {
     return false;
   }
 
   if (aPercentagesAllowed) {
     const nsAString& units = Substring(iter.get(), end.get());
--- a/content/svg/content/src/nsSVGPathDataParser.cpp
+++ b/content/svg/content/src/nsSVGPathDataParser.cpp
@@ -9,17 +9,17 @@
 #include "nsSVGDataParser.h"
 #include "SVGContentUtils.h"
 #include "SVGPathData.h"
 #include "SVGPathSegUtils.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 
-static inline PRUnichar ToUpper(PRUnichar aCh)
+static inline char16_t ToUpper(char16_t aCh)
 {
   return aCh >= 'a' && aCh <= 'z' ? aCh - 'a' + 'A' : aCh;
 }
 
 bool
 nsSVGPathDataParser::Parse()
 {
   mPathSegList->Clear();
@@ -69,34 +69,34 @@ nsSVGPathDataParser::ParseSubPath()
 {
   return ParseMoveto() && ParseSubPathElements();
 }
 
 bool
 nsSVGPathDataParser::ParseSubPathElements()
 {
   while (SkipWsp() && !IsStartOfSubPath()) {
-    PRUnichar commandType = ToUpper(*mIter);
+    char16_t commandType = ToUpper(*mIter);
 
     // Upper case commands have absolute co-ordinates,
     // lower case commands have relative co-ordinates.
     bool absCoords = commandType == *mIter;
 
     ++mIter;
     SkipWsp();
 
     if (!ParseSubPathElement(commandType, absCoords)) {
       return false;
     }
   }
   return true;
 }
 
 bool
-nsSVGPathDataParser::ParseSubPathElement(PRUnichar aCommandType,
+nsSVGPathDataParser::ParseSubPathElement(char16_t aCommandType,
                                          bool aAbsCoords)
 {
   switch (aCommandType) {
     case 'Z':
       return ParseClosePath();
     case 'L':
       return ParseLineto(aAbsCoords);
     case 'H':
--- a/content/svg/content/src/nsSVGPathDataParser.h
+++ b/content/svg/content/src/nsSVGPathDataParser.h
@@ -38,17 +38,17 @@ private:
   bool ParseCoordPair(float& aX, float& aY);
   bool ParseFlag(bool& aFlag);
 
   bool ParsePath();
   bool IsStartOfSubPath() const;
   bool ParseSubPath();
   
   bool ParseSubPathElements();
-  bool ParseSubPathElement(PRUnichar aCommandType,
+  bool ParseSubPathElement(char16_t aCommandType,
                            bool aAbsCoords);
 
   bool ParseMoveto();
   bool ParseClosePath();
   bool ParseLineto(bool aAbsCoords);
   bool ParseHorizontalLineto(bool aAbsCoords);
   bool ParseVerticalLineto(bool aAbsCoords);
   bool ParseCurveto(bool aAbsCoords);
--- a/content/svg/content/src/nsSVGTransform.cpp
+++ b/content/svg/content/src/nsSVGTransform.cpp
@@ -13,57 +13,57 @@ namespace {
   const double kRadPerDegree = 2.0 * M_PI / 360.0;
 }
 
 namespace mozilla {
 
 void
 nsSVGTransform::GetValueAsString(nsAString& aValue) const
 {
-  PRUnichar buf[256];
+  char16_t buf[256];
 
   switch (mType) {
     case SVG_TRANSFORM_TRANSLATE:
       // The spec say that if Y is not provided, it is assumed to be zero.
       if (mMatrix.y0 != 0)
-        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
             MOZ_UTF16("translate(%g, %g)"),
             mMatrix.x0, mMatrix.y0);
       else
-        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
             MOZ_UTF16("translate(%g)"),
             mMatrix.x0);
       break;
     case SVG_TRANSFORM_ROTATE:
       if (mOriginX != 0.0f || mOriginY != 0.0f)
-        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
             MOZ_UTF16("rotate(%g, %g, %g)"),
             mAngle, mOriginX, mOriginY);
       else
-        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
             MOZ_UTF16("rotate(%g)"), mAngle);
       break;
     case SVG_TRANSFORM_SCALE:
       if (mMatrix.xx != mMatrix.yy)
-        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
             MOZ_UTF16("scale(%g, %g)"), mMatrix.xx, mMatrix.yy);
       else
-        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+        nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
             MOZ_UTF16("scale(%g)"), mMatrix.xx);
       break;
     case SVG_TRANSFORM_SKEWX:
-      nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+      nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
                                 MOZ_UTF16("skewX(%g)"), mAngle);
       break;
     case SVG_TRANSFORM_SKEWY:
-      nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+      nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
                                 MOZ_UTF16("skewY(%g)"), mAngle);
       break;
     case SVG_TRANSFORM_MATRIX:
-      nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+      nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
           MOZ_UTF16("matrix(%g, %g, %g, %g, %g, %g)"),
                             mMatrix.xx, mMatrix.yx,
                             mMatrix.xy, mMatrix.yy,
                             mMatrix.x0, mMatrix.y0);
       break;
     default:
       buf[0] = '\0';
       NS_ERROR("unknown transformation type");
--- a/content/svg/content/src/nsSVGViewBox.cpp
+++ b/content/svg/content/src/nsSVGViewBox.cpp
@@ -175,18 +175,18 @@ nsSVGViewBox::SetBaseValueString(const n
 
 void
 nsSVGViewBox::GetBaseValueString(nsAString& aValue) const
 {
   if (mBaseVal.none) {
     aValue.AssignLiteral("none");
     return;
   }
-  PRUnichar buf[200];
-  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(PRUnichar),
+  char16_t buf[200];
+  nsTextFormatter::snprintf(buf, sizeof(buf)/sizeof(char16_t),
                             MOZ_UTF16("%g %g %g %g"),
                             (double)mBaseVal.x, (double)mBaseVal.y,
                             (double)mBaseVal.width, (double)mBaseVal.height);
   aValue.Assign(buf);
 }
 
 
 already_AddRefed<dom::SVGAnimatedRect>
--- a/content/xbl/src/nsXBLContentSink.cpp
+++ b/content/xbl/src/nsXBLContentSink.cpp
@@ -140,20 +140,20 @@ nsXBLContentSink::FlushText(bool aReleas
     if (content &&
         (content->NodeInfo()->NamespaceEquals(kNameSpaceID_XBL) ||
          (content->NodeInfo()->NamespaceEquals(kNameSpaceID_XUL) &&
           content->Tag() != nsGkAtoms::label &&
           content->Tag() != nsGkAtoms::description))) {
 
       bool isWS = true;
       if (mTextLength > 0) {
-        const PRUnichar* cp = mText;
-        const PRUnichar* end = mText + mTextLength;
+        const char16_t* cp = mText;
+        const char16_t* end = mText + mTextLength;
         while (cp < end) {
-          PRUnichar ch = *cp++;
+          char16_t ch = *cp++;
           if (!dom::IsSpaceCharacter(ch)) {
             isWS = false;
             break;
           }
         }
       }
 
       if (isWS && mTextLength > 0) {
@@ -163,18 +163,18 @@ nsXBLContentSink::FlushText(bool aReleas
       }
     }
   }
 
   return nsXMLContentSink::FlushText(aReleaseTextNode);
 }
 
 NS_IMETHODIMP
-nsXBLContentSink::ReportError(const PRUnichar* aErrorText, 
-                              const PRUnichar* aSourceText,
+nsXBLContentSink::ReportError(const char16_t* aErrorText, 
+                              const char16_t* aSourceText,
                               nsIScriptError *aError,
                               bool *_retval)
 {
   NS_PRECONDITION(aError && aSourceText && aErrorText, "Check arguments!!!");
 
   // XXX FIXME This function overrides and calls on
   // nsXMLContentSink::ReportError, and probably should die.  See bug 347826.
 
@@ -205,17 +205,17 @@ nsXBLContentSink::ReportUnexpectedElemen
 {
   // XXX we should really somehow stop the parse and drop the binding
   // instead of just letting the XML sink build the content model like
   // we do...
   mState = eXBL_Error;
   nsAutoString elementName;
   aElementName->ToString(elementName);
 
-  const PRUnichar* params[] = { elementName.get() };
+  const char16_t* params[] = { elementName.get() };
 
   return nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
                                          NS_LITERAL_CSTRING("XBL Content Sink"),
                                          mDocument,
                                          nsContentUtils::eXBL_PROPERTIES,
                                          "UnexpectedElement",
                                          params, ArrayLength(params),
                                          nullptr,
@@ -243,18 +243,18 @@ nsXBLContentSink::AddField(nsXBLProtoImp
     mImplField->SetNext(aField); // Already have a chain. Just append to the end.
   else
     mImplementation->SetFieldList(aField); // We're the first member in the chain.
 
   mImplField = aField; // Adjust our pointer to point to the new last field in the chain.
 }
 
 NS_IMETHODIMP 
-nsXBLContentSink::HandleStartElement(const PRUnichar *aName, 
-                                     const PRUnichar **aAtts, 
+nsXBLContentSink::HandleStartElement(const char16_t *aName, 
+                                     const char16_t **aAtts, 
                                      uint32_t aAttsCount, 
                                      int32_t aIndex, 
                                      uint32_t aLineNumber)
 {
   nsresult rv = nsXMLContentSink::HandleStartElement(aName,aAtts,aAttsCount,aIndex,aLineNumber);
   if (NS_FAILED(rv))
     return rv;
 
@@ -266,17 +266,17 @@ nsXBLContentSink::HandleStartElement(con
     // mBinding may still be null, if the binding had no id.  If so,
     // we'll deal with that later in the sink.
   }
 
   return rv;
 }
 
 NS_IMETHODIMP 
-nsXBLContentSink::HandleEndElement(const PRUnichar *aName)
+nsXBLContentSink::HandleEndElement(const char16_t *aName)
 {
   FlushText();
 
   if (mState != eXBL_InDocument) {
     int32_t nameSpaceID;
     nsCOMPtr<nsIAtom> prefix, localName;
     nsContentUtils::SplitExpatName(aName, getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
@@ -352,31 +352,31 @@ nsXBLContentSink::HandleEndElement(const
       return NS_OK;
     }
   }
 
   return nsXMLContentSink::HandleEndElement(aName);
 }
 
 NS_IMETHODIMP 
-nsXBLContentSink::HandleCDataSection(const PRUnichar *aData, 
+nsXBLContentSink::HandleCDataSection(const char16_t *aData, 
                                      uint32_t aLength)
 {
   if (mState == eXBL_InHandlers || mState == eXBL_InImplementation)
     return AddText(aData, aLength);
   return nsXMLContentSink::HandleCDataSection(aData, aLength);
 }
 
 #define ENSURE_XBL_STATE(_cond)                                                       \
   PR_BEGIN_MACRO                                                                      \
     if (!(_cond)) { ReportUnexpectedElement(aTagName, aLineNumber); return true; } \
   PR_END_MACRO
 
 bool 
-nsXBLContentSink::OnOpenContainer(const PRUnichar **aAtts, 
+nsXBLContentSink::OnOpenContainer(const char16_t **aAtts, 
                                   uint32_t aAttsCount, 
                                   int32_t aNameSpaceID, 
                                   nsIAtom* aTagName,
                                   uint32_t aLineNumber)
 {
   if (mState == eXBL_Error) {
     return true;
   }
@@ -576,17 +576,17 @@ nsXBLContentSink::ConstructBinding(uint3
                                     EmptyString(),
                                     aLineNumber);
   }
 
   return rv;
 }
 
 static bool
-FindValue(const PRUnichar **aAtts, nsIAtom *aAtom, const PRUnichar **aResult)
+FindValue(const char16_t **aAtts, nsIAtom *aAtom, const char16_t **aResult)
 {
   nsCOMPtr<nsIAtom> prefix, localName;
   for (; *aAtts; aAtts += 2) {
     int32_t nameSpaceID;
     nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
 
     // Is this attribute one of the ones we care about?
@@ -596,30 +596,30 @@ FindValue(const PRUnichar **aAtts, nsIAt
       return true;
     }
   }
 
   return false;
 }
 
 void
-nsXBLContentSink::ConstructHandler(const PRUnichar **aAtts, uint32_t aLineNumber)
+nsXBLContentSink::ConstructHandler(const char16_t **aAtts, uint32_t aLineNumber)
 {
-  const PRUnichar* event          = nullptr;
-  const PRUnichar* modifiers      = nullptr;
-  const PRUnichar* button         = nullptr;
-  const PRUnichar* clickcount     = nullptr;
-  const PRUnichar* keycode        = nullptr;
-  const PRUnichar* charcode       = nullptr;
-  const PRUnichar* phase          = nullptr;
-  const PRUnichar* command        = nullptr;
-  const PRUnichar* action         = nullptr;
-  const PRUnichar* group          = nullptr;
-  const PRUnichar* preventdefault = nullptr;
-  const PRUnichar* allowuntrusted = nullptr;
+  const char16_t* event          = nullptr;
+  const char16_t* modifiers      = nullptr;
+  const char16_t* button         = nullptr;
+  const char16_t* clickcount     = nullptr;
+  const char16_t* keycode        = nullptr;
+  const char16_t* charcode       = nullptr;
+  const char16_t* phase          = nullptr;
+  const char16_t* command        = nullptr;
+  const char16_t* action         = nullptr;
+  const char16_t* group          = nullptr;
+  const char16_t* preventdefault = nullptr;
+  const char16_t* allowuntrusted = nullptr;
 
   nsCOMPtr<nsIAtom> prefix, localName;
   for (; *aAtts; aAtts += 2) {
     int32_t nameSpaceID;
     nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
 
     if (nameSpaceID != kNameSpaceID_None) {
@@ -690,39 +690,39 @@ nsXBLContentSink::ConstructHandler(const
     // chain.
     mHandler = newHandler;
   } else {
     mState = eXBL_Error;
   }
 }
 
 void
-nsXBLContentSink::ConstructResource(const PRUnichar **aAtts,
+nsXBLContentSink::ConstructResource(const char16_t **aAtts,
                                     nsIAtom* aResourceType)
 {
   if (!mBinding)
     return;
 
-  const PRUnichar* src = nullptr;
+  const char16_t* src = nullptr;
   if (FindValue(aAtts, nsGkAtoms::src, &src)) {
     mBinding->AddResource(aResourceType, nsDependentString(src));
   }
 }
 
 void
-nsXBLContentSink::ConstructImplementation(const PRUnichar **aAtts)
+nsXBLContentSink::ConstructImplementation(const char16_t **aAtts)
 {
   mImplementation = nullptr;
   mImplMember = nullptr;
   mImplField = nullptr;
   
   if (!mBinding)
     return;
 
-  const PRUnichar* name = nullptr;
+  const char16_t* name = nullptr;
 
   nsCOMPtr<nsIAtom> prefix, localName;
   for (; *aAtts; aAtts += 2) {
     int32_t nameSpaceID;
     nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
 
     if (nameSpaceID != kNameSpaceID_None) {
@@ -741,20 +741,20 @@ nsXBLContentSink::ConstructImplementatio
       }
     }
   }
 
   NS_NewXBLProtoImpl(mBinding, name, &mImplementation);
 }
 
 void
-nsXBLContentSink::ConstructField(const PRUnichar **aAtts, uint32_t aLineNumber)
+nsXBLContentSink::ConstructField(const char16_t **aAtts, uint32_t aLineNumber)
 {
-  const PRUnichar* name     = nullptr;
-  const PRUnichar* readonly = nullptr;
+  const char16_t* name     = nullptr;
+  const char16_t* readonly = nullptr;
 
   nsCOMPtr<nsIAtom> prefix, localName;
   for (; *aAtts; aAtts += 2) {
     int32_t nameSpaceID;
     nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
 
     if (nameSpaceID != kNameSpaceID_None) {
@@ -777,22 +777,22 @@ nsXBLContentSink::ConstructField(const P
     if (mField) {
       mField->SetLineNumber(aLineNumber);
       AddField(mField);
     }
   }
 }
 
 void
-nsXBLContentSink::ConstructProperty(const PRUnichar **aAtts, uint32_t aLineNumber)
+nsXBLContentSink::ConstructProperty(const char16_t **aAtts, uint32_t aLineNumber)
 {
-  const PRUnichar* name     = nullptr;
-  const PRUnichar* readonly = nullptr;
-  const PRUnichar* onget    = nullptr;
-  const PRUnichar* onset    = nullptr;
+  const char16_t* name     = nullptr;
+  const char16_t* readonly = nullptr;
+  const char16_t* onget    = nullptr;
+  const char16_t* onset    = nullptr;
   bool exposeToUntrustedContent = false;
 
   nsCOMPtr<nsIAtom> prefix, localName;
   for (; *aAtts; aAtts += 2) {
     int32_t nameSpaceID;
     nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
 
@@ -827,50 +827,50 @@ nsXBLContentSink::ConstructProperty(cons
     if (exposeToUntrustedContent) {
       mProperty->SetExposeToUntrustedContent(true);
     }
     AddMember(mProperty);
   }
 }
 
 void
-nsXBLContentSink::ConstructMethod(const PRUnichar **aAtts)
+nsXBLContentSink::ConstructMethod(const char16_t **aAtts)
 {
   mMethod = nullptr;
 
-  const PRUnichar* name = nullptr;
-  const PRUnichar* expose = nullptr;
+  const char16_t* name = nullptr;
+  const char16_t* expose = nullptr;
   if (FindValue(aAtts, nsGkAtoms::name, &name)) {
     mMethod = new nsXBLProtoImplMethod(name);
     if (FindValue(aAtts, nsGkAtoms::exposeToUntrustedContent, &expose) &&
         nsDependentString(expose).EqualsLiteral("true"))
     {
       mMethod->SetExposeToUntrustedContent(true);
     }
   }
 
   if (mMethod) {
     AddMember(mMethod);
   }
 }
 
 void
-nsXBLContentSink::ConstructParameter(const PRUnichar **aAtts)
+nsXBLContentSink::ConstructParameter(const char16_t **aAtts)
 {
   if (!mMethod)
     return;
 
-  const PRUnichar* name = nullptr;
+  const char16_t* name = nullptr;
   if (FindValue(aAtts, nsGkAtoms::name, &name)) {
     mMethod->AddParameter(nsDependentString(name));
   }
 }
 
 nsresult
-nsXBLContentSink::CreateElement(const PRUnichar** aAtts, uint32_t aAttsCount,
+nsXBLContentSink::CreateElement(const char16_t** aAtts, uint32_t aAttsCount,
                                 nsINodeInfo* aNodeInfo, uint32_t aLineNumber,
                                 nsIContent** aResult, bool* aAppendContent,
                                 FromParser aFromParser)
 {
 #ifdef MOZ_XUL
   if (!aNodeInfo->NamespaceEquals(kNameSpaceID_XUL)) {
 #endif
     return nsXMLContentSink::CreateElement(aAtts, aAttsCount, aNodeInfo,
@@ -893,28 +893,28 @@ nsXBLContentSink::CreateElement(const PR
   Element* result;
   nsresult rv = nsXULElement::Create(prototype, mDocument, false, false, &result);
   *aResult = result;
   return rv;
 #endif
 }
 
 nsresult 
-nsXBLContentSink::AddAttributes(const PRUnichar** aAtts,
+nsXBLContentSink::AddAttributes(const char16_t** aAtts,
                                 nsIContent* aContent)
 {
   if (aContent->IsXUL())
     return NS_OK; // Nothing to do, since the proto already has the attrs.
 
   return nsXMLContentSink::AddAttributes(aAtts, aContent);
 }
 
 #ifdef MOZ_XUL
 nsresult
-nsXBLContentSink::AddAttributesToXULPrototype(const PRUnichar **aAtts, 
+nsXBLContentSink::AddAttributesToXULPrototype(const char16_t **aAtts, 
                                               uint32_t aAttsCount, 
                                               nsXULPrototypeElement* aElement)
 {
   // Add tag attributes to the element
   nsresult rv;
 
   // Create storage for the attributes
   nsXULPrototypeAttribute* attrs = nullptr;
--- a/content/xbl/src/nsXBLContentSink.h
+++ b/content/xbl/src/nsXBLContentSink.h
@@ -61,70 +61,70 @@ public:
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   nsresult Init(nsIDocument* aDoc,
                 nsIURI* aURL,
                 nsISupports* aContainer);
 
   // nsIContentSink overrides
-  NS_IMETHOD HandleStartElement(const PRUnichar *aName, 
-                                const PRUnichar **aAtts, 
+  NS_IMETHOD HandleStartElement(const char16_t *aName, 
+                                const char16_t **aAtts, 
                                 uint32_t aAttsCount, 
                                 int32_t aIndex, 
                                 uint32_t aLineNumber) MOZ_OVERRIDE;
 
-  NS_IMETHOD HandleEndElement(const PRUnichar *aName) MOZ_OVERRIDE;
+  NS_IMETHOD HandleEndElement(const char16_t *aName) MOZ_OVERRIDE;
   
-  NS_IMETHOD HandleCDataSection(const PRUnichar *aData, 
+  NS_IMETHOD HandleCDataSection(const char16_t *aData, 
                                 uint32_t aLength) MOZ_OVERRIDE;
 
 protected:
     // nsXMLContentSink overrides
     virtual void MaybeStartLayout(bool aIgnorePendingSheets) MOZ_OVERRIDE;
 
-    bool OnOpenContainer(const PRUnichar **aAtts, 
+    bool OnOpenContainer(const char16_t **aAtts, 
                            uint32_t aAttsCount, 
                            int32_t aNameSpaceID, 
                            nsIAtom* aTagName,
                            uint32_t aLineNumber) MOZ_OVERRIDE;
 
     bool NotifyForDocElement() MOZ_OVERRIDE { return false; }
 
-    nsresult CreateElement(const PRUnichar** aAtts, uint32_t aAttsCount,
+    nsresult CreateElement(const char16_t** aAtts, uint32_t aAttsCount,
                            nsINodeInfo* aNodeInfo, uint32_t aLineNumber,
                            nsIContent** aResult, bool* aAppendContent,
                            mozilla::dom::FromParser aFromParser) MOZ_OVERRIDE;
     
-    nsresult AddAttributes(const PRUnichar** aAtts, 
+    nsresult AddAttributes(const char16_t** aAtts, 
                            nsIContent* aContent) MOZ_OVERRIDE;
 
 #ifdef MOZ_XUL    
-    nsresult AddAttributesToXULPrototype(const PRUnichar **aAtts, 
+    nsresult AddAttributesToXULPrototype(const char16_t **aAtts, 
                                          uint32_t aAttsCount, 
                                          nsXULPrototypeElement* aElement);
 #endif
 
     // Our own helpers for constructing XBL prototype objects.
     nsresult ConstructBinding(uint32_t aLineNumber);
-    void ConstructHandler(const PRUnichar **aAtts, uint32_t aLineNumber);
-    void ConstructResource(const PRUnichar **aAtts, nsIAtom* aResourceType);
-    void ConstructImplementation(const PRUnichar **aAtts);
-    void ConstructProperty(const PRUnichar **aAtts, uint32_t aLineNumber);
-    void ConstructMethod(const PRUnichar **aAtts);
-    void ConstructParameter(const PRUnichar **aAtts);
-    void ConstructField(const PRUnichar **aAtts, uint32_t aLineNumber);
+    void ConstructHandler(const char16_t **aAtts, uint32_t aLineNumber);
+    void ConstructResource(const char16_t **aAtts, nsIAtom* aResourceType);
+    void ConstructImplementation(const char16_t **aAtts);
+    void ConstructProperty(const char16_t **aAtts, uint32_t aLineNumber);
+    void ConstructMethod(const char16_t **aAtts);
+    void ConstructParameter(const char16_t **aAtts);
+    void ConstructField(const char16_t **aAtts, uint32_t aLineNumber);
   
 
   // nsXMLContentSink overrides
   nsresult FlushText(bool aReleaseTextNode = true) MOZ_OVERRIDE;
 
   // nsIExpatSink overrides
-  NS_IMETHOD ReportError(const PRUnichar* aErrorText,
-                         const PRUnichar* aSourceText,
+  NS_IMETHOD ReportError(const char16_t* aErrorText,
+                         const char16_t* aSourceText,
                          nsIScriptError *aError,
                          bool *_retval) MOZ_OVERRIDE;
 
 protected:
   nsresult ReportUnexpectedElement(nsIAtom* aElementName, uint32_t aLineNumber);
 
   void AddMember(nsXBLProtoImplMember* aMember);
   void AddField(nsXBLProtoImplField* aField);
--- a/content/xbl/src/nsXBLProtoImpl.cpp
+++ b/content/xbl/src/nsXBLProtoImpl.cpp
@@ -295,17 +295,17 @@ nsXBLProtoImpl::FindField(const nsString
   return nullptr;
 }
 
 bool
 nsXBLProtoImpl::ResolveAllFields(JSContext *cx, JS::Handle<JSObject*> obj) const
 {
   for (nsXBLProtoImplField* f = mFields; f; f = f->GetNext()) {
     // Using OBJ_LOOKUP_PROPERTY is a pain, since what we have is a
-    // PRUnichar* for the property name.  Let's just use the public API and
+    // char16_t* for the property name.  Let's just use the public API and
     // all.
     nsDependentString name(f->GetName());
     JS::Rooted<JS::Value> dummy(cx);
     if (!::JS_LookupUCProperty(cx, obj, name.get(), name.Length(), &dummy)) {
       return false;
     }
   }
 
@@ -499,17 +499,17 @@ nsXBLProtoImpl::Write(nsIObjectOutputStr
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return aStream->Write8(XBLBinding_Serialize_NoMoreItems);
 }
 
 nsresult
 NS_NewXBLProtoImpl(nsXBLPrototypeBinding* aBinding, 
-                   const PRUnichar* aClassName, 
+                   const char16_t* aClassName, 
                    nsXBLProtoImpl** aResult)
 {
   nsXBLProtoImpl* impl = new nsXBLProtoImpl();
   if (!impl)
     return NS_ERROR_OUT_OF_MEMORY;
   if (aClassName)
     impl->mClassName.AssignWithConversion(aClassName);
   else
--- a/content/xbl/src/nsXBLProtoImpl.h
+++ b/content/xbl/src/nsXBLProtoImpl.h
@@ -110,12 +110,12 @@ protected:
 
 public:
   nsXBLProtoImplAnonymousMethod* mConstructor; // Our class constructor.
   nsXBLProtoImplAnonymousMethod* mDestructor;  // Our class destructor.
 };
 
 nsresult
 NS_NewXBLProtoImpl(nsXBLPrototypeBinding* aBinding,
-                   const PRUnichar* aClassName,
+                   const char16_t* aClassName,
                    nsXBLProtoImpl** aResult);
 
 #endif // nsXBLProtoImpl_h__
--- a/content/xbl/src/nsXBLProtoImplField.cpp
+++ b/content/xbl/src/nsXBLProtoImplField.cpp
@@ -19,17 +19,17 @@
 #include "nsCxPusher.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "xpcpublic.h"
 #include "WrapperFactory.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-nsXBLProtoImplField::nsXBLProtoImplField(const PRUnichar* aName, const PRUnichar* aReadOnly)
+nsXBLProtoImplField::nsXBLProtoImplField(const char16_t* aName, const char16_t* aReadOnly)
   : mNext(nullptr),
     mFieldText(nullptr),
     mFieldTextLength(0),
     mLineNumber(0)
 {
   MOZ_COUNT_CTOR(nsXBLProtoImplField);
   mName = NS_strdup(aName);  // XXXbz make more sense to use a stringbuffer?
   
@@ -65,17 +65,17 @@ nsXBLProtoImplField::~nsXBLProtoImplFiel
 }
 
 void 
 nsXBLProtoImplField::AppendFieldText(const nsAString& aText)
 {
   if (mFieldText) {
     nsDependentString fieldTextStr(mFieldText, mFieldTextLength);
     nsAutoString newFieldText = fieldTextStr + aText;
-    PRUnichar* temp = mFieldText;
+    char16_t* temp = mFieldText;
     mFieldText = ToNewUnicode(newFieldText);
     mFieldTextLength = newFieldText.Length();
     nsMemory::Free(temp);
   }
   else {
     mFieldText = ToNewUnicode(aText);
     mFieldTextLength = aText.Length();
   }
--- a/content/xbl/src/nsXBLProtoImplField.h
+++ b/content/xbl/src/nsXBLProtoImplField.h
@@ -15,17 +15,17 @@
 class nsIObjectInputStream;
 class nsIObjectOutputStream;
 class nsIScriptContext;
 class nsIURI;
 
 class nsXBLProtoImplField
 {
 public:
-  nsXBLProtoImplField(const PRUnichar* aName, const PRUnichar* aReadOnly);
+  nsXBLProtoImplField(const char16_t* aName, const char16_t* aReadOnly);
   nsXBLProtoImplField(const bool aIsReadOnly);
   ~nsXBLProtoImplField();
 
   void AppendFieldText(const nsAString& aText);
   void SetLineNumber(uint32_t aLineNumber) {
     mLineNumber = aLineNumber;
   }
   
@@ -38,27 +38,27 @@ public:
                         bool* aDidInstall) const;
 
   nsresult InstallAccessors(JSContext* aCx,
                             JS::Handle<JSObject*> aTargetClassObject);
 
   nsresult Read(nsIObjectInputStream* aStream);
   nsresult Write(nsIObjectOutputStream* aStream);
 
-  const PRUnichar* GetName() const { return mName; }
+  const char16_t* GetName() const { return mName; }
 
   unsigned AccessorAttributes() const {
     return JSPROP_SHARED | JSPROP_GETTER | JSPROP_SETTER |
            (mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
   }
 
   bool IsEmpty() const { return mFieldTextLength == 0; }
 
 protected:
   nsXBLProtoImplField* mNext;
-  PRUnichar* mName;
-  PRUnichar* mFieldText;
+  char16_t* mName;
+  char16_t* mFieldText;
   uint32_t mFieldTextLength;
   uint32_t mLineNumber;
   unsigned mJSAttributes;
 };
 
 #endif // nsXBLProtoImplField_h__
--- a/content/xbl/src/nsXBLProtoImplMember.h
+++ b/content/xbl/src/nsXBLProtoImplMember.h
@@ -13,17 +13,17 @@
 #include "nsContentUtils.h" // For NS_CONTENT_DELETE_LIST_MEMBER.
 #include "nsCycleCollectionParticipant.h"
 
 class nsIContent;
 class nsIObjectOutputStream;
 
 struct nsXBLTextWithLineNumber
 {
-  PRUnichar* mText;
+  char16_t* mText;
   uint32_t mLineNumber;
 
   nsXBLTextWithLineNumber() :
     mText(nullptr),
     mLineNumber(0)
   {
     MOZ_COUNT_CTOR(nsXBLTextWithLineNumber);
   }
@@ -32,72 +32,72 @@ struct nsXBLTextWithLineNumber
     MOZ_COUNT_DTOR(nsXBLTextWithLineNumber);
     if (mText) {
       nsMemory::Free(mText);
     }
   }
 
   void AppendText(const nsAString& aText) {
     if (mText) {
-      PRUnichar* temp = mText;
+      char16_t* temp = mText;
       mText = ToNewUnicode(nsDependentString(temp) + aText);
       nsMemory::Free(temp);
     } else {
       mText = ToNewUnicode(aText);
     }
   }
 
-  PRUnichar* GetText() {
+  char16_t* GetText() {
     return mText;
   }
 
   void SetLineNumber(uint32_t aLineNumber) {
     mLineNumber = aLineNumber;
   }
 
   uint32_t GetLineNumber() {
     return mLineNumber;
   }
 };
 
 class nsXBLProtoImplMember
 {
 public:
-  nsXBLProtoImplMember(const PRUnichar* aName)
+  nsXBLProtoImplMember(const char16_t* aName)
     : mNext(nullptr)
     , mExposeToUntrustedContent(false)
   {
     mName = ToNewUnicode(nsDependentString(aName));
   }
   virtual ~nsXBLProtoImplMember() {
     nsMemory::Free(mName);
     NS_CONTENT_DELETE_LIST_MEMBER(nsXBLProtoImplMember, this, mNext);
   }
 
   nsXBLProtoImplMember* GetNext() { return mNext; }
   void SetNext(nsXBLProtoImplMember* aNext) { mNext = aNext; }
   bool ShouldExposeToUntrustedContent() { return mExposeToUntrustedContent; }
   void SetExposeToUntrustedContent(bool aExpose) { mExposeToUntrustedContent = aExpose; }
-  const PRUnichar* GetName() { return mName; }
+  const char16_t* GetName() { return mName; }
 
   virtual nsresult InstallMember(JSContext* aCx,
                                  JS::Handle<JSObject*> aTargetClassObject) = 0;
   virtual nsresult CompileMember(const nsCString& aClassStr,
                                  JS::Handle<JSObject*> aClassObject) = 0;
 
   virtual void Trace(const TraceCallbacks& aCallbacks, void *aClosure) = 0;
 
   virtual nsresult Write(nsIObjectOutputStream* aStream)
   {
     return NS_OK;
   }
 
 protected:
   nsXBLProtoImplMember* mNext;  // The members of an implementation are chained.
-  PRUnichar* mName;               // The name of the field, method, or property.
+  char16_t* mName;               // The name of the field, method, or property.
 
   bool mExposeToUntrustedContent; // If this binding is installed on an element
                                   // in an untrusted scope, should this
                                   // implementation member be accessible to the
                                   // content?
 };
 
 #endif // nsXBLProtoImplMember_h__
--- a/content/xbl/src/nsXBLProtoImplMethod.cpp
+++ b/content/xbl/src/nsXBLProtoImplMethod.cpp
@@ -18,17 +18,17 @@
 #include "nsCxPusher.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIXPConnect.h"
 #include "xpcpublic.h"
 #include "nsXBLPrototypeBinding.h"
 
 using namespace mozilla;
 
-nsXBLProtoImplMethod::nsXBLProtoImplMethod(const PRUnichar* aName) :
+nsXBLProtoImplMethod::nsXBLProtoImplMethod(const char16_t* aName) :
   nsXBLProtoImplMember(aName),
   mMethod()
 {
   MOZ_COUNT_CTOR(nsXBLProtoImplMethod);
 }
 
 nsXBLProtoImplMethod::~nsXBLProtoImplMethod()
 {
@@ -171,17 +171,17 @@ nsXBLProtoImplMethod::CompileMember(cons
          curr = curr->mNext) {
       args[argPos] = curr->mName;
       argPos++;
     }
   }
 
   // Get the body
   nsDependentString body;
-  PRUnichar *bodyText = uncompiledMethod->mBodyText.GetText();
+  char16_t *bodyText = uncompiledMethod->mBodyText.GetText();
   if (bodyText)
     body.Rebind(bodyText);
 
   // Now that we have a body and args, compile the function
   // and then define it.
   NS_ConvertUTF16toUTF8 cname(mName);
   nsAutoCString functionUri(aClassStr);
   int32_t hash = functionUri.RFindChar('#');
--- a/content/xbl/src/nsXBLProtoImplMethod.h
+++ b/content/xbl/src/nsXBLProtoImplMethod.h
@@ -76,17 +76,17 @@ struct nsXBLUncompiledMethod {
   void SetLineNumber(uint32_t aLineNumber) {
     mBodyText.SetLineNumber(aLineNumber);
   }
 };
 
 class nsXBLProtoImplMethod: public nsXBLProtoImplMember
 {
 public:
-  nsXBLProtoImplMethod(const PRUnichar* aName);
+  nsXBLProtoImplMethod(const char16_t* aName);
   virtual ~nsXBLProtoImplMethod();
 
   void AppendBodyText(const nsAString& aBody);
   void AddParameter(const nsAString& aName);
 
   void SetLineNumber(uint32_t aLineNumber);
   
   virtual nsresult InstallMember(JSContext* aCx,
@@ -130,17 +130,17 @@ protected:
     return mMethod.GetJSFunctionPreserveColor();
   }
 
   JS::Heap<nsXBLMaybeCompiled<nsXBLUncompiledMethod> > mMethod;
 };
 
 class nsXBLProtoImplAnonymousMethod : public nsXBLProtoImplMethod {
 public:
-  nsXBLProtoImplAnonymousMethod(const PRUnichar* aName) :
+  nsXBLProtoImplAnonymousMethod(const char16_t* aName) :
     nsXBLProtoImplMethod(aName)
   {}
   
   nsresult Execute(nsIContent* aBoundElement);
 
   // Override InstallMember; these methods never get installed as members on
   // binding instantiations (though they may hang out in mMembers on the
   // prototype implementation).
--- a/content/xbl/src/nsXBLProtoImplProperty.cpp
+++ b/content/xbl/src/nsXBLProtoImplProperty.cpp
@@ -13,20 +13,20 @@
 #include "nsReadableUtils.h"
 #include "nsJSUtils.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsXBLSerialize.h"
 #include "xpcpublic.h"
 
 using namespace mozilla;
 
-nsXBLProtoImplProperty::nsXBLProtoImplProperty(const PRUnichar* aName,
-                                               const PRUnichar* aGetter, 
-                                               const PRUnichar* aSetter,
-                                               const PRUnichar* aReadOnly,
+nsXBLProtoImplProperty::nsXBLProtoImplProperty(const char16_t* aName,
+                                               const char16_t* aGetter, 
+                                               const char16_t* aSetter,
+                                               const char16_t* aReadOnly,
                                                uint32_t aLineNumber) :
   nsXBLProtoImplMember(aName), 
   mJSAttributes(JSPROP_ENUMERATE)
 #ifdef DEBUG
   , mIsCompiled(false)
 #endif
 {
   MOZ_COUNT_CTOR(nsXBLProtoImplProperty);
@@ -42,17 +42,17 @@ nsXBLProtoImplProperty::nsXBLProtoImplPr
     SetGetterLineNumber(aLineNumber);
   }
   if (aSetter) {
     AppendSetterText(nsDependentString(aSetter));
     SetSetterLineNumber(aLineNumber);
   }
 }
 
-nsXBLProtoImplProperty::nsXBLProtoImplProperty(const PRUnichar* aName,
+nsXBLProtoImplProperty::nsXBLProtoImplProperty(const char16_t* aName,
                                                const bool aIsReadOnly)
   : nsXBLProtoImplMember(aName),
     mJSAttributes(JSPROP_ENUMERATE)
 #ifdef DEBUG
   , mIsCompiled(false)
 #endif
 {
   MOZ_COUNT_CTOR(nsXBLProtoImplProperty);
--- a/content/xbl/src/nsXBLProtoImplProperty.h
+++ b/content/xbl/src/nsXBLProtoImplProperty.h
@@ -12,23 +12,23 @@
 #include "nsString.h"
 #include "nsXBLSerialize.h"
 #include "nsXBLMaybeCompiled.h"
 #include "nsXBLProtoImplMember.h"
 
 class nsXBLProtoImplProperty: public nsXBLProtoImplMember
 {
 public:
-  nsXBLProtoImplProperty(const PRUnichar* aName,
-                         const PRUnichar* aGetter, 
-                         const PRUnichar* aSetter,
-                         const PRUnichar* aReadOnly,
+  nsXBLProtoImplProperty(const char16_t* aName,
+                         const char16_t* aGetter, 
+                         const char16_t* aSetter,
+                         const char16_t* aReadOnly,
                          uint32_t aLineNumber);
 
-  nsXBLProtoImplProperty(const PRUnichar* aName, const bool aIsReadOnly);
+  nsXBLProtoImplProperty(const char16_t* aName, const bool aIsReadOnly);
  
   virtual ~nsXBLProtoImplProperty();
 
   void AppendGetterText(const nsAString& aGetter);
   void AppendSetterText(const nsAString& aSetter);
 
   void SetGetterLineNumber(uint32_t aLineNumber);
   void SetSetterLineNumber(uint32_t aLineNumber);
--- a/content/xbl/src/nsXBLPrototypeBinding.cpp
+++ b/content/xbl/src/nsXBLPrototypeBinding.cpp
@@ -355,18 +355,18 @@ nsXBLPrototypeBinding::AttributeChanged(
         realElement->UnsetAttr(dstNs, dstAttr, aNotify);
       else {
         bool attrPresent = true;
         nsAutoString value;
         // Check to see if the src attribute is xbl:text.  If so, then we need to obtain the 
         // children of the real element and get the text nodes' values.
         if (aAttribute == nsGkAtoms::text && aNameSpaceID == kNameSpaceID_XBL) {
           nsContentUtils::GetNodeTextContent(aChangedElement, false, value);
-          value.StripChar(PRUnichar('\n'));
-          value.StripChar(PRUnichar('\r'));
+          value.StripChar(char16_t('\n'));
+          value.StripChar(char16_t('\r'));
           nsAutoString stripVal(value);
           stripVal.StripWhitespace();
           if (stripVal.IsEmpty()) 
             attrPresent = false;
         }    
         else {
           attrPresent = aChangedElement->GetAttr(aNameSpaceID, aAttribute, value);
         }
@@ -508,18 +508,18 @@ bool SetAttrs(nsHashKey* aKey, void* aDa
   nsIAtom* src = entry->GetSrcAttribute();
   int32_t srcNs = changeData->mSrcNamespace;
   nsAutoString value;
   bool attrPresent = true;
 
   if (src == nsGkAtoms::text && srcNs == kNameSpaceID_XBL) {
     nsContentUtils::GetNodeTextContent(changeData->mBoundElement, false,
                                        value);
-    value.StripChar(PRUnichar('\n'));
-    value.StripChar(PRUnichar('\r'));
+    value.StripChar(char16_t('\n'));
+    value.StripChar(char16_t('\r'));
     nsAutoString stripVal(value);
     stripVal.StripWhitespace();
 
     if (stripVal.IsEmpty()) 
       attrPresent = false;
   }
   else {
     attrPresent = changeData->mBoundElement->GetAttr(srcNs, src, value);
@@ -1680,17 +1680,17 @@ nsXBLPrototypeBinding::ResolveBaseBindin
     mBinding->LookupNamespaceURI(prefix, nameSpace);
     if (!nameSpace.IsEmpty()) {
       int32_t nameSpaceID =
         nsContentUtils::NameSpaceManager()->GetNameSpaceID(nameSpace);
 
       nsCOMPtr<nsIAtom> tagName = do_GetAtom(display);
       // Check the white list
       if (!CheckTagNameWhiteList(nameSpaceID, tagName)) {
-        const PRUnichar* params[] = { display.get() };
+        const char16_t* params[] = { display.get() };
         nsContentUtils::ReportToConsole(nsIScriptError::errorFlag,
                                         NS_LITERAL_CSTRING("XBL"), nullptr,
                                         nsContentUtils::eXBL_PROPERTIES,
                                        "InvalidExtendsBinding",
                                         params, ArrayLength(params),
                                         doc->GetDocumentURI());
         NS_ASSERTION(!nsXBLService::IsChromeOrResourceURI(doc->GetDocumentURI()),
                      "Invalid extends value");
--- a/content/xbl/src/nsXBLPrototypeHandler.cpp
+++ b/content/xbl/src/nsXBLPrototypeHandler.cpp
@@ -66,28 +66,28 @@ const int32_t nsXBLPrototypeHandler::cSh
 const int32_t nsXBLPrototypeHandler::cAltMask = (1<<6);
 const int32_t nsXBLPrototypeHandler::cControlMask = (1<<7);
 const int32_t nsXBLPrototypeHandler::cMetaMask = (1<<8);
 const int32_t nsXBLPrototypeHandler::cOSMask = (1<<9);
 
 const int32_t nsXBLPrototypeHandler::cAllModifiers =
   cShiftMask | cAltMask | cControlMask | cMetaMask | cOSMask;
 
-nsXBLPrototypeHandler::nsXBLPrototypeHandler(const PRUnichar* aEvent,
-                                             const PRUnichar* aPhase,
-                                             const PRUnichar* aAction,
-                                             const PRUnichar* aCommand,
-                                             const PRUnichar* aKeyCode,
-                                             const PRUnichar* aCharCode,
-                                             const PRUnichar* aModifiers,
-                                             const PRUnichar* aButton,
-                                             const PRUnichar* aClickCount,
-                                             const PRUnichar* aGroup,
-                                             const PRUnichar* aPreventDefault,
-                                             const PRUnichar* aAllowUntrusted,
+nsXBLPrototypeHandler::nsXBLPrototypeHandler(const char16_t* aEvent,
+                                             const char16_t* aPhase,
+                                             const char16_t* aAction,
+                                             const char16_t* aCommand,
+                                             const char16_t* aKeyCode,
+                                             const char16_t* aCharCode,
+                                             const char16_t* aModifiers,
+                                             const char16_t* aButton,
+                                             const char16_t* aClickCount,
+                                             const char16_t* aGroup,
+                                             const char16_t* aPreventDefault,
+                                             const char16_t* aAllowUntrusted,
                                              nsXBLPrototypeBinding* aBinding,
                                              uint32_t aLineNumber)
   : mHandlerText(nullptr),
     mLineNumber(aLineNumber),
     mNextHandler(nullptr),
     mPrototypeBinding(aBinding)
 {
   Init();
@@ -142,17 +142,17 @@ nsXBLPrototypeHandler::GetHandlerElement
   return nullptr;
 }
 
 void
 nsXBLPrototypeHandler::AppendHandlerText(const nsAString& aText) 
 {
   if (mHandlerText) {
     // Append our text to the existing text.
-    PRUnichar* temp = mHandlerText;
+    char16_t* temp = mHandlerText;
     mHandlerText = ToNewUnicode(nsDependentString(temp) + aText);
     nsMemory::Free(temp);
   }
   else {
     mHandlerText = ToNewUnicode(aText);
   }
 }
 
@@ -621,17 +621,17 @@ nsXBLPrototypeHandler::KeyEventMatched(n
     uint32_t code;
 
     if (mMisc) {
       if (aCharCode)
         code = aCharCode;
       else
         aKeyEvent->GetCharCode(&code);
       if (IS_IN_BMP(code))
-        code = ToLowerCase(PRUnichar(code));
+        code = ToLowerCase(char16_t(code));
     }
     else
       aKeyEvent->GetKeyCode(&code);
 
     if (code != uint32_t(mDetail))
       return false;
   }
 
@@ -723,28 +723,28 @@ nsXBLPrototypeHandler::GetEventType(nsAS
   
   if (aEvent.IsEmpty() && (mType & NS_HANDLER_TYPE_XUL))
     // If no type is specified for a XUL <key> element, let's assume that we're "keypress".
     aEvent.AssignLiteral("keypress");
 }
 
 void
 nsXBLPrototypeHandler::ConstructPrototype(nsIContent* aKeyElement, 
-                                          const PRUnichar* aEvent,
-                                          const PRUnichar* aPhase,
-                                          const PRUnichar* aAction,
-                                          const PRUnichar* aCommand,
-                                          const PRUnichar* aKeyCode,
-                                          const PRUnichar* aCharCode,
-                                          const PRUnichar* aModifiers,
-                                          const PRUnichar* aButton,
-                                          const PRUnichar* aClickCount,
-                                          const PRUnichar* aGroup,
-                                          const PRUnichar* aPreventDefault,
-                                          const PRUnichar* aAllowUntrusted)
+                                          const char16_t* aEvent,
+                                          const char16_t* aPhase,
+                                          const char16_t* aAction,
+                                          const char16_t* aCommand,
+                                          const char16_t* aKeyCode,
+                                          const char16_t* aCharCode,
+                                          const char16_t* aModifiers,
+                                          const char16_t* aButton,
+                                          const char16_t* aClickCount,
+                                          const char16_t* aGroup,
+                                          const char16_t* aPreventDefault,
+                                          const char16_t* aAllowUntrusted)
 {
   mType = 0;
 
   if (aKeyElement) {
     mType |= NS_HANDLER_TYPE_XUL;
     nsCOMPtr<nsIWeakReference> weak = do_GetWeakReference(aKeyElement);
     if (!weak) {
       return;
@@ -840,22 +840,22 @@ nsXBLPrototypeHandler::ConstructPrototyp
       mKeyMask = cAllModifiers;
     ToLowerCase(key);
 
     // We have a charcode.
     mMisc = 1;
     mDetail = key[0];
     const uint8_t GTK2Modifiers = cShift | cControl | cShiftMask | cControlMask;
     if ((mKeyMask & GTK2Modifiers) == GTK2Modifiers &&
-        modifiers.First() != PRUnichar(',') &&
+        modifiers.First() != char16_t(',') &&
         (mDetail == 'u' || mDetail == 'U'))
       ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "GTK2Conflict");
     const uint8_t WinModifiers = cControl | cAlt | cControlMask | cAltMask;
     if ((mKeyMask & WinModifiers) == WinModifiers &&
-        modifiers.First() != PRUnichar(',') &&
+        modifiers.First() != char16_t(',') &&
         (('A' <= mDetail && mDetail <= 'Z') ||
          ('a' <= mDetail && mDetail <= 'z')))
       ReportKeyConflict(key.get(), modifiers.get(), aKeyElement, "WinConflict");
   }
   else {
     key.Assign(aKeyCode);
     if (mType & NS_HANDLER_TYPE_XUL)
       aKeyElement->GetAttr(kNameSpaceID_None, nsGkAtoms::keycode, key);
@@ -880,29 +880,29 @@ nsXBLPrototypeHandler::ConstructPrototyp
       mType |= NS_HANDLER_ALLOW_UNTRUSTED;
     } else {
       mType &= ~NS_HANDLER_ALLOW_UNTRUSTED;
     }
   }
 }
 
 void
-nsXBLPrototypeHandler::ReportKeyConflict(const PRUnichar* aKey, const PRUnichar* aModifiers, nsIContent* aKeyElement, const char *aMessageName)
+nsXBLPrototypeHandler::ReportKeyConflict(const char16_t* aKey, const char16_t* aModifiers, nsIContent* aKeyElement, const char *aMessageName)
 {
   nsCOMPtr<nsIDocument> doc;
   if (mPrototypeBinding) {
     nsXBLDocumentInfo* docInfo = mPrototypeBinding->XBLDocumentInfo();
     if (docInfo) {
       doc = docInfo->GetDocument();
     }
   } else if (aKeyElement) {
     doc = aKeyElement->OwnerDoc();
   }
 
-  const PRUnichar* params[] = { aKey, aModifiers };
+  const char16_t* params[] = { aKey, aModifiers };
   nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                   NS_LITERAL_CSTRING("XBL Prototype Handler"), doc,
                                   nsContentUtils::eXBL_PROPERTIES,
                                   aMessageName,
                                   params, ArrayLength(params),
                                   nullptr, EmptyString(), mLineNumber);
 }
 
--- a/content/xbl/src/nsXBLPrototypeHandler.h
+++ b/content/xbl/src/nsXBLPrototypeHandler.h
@@ -44,23 +44,23 @@ class EventTarget;
 #define NS_PHASE_CAPTURING          1
 #define NS_PHASE_TARGET             2
 #define NS_PHASE_BUBBLING           3
 
 class nsXBLPrototypeHandler
 {
 public:
   // This constructor is used by XBL handlers (both the JS and command shorthand variety)
-  nsXBLPrototypeHandler(const PRUnichar* aEvent, const PRUnichar* aPhase,
-                        const PRUnichar* aAction, const PRUnichar* aCommand,
-                        const PRUnichar* aKeyCode, const PRUnichar* aCharCode,
-                        const PRUnichar* aModifiers, const PRUnichar* aButton,
-                        const PRUnichar* aClickCount, const PRUnichar* aGroup,
-                        const PRUnichar* aPreventDefault,
-                        const PRUnichar* aAllowUntrusted,
+  nsXBLPrototypeHandler(const char16_t* aEvent, const char16_t* aPhase,
+                        const char16_t* aAction, const char16_t* aCommand,
+                        const char16_t* aKeyCode, const char16_t* aCharCode,
+                        const char16_t* aModifiers, const char16_t* aButton,
+                        const char16_t* aClickCount, const char16_t* aGroup,
+                        const char16_t* aPreventDefault,
+                        const char16_t* aAllowUntrusted,
                         nsXBLPrototypeBinding* aBinding,
                         uint32_t aLineNumber);
 
   // This constructor is used only by XUL key handlers (e.g., <key>)
   nsXBLPrototypeHandler(nsIContent* aKeyElement);
 
   // This constructor is used for handlers loaded from the cache
   nsXBLPrototypeHandler(nsXBLPrototypeBinding* aBinding);
@@ -147,25 +147,25 @@ protected:
       // Get the primary accelerator key.
       InitAccessKeys();
   }
 
   already_AddRefed<nsIController> GetController(mozilla::dom::EventTarget* aTarget);
 
   inline int32_t GetMatchingKeyCode(const nsAString& aKeyName);
   void ConstructPrototype(nsIContent* aKeyElement,
-                          const PRUnichar* aEvent=nullptr, const PRUnichar* aPhase=nullptr,
-                          const PRUnichar* aAction=nullptr, const PRUnichar* aCommand=nullptr,
-                          const PRUnichar* aKeyCode=nullptr, const PRUnichar* aCharCode=nullptr,
-                          const PRUnichar* aModifiers=nullptr, const PRUnichar* aButton=nullptr,
-                          const PRUnichar* aClickCount=nullptr, const PRUnichar* aGroup=nullptr,
-                          const PRUnichar* aPreventDefault=nullptr,
-                          const PRUnichar* aAllowUntrusted=nullptr);
+                          const char16_t* aEvent=nullptr, const char16_t* aPhase=nullptr,
+                          const char16_t* aAction=nullptr, const char16_t* aCommand=nullptr,
+                          const char16_t* aKeyCode=nullptr, const char16_t* aCharCode=nullptr,
+                          const char16_t* aModifiers=nullptr, const char16_t* aButton=nullptr,
+                          const char16_t* aClickCount=nullptr, const char16_t* aGroup=nullptr,
+                          const char16_t* aPreventDefault=nullptr,
+                          const char16_t* aAllowUntrusted=nullptr);
 
-  void ReportKeyConflict(const PRUnichar* aKey, const PRUnichar* aModifiers, nsIContent* aElement, const char *aMessageName);
+  void ReportKeyConflict(const char16_t* aKey, const char16_t* aModifiers, nsIContent* aElement, const char *aMessageName);
   void GetEventType(nsAString& type);
   bool ModifiersMatchMask(nsIDOMUIEvent* aEvent,
                             bool aIgnoreShiftKey = false);
   nsresult DispatchXBLCommand(mozilla::dom::EventTarget* aTarget, nsIDOMEvent* aEvent);
   nsresult DispatchXULKeyCommand(nsIDOMEvent* aEvent);
   nsresult EnsureEventHandler(nsIScriptGlobalObject* aGlobal,
                               nsIScriptContext *aBoundContext, nsIAtom *aName,
                               JS::MutableHandle<JSObject*> aHandler);
@@ -187,17 +187,17 @@ protected:
   static const int32_t cMetaMask;
   static const int32_t cOSMask;
 
   static const int32_t cAllModifiers;
 
 protected:
   union {
     nsIWeakReference* mHandlerElement;  // For XUL <key> element handlers. [STRONG]
-    PRUnichar*        mHandlerText;     // For XBL handlers (we don't build an
+    char16_t*        mHandlerText;     // For XBL handlers (we don't build an
                                         // element for the <handler>, and instead
                                         // we cache the JS text or command name
                                         // that we should use.
   };
 
   uint32_t mLineNumber;  // The line number we started at in the XBL file
   
   // The following four values make up 32 bits.
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -84,17 +84,17 @@ IsAncestorBinding(nsIDocument* aDocument
     if (binding->PrototypeBinding()->CompareBindingURI(aChildBindingURI)) {
       ++bindingRecursion;
       if (bindingRecursion < NS_MAX_XBL_BINDING_RECURSION) {
         continue;
       }
       nsAutoCString spec;
       aChildBindingURI->GetSpec(spec);
       NS_ConvertUTF8toUTF16 bindingURI(spec);
-      const PRUnichar* params[] = { bindingURI.get() };
+      const char16_t* params[] = { bindingURI.get() };
       nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                       NS_LITERAL_CSTRING("XBL"), aDocument,
                                       nsContentUtils::eXBL_PROPERTIES,
                                       "TooDeepBindingRecursion",
                                       params, ArrayLength(params));
       return true;
     }
   }
@@ -630,17 +630,17 @@ nsXBLService::DetachGlobalKeyHandler(Eve
                                      dom::TrustedEventsAtSystemGroupBubble());
 
   contentNode->DeleteProperty(nsGkAtoms::listener);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXBLService::Observe(nsISupports* aSubject, const char* aTopic, const PRUnichar* aSomeData)
+nsXBLService::Observe(nsISupports* aSubject, const char* aTopic, const char16_t* aSomeData)
 {
   if (nsCRT::strcmp(aTopic, "memory-pressure") == 0)
     FlushMemory();
 
   return NS_OK;
 }
 
 nsresult
@@ -757,17 +757,17 @@ nsXBLService::GetBinding(nsIContent* aBo
         rv = aDontExtendURIs[index]->Equals(baseBindingURI, &equal);
         NS_ENSURE_SUCCESS(rv, rv);
         if (equal) {
           nsAutoCString spec, basespec;
           protoBinding->BindingURI()->GetSpec(spec);
           NS_ConvertUTF8toUTF16 protoSpec(spec);
           baseBindingURI->GetSpec(basespec);
           NS_ConvertUTF8toUTF16 baseSpecUTF16(basespec);
-          const PRUnichar* params[] = { protoSpec.get(), baseSpecUTF16.get() };
+          const char16_t* params[] = { protoSpec.get(), baseSpecUTF16.get() };
           nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
                                           NS_LITERAL_CSTRING("XBL"), nullptr,
                                           nsContentUtils::eXBL_PROPERTIES,
                                           "CircularExtendsBinding",
                                           params, ArrayLength(params),
                                           boundDocument->GetDocumentURI());
           return NS_ERROR_ILLEGAL_VALUE;
         }
--- a/content/xbl/src/nsXBLWindowKeyHandler.cpp
+++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp
@@ -68,17 +68,17 @@ public:
 const char nsXBLSpecialDocInfo::sHTMLBindingStr[] =
   "chrome://global/content/platformHTMLBindings.xml";
 
 NS_IMPL_ISUPPORTS1(nsXBLSpecialDocInfo, nsIObserver)
 
 NS_IMETHODIMP
 nsXBLSpecialDocInfo::Observe(nsISupports* aSubject,
                              const char* aTopic,
-                             const PRUnichar* aData)
+                             const char16_t* aData)
 {
   MOZ_ASSERT(!strcmp(aTopic, "xpcom-shutdown"), "wrong topic");
 
   // On shutdown, clear our fields to avoid an extra cycle collection.
   mHTMLBindings = nullptr;
   mUserHTMLBindings = nullptr;
   mInitialized = false;
   nsContentUtils::UnregisterShutdownObserver(this);
--- a/content/xml/document/src/nsXMLContentSink.cpp
+++ b/content/xml/document/src/nsXMLContentSink.cpp
@@ -446,17 +446,17 @@ NS_IMETHODIMP
 nsXMLContentSink::SetParser(nsParserBase* aParser)
 {
   NS_PRECONDITION(aParser, "Should have a parser here!");
   mParser = aParser;
   return NS_OK;
 }
 
 nsresult
-nsXMLContentSink::CreateElement(const PRUnichar** aAtts, uint32_t aAttsCount,
+nsXMLContentSink::CreateElement(const char16_t** aAtts, uint32_t aAttsCount,
                                 nsINodeInfo* aNodeInfo, uint32_t aLineNumber,
                                 nsIContent** aResult, bool* aAppendContent,
                                 FromParser aFromParser)
 {
   NS_ASSERTION(aNodeInfo, "can't create element without nodeinfo");
 
   *aResult = nullptr;
   *aAppendContent = true;
@@ -929,29 +929,29 @@ nsXMLContentSink::SetDocElement(int32_t 
       aNameSpaceID == kNameSpaceID_XHTML) {
     ProcessOfflineManifest(aContent);
   }
 
   return true;
 }
 
 NS_IMETHODIMP
-nsXMLContentSink::HandleStartElement(const PRUnichar *aName,
-                                     const PRUnichar **aAtts,
+nsXMLContentSink::HandleStartElement(const char16_t *aName,
+                                     const char16_t **aAtts,
                                      uint32_t aAttsCount,
                                      int32_t aIndex,
                                      uint32_t aLineNumber)
 {
   return HandleStartElement(aName, aAtts, aAttsCount, aIndex, aLineNumber,
                             true);
 }
 
 nsresult
-nsXMLContentSink::HandleStartElement(const PRUnichar *aName,
-                                     const PRUnichar **aAtts,
+nsXMLContentSink::HandleStartElement(const char16_t *aName,
+                                     const char16_t **aAtts,
                                      uint32_t aAttsCount,
                                      int32_t aIndex,
                                      uint32_t aLineNumber,
                                      bool aInterruptable)
 {
   NS_PRECONDITION(aIndex >= -1, "Bogus aIndex");
   NS_PRECONDITION(aAttsCount % 2 == 0, "incorrect aAttsCount");
   // Adjust aAttsCount so it's the actual number of attributes
@@ -1049,23 +1049,23 @@ nsXMLContentSink::HandleStartElement(con
     NotifyDocElementCreated(mDocument);
   }
 
   return aInterruptable && NS_SUCCEEDED(result) ? DidProcessATokenImpl() :
                                                   result;
 }
 
 NS_IMETHODIMP
-nsXMLContentSink::HandleEndElement(const PRUnichar *aName)
+nsXMLContentSink::HandleEndElement(const char16_t *aName)
 {
   return HandleEndElement(aName, true);
 }
 
 nsresult
-nsXMLContentSink::HandleEndElement(const PRUnichar *aName,
+nsXMLContentSink::HandleEndElement(const char16_t *aName,
                                    bool aInterruptable)
 {
   nsresult result = NS_OK;
 
   // XXX Hopefully the parser will flag this before we get
   // here. If we're in the prolog or epilog, there should be
   // no close tags for elements.
   PR_ASSERT(eXMLContentSinkState_InDocumentElement == mState);
@@ -1126,30 +1126,30 @@ nsXMLContentSink::HandleEndElement(const
     }
   }
 
   return aInterruptable && NS_SUCCEEDED(result) ? DidProcessATokenImpl() :
                                                   result;
 }
 
 NS_IMETHODIMP 
-nsXMLContentSink::HandleComment(const PRUnichar *aName)
+nsXMLContentSink::HandleComment(const char16_t *aName)
 {
   FlushText();
 
   nsRefPtr<Comment> comment = new Comment(mNodeInfoManager);
   comment->SetText(nsDependentString(aName), false);
   nsresult rv = AddContentAsLeaf(comment);
   DidAddContent();
 
   return NS_SUCCEEDED(rv) ? DidProcessATokenImpl() : rv;
 }
 
 NS_IMETHODIMP 
-nsXMLContentSink::HandleCDataSection(const PRUnichar *aData, 
+nsXMLContentSink::HandleCDataSection(const char16_t *aData, 
                                      uint32_t aLength)
 {
   // XSLT doesn't differentiate between text and cdata and wants adjacent
   // textnodes merged, so add as text.
   if (mXSLTProcessor) {
     return AddText(aData, aLength);
   }
 
@@ -1212,37 +1212,37 @@ nsXMLContentSink::HandleDoctypeDecl(cons
   NS_ASSERTION(content, "doctype isn't content?");
 
   rv = mDocument->AppendChildTo(content, false);
   DidAddContent();
   return NS_SUCCEEDED(rv) ? DidProcessATokenImpl() : rv;
 }
 
 NS_IMETHODIMP
-nsXMLContentSink::HandleCharacterData(const PRUnichar *aData, 
+nsXMLContentSink::HandleCharacterData(const char16_t *aData, 
                                       uint32_t aLength)
 {
   return HandleCharacterData(aData, aLength, true);
 }
 
 nsresult
-nsXMLContentSink::HandleCharacterData(const PRUnichar *aData, uint32_t aLength,
+nsXMLContentSink::HandleCharacterData(const char16_t *aData, uint32_t aLength,
                                       bool aInterruptable)
 {
   nsresult rv = NS_OK;
   if (aData && mState != eXMLContentSinkState_InProlog &&
       mState != eXMLContentSinkState_InEpilog) {
     rv = AddText(aData, aLength);
   }
   return aInterruptable && NS_SUCCEEDED(rv) ? DidProcessATokenImpl() : rv;
 }
 
 NS_IMETHODIMP
-nsXMLContentSink::HandleProcessingInstruction(const PRUnichar *aTarget, 
-                                              const PRUnichar *aData)
+nsXMLContentSink::HandleProcessingInstruction(const char16_t *aTarget, 
+                                              const char16_t *aData)
 {
   FlushText();
 
   const nsDependentString target(aTarget);
   const nsDependentString data(aData);
 
   nsCOMPtr<nsIContent> node =
     NS_NewXMLProcessingInstruction(mNodeInfoManager, target, data);
@@ -1324,28 +1324,28 @@ nsXMLContentSink::ParsePIData(const nsSt
                                           alternate);
 
   aIsAlternate = alternate.EqualsLiteral("yes");
 
   return true;
 }
 
 NS_IMETHODIMP
-nsXMLContentSink::HandleXMLDeclaration(const PRUnichar *aVersion,
-                                       const PRUnichar *aEncoding,
+nsXMLContentSink::HandleXMLDeclaration(const char16_t *aVersion,
+                                       const char16_t *aEncoding,
                                        int32_t aStandalone)
 {
   mDocument->SetXMLDeclaration(aVersion, aEncoding, aStandalone);
 
   return DidProcessATokenImpl();
 }
 
 NS_IMETHODIMP
-nsXMLContentSink::ReportError(const PRUnichar* aErrorText, 
-                              const PRUnichar* aSourceText,
+nsXMLContentSink::ReportError(const char16_t* aErrorText, 
+                              const char16_t* aSourceText,
                               nsIScriptError *aError,
                               bool *_retval)
 {
   NS_PRECONDITION(aError && aSourceText && aErrorText, "Check arguments!!!");
   nsresult rv = NS_OK;
 
   // The expat driver should report the error.  We're just cleaning up the mess.
   *_retval = true;
@@ -1388,34 +1388,34 @@ nsXMLContentSink::ReportError(const PRUn
   // release the nodes on stack
   mContentStack.Clear();
   mNotifyLevel = 0;
 
   rv = HandleProcessingInstruction(MOZ_UTF16("xml-stylesheet"),
                                    MOZ_UTF16("href=\"chrome://global/locale/intl.css\" type=\"text/css\""));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  const PRUnichar* noAtts[] = { 0, 0 };
+  const char16_t* noAtts[] = { 0, 0 };
 
   NS_NAMED_LITERAL_STRING(errorNs,
                           "http://www.mozilla.org/newlayout/xml/parsererror.xml");
 
   nsAutoString parsererror(errorNs);
-  parsererror.Append((PRUnichar)0xFFFF);
+  parsererror.Append((char16_t)0xFFFF);
   parsererror.AppendLiteral("parsererror");
   
   rv = HandleStartElement(parsererror.get(), noAtts, 0, -1, (uint32_t)-1,
                           false);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = HandleCharacterData(aErrorText, NS_strlen(aErrorText), false);
   NS_ENSURE_SUCCESS(rv, rv);  
   
   nsAutoString sourcetext(errorNs);
-  sourcetext.Append((PRUnichar)0xFFFF);
+  sourcetext.Append((char16_t)0xFFFF);
   sourcetext.AppendLiteral("sourcetext");
 
   rv = HandleStartElement(sourcetext.get(), noAtts, 0, -1, (uint32_t)-1,
                           false);
   NS_ENSURE_SUCCESS(rv, rv);
   
   rv = HandleCharacterData(aSourceText, NS_strlen(aSourceText), false);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1427,17 +1427,17 @@ nsXMLContentSink::ReportError(const PRUn
   NS_ENSURE_SUCCESS(rv, rv);
 
   FlushTags();
 
   return NS_OK;
 }
 
 nsresult
-nsXMLContentSink::AddAttributes(const PRUnichar** aAtts,
+nsXMLContentSink::AddAttributes(const char16_t** aAtts,
                                 nsIContent* aContent)
 {
   // Add tag attributes to the content attributes
   nsCOMPtr<nsIAtom> prefix, localName;
   while (*aAtts) {
     int32_t nameSpaceID;
     nsContentUtils::SplitExpatName(aAtts[0], getter_AddRefs(prefix),
                                    getter_AddRefs(localName), &nameSpaceID);
@@ -1449,22 +1449,22 @@ nsXMLContentSink::AddAttributes(const PR
   }
 
   return NS_OK;
 }
 
 #define NS_ACCUMULATION_BUFFER_SIZE 4096
 
 nsresult
-nsXMLContentSink::AddText(const PRUnichar* aText, 
+nsXMLContentSink::AddText(const char16_t* aText, 
                           int32_t aLength)
 {
   // Create buffer when we first need it
   if (0 == mTextSize) {
-    mText = (PRUnichar *) PR_MALLOC(sizeof(PRUnichar) * NS_ACCUMULATION_BUFFER_SIZE);
+    mText = (char16_t *) PR_MALLOC(sizeof(char16_t) * NS_ACCUMULATION_BUFFER_SIZE);
     if (nullptr == mText) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
     mTextSize = NS_ACCUMULATION_BUFFER_SIZE;
   }
 
   // Copy data from string into our buffer; flush buffer when it fills up
   int32_t offset = 0;
@@ -1477,30 +1477,30 @@ nsXMLContentSink::AddText(const PRUnicha
         if (NS_OK != rv) {
           return rv;
         }
 
         amount = mTextSize - mTextLength;
       }
       else {
         mTextSize += aLength;
-        mText = (PRUnichar *) PR_REALLOC(mText, sizeof(PRUnichar) * mTextSize);
+        mText = (char16_t *) PR_REALLOC(mText, sizeof(char16_t) * mTextSize);
         if (nullptr == mText) {
           mTextSize = 0;
 
           return NS_ERROR_OUT_OF_MEMORY;
         }
 
         amount = aLength;
       }
     }
     if (amount > aLength) {
       amount = aLength;
     }
-    memcpy(&mText[mTextLength], &aText[offset], sizeof(PRUnichar) * amount);
+    memcpy(&mText[mTextLength], &aText[offset], sizeof(char16_t) * amount);
     mTextLength += amount;
     offset += amount;
     aLength -= amount;
   }
 
   return NS_OK;
 }
 
--- a/content/xml/document/src/nsXMLContentSink.h
+++ b/content/xml/document/src/nsXMLContentSink.h
@@ -90,32 +90,32 @@ protected:
 
   void ContinueInterruptedParsingIfEnabled();
 
   // Start layout.  If aIgnorePendingSheets is true, this will happen even if
   // we still have stylesheet loads pending.  Otherwise, we'll wait until the
   // stylesheets are all done loading.
   virtual void MaybeStartLayout(bool aIgnorePendingSheets);
 
-  virtual nsresult AddAttributes(const PRUnichar** aNode, nsIContent* aContent);
-  nsresult AddText(const PRUnichar* aString, int32_t aLength);
+  virtual nsresult AddAttributes(const char16_t** aNode, nsIContent* aContent);
+  nsresult AddText(const char16_t* aString, int32_t aLength);
 
-  virtual bool OnOpenContainer(const PRUnichar **aAtts, 
+  virtual bool OnOpenContainer(const char16_t **aAtts, 
                                  uint32_t aAttsCount, 
                                  int32_t aNameSpaceID, 
                                  nsIAtom* aTagName,
                                  uint32_t aLineNumber) { return true; }
   // Set the given content as the root element for the created document
   //  don't set if root element was already set.
   //  return TRUE if this call set the root element
   virtual bool SetDocElement(int32_t aNameSpaceID, 
                                nsIAtom *aTagName,
                                nsIContent *aContent);
   virtual bool NotifyForDocElement() { return true; }
-  virtual nsresult CreateElement(const PRUnichar** aAtts, uint32_t aAttsCount,
+  virtual nsresult CreateElement(const char16_t** aAtts, uint32_t aAttsCount,
                                  nsINodeInfo* aNodeInfo, uint32_t aLineNumber,
                                  nsIContent** aResult, bool* aAppendContent,
                                  mozilla::dom::FromParser aFromParser);
 
   // aParent is allowed to be null here if this is the root content
   // being closed
   virtual nsresult CloseElement(nsIContent* aContent);
 
@@ -151,27 +151,27 @@ protected:
   nsresult LoadXSLStyleSheet(nsIURI* aUrl);
 
   bool CanStillPrettyPrint();
 
   nsresult MaybePrettyPrint();
   
   bool IsMonolithicContainer(nsINodeInfo* aNodeInfo);
 
-  nsresult HandleStartElement(const PRUnichar *aName, const PRUnichar **aAtts, 
+  nsresult HandleStartElement(const char16_t *aName, const char16_t **aAtts, 
                               uint32_t aAttsCount, int32_t aIndex, 
                               uint32_t aLineNumber,
                               bool aInterruptable);
-  nsresult HandleEndElement(const PRUnichar *aName, bool aInterruptable);
-  nsresult HandleCharacterData(const PRUnichar *aData, uint32_t aLength,
+  nsresult HandleEndElement(const char16_t *aName, bool aInterruptable);
+  nsresult HandleCharacterData(const char16_t *aData, uint32_t aLength,
                                bool aInterruptable);
 
   nsCOMPtr<nsIContent> mDocElement;
   nsCOMPtr<nsIContent> mCurrentHead;  // When set, we're in an XHTML <haed>
-  PRUnichar*       mText;
+  char16_t*       mText;
 
   XMLContentSinkState mState;
 
   int32_t mTextLength;
   int32_t mTextSize;
   
   int32_t mNotifyLevel;
   nsCOMPtr<nsIContent> mLastTextNode;
--- a/content/xml/document/src/nsXMLFragmentContentSink.cpp
+++ b/content/xml/document/src/nsXMLFragmentContentSink.cpp
@@ -46,23 +46,23 @@ public:
                                                      nsXMLContentSink)
 
   // nsIExpatSink
   NS_IMETHOD HandleDoctypeDecl(const nsAString & aSubset, 
                                const nsAString & aName, 
                                const nsAString & aSystemId, 
                                const nsAString & aPublicId,
                                nsISupports* aCatalogData);
-  NS_IMETHOD HandleProcessingInstruction(const PRUnichar *aTarget, 
-                                         const PRUnichar *aData);
-  NS_IMETHOD HandleXMLDeclaration(const PRUnichar *aVersion,
-                                  const PRUnichar *aEncoding,
+  NS_IMETHOD HandleProcessingInstruction(const char16_t *aTarget, 
+                                         const char16_t *aData);
+  NS_IMETHOD HandleXMLDeclaration(const char16_t *aVersion,
+                                  const char16_t *aEncoding,
                                   int32_t aStandalone);
-  NS_IMETHOD ReportError(const PRUnichar* aErrorText, 
-                         const PRUnichar* aSourceText,
+  NS_IMETHOD ReportError(const char16_t* aErrorText, 
+                         const char16_t* aSourceText,
                          nsIScriptError *aError,
                          bool *_retval);
 
   // nsIContentSink
   NS_IMETHOD WillBuildModel(nsDTDMode aDTDMode);
   NS_IMETHOD DidBuildModel(bool aTerminated);
   NS_IMETHOD SetDocumentCharset(nsACString& aCharset);
   virtual nsISupports *GetTarget();
@@ -77,17 +77,17 @@ public:
   NS_IMETHOD DidBuildContent();
   NS_IMETHOD IgnoreFirstContainer();
   NS_IMETHOD SetPreventScriptExecution(bool aPreventScriptExecution);
 
 protected:
   virtual bool SetDocElement(int32_t aNameSpaceID, 
                                nsIAtom *aTagName,
                                nsIContent *aContent);
-  virtual nsresult CreateElement(const PRUnichar** aAtts, uint32_t aAttsCount,
+  virtual nsresult CreateElement(const char16_t** aAtts, uint32_t aAttsCount,
                                  nsINodeInfo* aNodeInfo, uint32_t aLineNumber,
                                  nsIContent** aResult, bool* aAppendContent,
                                  mozilla::dom::FromParser aFromParser);
   virtual nsresult CloseElement(nsIContent* aContent);
 
   virtual void MaybeStartLayout(bool aIgnorePendingSheets);
 
   // nsContentSink overrides
@@ -195,17 +195,17 @@ nsXMLFragmentContentSink::SetDocElement(
                                         nsIAtom* aTagName,
                                         nsIContent *aContent)
 {
   // this is a fragment, not a document
   return false;
 }
 
 nsresult
-nsXMLFragmentContentSink::CreateElement(const PRUnichar** aAtts, uint32_t aAttsCount,
+nsXMLFragmentContentSink::CreateElement(const char16_t** aAtts, uint32_t aAttsCount,
                                         nsINodeInfo* aNodeInfo, uint32_t aLineNumber,
                                         nsIContent** aResult, bool* aAppendContent,
                                         FromParser /*aFromParser*/)
 {
   // Claim to not be coming from parser, since we don't do any of the
   // fancy CloseElement stuff.
   nsresult rv = nsXMLContentSink::CreateElement(aAtts, aAttsCount,
                                                 aNodeInfo, aLineNumber,
@@ -251,43 +251,43 @@ nsXMLFragmentContentSink::HandleDoctypeD
                                             nsISupports* aCatalogData)
 {
   NS_NOTREACHED("fragments shouldn't have doctype declarations");
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXMLFragmentContentSink::HandleProcessingInstruction(const PRUnichar *aTarget, 
-                                                      const PRUnichar *aData)
+nsXMLFragmentContentSink::HandleProcessingInstruction(const char16_t *aTarget, 
+                                                      const char16_t *aData)
 {
   FlushText();
 
   const nsDependentString target(aTarget);
   const nsDependentString data(aData);
 
   nsRefPtr<ProcessingInstruction> node =
     NS_NewXMLProcessingInstruction(mNodeInfoManager, target, data);
 
   // no special processing here.  that should happen when the fragment moves into the document
   return AddContentAsLeaf(node);
 }
 
 NS_IMETHODIMP
-nsXMLFragmentContentSink::HandleXMLDeclaration(const PRUnichar *aVersion,
-                                               const PRUnichar *aEncoding,
+nsXMLFragmentContentSink::HandleXMLDeclaration(const char16_t *aVersion,
+                                               const char16_t *aEncoding,
                                                int32_t aStandalone)
 {
   NS_NOTREACHED("fragments shouldn't have XML declarations");
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXMLFragmentContentSink::ReportError(const PRUnichar* aErrorText, 
-                                      const PRUnichar* aSourceText,
+nsXMLFragmentContentSink::ReportError(const char16_t* aErrorText, 
+                                      const char16_t* aSourceText,
                                       nsIScriptError *aError,
                                       bool *_retval)
 {
   NS_PRECONDITION(aError && aSourceText && aErrorText, "Check arguments!!!");
 
   // The expat driver should report the error.
   *_retval = true;
 
--- a/content/xslt/src/base/txDouble.cpp
+++ b/content/xslt/src/base/txDouble.cpp
@@ -22,28 +22,28 @@
 
 /*
  * Converts the given String to a double, if the String value does not
  * represent a double, NaN will be returned
  */
 class txStringToDouble
 {
 public:
-    typedef PRUnichar input_type;
-    typedef PRUnichar value_type;
+    typedef char16_t input_type;
+    typedef char16_t value_type;
     txStringToDouble(): mState(eWhitestart), mSign(ePositive) {}
 
     void
     write(const input_type* aSource, uint32_t aSourceLength)
     {
         if (mState == eIllegal) {
             return;
         }
         uint32_t i = 0;
-        PRUnichar c;
+        char16_t c;
         for ( ; i < aSourceLength; ++i) {
             c = aSource[i];
             switch (mState) {
                 case eWhitestart:
                     if (c == '-') {
                         mState = eDecimal;
                         mSign = eNegative;
                     }
@@ -143,17 +143,17 @@ void txDouble::toString(double aValue, n
     // check for special cases
 
     if (mozilla::IsNaN(aValue)) {
         aDest.AppendLiteral("NaN");
         return;
     }
     if (mozilla::IsInfinite(aValue)) {
         if (aValue < 0)
-            aDest.Append(PRUnichar('-'));
+            aDest.Append(char16_t('-'));
         aDest.AppendLiteral("Infinity");
         return;
     }
 
     // Mantissa length is 17, so this is plenty
     const int buflen = 20;
     char buf[buflen];
 
--- a/content/xslt/src/xml/txXMLUtils.cpp
+++ b/content/xslt/src/xml/txXMLUtils.cpp
@@ -16,30 +16,30 @@
 #include "txXPathTreeWalker.h"
 #include "nsContentUtils.h"
 
 nsresult
 txExpandedName::init(const nsAString& aQName, txNamespaceMap* aResolver,
                      bool aUseDefault)
 {
     const nsAFlatString& qName = PromiseFlatString(aQName);
-    const PRUnichar* colon;
+    const char16_t* colon;
     bool valid = XMLUtils::isValidQName(qName, &colon);
     if (!valid) {
         return NS_ERROR_FAILURE;
     }
 
     if (colon) {
         nsCOMPtr<nsIAtom> prefix = do_GetAtom(Substring(qName.get(), colon));
         int32_t namespaceID = aResolver->lookupNamespace(prefix);
         if (namespaceID == kNameSpaceID_Unknown)
             return NS_ERROR_FAILURE;
         mNamespaceID = namespaceID;
 
-        const PRUnichar *end;
+        const char16_t *end;
         qName.EndReading(end);
         mLocalName = do_GetAtom(Substring(colon + 1, end));
     }
     else {
         mNamespaceID = aUseDefault ? aResolver->lookupNamespace(nullptr) :
                                      kNameSpaceID_None;
         mLocalName = do_GetAtom(aQName);
     }
@@ -47,52 +47,52 @@ txExpandedName::init(const nsAString& aQ
 }
 
   //------------------------------/
  //- Implementation of XMLUtils -/
 //------------------------------/
 
 // static
 nsresult
-XMLUtils::splitExpatName(const PRUnichar *aExpatName, nsIAtom **aPrefix,
+XMLUtils::splitExpatName(const char16_t *aExpatName, nsIAtom **aPrefix,
                          nsIAtom **aLocalName, int32_t* aNameSpaceID)
 {
     /**
      *  Expat can send the following:
      *    localName
      *    namespaceURI<separator>localName
      *    namespaceURI<separator>localName<separator>prefix
      */
 
-    const PRUnichar *uriEnd = nullptr;
-    const PRUnichar *nameEnd = nullptr;
-    const PRUnichar *pos;
+    const char16_t *uriEnd = nullptr;
+    const char16_t *nameEnd = nullptr;
+    const char16_t *pos;
     for (pos = aExpatName; *pos; ++pos) {
         if (*pos == kExpatSeparatorChar) {
             if (uriEnd) {
                 nameEnd = pos;
             }
             else {
                 uriEnd = pos;
             }
         }
     }
 
-    const PRUnichar *nameStart;
+    const char16_t *nameStart;
     if (uriEnd) {
         *aNameSpaceID =
             txNamespaceManager::getNamespaceID(nsDependentSubstring(aExpatName,
                                                                     uriEnd));
         if (*aNameSpaceID == kNameSpaceID_Unknown) {
             return NS_ERROR_FAILURE;
         }
 
         nameStart = (uriEnd + 1);
         if (nameEnd)  {
-            const PRUnichar *prefixStart = nameEnd + 1;
+            const char16_t *prefixStart = nameEnd + 1;
             *aPrefix = NS_NewAtom(Substring(prefixStart, pos)).get();
             if (!*aPrefix) {
                 return NS_ERROR_OUT_OF_MEMORY;
             }
         }
         else {
             nameEnd = pos;
             *aPrefix = nullptr;
@@ -110,24 +110,24 @@ XMLUtils::splitExpatName(const PRUnichar
     return *aLocalName ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 nsresult
 XMLUtils::splitQName(const nsAString& aName, nsIAtom** aPrefix,
                      nsIAtom** aLocalName)
 {
     const nsAFlatString& qName = PromiseFlatString(aName);
-    const PRUnichar* colon;
+    const char16_t* colon;
     bool valid = XMLUtils::isValidQName(qName, &colon);
     if (!valid) {
         return NS_ERROR_FAILURE;
     }
 
     if (colon) {
-        const PRUnichar *end;
+        const char16_t *end;
         qName.EndReading(end);
 
         *aPrefix = NS_NewAtom(Substring(qName.get(), colon)).get();
         *aLocalName = NS_NewAtom(Substring(colon + 1, end)).get();
     }
     else {
         *aPrefix = nullptr;
         *aLocalName = NS_NewAtom(aName).get();
@@ -155,43 +155,43 @@ bool XMLUtils::isWhitespace(const nsAFla
 /**
  * Normalizes the value of a XML processing instruction
 **/
 void XMLUtils::normalizePIValue(nsAString& piValue)
 {
     nsAutoString origValue(piValue);
     uint32_t origLength = origValue.Length();
     uint32_t conversionLoop = 0;
-    PRUnichar prevCh = 0;
+    char16_t prevCh = 0;
     piValue.Truncate();
 
     while (conversionLoop < origLength) {
-        PRUnichar ch = origValue.CharAt(conversionLoop);
+        char16_t ch = origValue.CharAt(conversionLoop);
         switch (ch) {
             case '>':
             {
                 if (prevCh == '?') {
-                    piValue.Append(PRUnichar(' '));
+                    piValue.Append(char16_t(' '));
                 }
                 break;
             }
             default:
             {
                 break;
             }
         }
         piValue.Append(ch);
         prevCh = ch;
         ++conversionLoop;
     }
 }
 
 //static
 bool XMLUtils::isValidQName(const nsAFlatString& aQName,
-                            const PRUnichar** aColon)
+                            const char16_t** aColon)
 {
   return NS_SUCCEEDED(nsContentUtils::CheckQName(aQName, true, aColon));
 }
 
 //static
 bool XMLUtils::getXMLSpacePreserve(const txXPathNode& aNode)
 {
     nsAutoString value;
--- a/content/xslt/src/xml/txXMLUtils.h
+++ b/content/xslt/src/xml/txXMLUtils.h
@@ -77,26 +77,26 @@ public:
 
     int32_t mNamespaceID;
     nsCOMPtr<nsIAtom> mLocalName;
 };
 
 class XMLUtils {
 
 public:
-    static nsresult splitExpatName(const PRUnichar *aExpatName,
+    static nsresult splitExpatName(const char16_t *aExpatName,
                                    nsIAtom **aPrefix, nsIAtom **aLocalName,
                                    int32_t* aNameSpaceID);
     static nsresult splitQName(const nsAString& aName, nsIAtom** aPrefix,
                                nsIAtom** aLocalName);
 
     /*
      * Returns true if the given character is whitespace.
      */
-    static bool isWhitespace(const PRUnichar& aChar)
+    static bool isWhitespace(const char16_t& aChar)
     {
         return (aChar <= ' ' &&
                 (aChar == ' ' || aChar == '\r' ||
                  aChar == '\n'|| aChar == '\t'));
     }
 
     /**
      * Returns true if the given string has only whitespace characters
@@ -107,30 +107,30 @@ public:
      * Normalizes the value of a XML processingInstruction
     **/
     static void normalizePIValue(nsAString& attValue);
 
     /**
      * Returns true if the given string is a valid XML QName
      */
     static bool isValidQName(const nsAFlatString& aQName,
-                             const PRUnichar** aColon);
+                             const char16_t** aColon);
 
     /**
      * Returns true if the given character represents an Alpha letter
      */
-    static bool isLetter(PRUnichar aChar)
+    static bool isLetter(char16_t aChar)
     {
         return !!MOZ_XMLIsLetter(reinterpret_cast<const char*>(&aChar));
     }   
 
     /**
      * Returns true if the given character is an allowable NCName character
      */
-    static bool isNCNameChar(PRUnichar aChar)
+    static bool isNCNameChar(char16_t aChar)
     {
         return !!MOZ_XMLIsNCNameChar(reinterpret_cast<const char*>(&aChar));
     }
 
     /*
      * Walks up the document tree and returns true if the closest xml:space
      * attribute is "preserve"
      */
--- a/content/xslt/src/xpath/txCoreFunctionCall.cpp
+++ b/content/xslt/src/xpath/txCoreFunctionCall.cpp
@@ -269,26 +269,26 @@ txCoreFunctionCall::evaluate(txIEvalCont
 
             nsRefPtr<StringResult> strRes;
             rv = aContext->recycler()->getStringResult(getter_AddRefs(strRes));
             NS_ENSURE_SUCCESS(rv, rv);
 
             bool addSpace = false;
             bool first = true;
             strRes->mValue.SetCapacity(resultStr.Length());
-            PRUnichar c;
+            char16_t c;
             uint32_t src;
             for (src = 0; src < resultStr.Length(); src++) {
                 c = resultStr.CharAt(src);
                 if (XMLUtils::isWhitespace(c)) {
                     addSpace = true;
                 }
                 else {
                     if (addSpace && !first)
-                        strRes->mValue.Append(PRUnichar(' '));
+                        strRes->mValue.Append(char16_t(' '));
 
                     strRes->mValue.Append(c);
                     addSpace = false;
                     first = false;
                 }
             }
             *aResult = strRes;
             NS_ADDREF(*aResult);
--- a/content/xslt/src/xpath/txExprLexer.h
+++ b/content/xslt/src/xpath/txExprLexer.h
@@ -211,16 +211,16 @@ private:
      *  Lexical Structure
      */
     bool nextIsOperatorToken(Token* aToken);
 
     /**
      * Returns true if the given character represents a numeric letter (digit)
      * Implemented in ExprLexerChars.cpp
      */
-    static bool isXPathDigit(PRUnichar ch)
+    static bool isXPathDigit(char16_t ch)
     {
         return (ch >= '0' && ch <= '9');
     }
 };
 
 #endif
 
--- a/content/xslt/src/xpath/txExprParser.cpp
+++ b/content/xslt/src/xpath/txExprParser.cpp
@@ -45,17 +45,17 @@ txExprParser::createAVT(const nsSubstrin
         // Every iteration through this loop parses either a literal section
         // or an expression
         start = iter;
         nsAutoPtr<Expr> newExpr;
         if (!inExpr) {
             // Parse literal section
             literalString.Truncate();
             while (iter != end) {
-                PRUnichar q = *iter;
+                char16_t q = *iter;
                 if (q == '{' || q == '}') {
                     // Store what we've found so far and set a new |start| to
                     // skip the (first) brace
                     literalString.Append(Substring(start, iter));
                     start = ++iter;
                     // Unless another brace follows we've found the start of
                     // an expression (in case of '{') or an unbalanced brace
                     // (in case of '}')
@@ -91,17 +91,17 @@ txExprParser::createAVT(const nsSubstrin
                                             getter_Transfers(newExpr));
                     NS_ENSURE_SUCCESS(rv, rv);
 
                     inExpr = false;
                     ++iter; // skip closing '}'
                     break;
                 }
                 else if (*iter == '\'' || *iter == '"') {
-                    PRUnichar q = *iter;
+                    char16_t q = *iter;
                     while (++iter != end && *iter != q) {} /* do nothing */
                     if (iter == end) {
                         break;
                     }
                 }
                 ++iter;
             }
 
--- a/content/xslt/src/xpath/txFunctionCall.cpp
+++ b/content/xslt/src/xpath/txFunctionCall.cpp
@@ -119,15 +119,15 @@ FunctionCall::toString(nsAString& aDest)
     }
 
 
 
     aDest.Append(nsDependentAtomString(functionNameAtom) +
                  NS_LITERAL_STRING("("));
     for (uint32_t i = 0; i < mParams.Length(); ++i) {
         if (i != 0) {
-            aDest.Append(PRUnichar(','));
+            aDest.Append(char16_t(','));
         }
         mParams[i]->toString(aDest);
     }
-    aDest.Append(PRUnichar(')'));
+    aDest.Append(char16_t(')'));
 }
 #endif
--- a/content/xslt/src/xpath/txLiteralExpr.cpp
+++ b/content/xslt/src/xpath/txLiteralExpr.cpp
@@ -73,17 +73,17 @@ txLiteralExpr::toString(nsAString& aStr)
             txDouble::toString(mValue->numberValue(), aStr);
             return;
         }
         case txAExprResult::STRING:
         {
             StringResult* strRes =
                 static_cast<StringResult*>(static_cast<txAExprResult*>
                                        (mValue));
-            PRUnichar ch = '\'';
+            char16_t ch = '\'';
             if (strRes->mValue.FindChar(ch) != kNotFound) {
                 ch = '\"';
             }
             aStr.Append(ch);
             aStr.Append(strRes->mValue);
             aStr.Append(ch);
             return;
         }
--- a/content/xslt/src/xpath/txLocationStep.cpp
+++ b/content/xslt/src/xpath/txLocationStep.cpp
@@ -280,17 +280,17 @@ LocationStep::toString(nsAString& str)
     switch (mAxisIdentifier) {
         case ANCESTOR_AXIS :
             str.AppendLiteral("ancestor::");
             break;
         case ANCESTOR_OR_SELF_AXIS :
             str.AppendLiteral("ancestor-or-self::");
             break;
         case ATTRIBUTE_AXIS:
-            str.Append(PRUnichar('@'));
+            str.Append(char16_t('@'));
             break;
         case DESCENDANT_AXIS:
             str.AppendLiteral("descendant::");
             break;
         case DESCENDANT_OR_SELF_AXIS:
             str.AppendLiteral("descendant-or-self::");
             break;
         case FOLLOWING_AXIS :
--- a/content/xslt/src/xpath/txNameTest.cpp
+++ b/content/xslt/src/xpath/txNameTest.cpp
@@ -81,15 +81,15 @@ txNameTest::isSensitiveTo(Expr::ContextS
 #ifdef TX_TO_STRING
 void
 txNameTest::toString(nsAString& aDest)
 {
     if (mPrefix) {
         nsAutoString prefix;
         mPrefix->ToString(prefix);
         aDest.Append(prefix);
-        aDest.Append(PRUnichar(':'));
+        aDest.Append(char16_t(':'));
     }
     nsAutoString localName;
     mLocalName->ToString(localName);
     aDest.Append(localName);
 }
 #endif
--- a/content/xslt/src/xpath/txNamedAttributeStep.cpp
+++ b/content/xslt/src/xpath/txNamedAttributeStep.cpp
@@ -45,20 +45,20 @@ txNamedAttributeStep::isSensitiveTo(Cont
 {
     return !!(aContext & NODE_CONTEXT);
 }
 
 #ifdef TX_TO_STRING
 void
 txNamedAttributeStep::toString(nsAString& aDest)
 {
-    aDest.Append(PRUnichar('@'));
+    aDest.Append(char16_t('@'));
     if (mPrefix) {
         nsAutoString prefix;
         mPrefix->ToString(prefix);
         aDest.Append(prefix);
-        aDest.Append(PRUnichar(':'));
+        aDest.Append(char16_t(':'));
     }
     nsAutoString localName;
     mLocalName->ToString(localName);
     aDest.Append(localName);
 }
 #endif
--- a/content/xslt/src/xpath/txNodeTypeTest.cpp
+++ b/content/xslt/src/xpath/txNodeTypeTest.cpp
@@ -67,20 +67,20 @@ txNodeTypeTest::toString(nsAString& aDes
         case TEXT_TYPE:
             aDest.Append(NS_LITERAL_STRING("text()"));
             break;
         case PI_TYPE:
             aDest.AppendLiteral("processing-instruction(");
             if (mNodeName) {
                 nsAutoString str;
                 mNodeName->ToString(str);
-                aDest.Append(PRUnichar('\''));
+                aDest.Append(char16_t('\''));
                 aDest.Append(str);
-                aDest.Append(PRUnichar('\''));
+                aDest.Append(char16_t('\''));
             }
-            aDest.Append(PRUnichar(')'));
+            aDest.Append(char16_t(')'));
             break;
         case NODE_TYPE:
             aDest.Append(NS_LITERAL_STRING("node()"));
             break;
     }
 }
 #endif
--- a/content/xslt/src/xpath/txPathExpr.cpp
+++ b/content/xslt/src/xpath/txPathExpr.cpp
@@ -239,15 +239,15 @@ PathExpr::toString(nsAString& dest)
     
     uint32_t i, len = mItems.Length();
     for (i = 1; i < len; ++i) {
         switch (mItems[i].pathOp) {
             case DESCENDANT_OP:
                 dest.AppendLiteral("//");
                 break;
             case RELATIVE_OP:
-                dest.Append(PRUnichar('/'));
+                dest.Append(char16_t('/'));
                 break;
         }
         mItems[i].expr->toString(dest);
     }
 }
 #endif
--- a/content/xslt/src/xpath/txPredicateList.cpp
+++ b/content/xslt/src/xpath/txPredicateList.cpp
@@ -72,14 +72,14 @@ PredicateList::isSensitiveTo(Expr::Conte
 
     return false;
 }
 
 #ifdef TX_TO_STRING
 void PredicateList::toString(nsAString& dest)
 {
     for (uint32_t i = 0; i < mPredicates.Length(); ++i) {
-        dest.Append(PRUnichar('['));
+        dest.Append(char16_t('['));
         mPredicates[i]->toString(dest);
-        dest.Append(PRUnichar(']'));
+        dest.Append(char16_t(']'));
     }
 }
 #endif
--- a/content/xslt/src/xpath/txPredicatedNodeTest.cpp
+++ b/content/xslt/src/xpath/txPredicatedNodeTest.cpp
@@ -45,13 +45,13 @@ txPredicatedNodeTest::isSensitiveTo(Expr
            mPredicate->isSensitiveTo(aContext);
 }
 
 #ifdef TX_TO_STRING
 void
 txPredicatedNodeTest::toString(nsAString& aDest)
 {
     mNodeTest->toString(aDest);
-    aDest.Append(PRUnichar('['));
+    aDest.Append(char16_t('['));
     mPredicate->toString(aDest);
-    aDest.Append(PRUnichar(']'));
+    aDest.Append(char16_t(']'));
 }
 #endif
--- a/content/xslt/src/xpath/txRelationalExpr.cpp
+++ b/content/xslt/src/xpath/txRelationalExpr.cpp
@@ -176,27 +176,27 @@ RelationalExpr::toString(nsAString& str)
 {
     mLeftExpr->toString(str);
 
     switch (mOp) {
         case NOT_EQUAL:
             str.AppendLiteral("!=");
             break;
         case LESS_THAN:
-            str.Append(PRUnichar('<'));
+            str.Append(char16_t('<'));
             break;
         case LESS_OR_EQUAL:
             str.AppendLiteral("<=");
             break;
         case GREATER_THAN :
-            str.Append(PRUnichar('>'));
+            str.Append(char16_t('>'));
             break;
         case GREATER_OR_EQUAL:
             str.AppendLiteral(">=");
             break;
         default:
-            str.Append(PRUnichar('='));
+            str.Append(char16_t('='));
             break;
     }
 
     mRightExpr->toString(str);
 }
 #endif
--- a/content/xslt/src/xpath/txRootExpr.cpp
+++ b/content/xslt/src/xpath/txRootExpr.cpp
@@ -33,11 +33,11 @@ RootExpr::isSensitiveTo(ContextSensitivi
     return !!(aContext & NODE_CONTEXT);
 }
 
 #ifdef TX_TO_STRING
 void
 RootExpr::toString(nsAString& dest)
 {
     if (mSerialize)
-        dest.Append(PRUnichar('/'));
+        dest.Append(char16_t('/'));
 }
 #endif
--- a/content/xslt/src/xpath/txUnaryExpr.cpp
+++ b/content/xslt/src/xpath/txUnaryExpr.cpp
@@ -44,12 +44,12 @@ UnaryExpr::isSensitiveTo(ContextSensitiv
 }
 
 #ifdef TX_TO_STRING
 void
 UnaryExpr::toString(nsAString& str)
 {
     if (!expr)
         return;
-    str.Append(PRUnichar('-'));
+    str.Append(char16_t('-'));
     expr->toString(str);
 }
 #endif
--- a/content/xslt/src/xpath/txVariableRefExpr.cpp
+++ b/content/xslt/src/xpath/txVariableRefExpr.cpp
@@ -50,20 +50,20 @@ VariableRefExpr::isSensitiveTo(ContextSe
 {
     return !!(aContext & VARIABLES_CONTEXT);
 }
 
 #ifdef TX_TO_STRING
 void
 VariableRefExpr::toString(nsAString& aDest)
 {
-    aDest.Append(PRUnichar('$'));
+    aDest.Append(char16_t('$'));
     if (mPrefix) {
         nsAutoString prefix;
         mPrefix->ToString(prefix);
         aDest.Append(prefix);
-        aDest.Append(PRUnichar(':'));
+        aDest.Append(char16_t(':'));
     }
     nsAutoString lname;
     mLocalName->ToString(lname);
     aDest.Append(lname);
 }
 #endif
--- a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
+++ b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
@@ -175,19 +175,19 @@ LookupFunction(const char *aContractID, 
     NS_ENSURE_SUCCESS(rv, rv);
 
     txInterfacesArrayHolder holder(iidArray, iidCount);
 
     // Remove any minus signs and uppercase the following letter (so
     // foo-bar becomes fooBar). Note that if there are any names that already
     // have uppercase letters they might cause false matches (both fooBar and
     // foo-bar matching fooBar).
-    const PRUnichar *name = aName->GetUTF16String();
+    const char16_t *name = aName->GetUTF16String();
     nsAutoCString methodName;
-    PRUnichar letter;
+    char16_t letter;
     bool upperNext = false;
     while ((letter = *name)) {
         if (letter == '-') {
             upperNext = true;
         }
         else {
             MOZ_ASSERT(nsCRT::IsAscii(letter),
                        "invalid static_cast coming up");
--- a/content/xslt/src/xslt/txDocumentFunctionCall.cpp
+++ b/content/xslt/src/xslt/txDocumentFunctionCall.cpp
@@ -24,17 +24,17 @@ DocumentFunctionCall::DocumentFunctionCa
 
 static void
 retrieveNode(txExecutionState* aExecutionState, const nsAString& aUri,
              const nsAString& aBaseUri, txNodeSet* aNodeSet)
 {
     nsAutoString absUrl;
     URIUtils::resolveHref(aUri, aBaseUri, absUrl);
 
-    int32_t hash = absUrl.RFindChar(PRUnichar('#'));
+    int32_t hash = absUrl.RFindChar(char16_t('#'));
     uint32_t urlEnd, fragStart, fragEnd;
     if (hash == kNotFound) {
         urlEnd = absUrl.Length();
         fragStart = 0;
         fragEnd = 0;
     }
     else {
         urlEnd = hash;
--- a/content/xslt/src/xslt/txExecutionState.cpp
+++ b/content/xslt/src/xslt/txExecutionState.cpp
@@ -372,17 +372,17 @@ txIEvalContext*
 txExecutionState::getEvalContext()
 {
     return mEvalContext;
 }
 
 const txXPathNode*
 txExecutionState::retrieveDocument(const nsAString& aUri)
 {
-    NS_ASSERTION(aUri.FindChar(PRUnichar('#')) == kNotFound,
+    NS_ASSERTION(aUri.FindChar(char16_t('#')) == kNotFound,
                  "Remove the fragment.");
 
     if (mDisableLoads) {
         return nullptr;
     }
 
     PR_LOG(txLog::xslt, PR_LOG_DEBUG,
            ("Retrieve Document %s", NS_LossyConvertUTF16toASCII(aUri).get()));
--- a/content/xslt/src/xslt/txFormatNumberFunctionCall.cpp
+++ b/content/xslt/src/xslt/txFormatNumberFunctionCall.cpp
@@ -12,17 +12,17 @@
 #include <math.h>
 #include "txNamespaceMap.h"
 
 #include "prdtoa.h"
 
 #define INVALID_PARAM_VALUE \
     NS_LITERAL_STRING("invalid parameter value for function")
 
-const PRUnichar txFormatNumberFunctionCall::FORMAT_QUOTE = '\'';
+const char16_t txFormatNumberFunctionCall::FORMAT_QUOTE = '\'';
 
 /*
  * FormatNumberFunctionCall
  * A representation of the XSLT additional function: format-number()
  */
 
 /*
  * Creates a new format-number function call
@@ -128,17 +128,17 @@ txFormatNumberFunctionCall::evaluate(txI
         else
             pos++;
     }
 
     // Parse the format string
     FormatParseState pState = Prefix;
     inQuote = false;
 
-    PRUnichar c = 0;
+    char16_t c = 0;
     while (pos < formatLen && pState != Finished) {
         c=formatStr.CharAt(pos++);
 
         switch (pState) {
 
         case Prefix:
         case Suffix:
             if (!inQuote) {
@@ -313,17 +313,17 @@ txFormatNumberFunctionCall::evaluate(txI
         
         if (carry) {
             digit = (digit + 1) % 10;
             carry = digit == 0;
         }
 
         if (hasFraction || digit != 0 || i < bufIntDigits+minFractionSize) {
             hasFraction = true;
-            res.SetCharAt((PRUnichar)(digit + format->mZeroDigit),
+            res.SetCharAt((char16_t)(digit + format->mZeroDigit),
                           resPos--);
         }
         else {
             res.Truncate(resPos--);
         }
     }
 
     // Decimal separator
@@ -348,24 +348,24 @@ txFormatNumberFunctionCall::evaluate(txI
             digit = (digit + 1) % 10;
             carry = digit == 0;
         }
 
         if (i != 0 && i%groupSize == 0) {
             res.SetCharAt(format->mGroupingSeparator, resPos--);
         }
 
-        res.SetCharAt((PRUnichar)(digit + format->mZeroDigit), resPos--);
+        res.SetCharAt((char16_t)(digit + format->mZeroDigit), resPos--);
     }
 
     if (carry) {
         if (i%groupSize == 0) {
             res.Insert(format->mGroupingSeparator, resPos + 1);
         }
-        res.Insert((PRUnichar)(1 + format->mZeroDigit), resPos + 1);
+        res.Insert((char16_t)(1 + format->mZeroDigit), resPos + 1);
     }
     
     if (!hasFraction && !intDigits && !carry) {
         // If we havn't added any characters we add a '0'
         // This can only happen for formats like '##.##'
         res.Append(format->mZeroDigit);
     }
 
--- a/content/xslt/src/xslt/txInstructions.cpp
+++ b/content/xslt/src/xslt/txInstructions.cpp
@@ -96,17 +96,17 @@ txAttribute::txAttribute(nsAutoPtr<Expr>
 
 nsresult
 txAttribute::execute(txExecutionState& aEs)
 {
     nsAutoString name;
     nsresult rv = mName->evaluateToString(aEs.getEvalContext(), name);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    const PRUnichar* colon;
+    const char16_t* colon;
     if (!XMLUtils::isValidQName(name, &colon) ||
         TX_StringEqualsAtom(name, nsGkAtoms::xmlns)) {
         return NS_OK;
     }
 
     nsCOMPtr<nsIAtom> prefix;
     uint32_t lnameStart = 0;
     if (colon) {
@@ -205,17 +205,17 @@ txComment::execute(txExecutionState& aEs
 {
     nsAutoPtr<txTextHandler> handler(
         static_cast<txTextHandler*>(aEs.popResultHandler()));
     uint32_t length = handler->mValue.Length();
     int32_t pos = 0;
     while ((pos = handler->mValue.FindChar('-', (uint32_t)pos)) != kNotFound) {
         ++pos;
         if ((uint32_t)pos == length || handler->mValue.CharAt(pos) == '-') {
-            handler->mValue.Insert(PRUnichar(' '), pos++);
+            handler->mValue.Insert(char16_t(' '), pos++);
             ++length;
         }
     }
 
     return aEs.mResultHandler->comment(handler->mValue);
 }
 
 nsresult
@@ -585,17 +585,17 @@ txProcessingInstruction::execute(txExecu
     XMLUtils::normalizePIValue(handler->mValue);
 
     nsAutoString name;
     nsresult rv = mName->evaluateToString(aEs.getEvalContext(), name);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Check name validity (must be valid NCName and a PITarget)
     // XXX Need to check for NCName and PITarget
-    const PRUnichar* colon;
+    const char16_t* colon;
     if (!XMLUtils::isValidQName(name, &colon)) {
         // XXX ErrorReport: bad PI-target
         return NS_ERROR_FAILURE;
     }
 
     return aEs.mResultHandler->processingInstruction(name, handler->mValue);
 }
 
@@ -822,17 +822,17 @@ txStartElement::execute(txExecutionState
     nsresult rv = mName->evaluateToString(aEs.getEvalContext(), name);
     NS_ENSURE_SUCCESS(rv, rv);
 
 
     int32_t nsId = kNameSpaceID_None;
     nsCOMPtr<nsIAtom> prefix;
     uint32_t lnameStart = 0;
 
-    const PRUnichar* colon;
+    const char16_t* colon;
     if (XMLUtils::isValidQName(name, &colon)) {
         if (colon) {
             prefix = do_GetAtom(Substring(name.get(), colon));
             lnameStart = colon - name.get() + 1;
         }
 
         if (mNamespace) {
             nsAutoString nspace;
--- a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
+++ b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
@@ -111,18 +111,18 @@ NS_IMPL_ISUPPORTS6(txStylesheetSink,
                    nsIXMLContentSink,
                    nsIContentSink,
                    nsIExpatSink,
                    nsIStreamListener,
                    nsIRequestObserver,
                    nsIInterfaceRequestor)
 
 NS_IMETHODIMP
-txStylesheetSink::HandleStartElement(const PRUnichar *aName,
-                                     const PRUnichar **aAtts,
+txStylesheetSink::HandleStartElement(const char16_t *aName,
+                                     const char16_t **aAtts,
                                      uint32_t aAttsCount,
                                      int32_t aIndex,
                                      uint32_t aLineNumber)
 {
     NS_PRECONDITION(aAttsCount % 2 == 0, "incorrect aAttsCount");
 
     nsresult rv =
         mCompiler->startElement(aName, aAtts, aAttsCount / 2, aIndex);
@@ -131,82 +131,82 @@ txStylesheetSink::HandleStartElement(con
 
         return rv;
     }
     
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::HandleEndElement(const PRUnichar *aName)
+txStylesheetSink::HandleEndElement(const char16_t *aName)
 {
     nsresult rv = mCompiler->endElement();
     if (NS_FAILED(rv)) {
         mCompiler->cancel(rv);
 
         return rv;
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::HandleComment(const PRUnichar *aName)
+txStylesheetSink::HandleComment(const char16_t *aName)
 {
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::HandleCDataSection(const PRUnichar *aData,
+txStylesheetSink::HandleCDataSection(const char16_t *aData,
                                      uint32_t aLength)
 {
     return HandleCharacterData(aData, aLength);
 }
 
 NS_IMETHODIMP
 txStylesheetSink::HandleDoctypeDecl(const nsAString & aSubset,
                                     const nsAString & aName,
                                     const nsAString & aSystemId,
                                     const nsAString & aPublicId,
                                     nsISupports *aCatalogData)
 {
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::HandleCharacterData(const PRUnichar *aData,
+txStylesheetSink::HandleCharacterData(const char16_t *aData,
                                       uint32_t aLength)
 {
     nsresult rv = mCompiler->characters(Substring(aData, aData + aLength));
     if (NS_FAILED(rv)) {
         mCompiler->cancel(rv);
         return rv;
     }
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::HandleProcessingInstruction(const PRUnichar *aTarget,
-                                              const PRUnichar *aData)
+txStylesheetSink::HandleProcessingInstruction(const char16_t *aTarget,
+                                              const char16_t *aData)
 {
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::HandleXMLDeclaration(const PRUnichar *aVersion,
-                                       const PRUnichar *aEncoding,
+txStylesheetSink::HandleXMLDeclaration(const char16_t *aVersion,
+                                       const char16_t *aEncoding,
                                        int32_t aStandalone)
 {
     return NS_OK;
 }
 
 NS_IMETHODIMP
-txStylesheetSink::ReportError(const PRUnichar *aErrorText,
-                              const PRUnichar *aSourceText,
+txStylesheetSink::ReportError(const char16_t *aErrorText,
+                              const char16_t *aSourceText,
                               nsIScriptError *aError,
                               bool *_retval)
 {
     NS_PRECONDITION(aError && aSourceText && aErrorText, "Check arguments!!!");
 
     // The expat driver should report the error.
     *_retval = true;
 
@@ -432,18 +432,18 @@ txCompileObserver::loadURI(const nsAStri
     }
 
     return startLoad(uri, aCompiler, referrerPrincipal);
 }
 
 void
 txCompileObserver::onDoneCompiling(txStylesheetCompiler* aCompiler,
                                    nsresult aResult,
-                                   const PRUnichar *aErrorText,
-                                   const PRUnichar *aParam)
+                                   const char16_t *aErrorText,
+                                   const char16_t *aParam)
 {
     if (NS_SUCCEEDED(aResult)) {
         mProcessor->setStylesheet(aCompiler->getStylesheet());
     }
     else {
         mProcessor->reportError(aResult, aErrorText, aParam);
     }
 }
@@ -675,18 +675,18 @@ txSyncCompileObserver::loadURI(const nsA
     }
 
     rv = aCompiler->doneLoading();
     return rv;
 }
 
 void txSyncCompileObserver::onDoneCompiling(txStylesheetCompiler* aCompiler,
                                             nsresult aResult,
-                                            const PRUnichar *aErrorText,
-                                            const PRUnichar *aParam)
+                                            const char16_t *aErrorText,
+                                            const char16_t *aParam)
 {
 }
 
 nsresult
 TX_CompileStylesheet(nsINode* aNode, txMozillaXSLTProcessor* aProcessor,
                      nsIPrincipal* aCallerPrincipal,
                      txStylesheet** aStylesheet)
 {
--- a/content/xslt/src/xslt/txMozillaXMLOutput.cpp
+++ b/content/xslt/src/xslt/txMozillaXMLOutput.cpp
@@ -851,17 +851,17 @@ txMozillaXMLOutput::createResultDocument
           standalone = 0;
         }
         else {
           standalone = 1;
         }
 
         // Could use mOutputFormat.mVersion.get() when we support
         // versions > 1.0.
-        static const PRUnichar kOneDotZero[] = { '1', '.', '0', '\0' };
+        static const char16_t kOneDotZero[] = { '1', '.', '0', '\0' };
         mDocument->SetXMLDeclaration(kOneDotZero, mOutputFormat.mEncoding.get(),
                                      standalone);
     }
 
     // Set up script loader of the result document.
     nsScriptLoader *loader = mDocument->ScriptLoader();
     if (mNotifier) {
         loader->AddObserver(mNotifier);
--- a/content/xslt/src/xslt/txMozillaXSLTProcessor.cpp
+++ b/content/xslt/src/xslt/txMozillaXSLTProcessor.cpp
@@ -1035,18 +1035,18 @@ txMozillaXSLTProcessor::setStylesheet(tx
     if (mSource) {
         return DoTransform();
     }
     return NS_OK;
 }
 
 void
 txMozillaXSLTProcessor::reportError(nsresult aResult,
-                                    const PRUnichar *aErrorText,
-                                    const PRUnichar *aSourceText)
+                                    const char16_t *aErrorText,
+                                    const char16_t *aSourceText)
 {
     if (!mObserver) {
         return;
     }
 
     mTransformResult = aResult;
 
     if (aErrorText) {
@@ -1060,17 +1060,17 @@ txMozillaXSLTProcessor::reportError(nsre
             sbs->FormatStatusMessage(aResult, EmptyString().get(),
                                      getter_Copies(errorText));
 
             nsXPIDLString errorMessage;
             nsCOMPtr<nsIStringBundle> bundle;
             sbs->CreateBundle(XSLT_MSGS_URL, getter_AddRefs(bundle));
 
             if (bundle) {
-                const PRUnichar* error[] = { errorText.get() };
+                const char16_t* error[] = { errorText.get() };
                 if (mStylesheet) {
                     bundle->FormatStringFromName(MOZ_UTF16("TransformError"),
                                                  error, 1,
                                                  getter_Copies(errorMessage));
                 }
                 else {
                     bundle->FormatStringFromName(MOZ_UTF16("LoadingError"),
                                                  error, 1,
--- a/content/xslt/src/xslt/txMozillaXSLTProcessor.h
+++ b/content/xslt/src/xslt/txMozillaXSLTProcessor.h
@@ -83,18 +83,18 @@ public:
     NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
     NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
     NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
     NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
     NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
     NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED
 
     nsresult setStylesheet(txStylesheet* aStylesheet);
-    void reportError(nsresult aResult, const PRUnichar *aErrorText,
-                     const PRUnichar *aSourceText);
+    void reportError(nsresult aResult, const char16_t *aErrorText,
+                     const char16_t *aSourceText);
 
     nsIDOMNode *GetSourceContentModel()
     {
         return mSource;
     }
 
     nsresult TransformToDoc(nsIDOMDocument **aResult,
                             bool aCreateDataDocument);
--- a/content/xslt/src/xslt/txPatternParser.cpp
+++ b/content/xslt/src/xslt/txPatternParser.cpp
@@ -241,17 +241,17 @@ nsresult txPatternParser::createKeyPatte
     if (aLexer.nextToken()->mType != Token::COMMA && 
         aLexer.peek()->mType != Token::LITERAL)
         return NS_ERROR_XPATH_PARSE_FAILURE;
     const nsDependentSubstring& value =
         aLexer.nextToken()->Value();
     if (aLexer.nextToken()->mType != Token::R_PAREN)
         return NS_ERROR_XPATH_PARSE_FAILURE;
 
-    const PRUnichar* colon;
+    const char16_t* colon;
     if (!XMLUtils::isValidQName(PromiseFlatString(key), &colon))
         return NS_ERROR_XPATH_PARSE_FAILURE;
     nsCOMPtr<nsIAtom> prefix, localName;
     int32_t namespaceID;
     nsresult rv = resolveQName(key, getter_AddRefs(prefix), aContext,
                                getter_AddRefs(localName), namespaceID);
     if (NS_FAILED(rv))
         return rv;
--- a/content/xslt/src/xslt/txStylesheetCompileHandlers.cpp
+++ b/content/xslt/src/xslt/txStylesheetCompileHandlers.cpp
@@ -341,17 +341,17 @@ getYesNoAttr(txStylesheetAttr* aAttribut
 }
 
 static nsresult
 getCharAttr(txStylesheetAttr* aAttributes,
             int32_t aAttrCount,
             nsIAtom* aName,
             bool aRequired,
             txStylesheetCompilerState& aState,
-            PRUnichar& aChar)
+            char16_t& aChar)
 {
     // Don't reset aChar since it contains the default value
     txStylesheetAttr* attr = nullptr;
     nsresult rv = getStyleAttr(aAttributes, aAttrCount, kNameSpaceID_None,
                                aName, aRequired, &attr);
     if (!attr) {
         return rv;
     }
@@ -1034,17 +1034,17 @@ txFnStartStripSpace(int32_t aNamespaceID
         const nsASingleFragmentString& name = tokenizer.nextToken();
         int32_t ns = kNameSpaceID_None;
         nsCOMPtr<nsIAtom> prefix, localName;
         rv = XMLUtils::splitQName(name, getter_AddRefs(prefix),
                                   getter_AddRefs(localName));
         if (NS_FAILED(rv)) {
             // check for "*" or "prefix:*"
             uint32_t length = name.Length();
-            const PRUnichar* c;
+            const char16_t* c;
             name.BeginReading(c);
             if (length == 2 || c[length-1] != '*') {
                 // these can't work
                 return NS_ERROR_XSLT_PARSE_FAILURE;
             }
             if (length > 1) {
                 // Check for a valid prefix, that is, the returned prefix
                 // should be empty and the real prefix is returned in
--- a/content/xslt/src/xslt/txStylesheetCompiler.cpp
+++ b/content/xslt/src/xslt/txStylesheetCompiler.cpp
@@ -95,18 +95,18 @@ txStylesheetCompiler::startElement(int32
         }
     }
 
     return startElementInternal(aNamespaceID, aLocalName, aPrefix,
                                 aAttributes, aAttrCount);
 }
 
 nsresult
-txStylesheetCompiler::startElement(const PRUnichar *aName,
-                                   const PRUnichar **aAttrs,
+txStylesheetCompiler::startElement(const char16_t *aName,
+                                   const char16_t **aAttrs,
                                    int32_t aAttrCount, int32_t aIDOffset)
 {
     if (NS_FAILED(mStatus)) {
         // ignore content after failure
         // XXX reevaluate once expat stops on failure
         return NS_OK;
     }
 
@@ -383,18 +383,18 @@ txStylesheetCompiler::doneLoading()
     }
 
     mDoneWithThisStylesheet = true;
 
     return maybeDoneCompiling();
 }
 
 void
-txStylesheetCompiler::cancel(nsresult aError, const PRUnichar *aErrorText,
-                             const PRUnichar *aParam)
+txStylesheetCompiler::cancel(nsresult aError, const char16_t *aErrorText,
+                             const char16_t *aParam)
 {
     PR_LOG(txLog::xslt, PR_LOG_ALWAYS,
            ("Compiler::cancel: %s, module: %d, code %d\n",
             NS_LossyConvertUTF16toASCII(mStylesheetURI).get(),
             NS_ERROR_GET_MODULE(aError),
             NS_ERROR_GET_CODE(aError)));
     if (NS_SUCCEEDED(mStatus)) {
         mStatus = aError;
@@ -428,18 +428,18 @@ txStylesheetCompiler::loadURI(const nsAS
     }
     return mObserver ? mObserver->loadURI(aUri, aReferrerUri, aCompiler) :
                        NS_ERROR_FAILURE;
 }
 
 void
 txStylesheetCompiler::onDoneCompiling(txStylesheetCompiler* aCompiler,
                                       nsresult aResult,
-                                      const PRUnichar *aErrorText,
-                                      const PRUnichar *aParam)
+                                      const char16_t *aErrorText,
+                                      const char16_t *aParam)
 {
     if (NS_FAILED(aResult)) {
         cancel(aResult, aErrorText, aParam);
         return;
     }
 
     mChildCompilerList.RemoveElement(aCompiler);
 
--- a/content/xslt/src/xslt/txStylesheetCompiler.h
+++ b/content/xslt/src/xslt/txStylesheetCompiler.h
@@ -48,26 +48,26 @@ public:
     NS_IMETHOD_(nsrefcnt) AddRef() = 0;
     NS_IMETHOD_(nsrefcnt) Release() = 0;
 
     virtual nsresult loadURI(const nsAString& aUri,
                              const nsAString& aReferrerUri,
                              txStylesheetCompiler* aCompiler) = 0;
     virtual void onDoneCompiling(txStylesheetCompiler* aCompiler,
                                  nsresult aResult,
-                                 const PRUnichar *aErrorText = nullptr,
-                                 const PRUnichar *aParam = nullptr) = 0;
+                                 const char16_t *aErrorText = nullptr,
+                                 const char16_t *aParam = nullptr) = 0;
 };
 
 #define TX_DECL_ACOMPILEOBSERVER \
   nsresult loadURI(const nsAString& aUri, const nsAString& aReferrerUri, \
                    txStylesheetCompiler* aCompiler); \
   void onDoneCompiling(txStylesheetCompiler* aCompiler, nsresult aResult, \
-                       const PRUnichar *aErrorText = nullptr, \
-                       const PRUnichar *aParam = nullptr);
+                       const char16_t *aErrorText = nullptr, \
+                       const char16_t *aParam = nullptr);
 
 class txStylesheetCompilerState : public txIParseContext
 {
 public:
     txStylesheetCompilerState(txACompileObserver* aObserver);
     ~txStylesheetCompilerState();
     
     nsresult init(const nsAString& aStylesheetURI, txStylesheet* aStylesheet,
@@ -195,25 +195,25 @@ public:
                          txListIterator* aInsertPosition,
                          txACompileObserver* aObserver);
 
     void setBaseURI(const nsString& aBaseURI);
 
     nsresult startElement(int32_t aNamespaceID, nsIAtom* aLocalName,
                           nsIAtom* aPrefix, txStylesheetAttr* aAttributes,
                           int32_t aAttrCount);
-    nsresult startElement(const PRUnichar *aName,
-                          const PRUnichar **aAtts,
+    nsresult startElement(const char16_t *aName,
+                          const char16_t **aAtts,
                           int32_t aAttrCount, int32_t aIDOffset);
     nsresult endElement();
     nsresult characters(const nsAString& aStr);
     nsresult doneLoading();
 
-    void cancel(nsresult aError, const PRUnichar *aErrorText = nullptr,
-                const PRUnichar *aParam = nullptr);
+    void cancel(nsresult aError, const char16_t *aErrorText = nullptr,
+                const char16_t *aParam = nullptr);
 
     txStylesheet* getStylesheet();
 
     TX_DECL_ACOMPILEOBSERVER
     NS_INLINE_DECL_REFCOUNTING(txStylesheetCompiler)
 
 private:
     nsresult startElementInternal(int32_t aNamespaceID, nsIAtom* aLocalName,
--- a/content/xslt/src/xslt/txXSLTFunctions.h
+++ b/content/xslt/src/xslt/txXSLTFunctions.h
@@ -62,17 +62,17 @@ pu