Merge mozilla-central to mozilla-inbound
authorEd Morley <emorley@mozilla.com>
Thu, 09 Aug 2012 12:51:21 +0100
changeset 101946 f799dd18029265f44319c37d66a12c9c51e50f21
parent 101926 2e9222b7cfcc8d8145727fd072f610900a8bfd55 (current diff)
parent 101945 9249f0c9ca93f2f51bf7559a19725a8469f28ae0 (diff)
child 101947 e3422c4a00b43a6e7ab12fc51f674127596aafc2
push id13237
push useremorley@mozilla.com
push dateThu, 09 Aug 2012 11:51:38 +0000
treeherdermozilla-inbound@f799dd180292 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to mozilla-inbound
editor/libeditor/html/nsHTMLEditor.cpp
layout/generic/nsGfxScrollFrame.cpp
--- a/caps/src/nsPrincipal.cpp
+++ b/caps/src/nsPrincipal.cpp
@@ -1038,17 +1038,17 @@ nsPrincipal::InitFromPersistent(const ch
     mTrusted = aTrusted;
   }
 
   //-- Save the preference name
   mPrefName = aPrefName;
 
   const char* ordinalBegin = PL_strpbrk(aPrefName, "1234567890");
   if (ordinalBegin) {
-    PRIntn n = atoi(ordinalBegin);
+    int n = atoi(ordinalBegin);
     if (sCapabilitiesOrdinal <= n) {
       sCapabilitiesOrdinal = n + 1;
     }
   }
 
   //-- Store the capabilities
   rv = NS_OK;
   if (aGrantedList) {
@@ -1117,17 +1117,17 @@ nsPrincipal::Read(nsIObjectInputStream* 
 
   rv = NS_ReadOptionalCString(aStream, mPrefName);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   const char* ordinalBegin = PL_strpbrk(mPrefName.get(), "1234567890");
   if (ordinalBegin) {
-    PRIntn n = atoi(ordinalBegin);
+    int n = atoi(ordinalBegin);
     if (sCapabilitiesOrdinal <= n) {
       sCapabilitiesOrdinal = n + 1;
     }
   }
 
   bool haveCert;
   rv = aStream->ReadBoolean(&haveCert);
   if (NS_FAILED(rv)) {
--- a/content/base/src/nsContentSink.h
+++ b/content/base/src/nsContentSink.h
@@ -48,17 +48,17 @@ class Loader;
 #ifdef DEBUG
 
 extern PRLogModuleInfo* gContentSinkLogModuleInfo;
 
 #define SINK_TRACE_CALLS              0x1
 #define SINK_TRACE_REFLOW             0x2
 #define SINK_ALWAYS_REFLOW            0x4
 
-#define SINK_LOG_TEST(_lm, _bit) (PRIntn((_lm)->level) & (_bit))
+#define SINK_LOG_TEST(_lm, _bit) (int((_lm)->level) & (_bit))
 
 #define SINK_TRACE(_lm, _bit, _args) \
   PR_BEGIN_MACRO                     \
     if (SINK_LOG_TEST(_lm, _bit)) {  \
       PR_LogPrint _args;             \
     }                                \
   PR_END_MACRO
 
--- a/content/base/src/nsNodeInfoManager.cpp
+++ b/content/base/src/nsNodeInfoManager.cpp
@@ -49,17 +49,17 @@ nsNodeInfoManager::GetNodeInfoInnerHashV
     // the moment because node->mName->hash() is not the same as
     // HashString(*(node->mNameString)).  See bug 732815.
     return HashString(nsDependentAtomString(node->mName));
   }
   return HashString(*(node->mNameString));
 }
 
 
-PRIntn
+int
 nsNodeInfoManager::NodeInfoInnerKeyCompare(const void *key1, const void *key2)
 {
   NS_ASSERTION(key1 && key2, "Null key passed to NodeInfoInnerKeyCompare!");
 
   const nsINodeInfo::nsNodeInfoInner *node1 =
     reinterpret_cast<const nsINodeInfo::nsNodeInfoInner *>(key1);
   const nsINodeInfo::nsNodeInfoInner *node2 =
     reinterpret_cast<const nsINodeInfo::nsNodeInfoInner *>(key2);
@@ -178,18 +178,18 @@ nsNodeInfoManager::Init(nsIDocument *aDo
     PR_LOG(gNodeInfoManagerLeakPRLog, PR_LOG_DEBUG,
            ("NODEINFOMANAGER %p Init document=%p", this, aDocument));
 #endif
 
   return NS_OK;
 }
 
 // static
-PRIntn
-nsNodeInfoManager::DropNodeInfoDocument(PLHashEntry *he, PRIntn hashIndex, void *arg)
+int
+nsNodeInfoManager::DropNodeInfoDocument(PLHashEntry *he, int hashIndex, void *arg)
 {
   static_cast<nsINodeInfo*>(he->value)->mDocument = nullptr;
   return HT_ENUMERATE_NEXT;
 }
 
 void
 nsNodeInfoManager::DropDocumentReference()
 {
--- a/content/base/src/nsNodeInfoManager.h
+++ b/content/base/src/nsNodeInfoManager.h
@@ -111,19 +111,19 @@ protected:
                                         const nsAString& );
 
   /**
    * Sets the principal of the document this nodeinfo manager belongs to.
    */
   void SetDocumentPrincipal(nsIPrincipal *aPrincipal);
 
 private:
-  static PRIntn NodeInfoInnerKeyCompare(const void *key1, const void *key2);
+  static int NodeInfoInnerKeyCompare(const void *key1, const void *key2);
   static PLHashNumber GetNodeInfoInnerHashValue(const void *key);
-  static PRIntn DropNodeInfoDocument(PLHashEntry *he, PRIntn hashIndex,
+  static int DropNodeInfoDocument(PLHashEntry *he, int hashIndex,
                                      void *arg);
 
   PLHashTable *mNodeInfoHash;
   nsIDocument *mDocument; // WEAK
   PRUint32 mNonDocumentNodeInfos;
   nsIPrincipal *mPrincipal; // STRONG, but not nsCOMPtr to avoid include hell
                             // while inlining DocumentPrincipal().  Never null
                             // after Init() succeeds.
new file mode 100644
--- /dev/null
+++ b/content/canvas/crashtests/727547.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<canvas></canvas>
+<script>
+var canvas = document.body.firstChild,
+    gl = canvas.getContext("experimental-webgl");
+gl.texImage2D(0, 0, 0, 0, 0, { width: 10, height: 10, data: 7 });
+</script>
--- a/content/canvas/crashtests/crashtests.list
+++ b/content/canvas/crashtests/crashtests.list
@@ -1,12 +1,13 @@
 load 360293-1.html
 load 421715-1.html
 load 553938-1.html
 load 647480.html
+load 727547.html
 load 0px-size-font-667225.html
 load texImage2D.html
 load 729116.html
 load 745699-1.html
 load 746813-1.html
 # this test crashes in a bunch places still
 #load 745818-large-source.html
 load 743499-negative-size.html
--- a/content/events/src/nsDOMSimpleGestureEvent.cpp
+++ b/content/events/src/nsDOMSimpleGestureEvent.cpp
@@ -45,17 +45,17 @@ nsDOMSimpleGestureEvent::GetDirection(PR
 {
   NS_ENSURE_ARG_POINTER(aDirection);
   *aDirection = static_cast<nsSimpleGestureEvent*>(mEvent)->direction;
   return NS_OK;
 }
 
 /* readonly attribute float delta; */
 NS_IMETHODIMP
-nsDOMSimpleGestureEvent::GetDelta(PRFloat64 *aDelta)
+nsDOMSimpleGestureEvent::GetDelta(double *aDelta)
 {
   NS_ENSURE_ARG_POINTER(aDelta);
   *aDelta = static_cast<nsSimpleGestureEvent*>(mEvent)->delta;
   return NS_OK;
 }
 
 /* readonly attribute unsigned long clickCount; */
 NS_IMETHODIMP
@@ -78,17 +78,17 @@ nsDOMSimpleGestureEvent::InitSimpleGestu
                                                 PRInt32 aClientY,
                                                 bool aCtrlKeyArg,
                                                 bool aAltKeyArg,
                                                 bool aShiftKeyArg,
                                                 bool aMetaKeyArg,
                                                 PRUint16 aButton,
                                                 nsIDOMEventTarget* aRelatedTarget,
                                                 PRUint32 aDirectionArg,
-                                                PRFloat64 aDeltaArg,
+                                                double aDeltaArg,
                                                 PRUint32 aClickCountArg)
 {
   nsresult rv = nsDOMMouseEvent::InitMouseEvent(aTypeArg,
                                                 aCanBubbleArg,
                                                 aCancelableArg,
                                                 aViewArg,
                                                 aDetailArg,
                                                 aScreenX, 
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -260,16 +260,17 @@ MOCHITEST_FILES = \
 		test_bug651956.html \
 		test_bug694503.html \
 		test_object_plugin_nav.html \
 		test_bug742030.html \
 		test_bug742549.html \
 		test_bug745685.html \
 		test_input_file_picker.html \
 		test_bug763626.html \
+		test_bug780993.html \
 		$(NULL)
 
 MOCHITEST_BROWSER_FILES = \
 		browser_bug649778.js \
 		file_bug649778.html \
 		file_bug649778.html^headers^ \
 		$(NULL)
 
new file mode 100644
--- /dev/null
+++ b/content/html/content/test/test_bug780993.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test for bug 780993</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<script>
+test(function() {
+  var select = document.createElement("select");
+  var option = document.createElement("option");
+  select.appendChild(option);
+  assert_equals(select[0], option);
+  select[0] = null;
+  assert_equals(option.parentNode, null);
+  assert_equals(select[0], null);
+}, "Should be able to set select[n] to null.");
+test(function() {
+  var select = document.createElement("select");
+  var option = document.createElement("option");
+  var option2 = document.createElement("option");
+  select.appendChild(option);
+  assert_equals(select[0], option);
+  select[0] = option2;
+  assert_equals(option.parentNode, null);
+  assert_equals(option2.parentNode, select);
+  assert_equals(select[0], option2);
+}, "Should be able to set select[n] to an option element");
+test(function() {
+  var select = document.createElement("select");
+  var option = document.createElement("option");
+  select.appendChild(option);
+  assert_equals(select[0], option);
+  assert_throws(null, function() {
+    select[0] = 42;
+  });
+  assert_equals(option.parentNode, select);
+  assert_equals(select[0], option);
+}, "Should not be able to set select[n] to a primitive.");
+</script>
--- a/content/media/plugins/nsMediaPluginReader.h
+++ b/content/media/plugins/nsMediaPluginReader.h
@@ -11,18 +11,18 @@
 #include "nsBuiltinDecoderReader.h"
 
 #include "MPAPI.h"
 
 class nsMediaPluginReader : public nsBuiltinDecoderReader
 {
   nsCString mType;
   MPAPI::Decoder *mPlugin;
-  PRBool mHasAudio;
-  PRBool mHasVideo;
+  bool mHasAudio;
+  bool mHasVideo;
   nsIntRect mPicture;
   nsIntSize mInitialFrame;
   int64_t mVideoSeekTimeUs;
   int64_t mAudioSeekTimeUs;
   VideoData *mLastVideoFrame;
 public:
   nsMediaPluginReader(nsBuiltinDecoder* aDecoder);
   ~nsMediaPluginReader();
--- a/content/xslt/src/base/txDouble.cpp
+++ b/content/xslt/src/base/txDouble.cpp
@@ -151,17 +151,17 @@ void txDouble::toString(double aValue, n
         aDest.AppendLiteral("Infinity");
         return;
     }
 
     // Mantissa length is 17, so this is plenty
     const int buflen = 20;
     char buf[buflen];
 
-    PRIntn intDigits, sign;
+    int intDigits, sign;
     char* endp;
     PR_dtoa(aValue, 0, 0, &intDigits, &sign, &endp, buf, buflen - 1);
 
     // compute length
     PRInt32 length = endp - buf;
     if (length > intDigits) {
         // decimal point needed
         ++length;
--- a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
+++ b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp
@@ -567,17 +567,17 @@ txXPathNodeUtils::getXSLTId(const txXPat
 /* static */
 void
 txXPathNodeUtils::getBaseURI(const txXPathNode& aNode, nsAString& aURI)
 {
     aNode.mNode->GetDOMBaseURI(aURI);
 }
 
 /* static */
-PRIntn
+int
 txXPathNodeUtils::comparePosition(const txXPathNode& aNode,
                                   const txXPathNode& aOtherNode)
 {
     // First check for equal nodes or attribute-nodes on the same element.
     if (aNode.mNode == aOtherNode.mNode) {
         if (aNode.mIndex == aOtherNode.mIndex) {
             return 0;
         }
--- a/content/xslt/src/xpath/txNodeSet.cpp
+++ b/content/xslt/src/xpath/txNodeSet.cpp
@@ -562,33 +562,33 @@ txXPathNode*
 txNodeSet::findPosition(const txXPathNode& aNode, txXPathNode* aFirst,
                         txXPathNode* aLast, bool& aDupe) const
 {
     aDupe = false;
     if (aLast - aFirst <= 2) {
         // If we search 2 nodes or less there is no point in further divides
         txXPathNode* pos = aFirst;
         for (; pos < aLast; ++pos) {
-            PRIntn cmp = txXPathNodeUtils::comparePosition(aNode, *pos);
+            int cmp = txXPathNodeUtils::comparePosition(aNode, *pos);
             if (cmp < 0) {
                 return pos;
             }
 
             if (cmp == 0) {
                 aDupe = true;
 
                 return pos;
             }
         }
         return pos;
     }
 
     // (cannot add two pointers)
     txXPathNode* midpos = aFirst + (aLast - aFirst) / 2;
-    PRIntn cmp = txXPathNodeUtils::comparePosition(aNode, *midpos);
+    int cmp = txXPathNodeUtils::comparePosition(aNode, *midpos);
     if (cmp == 0) {
         aDupe = true;
 
         return midpos;
     }
 
     if (cmp > 0) {
         return findPosition(aNode, midpos + 1, aLast, aDupe);
--- a/content/xslt/src/xpath/txXPathTreeWalker.h
+++ b/content/xslt/src/xpath/txXPathTreeWalker.h
@@ -89,18 +89,18 @@ public:
     static void appendNodeValue(const txXPathNode& aNode, nsAString& aResult);
     static bool isWhitespace(const txXPathNode& aNode);
     static txXPathNode* getOwnerDocument(const txXPathNode& aNode);
     static PRInt32 getUniqueIdentifier(const txXPathNode& aNode);
     static nsresult getXSLTId(const txXPathNode& aNode,
                               const txXPathNode& aBase, nsAString& aResult);
     static void release(txXPathNode* aNode);
     static void getBaseURI(const txXPathNode& aNode, nsAString& aURI);
-    static PRIntn comparePosition(const txXPathNode& aNode,
-                                  const txXPathNode& aOtherNode);
+    static int comparePosition(const txXPathNode& aNode,
+                               const txXPathNode& aOtherNode);
     static bool localNameEquals(const txXPathNode& aNode,
                                   nsIAtom* aLocalName);
     static bool isRoot(const txXPathNode& aNode);
     static bool isElement(const txXPathNode& aNode);
     static bool isAttribute(const txXPathNode& aNode);
     static bool isProcessingInstruction(const txXPathNode& aNode);
     static bool isComment(const txXPathNode& aNode);
     static bool isText(const txXPathNode& aNode);
--- a/content/xslt/src/xslt/txFormatNumberFunctionCall.cpp
+++ b/content/xslt/src/xslt/txFormatNumberFunctionCall.cpp
@@ -272,17 +272,17 @@ txFormatNumberFunctionCall::evaluate(txI
     if (value > 1)
         bufsize = (int)log10(value) + 30;
     else
         bufsize = 1 + 30;
 
     char* buf = new char[bufsize];
     NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
 
-    PRIntn bufIntDigits, sign;
+    int bufIntDigits, sign;
     char* endp;
     PR_dtoa(value, 0, 0, &bufIntDigits, &sign, &endp, buf, bufsize-1);
 
     int buflen = endp - buf;
     int intDigits;
     intDigits = bufIntDigits > minIntegerSize ? bufIntDigits : minIntegerSize;
 
     if (groupSize < 0)
--- a/content/xul/templates/src/nsRuleNetwork.cpp
+++ b/content/xul/templates/src/nsRuleNetwork.cpp
@@ -200,17 +200,17 @@ Instantiation::Hash(const void* aKey)
     for (nsAssignmentSet::ConstIterator assignment = inst->mAssignments.First();
          assignment != last; ++assignment)
         result ^= assignment->Hash();
 
     return result;
 }
 
 
-PRIntn
+int
 Instantiation::Compare(const void* aLeft, const void* aRight)
 {
     const Instantiation* left  = static_cast<const Instantiation*>(aLeft);
     const Instantiation* right = static_cast<const Instantiation*>(aRight);
 
     return *left == *right;
 }
 
--- a/content/xul/templates/src/nsRuleNetwork.h
+++ b/content/xul/templates/src/nsRuleNetwork.h
@@ -461,17 +461,17 @@ public:
 
     bool operator==(const Instantiation& aInstantiation) const {
         return Equals(aInstantiation); }
 
     bool operator!=(const Instantiation& aInstantiation) const {
         return !Equals(aInstantiation); }
 
     static PLHashNumber Hash(const void* aKey);
-    static PRIntn Compare(const void* aLeft, const void* aRight);
+    static int Compare(const void* aLeft, const void* aRight);
 };
 
 
 //----------------------------------------------------------------------
 
 /**
  * A collection of intantiations
  */
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.cpp
@@ -330,17 +330,17 @@ nsXULTemplateQueryProcessorStorage::Comp
                   &nsGkAtoms::null, &nsGkAtoms::double_, &nsGkAtoms::string, nullptr };
 
             PRInt32 typeError = 1;
             PRInt32 typeValue = child->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
                                                        sTypeValues, eCaseMatters);
             rv = NS_ERROR_ILLEGAL_VALUE;
             PRInt32 valInt32 = 0;
             PRInt64 valInt64 = 0;
-            PRFloat64 valFloat = 0;
+            double valFloat = 0;
 
             switch (typeValue) {
               case 0:
               case 1:
                 typeError = PR_sscanf(NS_ConvertUTF16toUTF8(value).get(),"%d",&valInt32);
                 if (typeError > 0)
                     rv = statement->BindInt32ByIndex(index, valInt32);
                 break;
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1702,34 +1702,40 @@ static nsDOMClassInfoData sClassInfoData
 
 // Objects that should be constructable through |new Name();|
 struct nsContractIDMapData
 {
   PRInt32 mDOMClassInfoID;
   const char *mContractID;
 };
 
-#define NS_DEFINE_CONSTRUCTOR_DATA(_class, _contract_id)                      \
-  { eDOMClassInfo_##_class##_id, _contract_id },
-
-static const nsContractIDMapData kConstructorMap[] =
-{
-  NS_DEFINE_CONSTRUCTOR_DATA(DOMParser, NS_DOMPARSER_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(FileReader, NS_FILEREADER_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(ArchiveReader, NS_ARCHIVEREADER_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(FormData, NS_FORMDATA_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(XMLSerializer, NS_XMLSERIALIZER_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(WebSocket, NS_WEBSOCKET_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(XPathEvaluator, NS_XPATH_EVALUATOR_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(XSLTProcessor,
-                             "@mozilla.org/document-transformer;1?type=xslt")
-  NS_DEFINE_CONSTRUCTOR_DATA(EventSource, NS_EVENTSOURCE_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(MutationObserver, NS_DOMMUTATIONOBSERVER_CONTRACTID)
-  NS_DEFINE_CONSTRUCTOR_DATA(MozActivity, NS_DOMACTIVITY_CONTRACTID)
-};
+#define NS_DEFINE_CONTRACT_CTOR(_class, _contract_id)                           \
+  nsresult                                                                      \
+  _class##Ctor(nsISupports** aInstancePtrResult)                                \
+  {                                                                             \
+    nsresult rv = NS_OK;                                                        \
+    nsCOMPtr<nsISupports> native = do_CreateInstance(_contract_id, &rv);        \
+    native.forget(aInstancePtrResult);                                          \
+    return rv;                                                                  \
+  }
+
+NS_DEFINE_CONTRACT_CTOR(DOMParser, NS_DOMPARSER_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(FileReader, NS_FILEREADER_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(ArchiveReader, NS_ARCHIVEREADER_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(FormData, NS_FORMDATA_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(XMLSerializer, NS_XMLSERIALIZER_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(WebSocket, NS_WEBSOCKET_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(XPathEvaluator, NS_XPATH_EVALUATOR_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(XSLTProcessor,
+                        "@mozilla.org/document-transformer;1?type=xslt")
+NS_DEFINE_CONTRACT_CTOR(EventSource, NS_EVENTSOURCE_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(MutationObserver, NS_DOMMUTATIONOBSERVER_CONTRACTID)
+NS_DEFINE_CONTRACT_CTOR(MozActivity, NS_DOMACTIVITY_CONTRACTID)
+
+#undef NS_DEFINE_CONTRACT_CTOR
 
 #define NS_DEFINE_EVENT_CTOR(_class)                        \
   nsresult                                                  \
   NS_DOM##_class##Ctor(nsISupports** aInstancePtrResult)    \
   {                                                         \
     nsIDOMEvent* e = nullptr;                                \
     nsresult rv = NS_NewDOM##_class(&e, nullptr, nullptr);    \
     *aInstancePtrResult = e;                                \
@@ -1782,30 +1788,40 @@ static const nsConstructorFuncMapData kC
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozWifiConnectionInfoEvent)
 #endif
 #define MOZ_GENERATED_EVENT_LIST
 #define MOZ_GENERATED_EVENT(_event_interface) \
   NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(_event_interface)
 #include "GeneratedEvents.h"
   NS_DEFINE_CONSTRUCTOR_FUNC_DATA(MozSmsFilter, sms::SmsFilter::NewSmsFilter)
   NS_DEFINE_CONSTRUCTOR_FUNC_DATA(XMLHttpRequest, NS_XMLHttpRequestCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(DOMParser, DOMParserCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(FileReader, FileReaderCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(ArchiveReader, ArchiveReaderCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(FormData, FormDataCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(XMLSerializer, XMLSerializerCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(WebSocket, WebSocketCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(XPathEvaluator, XPathEvaluatorCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(XSLTProcessor, XSLTProcessorCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(EventSource, EventSourceCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(MutationObserver, MutationObserverCtor)
+  NS_DEFINE_CONSTRUCTOR_FUNC_DATA(MozActivity, MozActivityCtor)
 };
 
 nsIXPConnect *nsDOMClassInfo::sXPConnect = nullptr;
 nsIScriptSecurityManager *nsDOMClassInfo::sSecMan = nullptr;
 bool nsDOMClassInfo::sIsInitialized = false;
 bool nsDOMClassInfo::sDisableDocumentAllSupport = false;
 bool nsDOMClassInfo::sDisableGlobalScopePollutionSupport = false;
 
 
 jsid nsDOMClassInfo::sParent_id          = JSID_VOID;
 jsid nsDOMClassInfo::sScrollbars_id      = JSID_VOID;
 jsid nsDOMClassInfo::sLocation_id        = JSID_VOID;
 jsid nsDOMClassInfo::sConstructor_id     = JSID_VOID;
-jsid nsDOMClassInfo::s_content_id        = JSID_VOID;
 jsid nsDOMClassInfo::sContent_id         = JSID_VOID;
 jsid nsDOMClassInfo::sMenubar_id         = JSID_VOID;
 jsid nsDOMClassInfo::sToolbar_id         = JSID_VOID;
 jsid nsDOMClassInfo::sLocationbar_id     = JSID_VOID;
 jsid nsDOMClassInfo::sPersonalbar_id     = JSID_VOID;
 jsid nsDOMClassInfo::sStatusbar_id       = JSID_VOID;
 jsid nsDOMClassInfo::sDialogArguments_id = JSID_VOID;
 jsid nsDOMClassInfo::sControllers_id     = JSID_VOID;
@@ -2072,17 +2088,16 @@ nsDOMClassInfo::DefineStaticJSVals(JSCon
       return NS_ERROR_OUT_OF_MEMORY;
 
   JSAutoRequest ar(cx);
 
   SET_JSID_TO_STRING(sParent_id,          cx, "parent");
   SET_JSID_TO_STRING(sScrollbars_id,      cx, "scrollbars");
   SET_JSID_TO_STRING(sLocation_id,        cx, "location");
   SET_JSID_TO_STRING(sConstructor_id,     cx, "constructor");
-  SET_JSID_TO_STRING(s_content_id,        cx, "_content");
   SET_JSID_TO_STRING(sContent_id,         cx, "content");
   SET_JSID_TO_STRING(sMenubar_id,         cx, "menubar");
   SET_JSID_TO_STRING(sToolbar_id,         cx, "toolbar");
   SET_JSID_TO_STRING(sLocationbar_id,     cx, "locationbar");
   SET_JSID_TO_STRING(sPersonalbar_id,     cx, "personalbar");
   SET_JSID_TO_STRING(sStatusbar_id,       cx, "statusbar");
   SET_JSID_TO_STRING(sDialogArguments_id, cx, "dialogArguments");
   SET_JSID_TO_STRING(sControllers_id,     cx, "controllers");
@@ -2180,33 +2195,16 @@ CutPrefix(const char *aName) {
     return aName + sizeof(prefix_nsI) - 1;
   }
 
   return aName;
 }
 
 // static
 nsresult
-nsDOMClassInfo::RegisterClassName(PRInt32 aClassInfoID)
-{
-  nsScriptNameSpaceManager *nameSpaceManager =
-    nsJSRuntime::GetNameSpaceManager();
-  NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
-
-  nameSpaceManager->RegisterClassName(sClassInfoData[aClassInfoID].mName,
-                                      aClassInfoID,
-                                      sClassInfoData[aClassInfoID].mChromeOnly,
-                                      sClassInfoData[aClassInfoID].mDisabled,
-                                      &sClassInfoData[aClassInfoID].mNameUTF16);
-
-  return NS_OK;
-}
-
-// static
-nsresult
 nsDOMClassInfo::RegisterClassProtos(PRInt32 aClassInfoID)
 {
   nsScriptNameSpaceManager *nameSpaceManager =
     nsJSRuntime::GetNameSpaceManager();
   NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
   bool found_old;
 
   const nsIID *primary_iid = sClassInfoData[aClassInfoID].mProtoChainInterface;
@@ -4540,17 +4538,19 @@ nsDOMClassInfo::Init()
 #endif
 
   // Initialize static JSString's
   DefineStaticJSVals(cx);
 
   PRInt32 i;
 
   for (i = 0; i < eDOMClassInfoIDCount; ++i) {
-    RegisterClassName(i);
+    nsDOMClassInfoData& data = sClassInfoData[i];
+    nameSpaceManager->RegisterClassName(data.mName, i, data.mChromeOnly,
+                                        data.mDisabled, &data.mNameUTF16);
   }
 
   for (i = 0; i < eDOMClassInfoIDCount; ++i) {
     RegisterClassProtos(i);
   }
 
   RegisterExternalClasses();
 
@@ -5199,17 +5199,16 @@ nsDOMClassInfo::ShutDown()
       NS_IF_RELEASE(sClassInfoData[i].mCachedClassInfo);
     }
   }
 
   sParent_id          = JSID_VOID;
   sScrollbars_id      = JSID_VOID;
   sLocation_id        = JSID_VOID;
   sConstructor_id     = JSID_VOID;
-  s_content_id        = JSID_VOID;
   sContent_id         = JSID_VOID;
   sMenubar_id         = JSID_VOID;
   sToolbar_id         = JSID_VOID;
   sLocationbar_id     = JSID_VOID;
   sPersonalbar_id     = JSID_VOID;
   sStatusbar_id       = JSID_VOID;
   sDialogArguments_id = JSID_VOID;
   sControllers_id     = JSID_VOID;
@@ -5638,29 +5637,16 @@ nsWindowSH::Enumerate(nsIXPConnectWrappe
 {
   if (!ObjectIsNativeWrapper(cx, obj)) {
     *_retval = JS_EnumerateStandardClasses(cx, obj);
   }
 
   return NS_OK;
 }
 
-static const char*
-FindConstructorContractID(const nsDOMClassInfoData *aDOMClassInfoData)
-{
-  PRUint32 i;
-  for (i = 0; i < ArrayLength(kConstructorMap); ++i) {
-    if (&sClassInfoData[kConstructorMap[i].mDOMClassInfoID] ==
-        aDOMClassInfoData) {
-      return kConstructorMap[i].mContractID;
-    }
-  }
-  return nullptr;
-}
-
 static nsDOMConstructorFunc
 FindConstructorFunc(const nsDOMClassInfoData *aDOMClassInfoData)
 {
   for (PRUint32 i = 0; i < ArrayLength(kConstructorFuncMap); ++i) {
     if (&sClassInfoData[kConstructorFuncMap[i].mDOMClassInfoID] ==
         aDOMClassInfoData) {
       return kConstructorFuncMap[i].mConstructorFunc;
     }
@@ -5673,28 +5659,21 @@ BaseStubConstructor(nsIWeakReference* aW
                     const nsGlobalNameStruct *name_struct, JSContext *cx,
                     JSObject *obj, unsigned argc, jsval *argv, jsval *rval)
 {
   nsresult rv;
   nsCOMPtr<nsISupports> native;
   if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
     const nsDOMClassInfoData* ci_data =
       &sClassInfoData[name_struct->mDOMClassInfoID];
-    const char *contractid = FindConstructorContractID(ci_data);
-    if (contractid) {
-      native = do_CreateInstance(contractid, &rv);
-    }
-    else {
-      nsDOMConstructorFunc func = FindConstructorFunc(ci_data);
-      if (func) {
-        rv = func(getter_AddRefs(native));
-      }
-      else {
-        rv = NS_ERROR_NOT_AVAILABLE;
-      }
+    nsDOMConstructorFunc func = FindConstructorFunc(ci_data);
+    if (func) {
+      rv = func(getter_AddRefs(native));
+    } else {
+      rv = NS_ERROR_NOT_AVAILABLE;
     }
   } else if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructor) {
     native = do_CreateInstance(name_struct->mCID, &rv);
   } else if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {
     native = do_CreateInstance(name_struct->mAlias->mCID, &rv);
   } else {
     native = do_CreateInstance(*name_struct->mData->mConstructorCID, &rv);
   }
@@ -6097,17 +6076,17 @@ private:
   static bool IsConstructable(const nsDOMClassInfoData *aData)
   {
     if (IS_EXTERNAL(aData->mCachedClassInfo)) {
       const nsExternalDOMClassInfoData* data =
         static_cast<const nsExternalDOMClassInfoData*>(aData);
       return data->mConstructorCID != nullptr;
     }
 
-    return FindConstructorContractID(aData) || FindConstructorFunc(aData);
+    return FindConstructorFunc(aData);
   }
   static bool IsConstructable(const nsGlobalNameStruct *aNameStruct)
   {
     return
       (aNameStruct->mType == nsGlobalNameStruct::eTypeClassConstructor &&
        IsConstructable(&sClassInfoData[aNameStruct->mDOMClassInfoID])) ||
       (aNameStruct->mType == nsGlobalNameStruct::eTypeExternalClassInfo &&
        IsConstructable(aNameStruct->mData)) ||
@@ -6957,28 +6936,16 @@ nsWindowSH::GlobalResolve(nsGlobalWindow
     rv = nameset->InitializeNameSet(context);
 
     *did_resolve = true;
   }
 
   return rv;
 }
 
-// Native code for window._content getter, this simply maps
-// window._content to window.content for backwards compatibility only.
-static JSBool
-ContentWindowGetter(JSContext *cx, unsigned argc, jsval *vp)
-{
-  JSObject *obj = JS_THIS_OBJECT(cx, vp);
-  if (!obj)
-    return JS_FALSE;
-
-  return ::JS_GetProperty(cx, obj, "content", vp);
-}
-
 static JSNewResolveOp sOtherResolveFuncs[] = {
   mozilla::dom::workers::ResolveWorkerClasses
 };
 
 template<class Interface>
 static nsresult
 LocationSetterGuts(JSContext *cx, JSObject *obj, jsval *vp)
 {
@@ -7080,78 +7047,76 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
       }
     }
 
     return NS_OK;
   }
 
   nsIScriptContext *my_context = win->GetContextInternal();
 
-  nsresult rv = NS_OK;
-
   // Resolve standard classes on my_context's JSContext (or on cx,
   // if we don't have a my_context yet), in case the two contexts
   // have different origins.  We want lazy standard class
   // initialization to behave as if it were done eagerly, on each
   // window's own context (not on some other window-caller's
   // context).
-
-  JSBool did_resolve = JS_FALSE;
-  JSContext *my_cx;
-
-  JSBool ok = JS_TRUE;
-  jsval exn = JSVAL_VOID;
   if (!ObjectIsNativeWrapper(cx, obj)) {
-    JSAutoEnterCompartment ac;
-
-    if (!my_context) {
-      my_cx = cx;
-    } else {
-      my_cx = my_context->GetNativeContext();
-
-      if (my_cx != cx) {
-        if (!ac.enter(my_cx, obj)) {
-          return NS_ERROR_UNEXPECTED;
+    JSBool did_resolve = JS_FALSE;
+    JSBool ok = JS_TRUE;
+    JS::Value exn = JSVAL_VOID;
+
+    {
+      JSAutoEnterCompartment ac;
+
+      JSContext* my_cx;
+      if (!my_context) {
+        my_cx = cx;
+      } else {
+        my_cx = my_context->GetNativeContext();
+
+        if (my_cx != cx) {
+          if (!ac.enter(my_cx, obj)) {
+            return NS_ERROR_UNEXPECTED;
+          }
         }
       }
-    }
-
-    JSAutoRequest transfer(my_cx);
-
-    // Don't resolve standard classes on XPCNativeWrapper etc, only
-    // resolve them if we're resolving on the real global object.
-    ok = JS_ResolveStandardClass(my_cx, obj, id, &did_resolve);
+
+      JSAutoRequest transfer(my_cx);
+
+      // Don't resolve standard classes on XPCNativeWrapper etc, only
+      // resolve them if we're resolving on the real global object.
+      ok = JS_ResolveStandardClass(my_cx, obj, id, &did_resolve);
+
+      if (!ok) {
+        // Trust the JS engine (or the script security manager) to set
+        // the exception in the JS engine.
+
+        if (!JS_GetPendingException(my_cx, &exn)) {
+          return NS_ERROR_UNEXPECTED;
+        }
+
+        // Return NS_OK to avoid stomping over the exception that was passed
+        // down from the ResolveStandardClass call.
+        // Note that the order of the JS_ClearPendingException and
+        // JS_SetPendingException is important in the case that my_cx == cx.
+
+        JS_ClearPendingException(my_cx);
+      }
+    }
 
     if (!ok) {
-      // Trust the JS engine (or the script security manager) to set
-      // the exception in the JS engine.
-
-      if (!JS_GetPendingException(my_cx, &exn)) {
-        return NS_ERROR_UNEXPECTED;
-      }
-
-      // Return NS_OK to avoid stomping over the exception that was passed
-      // down from the ResolveStandardClass call.
-      // Note that the order of the JS_ClearPendingException and
-      // JS_SetPendingException is important in the case that my_cx == cx.
-
-      JS_ClearPendingException(my_cx);
-    }
-  }
-
-  if (!ok) {
-    JS_SetPendingException(cx, exn);
-    *_retval = JS_FALSE;
-    return NS_OK;
-  }
-
-  if (did_resolve) {
-    *objp = obj;
-
-    return NS_OK;
+      JS_SetPendingException(cx, exn);
+      *_retval = JS_FALSE;
+      return NS_OK;
+    }
+
+    if (did_resolve) {
+      *objp = obj;
+      return NS_OK;
+    }
   }
 
   if (!(flags & JSRESOLVE_ASSIGNING)) {
     // We want this code to be before the child frame lookup code
     // below so that a child frame named 'constructor' doesn't
     // shadow the window's constructor property.
     if (sConstructor_id == id) {
       return ResolveConstructor(cx, obj, objp);
@@ -7160,16 +7125,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
 
   if (!my_context || !my_context->IsContextInitialized()) {
     // The context is not yet initialized so there's nothing we can do
     // here yet.
 
     return NS_OK;
   }
 
+  nsresult rv = NS_OK;
   if (sLocation_id == id) {
     // This must be done even if we're just getting the value of
     // window.location (i.e. no checking flags & JSRESOLVE_ASSIGNING
     // here) since we must define window.location to prevent the
     // getter from being overriden (for security reasons).
 
     // Note: Because we explicitly don't forward to the inner window
     // above, we have to ensure here that our window has a current
@@ -7301,46 +7267,16 @@ nsWindowSH::NewResolve(nsIXPConnectWrapp
     if (did_resolve) {
       // GlobalResolve() resolved something, so we're done here.
       *objp = obj;
 
       return NS_OK;
     }
   }
 
-  if (s_content_id == id) {
-    // Map window._content to window.content for backwards
-    // compatibility, this should spit out an message on the JS
-    // console.
-
-    JSObject *windowObj = win->GetGlobalJSObject();
-
-    JSAutoRequest ar(cx);
-
-    JSFunction *fun = ::JS_NewFunction(cx, ContentWindowGetter, 0, 0,
-                                       windowObj, "_content");
-    if (!fun) {
-      return NS_ERROR_OUT_OF_MEMORY;
-    }
-
-    JSObject *funObj = ::JS_GetFunctionObject(fun);
-
-    if (!::JS_DefinePropertyById(cx, windowObj, id, JSVAL_VOID,
-                                 JS_DATA_TO_FUNC_PTR(JSPropertyOp, funObj),
-                                 nullptr,
-                                 JSPROP_ENUMERATE | JSPROP_GETTER |
-                                 JSPROP_SHARED)) {
-      return NS_ERROR_FAILURE;
-    }
-
-    *objp = obj;
-
-    return NS_OK;
-  }
-
   if (flags & JSRESOLVE_ASSIGNING) {
     if (IsReadonlyReplaceable(id) ||
         (!(flags & JSRESOLVE_QUALIFIED) && IsWritableReplaceable(id))) {
       // A readonly "replaceable" property is being set, or a
       // readwrite "replaceable" property is being set w/o being
       // fully qualified. Define the property on obj with the value
       // undefined to override the predefined property. This is done
       // for compatibility with other browsers.
@@ -9060,25 +8996,26 @@ GetDocumentAllHelper(JSObject *obj)
   }
 
   return obj;
 }
 
 static inline void *
 FlagsToPrivate(PRUint32 flags)
 {
-  JS_ASSERT((flags & (1 << 31)) == 0);
-  return (void *)(flags << 1);
+  MOZ_ASSERT((flags & (1 << 31)) == 0);
+  return reinterpret_cast<void*>(static_cast<uintptr_t>(flags << 1));
 }
 
 static inline PRUint32
 PrivateToFlags(void *priv)
 {
-  JS_ASSERT(size_t(priv) <= PR_UINT32_MAX && (size_t(priv) & 1) == 0);
-  return (PRUint32)(size_t(priv) >> 1);
+  uintptr_t intPriv = reinterpret_cast<uintptr_t>(priv);
+  MOZ_ASSERT(intPriv <= PR_UINT32_MAX && (intPriv & 1) == 0);
+  return static_cast<PRUint32>(intPriv >> 1);
 }
 
 JSBool
 nsHTMLDocumentSH::DocumentAllHelperGetProperty(JSContext *cx, JSHandleObject obj,
                                                JSHandleId id, JSMutableHandleValue vp)
 {
   if (nsDOMClassInfo::sAll_id != id) {
     return JS_TRUE;
@@ -9573,24 +9510,28 @@ nsHTMLSelectElementSH::GetProperty(nsIXP
 // static
 nsresult
 nsHTMLSelectElementSH::SetOption(JSContext *cx, JS::Value *vp, PRUint32 aIndex,
                                  nsIDOMHTMLOptionsCollection *aOptCollection)
 {
   JSAutoRequest ar(cx);
 
   // vp must refer to an object
-  if (!vp->isObject()) {
+  if (!vp->isObjectOrNull()) {
     return NS_ERROR_UNEXPECTED;
   }
 
-  nsCOMPtr<nsIDOMHTMLOptionElement> new_option = do_QueryWrapper(cx, &vp->toObject());
-  if (!new_option) {
-    // Someone is trying to set an option to a non-option object.
-    return NS_ERROR_UNEXPECTED;
+  nsCOMPtr<nsIDOMHTMLOptionElement> new_option;
+
+  if (JSObject* obj = vp->toObjectOrNull()) {
+    new_option = do_QueryWrapper(cx, obj);
+    if (!new_option) {
+      // Someone is trying to set an option to a non-option object.
+      return NS_ERROR_UNEXPECTED;
+    }
   }
 
   return aOptCollection->SetOption(aIndex, new_option);
 }
 
 NS_IMETHODIMP
 nsHTMLSelectElementSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
                                    JSContext *cx, JSObject *obj, jsid id,
--- a/dom/base/nsDOMClassInfo.h
+++ b/dom/base/nsDOMClassInfo.h
@@ -152,17 +152,16 @@ protected:
   }
 
   virtual PRUint32 GetInterfacesBitmap()
   {
     return mData->mInterfacesBitmap;
   }
 
   static nsresult Init();
-  static nsresult RegisterClassName(PRInt32 aDOMClassInfoID);
   static nsresult RegisterClassProtos(PRInt32 aDOMClassInfoID);
   static nsresult RegisterExternalClasses();
   nsresult ResolveConstructor(JSContext *cx, JSObject *obj,
                               JSObject **objp);
 
   // Checks if id is a number and returns the number, if aIsNumber is
   // non-null it's set to true if the id is a number and false if it's
   // not a number. If id is not a number this method returns -1
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1001,17 +1001,17 @@ nsDOMWindowUtils::CycleCollect(nsICycleC
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SendSimpleGestureEvent(const nsAString& aType,
                                          float aX,
                                          float aY,
                                          PRUint32 aDirection,
-                                         PRFloat64 aDelta,
+                                         double aDelta,
                                          PRInt32 aModifiers,
                                          PRUint32 aClickCount)
 {
   if (!IsUniversalXPConnectCapable()) {
     return NS_ERROR_DOM_SECURITY_ERR;
   }
 
   // get the widget to send the event to
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -3080,16 +3080,24 @@ nsGlobalWindow::GetTopImpl(nsIDOMWindow*
 
   if (parent) {
     parent.swap(*aTop);
   }
 
   return NS_OK;
 }
 
+// Map window._content to window.content for backwards compatibility, this
+// should spit out an message on the JS console.
+NS_IMETHODIMP
+nsGlobalWindow::GetContentForCompat(nsIDOMWindow** aContent)
+{
+  return GetContent(aContent);
+}
+
 NS_IMETHODIMP
 nsGlobalWindow::GetContent(nsIDOMWindow** aContent)
 {
   FORWARD_TO_OUTER(GetContent, (aContent), NS_ERROR_NOT_INITIALIZED);
   *aContent = nullptr;
 
   // If we're contained in <iframe mozbrowser>, then GetContent is the same as
   // window.top.
@@ -3124,17 +3132,17 @@ nsGlobalWindow::GetContent(nsIDOMWindow*
     nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
     GetTreeOwner(getter_AddRefs(treeOwner));
     NS_ENSURE_TRUE(treeOwner, NS_ERROR_FAILURE);
 
     treeOwner->GetPrimaryContentShell(getter_AddRefs(primaryContent));
   }
 
   nsCOMPtr<nsIDOMWindow> domWindow(do_GetInterface(primaryContent));
-  NS_IF_ADDREF(*aContent = domWindow);
+  domWindow.forget(aContent);
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
 nsGlobalWindow::GetPrompter(nsIPrompt** aPrompt)
 {
--- a/dom/interfaces/base/nsIDOMJSWindow.idl
+++ b/dom/interfaces/base/nsIDOMJSWindow.idl
@@ -1,16 +1,16 @@
 /* -*- Mode: IDL; 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/. */
 
 #include "domstubs.idl"
 
-[scriptable, uuid(6652c4d2-6b49-424b-aaf9-91f91006fab7)]
+[scriptable, uuid(1f4da4d4-1d72-4709-8207-3665dbaac4b4)]
 interface nsIDOMJSWindow : nsISupports
 {
   void                      dump(in DOMString str);
 
   /**
    * These methods take typeless arguments and optional arguments, the
    * first argument is either a function or a string, the second
    * argument must be a number (ms) and the rest of the arguments (2
@@ -71,9 +71,12 @@ interface nsIDOMJSWindow : nsISupports
    * window.frames in Netscape 4.x and IE is just a reference to the
    * window itself (i.e. window.frames === window), but this doesn't
    * make sense from a generic API point of view so that's why this is
    * JS specific.
    *
    * This property is "replaceable" in JavaScript.
    */
   readonly attribute nsIDOMWindow             frames;
+
+  [binaryname(ContentForCompat)]
+  readonly attribute nsIDOMWindow             _content;
 };
--- a/dom/plugins/base/nsPluginNativeWindowGtk2.cpp
+++ b/dom/plugins/base/nsPluginNativeWindowGtk2.cpp
@@ -23,16 +23,25 @@
 
 class nsPluginNativeWindowGtk2 : public nsPluginNativeWindow {
 public: 
   nsPluginNativeWindowGtk2();
   virtual ~nsPluginNativeWindowGtk2();
 
   virtual nsresult CallSetWindow(nsRefPtr<nsNPAPIPluginInstance> &aPluginInstance);
 private:
+  void SetWindow(XID aWindow)
+  {
+    window = reinterpret_cast<void*>(static_cast<uintptr_t>(aWindow));
+  }
+  XID GetWindow() const
+  {
+    return static_cast<XID>(reinterpret_cast<uintptr_t>(window));
+  }
+
   NPSetWindowCallbackStruct mWsInfo;
   /**
    * Either a GtkSocket or a special GtkXtBin widget (derived from GtkSocket)
    * that encapsulates the Xt toolkit within a Gtk Application.
    */
   GtkWidget* mSocketWidget;
   nsresult  CreateXEmbedWindow(bool aEnableXtFocus);
   nsresult  CreateXtWindow();
@@ -126,21 +135,21 @@ nsresult nsPluginNativeWindowGtk2::CallS
       }
 
       // Make sure to resize and re-place the window if required.
       // Need to reset "window" each time as nsObjectFrame::DidReflow sets it
       // to the ancestor window.
       if (GTK_IS_XTBIN(mSocketWidget)) {
         gtk_xtbin_resize(mSocketWidget, width, height);
         // Point the NPWindow structures window to the actual X window
-        window = (void*)GTK_XTBIN(mSocketWidget)->xtwindow;
+        SetWindow(GTK_XTBIN(mSocketWidget)->xtwindow);
       }
       else { // XEmbed or OOP&Xt
         SetAllocation();
-        window = (void*)gtk_socket_get_id(GTK_SOCKET(mSocketWidget));
+        SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));
       }
 #ifdef DEBUG
       printf("nsPluginNativeWindowGtk2: call SetWindow with xid=%p\n", (void *)window);
 #endif
     } // NPWindowTypeWindow
     aPluginInstance->SetWindow(this);
   }
   else if (mPluginInstance)
@@ -148,17 +157,17 @@ nsresult nsPluginNativeWindowGtk2::CallS
 
   SetPluginInstance(aPluginInstance);
   return NS_OK;
 }
 
 nsresult nsPluginNativeWindowGtk2::CreateXEmbedWindow(bool aEnableXtFocus) {
   NS_ASSERTION(!mSocketWidget,"Already created a socket widget!");
   GdkDisplay *display = gdk_display_get_default();
-  GdkWindow *parent_win = gdk_x11_window_lookup_for_display(display, (XID)window);
+  GdkWindow *parent_win = gdk_x11_window_lookup_for_display(display, GetWindow());
   mSocketWidget = gtk_socket_new();
 
   //attach the socket to the container widget
   gtk_widget_set_parent_window(mSocketWidget, parent_win);
 
   // enable/disable focus event handlers,
   // see plugin_window_filter_func() for details
   g_object_set_data(G_OBJECT(mSocketWidget), "enable-xt-focus", (void *)aEnableXtFocus);
@@ -194,21 +203,21 @@ nsresult nsPluginNativeWindowGtk2::Creat
 #endif
 
   // Resize before we show
   SetAllocation();
 
   gtk_widget_show(mSocketWidget);
 
   gdk_flush();
-  window = (void*)gtk_socket_get_id(GTK_SOCKET(mSocketWidget));
+  SetWindow(gtk_socket_get_id(GTK_SOCKET(mSocketWidget)));
 
   // Fill out the ws_info structure.
   // (The windowless case is done in nsObjectFrame.cpp.)
-  GdkWindow *gdkWindow = gdk_window_lookup((XID)window);
+  GdkWindow *gdkWindow = gdk_window_lookup(GetWindow());
   if(!gdkWindow)
     return NS_ERROR_FAILURE;
 
   mWsInfo.display = GDK_WINDOW_XDISPLAY(gdkWindow);
 #if (MOZ_WIDGET_GTK == 2)
   mWsInfo.colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(gdkWindow));
   GdkVisual* gdkVisual = gdk_drawable_get_visual(gdkWindow);
   mWsInfo.depth = gdkVisual->depth;
@@ -237,17 +246,17 @@ void nsPluginNativeWindowGtk2::SetAlloca
 nsresult nsPluginNativeWindowGtk2::CreateXtWindow() {
   NS_ASSERTION(!mSocketWidget,"Already created a socket widget!");
 
 #ifdef DEBUG      
   printf("About to create new xtbin of %i X %i from %p...\n",
          width, height, (void*)window);
 #endif
   GdkDisplay *display = gdk_display_get_default();
-  GdkWindow *gdkWindow = gdk_x11_window_lookup_for_display(display, (XID)window);
+  GdkWindow *gdkWindow = gdk_x11_window_lookup_for_display(display, GetWindow());
   mSocketWidget = gtk_xtbin_new(gdkWindow, 0);
   // Check to see if creating the xtbin failed for some reason.
   // if it did, we can't go any further.
   if (!mSocketWidget)
     return NS_ERROR_FAILURE;
 
   g_signal_connect(mSocketWidget, "destroy",
                    G_CALLBACK(gtk_widget_destroyed), &mSocketWidget);
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -401,17 +401,17 @@ PluginInstanceParent::AnswerNPN_SetValue
             gfxWindowsPlatform::GetPlatform()->GetRenderMode() != gfxWindowsPlatform::RENDER_DIRECT2D) {
             *result = NPERR_GENERIC_ERROR;
             return true;
         }
 #endif
 
         mDrawingModel = drawingModel;
         *result = mNPNIface->setvalue(mNPP, NPPVpluginDrawingModel,
-                                        (void*)drawingModel);
+                                      reinterpret_cast<void*>(static_cast<uintptr_t>(drawingModel)));
 
 
         if (*result != NPERR_NO_ERROR) {
             return true;
         }
 
         AllocUnsafeShmem(sizeof(RemoteImageData), SharedMemory::TYPE_BASIC, &mRemoteImageDataShmem);
 
--- a/editor/libeditor/html/nsHTMLCSSUtils.cpp
+++ b/editor/libeditor/html/nsHTMLCSSUtils.cpp
@@ -637,17 +637,16 @@ nsHTMLCSSUtils::GetComputedStyle(nsIDOME
 }
 
 already_AddRefed<nsComputedDOMStyle>
 nsHTMLCSSUtils::GetComputedStyle(dom::Element* aElement)
 {
   MOZ_ASSERT(aElement);
 
   nsIDocument* doc = aElement->GetCurrentDoc();
-  NS_ASSERTION(doc, "Trying to compute style of detached element");
   NS_ENSURE_TRUE(doc, nullptr);
 
   nsIPresShell* presShell = doc->GetShell();
   NS_ASSERTION(presShell, "Trying to compute style without PresShell");
   NS_ENSURE_TRUE(presShell, nullptr);
 
   nsRefPtr<nsComputedDOMStyle> style =
     NS_NewComputedDOMStyle(aElement, EmptyString(), presShell);
--- a/editor/libeditor/html/nsHTMLEditor.cpp
+++ b/editor/libeditor/html/nsHTMLEditor.cpp
@@ -706,17 +706,16 @@ AssertParserServiceIsCorrect(nsIAtom* aT
       aTag==nsEditProperty::ol         ||
       aTag==nsEditProperty::dl         ||
       aTag==nsEditProperty::noscript   ||
       aTag==nsEditProperty::form       ||
       aTag==nsEditProperty::hr         ||
       aTag==nsEditProperty::table      ||
       aTag==nsEditProperty::fieldset   ||
       aTag==nsEditProperty::address    ||
-      aTag==nsEditProperty::caption    ||
       aTag==nsEditProperty::col        ||
       aTag==nsEditProperty::colgroup   ||
       aTag==nsEditProperty::li         ||
       aTag==nsEditProperty::dt         ||
       aTag==nsEditProperty::dd         ||
       aTag==nsEditProperty::legend     )
   {
     if (!aIsBlock) {
@@ -3518,19 +3517,16 @@ nsHTMLEditor::TagCanContainTag(nsIAtom* 
   // XXX Should this handle #cdata-section too?
   if (aChildTag == nsGkAtoms::textTagName) {
     childTagEnum = eHTMLTag_text;
   } else {
     childTagEnum = parserService->HTMLAtomTagToId(aChildTag);
   }
 
   PRInt32 parentTagEnum = parserService->HTMLAtomTagToId(aParentTag);
-  NS_ASSERTION(parentTagEnum < NS_HTML_TAG_MAX,
-               "Fix the caller, this type of node can never contain children.");
-
   return nsHTMLEditUtils::CanContain(parentTagEnum, childTagEnum);
 }
 
 bool
 nsHTMLEditor::IsContainer(nsIDOMNode *aNode)
 {
   if (!aNode) {
     return false;
--- a/gfx/layers/basic/BasicThebesLayer.h
+++ b/gfx/layers/basic/BasicThebesLayer.h
@@ -193,15 +193,15 @@ private:
   // When it goes out of scope on the stack, it unmaps whichever
   // buffers have been mapped (if any).
   AutoBufferTracker* mBufferTracker;
 
   bool mIsNewBuffer;
   OptionalThebesBuffer mROFrontBuffer;
   nsIntRegion mFrontUpdatedRegion;
   nsIntRegion mFrontValidRegion;
-  PRPackedBool mFrontAndBackBufferDiffer;
+  bool mFrontAndBackBufferDiffer;
 };
 
 }
 }
 
 #endif
--- a/gfx/src/nsColor.cpp
+++ b/gfx/src/nsColor.cpp
@@ -222,26 +222,26 @@ NS_GFX_(bool) NS_ColorNameToRGB(const ns
 // equivalent to target = (bg*(255-fgalpha) + fg*fgalpha)/255
 #define MOZ_BLEND(target, bg, fg, fgalpha)       \
   FAST_DIVIDE_BY_255(target, (bg)*(255-fgalpha) + (fg)*(fgalpha))
 
 NS_GFX_(nscolor)
 NS_ComposeColors(nscolor aBG, nscolor aFG)
 {
   // This function uses colors that are non premultiplied alpha.
-  PRIntn r, g, b, a;
+  int r, g, b, a;
 
-  PRIntn bgAlpha = NS_GET_A(aBG);
-  PRIntn fgAlpha = NS_GET_A(aFG);
+  int bgAlpha = NS_GET_A(aBG);
+  int fgAlpha = NS_GET_A(aFG);
 
   // Compute the final alpha of the blended color
   // a = fgAlpha + bgAlpha*(255 - fgAlpha)/255;
   FAST_DIVIDE_BY_255(a, bgAlpha*(255-fgAlpha));
   a = fgAlpha + a;
-  PRIntn blendAlpha;
+  int blendAlpha;
   if (a == 0) {
     // In this case the blended color is totally trasparent,
     // we preserve the color information of the foreground color.
     blendAlpha = 255;
   } else {
     blendAlpha = (fgAlpha*255)/a;
   }
   MOZ_BLEND(r, NS_GET_R(aBG), NS_GET_R(aFG), blendAlpha);
--- a/image/decoders/nsPNGDecoder.cpp
+++ b/image/decoders/nsPNGDecoder.cpp
@@ -127,17 +127,17 @@ void nsPNGDecoder::SetAnimFrameInfo()
     timeout = 0; // SetFrameTimeout() will set to a minimum
   } else {
     if (delay_den == 0)
       delay_den = 100; // so says the APNG spec
 
     // Need to cast delay_num to float to have a proper division and
     // the result to int to avoid compiler warning
     timeout = static_cast<PRInt32>
-              (static_cast<PRFloat64>(delay_num) * 1000 / delay_den);
+              (static_cast<double>(delay_num) * 1000 / delay_den);
   }
 
   PRUint32 numFrames = mImage.GetNumFrames();
 
   mImage.SetFrameTimeout(numFrames - 1, timeout);
 
   if (dispose_op == PNG_DISPOSE_OP_PREVIOUS)
       mImage.SetFrameDisposalMethod(numFrames - 1,
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -1526,17 +1526,17 @@ RasterImage::AddSourceData(const char *a
            discardable_source_bytes));
 
   return NS_OK;
 }
 
 /* Note!  buf must be declared as char buf[9]; */
 // just used for logging and hashing the header
 static void
-get_header_str (char *buf, char *data, PRSize data_len)
+get_header_str (char *buf, char *data, size_t data_len)
 {
   int i;
   int n;
   static char hex[] = "0123456789abcdef";
 
   n = data_len < 4 ? data_len : 4;
 
   for (i = 0; i < n; i++) {
--- a/image/src/imgLoader.cpp
+++ b/image/src/imgLoader.cpp
@@ -807,17 +807,17 @@ imgCacheObserver *gCacheObserver;
 imgCacheExpirationTracker *gCacheTracker;
 
 imgLoader::imgCacheTable imgLoader::sCache;
 imgCacheQueue imgLoader::sCacheQueue;
 
 imgLoader::imgCacheTable imgLoader::sChromeCache;
 imgCacheQueue imgLoader::sChromeCacheQueue;
 
-PRFloat64 imgLoader::sCacheTimeWeight;
+double imgLoader::sCacheTimeWeight;
 PRUint32 imgLoader::sCacheMaxSize;
 
 NS_IMPL_ISUPPORTS5(imgLoader, imgILoader, nsIContentSniffer, imgICache, nsISupportsWeakReference, nsIObserver)
 
 imgLoader::imgLoader()
 {
   /* member initializers and constructor code */
 }
--- a/image/src/imgLoader.h
+++ b/image/src/imgLoader.h
@@ -319,17 +319,17 @@ private: // data
   friend class imgCacheEntry;
   friend class imgMemoryReporter;
 
   static imgCacheTable sCache;
   static imgCacheQueue sCacheQueue;
 
   static imgCacheTable sChromeCache;
   static imgCacheQueue sChromeCacheQueue;
-  static PRFloat64 sCacheTimeWeight;
+  static double sCacheTimeWeight;
   static PRUint32 sCacheMaxSize;
 
   nsCString mAcceptHeader;
 };
 
 
 
 /**
--- a/intl/locale/src/nsLocale.cpp
+++ b/intl/locale/src/nsLocale.cpp
@@ -89,25 +89,25 @@ nsLocale::Hash_HashFunction(const void* 
 
   while (*ptr)
     hash += (PLHashNumber) *ptr++;
 
   return hash;
 }
 
 
-PRIntn
+int
 nsLocale::Hash_CompareNSString(const void* s1, const void* s2)
 {
   return !nsCRT::strcmp((const PRUnichar *) s1, (const PRUnichar *) s2);
 }
 
 
-PRIntn
-nsLocale::Hash_EnumerateDelete(PLHashEntry *he, PRIntn hashIndex, void *arg)
+int
+nsLocale::Hash_EnumerateDelete(PLHashEntry *he, int hashIndex, void *arg)
 {
   // delete an entry
   nsMemory::Free((PRUnichar *)he->key);
   nsMemory::Free((PRUnichar *)he->value);
 
   return (HT_ENUMERATE_NEXT | HT_ENUMERATE_REMOVE);
 }
 
--- a/intl/locale/src/nsLocale.h
+++ b/intl/locale/src/nsLocale.h
@@ -36,18 +36,18 @@ public:
 	/* Declare methods from nsILocale */
 	NS_DECL_NSILOCALE
 
 protected:
 	
 	NS_IMETHOD AddCategory(const nsAString& category, const nsAString& value);
 
 	static PLHashNumber Hash_HashFunction(const void* key);
-	static PRIntn Hash_CompareNSString(const void* s1, const void* s2);
-	static PRIntn Hash_EnumerateDelete(PLHashEntry *he, PRIntn hashIndex, void *arg);
+	static int Hash_CompareNSString(const void* s1, const void* s2);
+	static int Hash_EnumerateDelete(PLHashEntry *he, int hashIndex, void *arg);
 
 	PLHashTable*	fHashtable;
 	PRUint32		fCategoryCount;
 
 };
 
 
 #endif
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1009,17 +1009,17 @@ GetTranslationForThebesLayer(ThebesLayer
     NS_ERROR("ThebesLayers should have integer translations only");
     return nsIntPoint(0, 0);
   }
   return nsIntPoint(PRInt32(transform.x0), PRInt32(transform.y0));
 }
 
 static const double SUBPIXEL_OFFSET_EPSILON = 0.02;
 
-static PRBool
+static bool
 SubpixelOffsetFuzzyEqual(gfxPoint aV1, gfxPoint aV2)
 {
   return fabs(aV2.x - aV1.x) < SUBPIXEL_OFFSET_EPSILON &&
          fabs(aV2.y - aV1.y) < SUBPIXEL_OFFSET_EPSILON;
 }
 
 /**
  * This normally computes NSToIntRoundUp(aValue). However, if that would
--- a/layout/base/nsBidi.cpp
+++ b/layout/base/nsBidi.cpp
@@ -179,17 +179,17 @@ void nsBidi::Init()
  *
  * Assume aSizeNeeded>0.
  * If *aMemory!=NULL, then assume *aSize>0.
  *
  * ### this realloc() may unnecessarily copy the old data,
  * which we know we don't need any more;
  * is this the best way to do this??
  */
-bool nsBidi::GetMemory(void **aMemory, PRSize *aSize, bool aMayAllocate, PRSize aSizeNeeded)
+bool nsBidi::GetMemory(void **aMemory, size_t *aSize, bool aMayAllocate, size_t aSizeNeeded)
 {
   /* check for existing memory */
   if(*aMemory==NULL) {
     /* we need to allocate memory */
     if(!aMayAllocate) {
       return false;
     } else {
       *aMemory=PR_MALLOC(aSizeNeeded);
--- a/layout/base/nsBidi.h
+++ b/layout/base/nsBidi.h
@@ -818,17 +818,17 @@ public:
 
 protected:
   friend class nsBidiPresUtils;
 
   /** length of the current text */
   PRInt32 mLength;
 
   /** memory sizes in bytes */
-  PRSize mDirPropsSize, mLevelsSize, mRunsSize;
+  size_t mDirPropsSize, mLevelsSize, mRunsSize;
 
   /** allocated memory */
   DirProp* mDirPropsMemory;
   nsBidiLevel* mLevelsMemory;
   Run* mRunsMemory;
 
   /** indicators for whether memory may be allocated after construction */
   bool mMayAllocateText, mMayAllocateRuns;
@@ -855,17 +855,17 @@ protected:
 
   /** for non-mixed text, we only need a tiny array of runs (no malloc()) */
   Run mSimpleRuns[1];
 
 private:
 
   void Init();
 
-  bool GetMemory(void **aMemory, PRSize* aSize, bool aMayAllocate, PRSize aSizeNeeded);
+  bool GetMemory(void **aMemory, size_t* aSize, bool aMayAllocate, size_t aSizeNeeded);
 
   void Free();
 
   void GetDirProps(const PRUnichar *aText);
 
   nsBidiDirection ResolveExplicitLevels();
 
   nsresult CheckExplicitLevels(nsBidiDirection *aDirection);
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -380,17 +380,17 @@ nsCSSRendering::ComputePixelRadii(const 
 
 void
 nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
                             nsRenderingContext& aRenderingContext,
                             nsIFrame* aForFrame,
                             const nsRect& aDirtyRect,
                             const nsRect& aBorderArea,
                             nsStyleContext* aStyleContext,
-                            PRIntn aSkipSides)
+                            int aSkipSides)
 {
   SAMPLE_LABEL("nsCSSRendering", "PaintBorder");
   nsStyleContext *styleIfVisited = aStyleContext->GetStyleIfVisited();
   const nsStyleBorder *styleBorder = aStyleContext->GetStyleBorder();
   // Don't check RelevantLinkVisited here, since we want to take the
   // same amount of time whether or not it's true.
   if (!styleIfVisited) {
     PaintBorderWithStyleBorder(aPresContext, aRenderingContext, aForFrame,
@@ -423,17 +423,17 @@ nsCSSRendering::PaintBorder(nsPresContex
 void
 nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
                                            nsRenderingContext& aRenderingContext,
                                            nsIFrame* aForFrame,
                                            const nsRect& aDirtyRect,
                                            const nsRect& aBorderArea,
                                            const nsStyleBorder& aStyleBorder,
                                            nsStyleContext* aStyleContext,
-                                           PRIntn aSkipSides)
+                                           int aSkipSides)
 {
   nsMargin            border;
   nscoord             twipsRadii[8];
   nsCompatibility     compatMode = aPresContext->CompatibilityMode();
 
   SN("++ PaintBorder");
 
   // Check to see if we have an appearance defined.  If so, we let the theme
@@ -2522,18 +2522,18 @@ nsCSSRendering::PrepareBackgroundLayer(n
   // determined.
   ComputeBackgroundAnchorPoint(aLayer, bgPositioningArea.Size(), imageSize,
                                &imageTopLeft, &state.mAnchor);
   imageTopLeft += bgPositioningArea.TopLeft();
   state.mAnchor += bgPositioningArea.TopLeft();
 
   state.mDestArea = nsRect(imageTopLeft + aBorderArea.TopLeft(), imageSize);
   state.mFillArea = state.mDestArea;
-  PRIntn repeatX = aLayer.mRepeat.mXRepeat;
-  PRIntn repeatY = aLayer.mRepeat.mYRepeat;
+  int repeatX = aLayer.mRepeat.mXRepeat;
+  int repeatY = aLayer.mRepeat.mYRepeat;
   if (repeatX == NS_STYLE_BG_REPEAT_REPEAT) {
     state.mFillArea.x = bgClipRect.x;
     state.mFillArea.width = bgClipRect.width;
   }
   if (repeatY == NS_STYLE_BG_REPEAT_REPEAT) {
     state.mFillArea.y = bgClipRect.y;
     state.mFillArea.height = bgClipRect.height;
   }
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -168,30 +168,30 @@ struct nsCSSRendering {
    * when rendering. If 0 then no sides are skipped.
    */
   static void PaintBorder(nsPresContext* aPresContext,
                           nsRenderingContext& aRenderingContext,
                           nsIFrame* aForFrame,
                           const nsRect& aDirtyRect,
                           const nsRect& aBorderArea,
                           nsStyleContext* aStyleContext,
-                          PRIntn aSkipSides = 0);
+                          int aSkipSides = 0);
 
   /**
    * Like PaintBorder, but taking an nsStyleBorder argument instead of
    * getting it from aStyleContext.
    */
   static void PaintBorderWithStyleBorder(nsPresContext* aPresContext,
                                          nsRenderingContext& aRenderingContext,
                                          nsIFrame* aForFrame,
                                          const nsRect& aDirtyRect,
                                          const nsRect& aBorderArea,
                                          const nsStyleBorder& aBorderStyle,
                                          nsStyleContext* aStyleContext,
-                                         PRIntn aSkipSides = 0);
+                                         int aSkipSides = 0);
 
 
   /**
    * Render the outline for an element using css rendering rules
    * for borders. aSkipSides is a bitmask of the sides to skip
    * when rendering. If 0 then no sides are skipped.
    */
   static void PaintOutline(nsPresContext* aPresContext,
--- a/layout/base/nsCSSRenderingBorders.cpp
+++ b/layout/base/nsCSSRenderingBorders.cpp
@@ -125,17 +125,17 @@ typedef enum {
 nsCSSBorderRenderer::nsCSSBorderRenderer(PRInt32 aAppUnitsPerPixel,
                                          gfxContext* aDestContext,
                                          gfxRect& aOuterRect,
                                          const PRUint8* aBorderStyles,
                                          const gfxFloat* aBorderWidths,
                                          gfxCornerSizes& aBorderRadii,
                                          const nscolor* aBorderColors,
                                          nsBorderColors* const* aCompositeColors,
-                                         PRIntn aSkipSides,
+                                         int aSkipSides,
                                          nscolor aBackgroundColor)
   : mContext(aDestContext),
     mOuterRect(aOuterRect),
     mBorderStyles(aBorderStyles),
     mBorderWidths(aBorderWidths),
     mBorderRadii(aBorderRadii),
     mBorderColors(aBorderColors),
     mCompositeColors(aCompositeColors),
@@ -518,17 +518,17 @@ nsCSSBorderRenderer::DoSideClipSubPath(m
   mContext->ClosePath();
 }
 
 void
 nsCSSBorderRenderer::FillSolidBorder(const gfxRect& aOuterRect,
                                      const gfxRect& aInnerRect,
                                      const gfxCornerSizes& aBorderRadii,
                                      const gfxFloat *aBorderSizes,
-                                     PRIntn aSides,
+                                     int aSides,
                                      const gfxRGBA& aColor)
 {
   mContext->SetColor(aColor);
   // Note that this function is allowed to draw more than just the
   // requested sides.
 
   // If we have a border radius, do full rounded rectangles
   // and fill, regardless of what sides we're asked to draw.
@@ -678,17 +678,17 @@ ComputeCompositeColorForLine(PRUint32 aL
 {
   while (aLineIndex-- && aBorderColors->mNext)
     aBorderColors = aBorderColors->mNext;
 
   return gfxRGBA(aBorderColors->mColor);
 }
 
 void
-nsCSSBorderRenderer::DrawBorderSidesCompositeColors(PRIntn aSides, const nsBorderColors *aCompositeColors)
+nsCSSBorderRenderer::DrawBorderSidesCompositeColors(int aSides, const nsBorderColors *aCompositeColors)
 {
   gfxCornerSizes radii = mBorderRadii;
 
   // the generic composite colors path; each border is 1px in size
   gfxRect soRect = mOuterRect;
   gfxFloat maxBorderWidth = 0;
   NS_FOR_CSS_SIDES (i) {
     maxBorderWidth = NS_MAX(maxBorderWidth, mBorderWidths[i]);
@@ -726,17 +726,17 @@ nsCSSBorderRenderer::DrawBorderSidesComp
 
     soRect = siRect;
 
     ComputeInnerRadii(radii, fakeBorderSizes, &radii);
   }
 }
 
 void
-nsCSSBorderRenderer::DrawBorderSides(PRIntn aSides)
+nsCSSBorderRenderer::DrawBorderSides(int aSides)
 {
   if (aSides == 0 || (aSides & ~SIDE_BITS_ALL) != 0) {
     NS_WARNING("DrawBorderSides: invalid sides!");
     return;
   }
 
   PRUint8 borderRenderStyle;
   nscolor borderRenderColor;
@@ -1538,17 +1538,17 @@ nsCSSBorderRenderer::DrawBorders()
 
   // if conditioning the outside rect failed, then bail -- the outside
   // rect is supposed to enclose the entire border
   mOuterRect.Condition();
   if (mOuterRect.IsEmpty())
     return;
 
   mInnerRect.Condition();
-  PRIntn dashedSides = 0;
+  int dashedSides = 0;
 
   NS_FOR_CSS_SIDES(i) {
     PRUint8 style = mBorderStyles[i];
     if (style == NS_STYLE_BORDER_STYLE_DASHED ||
         style == NS_STYLE_BORDER_STYLE_DOTTED)
     {
       // pretend that all borders aren't the same; we need to draw
       // things separately for dashed/dotting
@@ -1591,18 +1591,18 @@ nsCSSBorderRenderer::DrawBorders()
     }
 
     // First, the corners
     NS_FOR_CSS_CORNERS(corner) {
       // if there's no corner, don't do all this work for it
       if (IsZeroSize(mBorderCornerDimensions[corner]))
         continue;
 
-      const PRIntn sides[2] = { corner, PREV_SIDE(corner) };
-      PRIntn sideBits = (1 << sides[0]) | (1 << sides[1]);
+      const int sides[2] = { corner, PREV_SIDE(corner) };
+      int sideBits = (1 << sides[0]) | (1 << sides[1]);
 
       bool simpleCornerStyle = mCompositeColors[sides[0]] == NULL &&
                                  mCompositeColors[sides[1]] == NULL &&
                                  AreBorderSideFinalStylesSame(sideBits);
 
       // If we don't have anything complex going on in this corner,
       // then we can just fill the corner with a solid color, and avoid
       // the potentially expensive clip.
@@ -1667,17 +1667,17 @@ nsCSSBorderRenderer::DrawBorders()
 
     // in the case of a single-unit border, we already munged the
     // corners up above; so we can just draw the top left and bottom
     // right sides separately, if they're the same.
     //
     // We need to check for mNoBorderRadius, because when there is
     // one, FillSolidBorder always draws the full rounded rectangle
     // and expects there to be a clip in place.
-    PRIntn alreadyDrawnSides = 0;
+    int alreadyDrawnSides = 0;
     if (mOneUnitBorder &&
         mNoBorderRadius &&
         (dashedSides & (SIDE_BIT_TOP | SIDE_BIT_LEFT)) == 0)
     {
       if (tlBordersSame) {
         DrawBorderSides(SIDE_BIT_TOP | SIDE_BIT_LEFT);
         alreadyDrawnSides |= (SIDE_BIT_TOP | SIDE_BIT_LEFT);
       }
--- a/layout/base/nsCSSRenderingBorders.h
+++ b/layout/base/nsCSSRenderingBorders.h
@@ -66,17 +66,17 @@ struct nsCSSBorderRenderer {
   nsCSSBorderRenderer(PRInt32 aAppUnitsPerPixel,
                       gfxContext* aDestContext,
                       gfxRect& aOuterRect,
                       const PRUint8* aBorderStyles,
                       const gfxFloat* aBorderWidths,
                       gfxCornerSizes& aBorderRadii,
                       const nscolor* aBorderColors,
                       nsBorderColors* const* aCompositeColors,
-                      PRIntn aSkipSides,
+                      int aSkipSides,
                       nscolor aBackgroundColor);
 
   gfxCornerSizes mBorderCornerDimensions;
 
   // destination context
   gfxContext* mContext;
 
   // the rectangle of the outside and the inside of the border
@@ -93,17 +93,17 @@ struct nsCSSBorderRenderer {
   // colors
   const nscolor* mBorderColors;
   nsBorderColors* const* mCompositeColors;
 
   // core app units per pixel
   PRInt32 mAUPP;
 
   // misc -- which sides to skip, the background color
-  PRIntn mSkipSides;
+  int mSkipSides;
   nscolor mBackgroundColor;
 
   // calculated values
   bool mOneUnitBorder;
   bool mNoBorderRadius;
   bool mAvoidStroke;
 
   // For all the sides in the bitmask, would they be rendered
@@ -146,29 +146,29 @@ struct nsCSSBorderRenderer {
   // TL/BR paths.  Otherwise, we do the full path and fill.
   //
   // Calling code is expected to only set up a clip as necessary; no
   // clip is needed if we can render the entire border in 1 or 2 passes.
   void FillSolidBorder(const gfxRect& aOuterRect,
                        const gfxRect& aInnerRect,
                        const gfxCornerSizes& aBorderRadii,
                        const gfxFloat *aBorderSizes,
-                       PRIntn aSides,
+                       int aSides,
                        const gfxRGBA& aColor);
 
   //
   // core rendering
   //
 
   // draw the border for the given sides, using the style of the first side
   // present in the bitmask
-  void DrawBorderSides (PRIntn aSides);
+  void DrawBorderSides (int aSides);
 
   // function used by the above to handle -moz-border-colors
-  void DrawBorderSidesCompositeColors(PRIntn aSides, const nsBorderColors *compositeColors);
+  void DrawBorderSidesCompositeColors(int aSides, const nsBorderColors *compositeColors);
 
   // draw the given dashed side
   void DrawDashedSide (mozilla::css::Side aSide);
   
   // Setup the stroke style for a given side
   void SetupStrokeStyle(mozilla::css::Side aSize);
 
   // Analyze if all border sides have the same width.
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -1840,17 +1840,17 @@ nsFrameManager::RestoreFrameState(nsIFra
 //----------------------------------------------------------------------
 
 static PLHashNumber
 HashKey(void* key)
 {
   return NS_PTR_TO_INT32(key);
 }
 
-static PRIntn
+static int
 CompareKeys(void* key1, void* key2)
 {
   return key1 == key2;
 }
 
 //----------------------------------------------------------------------
 
 nsFrameManagerBase::UndisplayedMap::UndisplayedMap(PRUint32 aNumBuckets)
@@ -1973,18 +1973,18 @@ nsFrameManagerBase::UndisplayedMap::Remo
     UndisplayedNode*  node = (UndisplayedNode*)((*entry)->value);
     NS_ASSERTION(node, "null node for non-null entry in UndisplayedMap");
     delete node;
     PL_HashTableRawRemove(mTable, entry, *entry);
     mLastLookup = nullptr; // hashtable may have shifted bucket out from under us
   }
 }
 
-static PRIntn
-RemoveUndisplayedEntry(PLHashEntry* he, PRIntn i, void* arg)
+static int
+RemoveUndisplayedEntry(PLHashEntry* he, int i, void* arg)
 {
   UndisplayedNode*  node = (UndisplayedNode*)(he->value);
   delete node;
   // Remove and free this entry and continue enumerating
   return HT_ENUMERATE_REMOVE | HT_ENUMERATE_NEXT;
 }
 
 void
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -366,36 +366,36 @@ public:
   void SetPaintFrameCounts(bool aVal)        { mPaintFrameByFrameCounts = aVal; }
 
   bool IsPaintingFrameCounts() { return mPaintFrameByFrameCounts; }
 
 protected:
   void DisplayTotals(PRUint32 aTotal, PRUint32 * aDupArray, char * aTitle);
   void DisplayHTMLTotals(PRUint32 aTotal, PRUint32 * aDupArray, char * aTitle);
 
-  static PRIntn RemoveItems(PLHashEntry *he, PRIntn i, void *arg);
-  static PRIntn RemoveIndiItems(PLHashEntry *he, PRIntn i, void *arg);
+  static int RemoveItems(PLHashEntry *he, int i, void *arg);
+  static int RemoveIndiItems(PLHashEntry *he, int i, void *arg);
   void CleanUp();
 
   // stdout Output Methods
-  static PRIntn DoSingleTotal(PLHashEntry *he, PRIntn i, void *arg);
-  static PRIntn DoSingleIndi(PLHashEntry *he, PRIntn i, void *arg);
+  static int DoSingleTotal(PLHashEntry *he, int i, void *arg);
+  static int DoSingleIndi(PLHashEntry *he, int i, void *arg);
 
   void DoGrandTotals();
   void DoIndiTotalsTree();
 
   // HTML Output Methods
-  static PRIntn DoSingleHTMLTotal(PLHashEntry *he, PRIntn i, void *arg);
+  static int DoSingleHTMLTotal(PLHashEntry *he, int i, void *arg);
   void DoGrandHTMLTotals();
 
   // Zero Out the Totals
-  static PRIntn DoClearTotals(PLHashEntry *he, PRIntn i, void *arg);
+  static int DoClearTotals(PLHashEntry *he, int i, void *arg);
 
   // Displays the Diff Totals
-  static PRIntn DoDisplayDiffTotals(PLHashEntry *he, PRIntn i, void *arg);
+  static int DoDisplayDiffTotals(PLHashEntry *he, int i, void *arg);
 
   PLHashTable * mCounts;
   PLHashTable * mIndiFrameCounts;
   FILE * mFD;
   
   bool mDumpFrameCounts;
   bool mDumpFrameByFrameCounts;
   bool mPaintFrameByFrameCounts;
@@ -8593,28 +8593,28 @@ void ReflowCountMgr::PaintCount(const ch
       aRenderingContext->DrawString(buf, strlen(buf), x,y);
 
       aRenderingContext->PopState();
     }
   }
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::RemoveItems(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::RemoveItems(PLHashEntry *he, int i, void *arg)
 {
   char *str = (char *)he->key;
   ReflowCounter * counter = (ReflowCounter *)he->value;
   delete counter;
   NS_Free(str);
 
   return HT_ENUMERATE_REMOVE;
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::RemoveIndiItems(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::RemoveIndiItems(PLHashEntry *he, int i, void *arg)
 {
   char *str = (char *)he->key;
   IndiReflowCounter * counter = (IndiReflowCounter *)he->value;
   delete counter;
   NS_Free(str);
 
   return HT_ENUMERATE_REMOVE;
 }
@@ -8631,17 +8631,17 @@ void ReflowCountMgr::CleanUp()
   if (nullptr != mIndiFrameCounts) {
     PL_HashTableEnumerateEntries(mIndiFrameCounts, RemoveIndiItems, nullptr);
     PL_HashTableDestroy(mIndiFrameCounts);
     mIndiFrameCounts = nullptr;
   }
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::DoSingleTotal(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::DoSingleTotal(PLHashEntry *he, int i, void *arg)
 {
   char *str = (char *)he->key;
   ReflowCounter * counter = (ReflowCounter *)he->value;
 
   counter->DisplayTotals(str);
 
   return HT_ENUMERATE_NEXT;
 }
@@ -8693,17 +8693,17 @@ static void RecurseIndiTotals(nsPresCont
   while (child) {
     RecurseIndiTotals(aPresContext, aHT, child, aLevel+1);
     child = child->GetNextSibling();
   }
 
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::DoSingleIndi(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::DoSingleIndi(PLHashEntry *he, int i, void *arg)
 {
   IndiReflowCounter * counter = (IndiReflowCounter *)he->value;
   if (counter && !counter->mHasBeenOutput) {
     char * name = ToNewCString(counter->mName);
     printf("%s - %p   [%d][", name, (void*)counter->mFrame, counter->mCount);
     printf("%d", counter->mCounter.GetTotal());
     printf("]\n");
     nsMemory::Free(name);
@@ -8726,17 +8726,17 @@ void ReflowCountMgr::DoIndiTotalsTree()
       printf("-- Individual Counts of Frames not in Root Tree\n");
       printf("------------------------------------------------\n");
       PL_HashTableEnumerateEntries(mIndiFrameCounts, DoSingleIndi, this);
     }
   }
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::DoSingleHTMLTotal(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::DoSingleHTMLTotal(PLHashEntry *he, int i, void *arg)
 {
   char *str = (char *)he->key;
   ReflowCounter * counter = (ReflowCounter *)he->value;
 
   counter->DisplayHTMLTotals(str);
 
   return HT_ENUMERATE_NEXT;
 }
@@ -8803,17 +8803,17 @@ void ReflowCountMgr::DisplayHTMLTotals(c
     fprintf(mFD, "</body></html>\n");
     fclose(mFD);
     mFD = nullptr;
   }
 #endif // not XP!
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::DoClearTotals(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::DoClearTotals(PLHashEntry *he, int i, void *arg)
 {
   ReflowCounter * counter = (ReflowCounter *)he->value;
   counter->ClearTotals();
 
   return HT_ENUMERATE_NEXT;
 }
 
 //------------------------------------------------------------------
@@ -8833,17 +8833,17 @@ void ReflowCountMgr::ClearGrandTotals()
     } else {
       gTots->ClearTotals();
       gTots->SetTotalsCache();
     }
   }
 }
 
 //------------------------------------------------------------------
-PRIntn ReflowCountMgr::DoDisplayDiffTotals(PLHashEntry *he, PRIntn i, void *arg)
+int ReflowCountMgr::DoDisplayDiffTotals(PLHashEntry *he, int i, void *arg)
 {
   bool cycledOnce = (arg != 0);
 
   char *str = (char *)he->key;
   ReflowCounter * counter = (ReflowCounter *)he->value;
 
   if (cycledOnce) {
     counter->CalcDiffInTotals();
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -86,17 +86,17 @@ public:
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const {
     return MakeFrameName(NS_LITERAL_STRING("FieldSet"), aResult);
   }
 #endif
 
 protected:
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
   void ReparentFrameList(const nsFrameList& aFrameList);
 
   // mLegendFrame is a nsLegendFrame or a nsHTMLScrollFrame with the
   // nsLegendFrame as the scrolled frame (aka content insertion frame).
   nsIFrame* mLegendFrame;
   nsIFrame* mContentFrame;
   nsRect    mLegendRect;
   nscoord   mLegendSpace;
@@ -240,17 +240,17 @@ nsFieldSetFrame::BuildDisplayList(nsDisp
   contentDisplayItems.MoveTo(aLists);
   return NS_OK;
 }
 
 void
 nsFieldSetFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
     nsPoint aPt, const nsRect& aDirtyRect, PRUint32 aBGFlags)
 {
-  PRIntn skipSides = GetSkipSides();
+  int skipSides = GetSkipSides();
   const nsStyleBorder* borderStyle = GetStyleBorder();
        
   nscoord topBorder = borderStyle->GetComputedBorderWidth(NS_SIDE_TOP);
   nscoord yoff = 0;
   nsPresContext* presContext = PresContext();
      
   // if the border is smaller than the legend. Move the border down
   // to be centered on the legend. 
@@ -585,17 +585,17 @@ nsFieldSetFrame::Reflow(nsPresContext*  
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
 
   Invalidate(aDesiredSize.VisualOverflow());
 
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
   return NS_OK;
 }
 
-PRIntn
+int
 nsFieldSetFrame::GetSkipSides() const
 {
   return 0;
 }
 
 NS_IMETHODIMP
 nsFieldSetFrame::AppendFrames(ChildListID    aListID,
                               nsFrameList&   aFrameList)
--- a/layout/forms/nsFileControlFrame.cpp
+++ b/layout/forms/nsFileControlFrame.cpp
@@ -472,17 +472,17 @@ nsFileControlFrame::GetMinWidth(nsRender
 
 nsTextControlFrame*
 nsFileControlFrame::GetTextControlFrame()
 {
   nsITextControlFrame* tc = do_QueryFrame(mTextContent->GetPrimaryFrame());
   return static_cast<nsTextControlFrame*>(tc);
 }
 
-PRIntn
+int
 nsFileControlFrame::GetSkipSides() const
 {
   return 0;
 }
 
 void
 nsFileControlFrame::SyncAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
                              PRInt32 aWhichControls)
--- a/layout/forms/nsFileControlFrame.h
+++ b/layout/forms/nsFileControlFrame.h
@@ -138,17 +138,17 @@ protected:
   };
 
   virtual bool IsFrameOfType(PRUint32 aFlags) const
   {
     return nsBlockFrame::IsFrameOfType(aFlags &
       ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock));
   }
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   /**
    * The text box input.
    * @see nsFileControlFrame::CreateAnonymousContent
    */
   nsCOMPtr<nsIContent> mTextContent;
   /**
    * The browse button input.
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -323,17 +323,17 @@ nsHTMLButtonControlFrame::ReflowButtonCo
   if (aDesiredSize.ascent == nsHTMLReflowMetrics::ASK_FOR_BASELINE)
     aDesiredSize.ascent = aFirstKid->GetBaseline();
 
   // Adjust the baseline by our offset (since we moved the child's
   // baseline by that much).
   aDesiredSize.ascent += yoff;
 }
 
-PRIntn
+int
 nsHTMLButtonControlFrame::GetSkipSides() const
 {
   return 0;
 }
 
 nsresult nsHTMLButtonControlFrame::SetFormProperty(nsIAtom* aName, const nsAString& aValue)
 {
   if (nsGkAtoms::value == aName) {
--- a/layout/forms/nsHTMLButtonControlFrame.h
+++ b/layout/forms/nsHTMLButtonControlFrame.h
@@ -103,17 +103,17 @@ protected:
   virtual bool IsInput() { return false; }
   void ReflowButtonContents(nsPresContext* aPresContext,
                             nsHTMLReflowMetrics& aDesiredSize,
                             const nsHTMLReflowState& aReflowState,
                             nsIFrame* aFirstKid,
                             nsMargin aFocusPadding,
                             nsReflowStatus& aStatus);
 
-  PRIntn GetSkipSides() const;
+  int GetSkipSides() const;
   nsButtonFrameRenderer mRenderer;
 };
 
 #endif
 
 
 
 
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -1088,17 +1088,17 @@ NS_IMETHODIMP
 nsListControlFrame::OnOptionSelected(PRInt32 aIndex, bool aSelected)
 {
   if (aSelected) {
     ScrollToIndex(aIndex);
   }
   return NS_OK;
 }
 
-PRIntn
+int
 nsListControlFrame::GetSkipSides() const
 {    
     // Don't skip any sides during border rendering
   return 0;
 }
 
 void
 nsListControlFrame::OnContentReset()
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -108,17 +108,17 @@ public:
   virtual bool ShouldPropagateComputedHeightToScrolledContent() const;
 
     // for accessibility purposes
 #ifdef ACCESSIBILITY
   virtual already_AddRefed<Accessible> CreateAccessible();
 #endif
 
     // nsContainerFrame
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
     // nsIListControlFrame
   virtual void SetComboboxFrame(nsIFrame* aComboboxFrame);
   virtual PRInt32 GetSelectedIndex();
   virtual already_AddRefed<nsIContent> GetCurrentOption();
 
   /**
    * Gets the text of the currently selected item.
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -202,17 +202,17 @@ DumpStyleGeneaology(nsIFrame* aFrame, co
 #ifdef REFLOW_STATUS_COVERAGE
 static void
 RecordReflowStatus(bool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
 {
   static PRUint32 record[2];
 
   // 0: child-is-block
   // 1: child-is-inline
-  PRIntn index = 0;
+  int index = 0;
   if (!aChildIsBlock) index |= 1;
 
   // Compute new status
   PRUint32 newS = record[index];
   if (NS_INLINE_IS_BREAK(aFrameReflowStatus)) {
     if (NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
       newS |= 1;
     }
@@ -6093,23 +6093,23 @@ nsBlockFrame::RecoverFloatsFor(nsIFrame*
     block->RecoverFloats(aFloatManager);
     aFloatManager.Translate(-pos.x, -pos.y);
   }
 }
 
 //////////////////////////////////////////////////////////////////////
 // Painting, event handling
 
-PRIntn
+int
 nsBlockFrame::GetSkipSides() const
 {
   if (IS_TRUE_OVERFLOW_CONTAINER(this))
     return (1 << NS_SIDE_TOP) | (1 << NS_SIDE_BOTTOM);
 
-  PRIntn skip = 0;
+  int skip = 0;
   if (GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   nsIFrame* nif = GetNextInFlow();
   if (nif && !IS_TRUE_OVERFLOW_CONTAINER(nif)) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -392,17 +392,17 @@ protected:
   }
 
   /** move the frames contained by aLine by aDY
     * if aLine is a block, its child floats are added to the state manager
     */
   void SlideLine(nsBlockReflowState& aState,
                  nsLineBox* aLine, nscoord aDY);
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   virtual void ComputeFinalSize(const nsHTMLReflowState& aReflowState,
                                 nsBlockReflowState&      aState,
                                 nsHTMLReflowMetrics&     aMetrics,
                                 nscoord*                 aBottomEdgeOfChildren);
 
   void ComputeOverflowAreas(const nsRect&         aBounds,
                             const nsStyleDisplay* aDisplay,
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -89,17 +89,17 @@ nsBlockReflowContext::ComputeCollapsedTo
 
   // iterate not just through the lines of 'block' but also its
   // overflow lines and the normal and overflow lines of its next in
   // flows. Note that this will traverse some frames more than once:
   // for example, if A contains B and A->nextinflow contains
   // B->nextinflow, we'll traverse B->nextinflow twice. But this is
   // OK because our traversal is idempotent.
   for ( ;block; block = static_cast<nsBlockFrame*>(block->GetNextInFlow())) {
-    for (PRIntn overflowLines = false; overflowLines <= true; ++overflowLines) {
+    for (int overflowLines = false; overflowLines <= true; ++overflowLines) {
       nsBlockFrame::line_iterator line;
       nsBlockFrame::line_iterator line_end;
       bool anyLines = true;
       if (overflowLines) {
         nsBlockFrame::FrameLines* frames = block->GetOverflowLines();
         nsLineList* lines = frames ? &frames->mLines : nullptr;
         if (!lines) {
           anyLines = false;
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -439,21 +439,21 @@ static const char gUpperRomanCharsB[] = 
 static bool RomanToText(PRInt32 ordinal, nsString& result, const char* achars, const char* bchars)
 {
   if (ordinal < 1 || ordinal > 3999) {
     DecimalToText(ordinal, result);
     return false;
   }
   nsAutoString addOn, decStr;
   decStr.AppendInt(ordinal, 10);
-  PRIntn len = decStr.Length();
+  int len = decStr.Length();
   const PRUnichar* dp = decStr.get();
   const PRUnichar* end = dp + len;
-  PRIntn romanPos = len;
-  PRIntn n;
+  int romanPos = len;
+  int n;
 
   for (; dp < end; dp++) {
     romanPos--;
     addOn.SetLength(0);
     switch(*dp) {
       case '3':
         addOn.Append(PRUnichar(achars[romanPos]));
         // FALLTHROUGH
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -566,17 +566,17 @@ nsCanvasFrame::Reflow(nsPresContext*    
 
   FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowState, aStatus);
 
   NS_FRAME_TRACE_REFLOW_OUT("nsCanvasFrame::Reflow", aStatus);
   NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
   return NS_OK;
 }
 
-PRIntn
+int
 nsCanvasFrame::GetSkipSides() const
 {
   return 0;
 }
 
 nsIAtom*
 nsCanvasFrame::GetType() const
 {
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -103,17 +103,17 @@ public:
   NS_IMETHOD GetFrameName(nsAString& aResult) const;
 #endif
   NS_IMETHOD GetContentForEvent(nsEvent* aEvent,
                                 nsIContent** aContent);
 
   nsRect CanvasArea() const;
 
 protected:
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   // Data members
   bool                      mDoPaintFocus;
   bool                      mAddedScrollPositionListener;
 };
 
 /**
  * Override nsDisplayBackground methods so that we pass aBGClipRect to
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -79,17 +79,17 @@ public:
     return MakeFrameName(NS_LITERAL_STRING("ColumnSet"), aResult);
   }
 #endif
 
 protected:
   nscoord        mLastBalanceHeight;
   nsReflowStatus mLastFrameStatus;
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   /**
    * These are the parameters that control the layout of columns.
    */
   struct ReflowConfig {
     PRInt32 mBalanceColCount;
     nscoord mColWidth;
     nscoord mExpectedWidthLeftOver;
@@ -1119,17 +1119,17 @@ nsColumnSetFrame::BuildDisplayList(nsDis
   while (kid) {
     nsresult rv = BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
     NS_ENSURE_SUCCESS(rv, rv);
     kid = kid->GetNextSibling();
   }
   return NS_OK;
 }
 
-PRIntn
+int
 nsColumnSetFrame::GetSkipSides() const
 {
   return 0;
 }
 
 NS_IMETHODIMP
 nsColumnSetFrame::AppendFrames(ChildListID     aListID,
                                nsFrameList&    aFrameList)
--- a/layout/generic/nsFirstLetterFrame.cpp
+++ b/layout/generic/nsFirstLetterFrame.cpp
@@ -41,17 +41,17 @@ nsFirstLetterFrame::GetFrameName(nsAStri
 #endif
 
 nsIAtom*
 nsFirstLetterFrame::GetType() const
 {
   return nsGkAtoms::letterFrame;
 }
 
-PRIntn
+int
 nsFirstLetterFrame::GetSkipSides() const
 {
   return 0;
 }
 
 NS_IMETHODIMP
 nsFirstLetterFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                      const nsRect&           aDirtyRect,
--- a/layout/generic/nsFirstLetterFrame.h
+++ b/layout/generic/nsFirstLetterFrame.h
@@ -75,14 +75,14 @@ public:
   nsresult CreateContinuationForFloatingParent(nsPresContext* aPresContext,
                                                nsIFrame* aChild,
                                                nsIFrame** aContinuation,
                                                bool aIsFluid);
 
 protected:
   nscoord mBaseline;
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   void DrainOverflowFrames(nsPresContext* aPresContext);
 };
 
 #endif /* nsFirstLetterFrame_h__ */
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -906,17 +906,17 @@ nsIFrame::GetUsedPadding() const
     NS_ASSERTION(hasPadding, "We should have padding here! (out of memory?)");
   }
   return padding;
 }
 
 void
 nsIFrame::ApplySkipSides(nsMargin& aMargin) const
 {
-  PRIntn skipSides = GetSkipSides();
+  int skipSides = GetSkipSides();
   if (skipSides & (1 << NS_SIDE_TOP))
     aMargin.top = 0;
   if (skipSides & (1 << NS_SIDE_RIGHT))
     aMargin.right = 0;
   if (skipSides & (1 << NS_SIDE_BOTTOM))
     aMargin.bottom = 0;
   if (skipSides & (1 << NS_SIDE_LEFT))
     aMargin.left = 0;
@@ -1036,17 +1036,17 @@ nsIFrame::GetContentRect() const
 {
   return GetContentRectRelativeToSelf() + GetPosition();
 }
 
 bool
 nsIFrame::ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
                              const nsSize& aFrameSize,
                              const nsSize& aBorderArea,
-                             PRIntn aSkipSides,
+                             int aSkipSides,
                              nscoord aRadii[8])
 {
   // Percentages are relative to whichever side they're on.
   NS_FOR_CSS_HALF_CORNERS(i) {
     const nsStyleCoord c = aBorderRadius.Get(i);
     nscoord axis =
       NS_HALF_CORNER_IS_X(i) ? aFrameSize.width : aFrameSize.height;
 
@@ -8138,17 +8138,17 @@ void
 nsFrame::GetBoxName(nsAutoString& aName)
 {
   GetFrameName(aName);
 }
 #endif
 
 #ifdef DEBUG
 static void
-GetTagName(nsFrame* aFrame, nsIContent* aContent, PRIntn aResultSize,
+GetTagName(nsFrame* aFrame, nsIContent* aContent, int aResultSize,
            char* aResult)
 {
   if (aContent) {
     PR_snprintf(aResult, aResultSize, "%s@%p",
                 nsAtomCString(aContent->Tag()).get(), aFrame);
   }
   else {
     PR_snprintf(aResult, aResultSize, "@%p", aFrame);
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -25,17 +25,17 @@
  * specific type of logging. Each logging operation has associated
  * inline methods defined below.
  */
 #define NS_FRAME_TRACE_CALLS        0x1
 #define NS_FRAME_TRACE_PUSH_PULL    0x2
 #define NS_FRAME_TRACE_CHILD_REFLOW 0x4
 #define NS_FRAME_TRACE_NEW_FRAMES   0x8
 
-#define NS_FRAME_LOG_TEST(_lm,_bit) (PRIntn((_lm)->level) & (_bit))
+#define NS_FRAME_LOG_TEST(_lm,_bit) (int((_lm)->level) & (_bit))
 
 #ifdef DEBUG
 #define NS_FRAME_LOG(_bit,_args)                                \
   PR_BEGIN_MACRO                                                \
     if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) {  \
       PR_LogPrint _args;                                        \
     }                                                           \
   PR_END_MACRO
--- a/layout/generic/nsFrameSetFrame.cpp
+++ b/layout/generic/nsFrameSetFrame.cpp
@@ -657,17 +657,17 @@ PRInt32 nsHTMLFramesetFrame::GetBorderWi
       (mParentBorderWidth == 0 && !forcing)) {
     return mParentBorderWidth;
   }
 
   return nsPresContext::CSSPixelsToAppUnits(DEFAULT_BORDER_WIDTH_PX);
 }
 
 
-PRIntn
+int
 nsHTMLFramesetFrame::GetSkipSides() const
 {
   return 0;
 }
 
 void 
 nsHTMLFramesetFrame::GetDesiredSize(nsPresContext*          aPresContext,
                                     const nsHTMLReflowState& aReflowState,
--- a/layout/generic/nsFrameSetFrame.h
+++ b/layout/generic/nsFrameSetFrame.h
@@ -174,17 +174,17 @@ protected:
   nsFrameborder GetFrameBorder(nsIContent* aContent);
 
   nscolor GetBorderColor();
 
   nscolor GetBorderColor(nsIContent* aFrameContent);
 
   bool GetNoResize(nsIFrame* aChildFrame); 
   
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   void ReflowPlaceChild(nsIFrame*                aChild,
                         nsPresContext*          aPresContext,
                         const nsHTMLReflowState& aReflowState,
                         nsPoint&                 aOffset,
                         nsSize&                  aSize,
                         nsIntPoint*              aCellIndex = 0);
   
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -142,17 +142,17 @@ nsHTMLScrollFrame::RemoveFrame(ChildList
 }
 
 nsSplittableType
 nsHTMLScrollFrame::GetSplittableType() const
 {
   return NS_FRAME_NOT_SPLITTABLE;
 }
 
-PRIntn
+int
 nsHTMLScrollFrame::GetSkipSides() const
 {
   return 0;
 }
 
 nsIAtom*
 nsHTMLScrollFrame::GetType() const
 {
@@ -1082,17 +1082,17 @@ nsXULScrollFrame::GetSplittableType() co
 
 NS_IMETHODIMP
 nsXULScrollFrame::GetPadding(nsMargin& aMargin)
 {
    aMargin.SizeTo(0,0,0,0);
    return NS_OK;
 }
 
-PRIntn
+int
 nsXULScrollFrame::GetSkipSides() const
 {
   return 0;
 }
 
 nsIAtom*
 nsXULScrollFrame::GetType() const
 {
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -536,17 +536,17 @@ public:
   bool DidHistoryRestore() { return mInner.mDidHistoryRestore; }
 
 #ifdef ACCESSIBILITY
   virtual already_AddRefed<Accessible> CreateAccessible();
 #endif
 
 protected:
   nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot);
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
   
   void SetSuppressScrollbarUpdate(bool aSuppress) {
     mInner.mSupppressScrollbarUpdate = aSuppress;
   }
   bool GuessHScrollbarNeeded(const ScrollReflowState& aState);
   bool GuessVScrollbarNeeded(const ScrollReflowState& aState);
 
   bool IsScrollbarUpdateSuppressed() const {
@@ -783,17 +783,17 @@ public:
   }
 
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const;
 #endif
 
 protected:
   nsXULScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot);
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   void ClampAndSetBounds(nsBoxLayoutState& aState, 
                          nsRect& aRect,
                          nsPoint aScrollPosition,
                          bool aRemoveOverflowAreas = false) {
     /* 
      * For RTL frames, restore the original scrolled position of the right
      * edge, then subtract the current width to find the physical position.
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -996,17 +996,17 @@ public:
    * these, especially if we change the way we handle outline-radius (by
    * removing it and inflating the border radius)
    *
    * Return whether any radii are nonzero.
    */
   static bool ComputeBorderRadii(const nsStyleCorners& aBorderRadius,
                                    const nsSize& aFrameSize,
                                    const nsSize& aBorderArea,
-                                   PRIntn aSkipSides,
+                                   int aSkipSides,
                                    nscoord aRadii[8]);
 
   /*
    * Given a set of border radii for one box (e.g., border box), convert
    * it to the equivalent set of radii for another box (e.g., in to
    * padding box, out to outline box) by reducing radii or increasing
    * nonzero radii as appropriate.
    *
@@ -2352,17 +2352,17 @@ public:
    * Returns true if the overflow changed.
    */
   bool ClearOverflowRects();
 
   /**
    * Determine whether borders should not be painted on certain sides of the
    * frame.
    */
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   /**
    * @returns true if this frame is selected.
    */
   bool IsSelected() const {
     return (GetContent() && GetContent()->IsSelectionDescendant()) ?
       IsFrameSelected() : false;
   }
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -1738,20 +1738,20 @@ nsImageFrame::List(FILE* out, PRInt32 aI
       fprintf(out, " [src=%s]", uristr.get());
     }
   }
   fputs("\n", out);
   return NS_OK;
 }
 #endif
 
-PRIntn
+int
 nsImageFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   if (nullptr != GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nullptr != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
 }
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -120,17 +120,17 @@ public:
     return ImageFrameSuper::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced));
   }
 
 #ifdef DEBUG
   NS_IMETHOD GetFrameName(nsAString& aResult) const;
   NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
 #endif
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   nsresult GetIntrinsicImageSize(nsSize& aSize);
 
   static void ReleaseGlobals() {
     if (gIconLoad) {
       gIconLoad->Shutdown();
       NS_RELEASE(gIconLoad);
     }
--- a/layout/generic/nsInlineFrame.cpp
+++ b/layout/generic/nsInlineFrame.cpp
@@ -835,20 +835,20 @@ nsInlineFrame::PushFrames(nsPresContext*
   if (aState.mLineLayout) {
     aState.mLineLayout->SetDirtyNextLine();
   }
 }
 
 
 //////////////////////////////////////////////////////////////////////
 
-PRIntn
+int
 nsInlineFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   if (!IsLeftMost()) {
     nsInlineFrame* prev = (nsInlineFrame*) GetPrevContinuation();
     if ((GetStateBits() & NS_INLINE_FRAME_BIDI_VISUAL_STATE_IS_SET) ||
         (prev && (prev->mRect.height || prev->mRect.width))) {
       // Prev continuation is not empty therefore we don't render our left
       // border edge.
       skip |= 1 << NS_SIDE_LEFT;
     }
@@ -873,18 +873,18 @@ nsInlineFrame::GetSkipSides() const
 
   if (GetStateBits() & NS_FRAME_IS_SPECIAL) {
     // All but the last part of an {ib} split should skip the "end" side (as
     // determined by this frame's direction) and all but the first part of such
     // a split should skip the "start" side.  But figuring out which part of
     // the split we are involves getting our first continuation, which might be
     // expensive.  So don't bother if we already have the relevant bits set.
     bool ltr = (NS_STYLE_DIRECTION_LTR == GetStyleVisibility()->mDirection);
-    PRIntn startBit = (1 << (ltr ? NS_SIDE_LEFT : NS_SIDE_RIGHT));
-    PRIntn endBit = (1 << (ltr ? NS_SIDE_RIGHT : NS_SIDE_LEFT));
+    int startBit = (1 << (ltr ? NS_SIDE_LEFT : NS_SIDE_RIGHT));
+    int endBit = (1 << (ltr ? NS_SIDE_RIGHT : NS_SIDE_LEFT));
     if (((startBit | endBit) & skip) != (startBit | endBit)) {
       // We're missing one of the skip bits, so check whether we need to set it.
       // Only get the first continuation once, as an optimization.
       nsIFrame* firstContinuation = GetFirstContinuation();
       if (nsLayoutUtils::FrameIsNonLastInIBSplit(firstContinuation)) {
         skip |= endBit;
       }
       if (nsLayoutUtils::FrameIsNonFirstInIBSplit(firstContinuation)) {
--- a/layout/generic/nsInlineFrame.h
+++ b/layout/generic/nsInlineFrame.h
@@ -130,17 +130,17 @@ protected:
       mLineContainer = nullptr;
       mLineLayout = nullptr;
       mSetParentPointer = false;
     }
   };
 
   nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {}
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   nsresult ReflowFrames(nsPresContext* aPresContext,
                         const nsHTMLReflowState& aReflowState,
                         InlineReflowState& rs,
                         nsHTMLReflowMetrics& aMetrics,
                         nsReflowStatus& aStatus);
 
   nsresult ReflowInlineFrame(nsPresContext* aPresContext,
--- a/layout/generic/nsSubDocumentFrame.cpp
+++ b/layout/generic/nsSubDocumentFrame.cpp
@@ -198,17 +198,17 @@ nsSubDocumentFrame::ShowViewer()
         return;
       }
       mCallingShow = false;
       mDidCreateDoc = didCreateDoc;
     }
   }
 }
 
-PRIntn
+int
 nsSubDocumentFrame::GetSkipSides() const
 {
   return 0;
 }
 
 nsIFrame*
 nsSubDocumentFrame::GetSubdocumentRootFrame()
 {
--- a/layout/generic/nsSubDocumentFrame.h
+++ b/layout/generic/nsSubDocumentFrame.h
@@ -112,17 +112,17 @@ protected:
 
   nsFrameLoader* FrameLoader();
 
   bool IsInline() { return mIsInline; }
 
   virtual nscoord GetIntrinsicWidth();
   virtual nscoord GetIntrinsicHeight();
 
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   // Hide or show our document viewer
   void HideViewer();
   void ShowViewer();
 
   /* Obtains the frame we should use for intrinsic size information if we are
    * an HTML <object>, <embed> or <applet> (a replaced element - not <iframe>)
    * and our sub-document has an intrinsic size. The frame returned is the
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -1926,17 +1926,17 @@ public:
 private:
   nsRect mRect;
 };
 
 void nsDisplayMathMLCharDebug::Paint(nsDisplayListBuilder* aBuilder,
                                      nsRenderingContext* aCtx)
 {
   // for visual debug
-  PRIntn skipSides = 0;
+  int skipSides = 0;
   nsPresContext* presContext = mFrame->PresContext();
   nsStyleContext* styleContext = mFrame->GetStyleContext();
   nsRect rect = mRect + ToReferenceFrame();
   nsCSSRendering::PaintBorder(presContext, *aCtx, mFrame,
                               mVisibleRect, rect, styleContext, skipSides);
   nsCSSRendering::PaintOutline(presContext, *aCtx, mFrame,
                                mVisibleRect, rect, styleContext);
 }
--- a/layout/mathml/nsMathMLContainerFrame.h
+++ b/layout/mathml/nsMathMLContainerFrame.h
@@ -75,17 +75,17 @@ public:
 
   virtual bool IsFrameOfType(PRUint32 aFlags) const
   {
     return !(aFlags & nsIFrame::eLineParticipant) &&
       nsContainerFrame::IsFrameOfType(aFlags &
               ~(nsIFrame::eMathML | nsIFrame::eExcludesIgnorableWhitespace));
   }
 
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   NS_IMETHOD
   AppendFrames(ChildListID     aListID,
                nsFrameList&    aFrameList);
 
   NS_IMETHOD
   InsertFrames(ChildListID     aListID,
                nsIFrame*       aPrevFrame,
--- a/layout/mathml/nsMathMLTokenFrame.h
+++ b/layout/mathml/nsMathMLTokenFrame.h
@@ -67,17 +67,17 @@ public:
     ProcessTextData();
     return nsMathMLContainerFrame::ChildListChanged(aModType);
   }
 
 protected:
   nsMathMLTokenFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLTokenFrame();
 
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   // hook to perform MathML-specific actions depending on the tag
   virtual void ProcessTextData();
 
   // helper to set the style of <mi> which has to be italic or normal
   // depending on its textual content
   bool SetTextStyle();
 
--- a/layout/mathml/nsMathMLmactionFrame.h
+++ b/layout/mathml/nsMathMLmactionFrame.h
@@ -70,17 +70,17 @@ private:
 
     nsMathMLmactionFrame* mOwner;
   };
 
 protected:
   nsMathMLmactionFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmactionFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
 private:
   PRInt32         mActionType;
   PRInt32         mChildCount;
   PRInt32         mSelection;
   nsIFrame*       mSelectedFrame;
   nsCOMPtr<MouseListener> mListener;
 
--- a/layout/mathml/nsMathMLmfencedFrame.h
+++ b/layout/mathml/nsMathMLmfencedFrame.h
@@ -78,17 +78,17 @@ public:
             nscoord            aDesiredSize,
             nsBoundingMetrics& bm,
             nscoord&           dx);
 
 protected:
   nsMathMLmfencedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmfencedFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   nsMathMLChar* mOpenChar;
   nsMathMLChar* mCloseChar;
   nsMathMLChar* mSeparatorsChar;
   PRInt32       mSeparatorsCount;
 
   // clean up
   void
--- a/layout/mathml/nsMathMLmfracFrame.h
+++ b/layout/mathml/nsMathMLmfracFrame.h
@@ -90,17 +90,17 @@ public:
                     nsString&        aThicknessAttribute,
                     nscoord          onePixel,
                     nscoord          aDefaultRuleThickness);
 
 protected:
   nsMathMLmfracFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmfracFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   nsresult PlaceInternal(nsRenderingContext& aRenderingContext,
                          bool                 aPlaceOrigin,
                          nsHTMLReflowMetrics& aDesiredSize,
                          bool                 aWidthOnly);
 
   // Display a slash
   nsresult DisplaySlash(nsDisplayListBuilder* aBuilder,
--- a/layout/mathml/nsMathMLmmultiscriptsFrame.h
+++ b/layout/mathml/nsMathMLmmultiscriptsFrame.h
@@ -26,17 +26,17 @@ public:
   Place(nsRenderingContext& aRenderingContext,
         bool                 aPlaceOrigin,
         nsHTMLReflowMetrics& aDesiredSize);
 
 protected:
   nsMathMLmmultiscriptsFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmmultiscriptsFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
 private:
   nscoord mSubScriptShift;
   nscoord mSupScriptShift;
 
   void
   ProcessAttributes();
 };
--- a/layout/mathml/nsMathMLmoFrame.h
+++ b/layout/mathml/nsMathMLmoFrame.h
@@ -60,17 +60,17 @@ public:
           nsStretchDirection   aStretchDirection,
           nsBoundingMetrics&   aContainerSize,
           nsHTMLReflowMetrics& aDesiredStretchSize);
 
 protected:
   nsMathMLmoFrame(nsStyleContext* aContext) : nsMathMLTokenFrame(aContext) {}
   virtual ~nsMathMLmoFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   nsMathMLChar     mMathMLChar; // Here is the MathMLChar that will deal with the operator.
   nsOperatorFlags  mFlags;
   float            mMinSize;
   float            mMaxSize;
 
   bool UseMathMLChar();
 
--- a/layout/mathml/nsMathMLmpaddedFrame.h
+++ b/layout/mathml/nsMathMLmpaddedFrame.h
@@ -37,17 +37,17 @@ public:
   Place(nsRenderingContext& aRenderingContext,
         bool                 aPlaceOrigin,
         nsHTMLReflowMetrics& aDesiredSize);
 
 protected:
   nsMathMLmpaddedFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmpaddedFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
 private:
   nsCSSValue mWidth;
   nsCSSValue mHeight;
   nsCSSValue mDepth;
   nsCSSValue mLeadingSpace;
   nsCSSValue mVerticalOffset;
 
--- a/layout/mathml/nsMathMLmphantomFrame.h
+++ b/layout/mathml/nsMathMLmphantomFrame.h
@@ -31,12 +31,12 @@ public:
                               const nsRect&           aDirtyRect,
                               const nsDisplayListSet& aLists) { return NS_OK; }
 
 protected:
   nsMathMLmphantomFrame(nsStyleContext* aContext)
     : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmphantomFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 #endif /* nsMathMLmphantomFrame_h___ */
--- a/layout/mathml/nsMathMLmrootFrame.h
+++ b/layout/mathml/nsMathMLmrootFrame.h
@@ -45,15 +45,15 @@ public:
   NS_IMETHOD BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                               const nsRect&           aDirtyRect,
                               const nsDisplayListSet& aLists);
 
 protected:
   nsMathMLmrootFrame(nsStyleContext* aContext);
   virtual ~nsMathMLmrootFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
   nsMathMLChar mSqrChar;
   nsRect       mBarRect;
 };
 
 #endif /* nsMathMLmrootFrame_h___ */
--- a/layout/mathml/nsMathMLmrowFrame.h
+++ b/layout/mathml/nsMathMLmrowFrame.h
@@ -31,12 +31,12 @@ public:
   TransmitAutomaticData() {
     return TransmitAutomaticDataForMrowLikeElement();
   }
 
 protected:
   nsMathMLmrowFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmrowFrame();
 
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 #endif /* nsMathMLmrowFrame_h___ */
--- a/layout/mathml/nsMathMLmspaceFrame.h
+++ b/layout/mathml/nsMathMLmspaceFrame.h
@@ -34,17 +34,17 @@ public:
          nsHTMLReflowMetrics&     aDesiredSize,
          const nsHTMLReflowState& aReflowState,
          nsReflowStatus&          aStatus);
   
 protected:
   nsMathMLmspaceFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmspaceFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 
 private:
   nscoord mWidth;
   nscoord mHeight;
   nscoord mDepth;
 
   // helper method to initialize our member data
   void 
--- a/layout/mathml/nsMathMLmstyleFrame.h
+++ b/layout/mathml/nsMathMLmstyleFrame.h
@@ -39,12 +39,12 @@ public:
                                     PRInt32         aLastIndex,
                                     PRUint32        aFlagsValues,
                                     PRUint32        aFlagsToUpdate);
 
 protected:
   nsMathMLmstyleFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmstyleFrame();
 
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 #endif /* nsMathMLmstyleFrame_h___ */
--- a/layout/mathml/nsMathMLmsubFrame.h
+++ b/layout/mathml/nsMathMLmsubFrame.h
@@ -35,12 +35,12 @@ public:
                   nsMathMLContainerFrame* aForFrame,
                   nscoord              aUserSubScriptShift,
                   nscoord              aScriptSpace);
 
  protected:
   nsMathMLmsubFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmsubFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 #endif /* nsMathMLmsubFrame_h___ */
--- a/layout/mathml/nsMathMLmsubsupFrame.h
+++ b/layout/mathml/nsMathMLmsubsupFrame.h
@@ -36,12 +36,12 @@ public:
                     nscoord              aUserSubScriptShift,
                     nscoord              aUserSupScriptShift,
                     nscoord              aScriptSpace);
 
 protected:
   nsMathMLmsubsupFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmsubsupFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 #endif /* nsMathMLmsubsupFrame_h___ */
--- a/layout/mathml/nsMathMLmsupFrame.h
+++ b/layout/mathml/nsMathMLmsupFrame.h
@@ -35,12 +35,12 @@ public:
                     nsMathMLContainerFrame* aForFrame,
                     nscoord              aUserSupScriptShift,
                     nscoord              aScriptSpace);
 
 protected:
   nsMathMLmsupFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmsupFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 #endif /* nsMathMLmsupFrame_h___ */
--- a/layout/mathml/nsMathMLmtableFrame.h
+++ b/layout/mathml/nsMathMLmtableFrame.h
@@ -251,12 +251,12 @@ public:
     return nsBlockFrame::IsFrameOfType(aFlags &
       ~(nsIFrame::eMathML | nsIFrame::eExcludesIgnorableWhitespace));
   }
 
 protected:
   nsMathMLmtdInnerFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) {}
   virtual ~nsMathMLmtdInnerFrame();
 
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };  // class nsMathMLmtdInnerFrame
 
 #endif /* nsMathMLmtableFrame_h___ */
--- a/layout/mathml/nsMathMLmunderoverFrame.h
+++ b/layout/mathml/nsMathMLmunderoverFrame.h
@@ -44,13 +44,13 @@ public:
   AttributeChanged(PRInt32         aNameSpaceID,
                    nsIAtom*        aAttribute,
                    PRInt32         aModType);
 
 protected:
   nsMathMLmunderoverFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {}
   virtual ~nsMathMLmunderoverFrame();
   
-  virtual PRIntn GetSkipSides() const { return 0; }
+  virtual int GetSkipSides() const { return 0; }
 };
 
 
 #endif /* nsMathMLmunderoverFrame_h___ */
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -489,20 +489,20 @@ nsTableCellFrame::BuildDisplayList(nsDis
   // This isn't a problem since it won't have a real background except for
   // event handling. We do not call BuildDisplayListForNonBlockChildren
   // because that/ would put the child's background in the Content() list
   // which isn't right (e.g., would end up on top of our child floats for
   // event handling).
   return BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists);
 }
 
-PRIntn
+int
 nsTableCellFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   if (nullptr != GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nullptr != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
 }
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -207,17 +207,17 @@ public:
 
   void DecorateForSelection(nsRenderingContext& aRenderingContext,
                             nsPoint              aPt);
 
   virtual bool UpdateOverflow();
 
 protected:
   /** implement abstract method on nsContainerFrame */
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   /**
    * GetBorderOverflow says how far the cell's own borders extend
    * outside its own bounds.  In the separated borders model this should
    * just be zero (as it is for most frames), but in the collapsed
    * borders model (for which nsBCTableCellFrame overrides this virtual
    * method), it considers the extents of the collapsed border.
    */
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -328,20 +328,20 @@ nsTableColGroupFrame::RemoveFrame(ChildL
   }
   else {
     mFrames.DestroyFrame(aOldFrame);
   }
 
   return NS_OK;
 }
 
-PRIntn
+int
 nsTableColGroupFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   if (nullptr != GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nullptr != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
 }
--- a/layout/tables/nsTableColGroupFrame.h
+++ b/layout/tables/nsTableColGroupFrame.h
@@ -197,17 +197,17 @@ public:
                                   BCPixelSize aPixelValue);
 protected:
   nsTableColGroupFrame(nsStyleContext* aContext);
 
   void InsertColsReflow(PRInt32                   aColIndex,
                         const nsFrameList::Slice& aCols);
 
   /** implement abstract method on nsContainerFrame */
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   // data members
   PRInt32 mColCount;
   // the starting column index this col group represents. Must be >= 0. 
   PRInt32 mStartColIndex;
 
   // border width in pixels
   BCPixelSize mTopContBorderWidth;
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -1292,34 +1292,34 @@ nsTableFrame::PaintTableBorderBackground
   nsMargin deflate = GetDeflationForBackground(presContext);
   // If 'deflate' is (0,0,0,0) then we'll paint the table background
   // in a separate display item, so don't do it here.
   nsresult rv = painter.PaintTable(this, deflate, deflate != nsMargin(0, 0, 0, 0));
   if (NS_FAILED(rv)) return;
 
   if (GetStyleVisibility()->IsVisible()) {
     if (!IsBorderCollapse()) {
-      PRIntn skipSides = GetSkipSides();
+      int skipSides = GetSkipSides();
       nsRect rect(aPt, mRect.Size());
       nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
                                   aDirtyRect, rect, mStyleContext, skipSides);
     }
     else {
       // XXX we should probably get rid of this translation at some stage
       // But that would mean modifying PaintBCBorders, ugh
       nsRenderingContext::AutoPushTranslation translate(&aRenderingContext, aPt);
       PaintBCBorders(aRenderingContext, aDirtyRect - aPt);
     }
   }
 }
 
-PRIntn
+int
 nsTableFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   // frame attribute was accounted for in nsHTMLTableElement::MapTableBorderInto
   // account for pagination
   if (nullptr != GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nullptr != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -484,17 +484,17 @@ protected:
   nsTableFrame(nsStyleContext* aContext);
 
   /** destructor, responsible for mColumnLayoutData */
   virtual ~nsTableFrame();
 
   void InitChildReflowState(nsHTMLReflowState& aReflowState);
 
   /** implement abstract method on nsContainerFrame */
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
 public:
   bool IsRowInserted() const;
   void   SetRowInserted(bool aValue);
 
 protected:
     
   // A helper function to reflow a header or footer with unconstrained height
--- a/layout/tables/nsTableOuterFrame.h
+++ b/layout/tables/nsTableOuterFrame.h
@@ -152,17 +152,17 @@ protected:
   virtual ~nsTableOuterFrame();
 
   void InitChildReflowState(nsPresContext&    aPresContext,                     
                             nsHTMLReflowState& aReflowState);
 
   /** Always returns 0, since the outer table frame has no border of its own
     * The inner table frame can answer this question in a meaningful way.
     * @see nsContainerFrame::GetSkipSides */
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   PRUint8 GetCaptionSide(); // NS_STYLE_CAPTION_SIDE_* or NO_SIDE
 
   bool HasSideCaption() {
     PRUint8 captionSide = GetCaptionSide();
     return captionSide == NS_STYLE_CAPTION_SIDE_LEFT ||
            captionSide == NS_STYLE_CAPTION_SIDE_RIGHT;
   }
@@ -221,12 +221,12 @@ protected:
   nsTableFrame* InnerTableFrame() const {
     return static_cast<nsTableFrame*>(mFrames.FirstChild());
   }
   
 private:
   nsFrameList   mCaptionFrames;
 };
 
-inline PRIntn nsTableOuterFrame::GetSkipSides() const
+inline int nsTableOuterFrame::GetSkipSides() const
 { return 0; }
 
 #endif
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -573,20 +573,20 @@ nsTableRowFrame::BuildDisplayList(nsDisp
       item = new (aBuilder) nsDisplayTableRowBackground(aBuilder, this);
       nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
   return nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect, aLists, item);
 }
 
-PRIntn
+int
 nsTableRowFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   if (nullptr != GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nullptr != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
 }
--- a/layout/tables/nsTableRowFrame.h
+++ b/layout/tables/nsTableRowFrame.h
@@ -235,17 +235,17 @@ protected:
   nsTableRowFrame(nsStyleContext *aContext);
 
   void InitChildReflowState(nsPresContext&         aPresContext,
                             const nsSize&           aAvailSize,
                             bool                    aBorderCollapse,
                             nsTableCellReflowState& aReflowState);
   
   /** implement abstract method on nsContainerFrame */
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   // row-specific methods
 
   nscoord ComputeCellXOffset(const nsHTMLReflowState& aState,
                              nsIFrame*                aKidFrame,
                              const nsMargin&          aKidMargin) const;
   /**
    * Called for incremental/dirty and resize reflows. If aDirtyOnly is true then
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -226,20 +226,20 @@ nsTableRowGroupFrame::BuildDisplayList(n
       nsresult rv = aLists.BorderBackground()->AppendNewToTop(item);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }  
   return nsTableFrame::DisplayGenericTablePart(aBuilder, this, aDirtyRect,
                                                aLists, item, DisplayRows);
 }
 
-PRIntn
+int
 nsTableRowGroupFrame::GetSkipSides() const
 {
-  PRIntn skip = 0;
+  int skip = 0;
   if (nullptr != GetPrevInFlow()) {
     skip |= 1 << NS_SIDE_TOP;
   }
   if (nullptr != GetNextInFlow()) {
     skip |= 1 << NS_SIDE_BOTTOM;
   }
   return skip;
 }
--- a/layout/tables/nsTableRowGroupFrame.h
+++ b/layout/tables/nsTableRowGroupFrame.h
@@ -327,17 +327,17 @@ public:
 protected:
   nsTableRowGroupFrame(nsStyleContext* aContext);
 
   void InitChildReflowState(nsPresContext&     aPresContext, 
                             bool               aBorderCollapse,
                             nsHTMLReflowState& aReflowState);
   
   /** implement abstract method on nsContainerFrame */
-  virtual PRIntn GetSkipSides() const;
+  virtual int GetSkipSides() const;
 
   void PlaceChild(nsPresContext*         aPresContext,
                   nsRowGroupReflowState& aReflowState,
                   nsIFrame*              aKidFrame,
                   nsHTMLReflowMetrics&   aDesiredSize,
                   const nsRect&          aOriginalKidRect,
                   const nsRect&          aOriginalKidVisualOverflow);
 
--- a/layout/xul/base/src/nsGroupBoxFrame.cpp
+++ b/layout/xul/base/src/nsGroupBoxFrame.cpp
@@ -121,17 +121,17 @@ nsGroupBoxFrame::BuildDisplayList(nsDisp
 
   return BuildDisplayListForChildren(aBuilder, aDirtyRect, aLists);
   // REVIEW: Debug borders now painted by nsFrame::BuildDisplayListForChild
 }
 
 void
 nsGroupBoxFrame::PaintBorderBackground(nsRenderingContext& aRenderingContext,
     nsPoint aPt, const nsRect& aDirtyRect) {
-  PRIntn skipSides = 0;
+  int skipSides = 0;
   const nsStyleBorder* borderStyleData = GetStyleBorder();
   const nsMargin& border = borderStyleData->GetComputedBorder();
   nscoord yoff = 0;
   nsPresContext* presContext = PresContext();
 
   nsRect groupRect;
   nsIFrame* groupBox = GetCaptionBox(presContext, groupRect);
 
--- a/netwerk/cache/nsCacheEntryDescriptor.cpp
+++ b/netwerk/cache/nsCacheEntryDescriptor.cpp
@@ -539,17 +539,17 @@ nsInputStreamWrapper::LazyInit()
     if (!cacheEntry) return NS_ERROR_NOT_AVAILABLE;
 
     rv = nsCacheService::OpenInputStreamForEntry(cacheEntry, mode,
                                                  mStartOffset,
                                                  getter_AddRefs(mInput));
 
     CACHE_LOG_DEBUG(("nsInputStreamWrapper::LazyInit "
                       "[entry=%p, wrapper=%p, mInput=%p, rv=%d]",
-                      mDescriptor, this, mInput.get(), PRIntn(rv)));
+                      mDescriptor, this, mInput.get(), int(rv)));
 
     if (NS_FAILED(rv)) return rv;
 
     mInitialized = true;
     return NS_OK;
 }
 
 nsresult nsCacheEntryDescriptor::
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -134,17 +134,17 @@ nsDiskCacheInputStream::Read(char * buff
     if (mFD) {
         // just read from file
         PRInt32  result = PR_Read(mFD, buffer, count);
         if (result < 0) {
             PRErrorCode error = PR_GetError();
             nsresult rv = NS_ErrorAccordingToNSPR();
             CACHE_LOG_DEBUG(("CACHE: nsDiskCacheInputStream::Read PR_Read failed"
                              "[stream=%p, rv=%d, NSPR error %s",
-                             this, PRIntn(rv), PR_ErrorToName(error)));
+                             this, int(rv), PR_ErrorToName(error)));
             return rv;
         }
         
         mPos += (PRUint32)result;
         *bytesRead = (PRUint32)result;
         
     } else if (mBuffer) {
         // read data from mBuffer
@@ -694,17 +694,17 @@ nsDiskCacheStreamIO::UpdateFileSize()
             NS_WARNING("cacheMap->UpdateRecord() failed.");
             // XXX doom cache entry?
         }
     }
 }
 
 
 nsresult
-nsDiskCacheStreamIO::OpenCacheFile(PRIntn flags, PRFileDesc ** fd)
+nsDiskCacheStreamIO::OpenCacheFile(int flags, PRFileDesc ** fd)
 {
     NS_ENSURE_ARG_POINTER(fd);
     
     CACHE_LOG_DEBUG(("nsDiskCacheStreamIO::OpenCacheFile"));
 
     nsresult         rv;
     nsDiskCacheMap * cacheMap = mDevice->CacheMap();
     
--- a/netwerk/cache/nsDiskCacheStreams.h
+++ b/netwerk/cache/nsDiskCacheStreams.h
@@ -53,17 +53,17 @@ public:
 
     // GCC 2.95.2 requires this to be defined, although we never call it.
     // and OS/2 requires that it not be private
     nsDiskCacheStreamIO() { NS_NOTREACHED("oops"); }
 private:
 
 
     void        Close();
-    nsresult    OpenCacheFile(PRIntn flags, PRFileDesc ** fd);
+    nsresult    OpenCacheFile(int flags, PRFileDesc ** fd);
     nsresult    ReadCacheBlocks();
     nsresult    FlushBufferToFile();
     void        UpdateFileSize();
     void        DeleteBuffer();
     nsresult    Flush();
 
 
     nsDiskCacheBinding *        mBinding;       // not an owning reference
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -960,17 +960,17 @@ nsHostResolver::ThreadFunc(void *arg)
     nsResState rs;
 #endif
     nsHostResolver *resolver = (nsHostResolver *)arg;
     nsHostRecord *rec;
     PRAddrInfo *ai;
     while (resolver->GetHostToLookup(&rec)) {
         LOG(("Calling getaddrinfo for host [%s].\n", rec->host));
 
-        PRIntn flags = PR_AI_ADDRCONFIG;
+        int flags = PR_AI_ADDRCONFIG;
         if (!(rec->flags & RES_CANON_NAME))
             flags |= PR_AI_NOCANONNAME;
 
         TimeStamp startTime = TimeStamp::Now();
 
         ai = PR_GetAddrInfoByName(rec->host, rec->af, flags);
 #if defined(RES_RETRY_ON_FAILURE)
         if (!ai && rs.Reset())
--- a/netwerk/protocol/http/nsHttpAuthCache.cpp
+++ b/netwerk/protocol/http/nsHttpAuthCache.cpp
@@ -185,17 +185,17 @@ nsHttpAuthCache::LookupAuthNode(const ch
         return nullptr;
 
     GetAuthKey(scheme, host, port, key);
 
     return (nsHttpAuthNode *) PL_HashTableLookup(mDB, key.get());
 }
 
 void *
-nsHttpAuthCache::AllocTable(void *self, PRSize size)
+nsHttpAuthCache::AllocTable(void *self, size_t size)
 {
     return malloc(size);
 }
 
 void
 nsHttpAuthCache::FreeTable(void *self, void *item)
 {
     free(item);
--- a/netwerk/protocol/http/nsHttpAuthCache.h
+++ b/netwerk/protocol/http/nsHttpAuthCache.h
@@ -216,17 +216,17 @@ public:
 
 private:
     nsHttpAuthNode *LookupAuthNode(const char *scheme,
                                    const char *host,
                                    PRInt32     port,
                                    nsCString  &key);
 
     // hash table allocation functions
-    static void*        AllocTable(void *, PRSize size);
+    static void*        AllocTable(void *, size_t size);
     static void         FreeTable(void *, void *item);
     static PLHashEntry* AllocEntry(void *, const void *key);
     static void         FreeEntry(void *, PLHashEntry *he, PRUintn flag);
 
     static PLHashAllocOps gHashAllocOps;
     
 private:
     PLHashTable *mDB; // "host:port" --> nsHttpAuthNode
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -140,21 +140,21 @@ MaybeMarkCacheEntryValid(const void * ch
                          nsCacheAccessMode cacheAccess)
 {
     // Mark the cache entry as valid in order to allow others access to it.
     // XXX: Is it really necessary to check for write acccess to the entry?
     if (cacheAccess & nsICache::ACCESS_WRITE) {
         nsresult rv = cacheEntry->MarkValid();
         LOG(("Marking cache entry valid "
              "[channel=%p, entry=%p, access=%d, result=%d]",
-             channel, cacheEntry, PRIntn(cacheAccess), PRIntn(rv)));
+             channel, cacheEntry, int(cacheAccess), int(rv)));
     } else {
         LOG(("Not marking read-only cache entry valid "
              "[channel=%p, entry=%p, access=%d]", 
-             channel, cacheEntry, PRIntn(cacheAccess)));
+             channel, cacheEntry, int(cacheAccess)));
     }
 }
 
 } // unnamed namespace
 
 class AutoRedirectVetoNotifier
 {
 public:
@@ -2886,17 +2886,17 @@ HttpCacheQuery::Run()
 NS_IMETHODIMP
 HttpCacheQuery::OnCacheEntryAvailable(nsICacheEntryDescriptor *entry,
                                       nsCacheAccessMode access,
                                       nsresult status)
 
 {
     LOG(("HttpCacheQuery::OnCacheEntryAvailable [channel=%p entry=%p "
          "access=%x status=%x, mRunConut=%d]\n", mChannel.get(), entry, access,
-         status, PRIntn(mRunCount)));
+         status, int(mRunCount)));
 
     // XXX Bug 759805: Sometimes we will call this method directly from
     // HttpCacheQuery::Run when AsyncOpenCacheEntry fails, but
     // AsyncOpenCacheEntry will also call this method. As a workaround, we just
     // ensure we only execute this code once.
     NS_ENSURE_TRUE(mRunCount == 0, NS_ERROR_UNEXPECTED);
     ++mRunCount;
 
@@ -5857,17 +5857,17 @@ nsHttpChannel::DoInvalidateCacheEntry(co
     // one point by using only READ_ONLY access-policy. I think this is safe.
 
     // First, find session holding the cache-entry - use current storage-policy
     nsCacheStoragePolicy storagePolicy = DetermineStoragePolicy();
     const char * clientID =
         GetCacheSessionNameForStoragePolicy(storagePolicy, mPrivateBrowsing);
 
     LOG(("DoInvalidateCacheEntry [channel=%p session=%s policy=%d key=%s]",
-         this, clientID, PRIntn(storagePolicy), key.get()));
+         this, clientID, int(storagePolicy), key.get()));
 
     nsresult rv;
     nsCOMPtr<nsICacheService> serv =
         do_GetService(NS_CACHESERVICE_CONTRACTID, &rv);
     nsCOMPtr<nsICacheSession> session;
     if (NS_SUCCEEDED(rv)) {
         rv = serv->CreateSession(clientID, storagePolicy,  
                                  nsICache::STREAM_BASED,
@@ -5876,17 +5876,17 @@ nsHttpChannel::DoInvalidateCacheEntry(co
     if (NS_SUCCEEDED(rv)) {
         rv = session->SetIsPrivate(mPrivateBrowsing);
     }
     if (NS_SUCCEEDED(rv)) {
         rv = session->DoomEntry(key, nullptr);
     }
 
     LOG(("DoInvalidateCacheEntry [channel=%p session=%s policy=%d key=%s rv=%d]",
-         this, clientID, PRIntn(storagePolicy), key.get(), PRIntn(rv)));
+         this, clientID, int(storagePolicy), key.get(), int(rv)));
 }
 
 nsCacheStoragePolicy
 nsHttpChannel::DetermineStoragePolicy()
 {
     nsCacheStoragePolicy policy = nsICache::STORE_ANYWHERE;
     if (mPrivateBrowsing)
         policy = nsICache::STORE_IN_MEMORY;
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -1175,17 +1175,17 @@ nsSOCKSIOLayerGetPeerName(PRFileDesc *fd
         if (info->GetDestinationAddr(&addr) == NS_OK)
             return PR_SUCCESS;
     }
 
     return PR_FAILURE;
 }
 
 static PRStatus
-nsSOCKSIOLayerListen(PRFileDesc *fd, PRIntn backlog)
+nsSOCKSIOLayerListen(PRFileDesc *fd, int backlog)
 {
     // TODO: implement SOCKS support for listen
     return fd->lower->methods->listen(fd->lower, backlog);
 }
 
 // add SOCKS IO layer to an existing socket
 nsresult
 nsSOCKSIOLayerAddToSocket(PRInt32 family,
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -14,17 +14,17 @@
 
 static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
 
 #ifdef DEBUG_BenB_Perf
 #include "prtime.h"
 #include "prinrval.h"
 #endif
 
-const PRFloat64 growthRate = 1.2;
+const double growthRate = 1.2;
 
 // Bug 183111, editor now replaces multiple spaces with leading
 // 0xA0's and a single ending space, so need to treat 0xA0's as spaces.
 // 0xA0 is the Latin1/Unicode character for "non-breaking space (nbsp)"
 // Also recognize the Japanese ideographic space 0x3000 as a space.
 static inline bool IsSpace(const PRUnichar aChar)
 {
   return (nsCRT::IsAsciiSpace(aChar) || aChar == 0xA0 || aChar == 0x3000);
--- a/netwerk/test/TestProtocols.cpp
+++ b/netwerk/test/TestProtocols.cpp
@@ -539,17 +539,17 @@ InputTestConsumer::OnStopRequest(nsIRequ
          NS_ERROR_UNKNOWN_PROXY_HOST == aStatus) {
          LOG(("\tDNS lookup failed.\n"));
      }
     LOG(("\tTime to connect: %.3f seconds\n", connectTime));
     LOG(("\tTime to read: %.3f seconds.\n", readTime));
     LOG(("\tRead: %lld bytes.\n", info->mBytesRead));
     if (info->mBytesRead == PRInt64(0)) {
     } else if (readTime > 0.0) {
-      LOG(("\tThroughput: %.0f bps.\n", (PRFloat64)(info->mBytesRead*PRInt64(8))/readTime));
+      LOG(("\tThroughput: %.0f bps.\n", (double)(info->mBytesRead*PRInt64(8))/readTime));
     } else {
       LOG(("\tThroughput: REAL FAST!!\n"));
     }
 
     nsCOMPtr<nsITimedChannel> timed(do_QueryInterface(request));
     if (timed)
         PrintTimingInformation(timed);
   } else {
--- a/netwerk/test/TestSocketIO.cpp
+++ b/netwerk/test/TestSocketIO.cpp
@@ -232,17 +232,17 @@ main(int argc, char* argv[])
 
 #if defined(PR_LOGGING)
     gTestSocketIOLog = PR_NewLogModule("TestSocketIO");
 #endif
 
     if (argc < 3)
         usage(argv);
 
-    PRIntn i=0;
+    int i=0;
     bool sync = false;
     if (nsCRT::strcasecmp(argv[1], "-sync") == 0) {
         if (argc < 4)
             usage(argv);
         sync = true;
         i = 1;
     }
 
--- a/parser/htmlparser/src/nsHTMLTags.cpp
+++ b/parser/htmlparser/src/nsHTMLTags.cpp
@@ -294,17 +294,17 @@ PLHashTable* nsHTMLTags::gTagAtomTable;
 
 // PRUnichar* -> id hash
 static PLHashNumber
 HTMLTagsHashCodeUCPtr(const void *key)
 {
   return HashString(static_cast<const PRUnichar*>(key));
 }
 
-static PRIntn
+static int
 HTMLTagsKeyCompareUCPtr(const void *key1, const void *key2)
 {
   const PRUnichar *str1 = (const PRUnichar *)key1;
   const PRUnichar *str2 = (const PRUnichar *)key2;
 
   return nsCRT::strcmp(str1, str2) == 0;
 }
 
--- a/rdf/base/src/nsRDFService.cpp
+++ b/rdf/base/src/nsRDFService.cpp
@@ -77,17 +77,17 @@ static PRLogModuleInfo* gLog = nullptr;
 
 class BlobImpl;
 
 // These functions are copied from nsprpub/lib/ds/plhash.c, with one
 // change to free the key in DataSourceFreeEntry.
 // XXX sigh, why were DefaultAllocTable et. al. declared static, anyway?
 
 static void *
-DataSourceAllocTable(void *pool, PRSize size)
+DataSourceAllocTable(void *pool, size_t size)
 {
     return PR_MALLOC(size);
 }
 
 static void
 DataSourceFreeTable(void *pool, void *item)
 {
     PR_Free(item);
--- a/security/manager/ssl/src/nsCRLManager.cpp
+++ b/security/manager/ssl/src/nsCRLManager.cpp
@@ -388,17 +388,17 @@ nsCRLManager::ComputeNextAutoUpdateTime(
   PRTime microsecInDayCnt;
   PRTime now = PR_Now();
   PRTime tempTime;
   PRInt64 diff = 0;
   PRInt64 secsInDay = 86400UL;
   PRInt64 temp;
   PRInt64 cycleCnt = 0;
   PRInt64 secsInDayCnt;
-  PRFloat64 tmpData;
+  double tmpData;
   
   LL_L2F(tmpData,secsInDay);
   LL_MUL(tmpData,dayCnt,tmpData);
   LL_F2L(secsInDayCnt,tmpData);
   LL_MUL(microsecInDayCnt, secsInDayCnt, PR_USEC_PER_SEC);
     
   PRTime lastUpdate;
   PRTime nextUpdate;
--- a/security/manager/ssl/src/nsNSSCertHelper.cpp
+++ b/security/manager/ssl/src/nsNSSCertHelper.cpp
@@ -896,17 +896,17 @@ ProcessRDN(CERTRDN* rdn, nsAString &fina
     //This function returns a string in UTF8 format.
     decodeItem = CERT_DecodeAVAValue(&ava->value);
     if(!decodeItem) {
       return NS_ERROR_FAILURE;
     }
 
     // We know we can fit buffer of this length. CERT_RFC1485_EscapeAndQuote
     // will fail if we provide smaller buffer then the result can fit to.
-    PRIntn escapedValueCapacity = decodeItem->len * 3 + 3;
+    int escapedValueCapacity = decodeItem->len * 3 + 3;
     nsAutoArrayPtr<char> escapedValue;
     escapedValue = new char[escapedValueCapacity];
     if (!escapedValue) {
       SECITEM_FreeItem(decodeItem, true);
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     SECStatus status = CERT_RFC1485_EscapeAndQuote(
--- a/security/manager/ssl/src/nsNSSComponent.cpp
+++ b/security/manager/ssl/src/nsNSSComponent.cpp
@@ -118,17 +118,17 @@ static PLHashNumber PR_CALLBACK certHash
   
   for (i = 0; i < certKey->len; ++i, ++c) {
     hash += *c;
   }
   
   return hash;
 }
 
-static PRIntn PR_CALLBACK certHashtable_keyCompare(const void *k1, const void *k2)
+static int PR_CALLBACK certHashtable_keyCompare(const void *k1, const void *k2)
 {
   // return type is a bool, answering the question "are the keys equal?"
 
   if (!k1 || !k2)
     return false;
   
   SECItem *certKey1 = (SECItem*)k1;
   SECItem *certKey2 = (SECItem*)k2;
@@ -145,30 +145,30 @@ static PRIntn PR_CALLBACK certHashtable_
     if (*c1 != *c2) {
       return false;
     }
   }
   
   return true;
 }
 
-static PRIntn PR_CALLBACK certHashtable_valueCompare(const void *v1, const void *v2)
+static int PR_CALLBACK certHashtable_valueCompare(const void *v1, const void *v2)
 {
   // two values are identical if their keys are identical
   
   if (!v1 || !v2)
     return false;
   
   CERTCertificate *cert1 = (CERTCertificate*)v1;
   CERTCertificate *cert2 = (CERTCertificate*)v2;
   
   return certHashtable_keyCompare(&cert1->certKey, &cert2->certKey);
 }
 
-static PRIntn PR_CALLBACK certHashtable_clearEntry(PLHashEntry *he, PRIntn /*index*/, void * /*userdata*/)
+static int PR_CALLBACK certHashtable_clearEntry(PLHashEntry *he, int /*index*/, void * /*userdata*/)
 {
   if (he && he->value) {
     CERT_DestroyCertificate((CERTCertificate*)he->value);
   }
   
   return HT_ENUMERATE_NEXT;
 }
 
--- a/security/manager/ssl/src/nsNSSIOLayer.cpp
+++ b/security/manager/ssl/src/nsNSSIOLayer.cpp
@@ -693,22 +693,22 @@ PRStatus nsNSSSocketInfo::CloseSocketAnd
 }
 
 #if defined(DEBUG_SSL_VERBOSE) && defined(DUMP_BUFFER)
 /* Dumps a (potentially binary) buffer using SSM_DEBUG. 
    (We could have used the version in ssltrace.c, but that's
    specifically tailored to SSLTRACE. Sigh. */
 #define DUMPBUF_LINESIZE 24
 static void
-nsDumpBuffer(unsigned char *buf, PRIntn len)
+nsDumpBuffer(unsigned char *buf, int len)
 {
   char hexbuf[DUMPBUF_LINESIZE*3+1];
   char chrbuf[DUMPBUF_LINESIZE+1];
   static const char *hex = "0123456789abcdef";
-  PRIntn i = 0, l = 0;
+  int i = 0, l = 0;
   char ch, *c, *h;
   if (len == 0)
     return;
   hexbuf[DUMPBUF_LINESIZE*3] = '\0';
   chrbuf[DUMPBUF_LINESIZE] = '\0';
   (void) memset(hexbuf, 0x20, DUMPBUF_LINESIZE*3);
   (void) memset(chrbuf, 0x20, DUMPBUF_LINESIZE);
   h = hexbuf;
@@ -992,17 +992,17 @@ PRDescIdentity nsSSLIOLayerHelpers::nsSS
 PRIOMethods nsSSLIOLayerHelpers::nsSSLIOLayerMethods;
 Mutex *nsSSLIOLayerHelpers::mutex = nullptr;
 nsTHashtable<nsCStringHashKey> *nsSSLIOLayerHelpers::mTLSIntolerantSites = nullptr;
 nsTHashtable<nsCStringHashKey> *nsSSLIOLayerHelpers::mTLSTolerantSites = nullptr;
 nsTHashtable<nsCStringHashKey> *nsSSLIOLayerHelpers::mRenegoUnrestrictedSites = nullptr;
 bool nsSSLIOLayerHelpers::mTreatUnsafeNegotiationAsBroken = false;
 PRInt32 nsSSLIOLayerHelpers::mWarnLevelMissingRFC5746 = 1;
 
-static PRIntn _PSM_InvalidInt(void)
+static int _PSM_InvalidInt(void)
 {
     PR_ASSERT(!"I/O method is invalid");
     PR_SetError(PR_INVALID_METHOD_ERROR, 0);
     return -1;
 }
 
 static PRInt64 _PSM_InvalidInt64(void)
 {
@@ -1059,17 +1059,17 @@ static PRStatus PR_CALLBACK PSMSetsocket
   nsNSSShutDownPreventionLock locker;
   if (!getSocketInfoIfRunning(fd, not_reading_or_writing, locker))
     return PR_FAILURE;
 
   return fd->lower->methods->setsocketoption(fd, data);
 }
 
 static PRInt32 PR_CALLBACK PSMRecv(PRFileDesc *fd, void *buf, PRInt32 amount,
-    PRIntn flags, PRIntervalTime timeout)
+    int flags, PRIntervalTime timeout)
 {
   nsNSSShutDownPreventionLock locker;
   nsNSSSocketInfo *socketInfo = getSocketInfoIfRunning(fd, reading, locker);
   if (!socketInfo)
     return -1;
 
   if (flags != PR_MSG_PEEK && flags != 0) {
     PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
@@ -1084,17 +1084,17 @@ static PRInt32 PR_CALLBACK PSMRecv(PRFil
 #ifdef DEBUG_SSL_VERBOSE
   DEBUG_DUMP_BUFFER((unsigned char*)buf, bytesRead);
 #endif
 
   return checkHandshake(bytesRead, true, fd, socketInfo);
 }
 
 static PRInt32 PR_CALLBACK PSMSend(PRFileDesc *fd, const void *buf, PRInt32 amount,
-    PRIntn flags, PRIntervalTime timeout)
+    int flags, PRIntervalTime timeout)
 {
   nsNSSShutDownPreventionLock locker;
   nsNSSSocketInfo *socketInfo = getSocketInfoIfRunning(fd, writing, locker);
   if (!socketInfo)
     return -1;
 
   if (flags != 0) {
     PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
@@ -1131,17 +1131,17 @@ static PRStatus PR_CALLBACK PSMConnectco
   nsNSSShutDownPreventionLock locker;
   if (!getSocketInfoIfRunning(fd, not_reading_or_writing, locker)) {
     return PR_FAILURE;
   }
 
   return fd->lower->methods->connectcontinue(fd, out_flags);
 }
 
-static PRIntn PSMAvailable(void)
+static int PSMAvailable(void)
 {
   // This is called through PR_Available(), but is not implemented in PSM
   PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
   return -1;
 }
 
 static PRInt64 PSMAvailable64(void)
 {
@@ -1431,17 +1431,17 @@ loser:
  * CERTCertificateScopeEntry: struct for scope entry that can be consumed by
  *                            the code
  * certCertificateScopeOfUse: struct that represents the decoded extension data
  */
 typedef struct {
     SECItem derConstraint;
     SECItem derPort;
     CERTGeneralName* constraint; /* decoded constraint */
-    PRIntn port; /* decoded port number */
+    int port; /* decoded port number */
 } CERTCertificateScopeEntry;
 
 typedef struct {
     CERTCertificateScopeEntry** entries;
 } certCertificateScopeOfUse;
 
 /* corresponding ASN1 templates */
 static const SEC_ASN1Template cert_CertificateScopeEntryTemplate[] = {
@@ -1557,17 +1557,17 @@ static char* _str_to_lower(char* string)
 
 /*
  * Sees if the client certificate has a restriction in presenting the cert
  * to the host: returns true if there is no restriction or if the hostname
  * (and the port) satisfies the restriction, or false if the hostname (and
  * the port) does not satisfy the restriction
  */
 static bool CERT_MatchesScopeOfUse(CERTCertificate* cert, char* hostname,
-                                     char* hostIP, PRIntn port)
+                                     char* hostIP, int port)
 {
     bool rv = true; /* whether the cert can be presented */
     SECStatus srv;
     SECItem extData;
     PRArenaPool* arena = NULL;
     CERTCertificateScopeEntry** entries = NULL;
     /* arrays of decoded scope entries */
     int numEntries = 0;
@@ -1883,17 +1883,17 @@ void ClientAuthDataRunnable::RunOnTarget
   PRArenaPool* arena = NULL;
   char** caNameStrings;
   CERTCertificate* cert = NULL;
   SECKEYPrivateKey* privKey = NULL;
   CERTCertList* certList = NULL;
   CERTCertListNode* node;
   CERTCertNicknames* nicknames = NULL;
   char* extracted = NULL;
-  PRIntn keyError = 0; /* used for private key retrieval error */
+  int keyError = 0; /* used for private key retrieval error */
   SSM_UserCertChoice certChoice;
   PRInt32 NumberOfCerts = 0;
   void * wincx = mSocketInfo;
 
   /* create caNameStrings */
   arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
   if (arena == NULL) {
     goto loser;
--- a/security/manager/ssl/src/nsPKCS12Blob.cpp
+++ b/security/manager/ssl/src/nsPKCS12Blob.cpp
@@ -580,17 +580,17 @@ nsPKCS12Blob::inputToDecoder(SEC_PKCS12D
   }
   return NS_OK;
 }
 
 #ifdef XP_MAC
 
 OSErr ConvertMacPathToUnixPath(const char *macPath, char **unixPath)
 {
-  PRIntn len;
+  int len;
   char *cursor;
   
   len = PL_strlen(macPath);
   cursor = (char*)PR_Malloc(len+2);
   if (!cursor)
     return memFullErr;
     
   memcpy(cursor+1, macPath, len+1);
--- a/testing/mochitest/ssltunnel/ssltunnel.cpp
+++ b/testing/mochitest/ssltunnel/ssltunnel.cpp
@@ -260,29 +260,29 @@ PRNetAddr websocket_server;
 PRThreadPool* threads = NULL;
 PRLock* shutdown_lock = NULL;
 PRCondVar* shutdown_condvar = NULL;
 // Not really used, unless something fails to start
 bool shutdown_server = false;
 bool do_http_proxy = false;
 bool any_host_spec_config = false;
 
-PR_CALLBACK PRIntn ClientAuthValueComparator(const void *v1, const void *v2)
+PR_CALLBACK int ClientAuthValueComparator(const void *v1, const void *v2)
 {
   int a = *static_cast<const client_auth_option*>(v1) -
           *static_cast<const client_auth_option*>(v2);
   if (a == 0)
     return 0;
   if (a > 0)
     return 1;
   else // (a < 0)
     return -1;
 }
 
-static PRIntn match_hostname(PLHashEntry *he, PRIntn index, void* arg)
+static int match_hostname(PLHashEntry *he, int index, void* arg)
 {
   server_match_t *match = (server_match_t*)arg;
   if (match->fullHost.find((char*)he->key) != string::npos)
     match->matched = true;
   return HT_ENUMERATE_NEXT;
 }
 
 /*
@@ -1263,31 +1263,31 @@ int parseConfigFile(const char* filePath
   if (any_host_spec_config && !do_http_proxy)
   {
     LOG_ERROR(("Warning: any host-specific configurations are ignored, add httpproxy:1 to allow them\n"));
   }
 
   return 0;
 }
 
-PRIntn freeHostCertHashItems(PLHashEntry *he, PRIntn i, void *arg)
+int freeHostCertHashItems(PLHashEntry *he, int i, void *arg)
 {
   delete [] (char*)he->key;
   delete [] (char*)he->value;
   return HT_ENUMERATE_REMOVE;
 }
 
-PRIntn freeHostRedirHashItems(PLHashEntry *he, PRIntn i, void *arg)
+int freeHostRedirHashItems(PLHashEntry *he, int i, void *arg)
 {
   delete [] (char*)he->key;
   delete [] (char*)he->value;
   return HT_ENUMERATE_REMOVE;
 }
 
-PRIntn freeClientAuthHashItems(PLHashEntry *he, PRIntn i, void *arg)
+int freeClientAuthHashItems(PLHashEntry *he, int i, void *arg)
 {
   delete [] (char*)he->key;
   delete (client_auth_option*)he->value;
   return HT_ENUMERATE_REMOVE;
 }
 
 int main(int argc, char** argv)
 {
--- a/testing/mochitest/tests/SimpleTest/TestRunner.js
+++ b/testing/mochitest/tests/SimpleTest/TestRunner.js
@@ -420,20 +420,20 @@ TestRunner.testFinished = function(tests
                 TestRunner.log("TEST-INFO | Found unexpected crash dump file " +
                                aFilename + ".");
             });
         }
     }
 
     function runNextTest() {
         if (TestRunner.currentTestURL != TestRunner.getLoadedTestURL()) {
-            TestRunner.log("TEST-UNEXPECTED-FAIL | " +
-                           TestRunner.currentTestURL +
-                           " | finished in a non-clean fashion (in " +
-                           TestRunner.getLoadedTestURL() + ")");
+            TestRunner.error("TEST-UNEXPECTED-FAIL | " +
+                             TestRunner.currentTestURL +
+                             " | finished in a non-clean fashion (in " +
+                             TestRunner.getLoadedTestURL() + ")");
             tests.push({ result: false });
         }
 
         var runtime = new Date().valueOf() - TestRunner._currentTestStartTime;
         TestRunner.log("TEST-END | " +
                        TestRunner.currentTestURL +
                        " | finished in " + runtime + "ms");
 
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -2909,17 +2909,17 @@ nsDownload::SetProgressBytes(PRInt64 aCu
   (void)GetAmountTransferred(&currBytes);
   (void)GetSize(&maxBytes);
 
   if (currBytes == maxBytes)
     mPercentComplete = 100;
   else if (maxBytes <= 0)
     mPercentComplete = -1;
   else
-    mPercentComplete = (PRInt32)((PRFloat64)currBytes / maxBytes * 100 + .5);
+    mPercentComplete = (PRInt32)((double)currBytes / maxBytes * 100 + .5);
 }
 
 nsresult
 nsDownload::Pause()
 {
   if (!IsResumable())
     return NS_ERROR_UNEXPECTED;
 
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -1954,17 +1954,17 @@ EnumerateAnnotations(const nsACString& k
 static bool
 WriteExtraData(nsIFile* extraFile,
                const AnnotationTable& data,
                const Blacklist& blacklist,
                bool writeCrashTime=false,
                bool truncate=false)
 {
   PRFileDesc* fd;
-  PRIntn truncOrAppend = truncate ? PR_TRUNCATE : PR_APPEND;
+  int truncOrAppend = truncate ? PR_TRUNCATE : PR_APPEND;
   nsresult rv = 
     extraFile->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE | truncOrAppend,
                                 0600, &fd);
   if (NS_FAILED(rv))
     return false;
 
   EnumerateAnnotationsContext ctx = { blacklist, fd };
   data.EnumerateRead(EnumerateAnnotations, &ctx);
--- a/tools/trace-malloc/bloatblame.cpp
+++ b/tools/trace-malloc/bloatblame.cpp
@@ -185,17 +185,17 @@ bad:
                     continue;                                                 \
                 }                                                             \
                 nextp = &next->next;                                          \
             }                                                                 \
             currp = &curr->next;                                              \
         }                                                                     \
     PR_END_MACRO
 
-static PRIntn tabulate_node(PLHashEntry *he, PRIntn i, void *arg)
+static int tabulate_node(PLHashEntry *he, int i, void *arg)
 {
     tmgraphnode *node = (tmgraphnode*) he;
     tmgraphnode **table = (tmgraphnode**) arg;
 
     table[i] = node;
     BUBBLE_SORT_LINKED_LIST(&node->down, tmgraphnode,
         (curr->allocs.bytes.total < next->allocs.bytes.total));
     return HT_ENUMERATE_NEXT;
--- a/widget/nsGUIEvent.h
+++ b/widget/nsGUIEvent.h
@@ -1708,31 +1708,31 @@ public:
 
 /**
  * Simple gesture event
  */
 class nsSimpleGestureEvent : public nsMouseEvent_base
 {
 public:
   nsSimpleGestureEvent(bool isTrusted, PRUint32 msg, nsIWidget* w,
-                         PRUint32 directionArg, PRFloat64 deltaArg)
+                         PRUint32 directionArg, double deltaArg)
     : nsMouseEvent_base(isTrusted, msg, w, NS_SIMPLE_GESTURE_EVENT),
       direction(directionArg), delta(deltaArg), clickCount(0)
   {
   }
 
   nsSimpleGestureEvent(const nsSimpleGestureEvent& other)
     : nsMouseEvent_base((other.flags & NS_EVENT_FLAG_TRUSTED) != 0,
                         other.message, other.widget, NS_SIMPLE_GESTURE_EVENT),
       direction(other.direction), delta(other.delta), clickCount(0)
   {
   }
 
   PRUint32 direction;   // See nsIDOMSimpleGestureEvent for values
-  PRFloat64 delta;      // Delta for magnify and rotate events
+  double delta;         // Delta for magnify and rotate events
   PRUint32 clickCount;  // The number of taps for tap events
 };
 
 class nsTransitionEvent : public nsEvent
 {
 public:
   nsTransitionEvent(bool isTrusted, PRUint32 msg,
                     const nsString &propertyNameArg, float elapsedTimeArg)
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -2076,17 +2076,17 @@ nsWindow::OnGestureEvent(QGestureEvent* 
             hotspot.x = swipe->hotSpot().x();
             hotspot.y = swipe->hotSpot().y();
 
             // Cancel pinch gesture
             mGesturesCancelled = true;
             mPinchEvent.needDispatch = false;
 
             double distance = DistanceBetweenPoints(swipe->hotSpot(), mPinchEvent.touchPoint) * 2;
-            PRFloat64 delta = distance - mPinchEvent.startDistance;
+            double delta = distance - mPinchEvent.startDistance;
 
             DispatchGestureEvent(NS_SIMPLE_GESTURE_MAGNIFY, 0, delta / 2, hotspot);
 
             result = DispatchGestureEvent(NS_SIMPLE_GESTURE_SWIPE,
                                           swipe->Direction(), 0, hotspot);
         }
         mLastMultiTouchTime.start();
     }
--- a/widget/xremoteclient/XRemoteClient.cpp
+++ b/widget/xremoteclient/XRemoteClient.cpp
@@ -485,17 +485,17 @@ XRemoteClient::FindBestWindow(const char
                                     0, (65536 / sizeof (long)),
                                     False, XA_STRING,
                                     &type, &format, &nitems, &bytesafter,
                                     &data_return);
 
     if (!data_return)
       continue;
 
-    PRFloat64 version = PR_strtod((char*) data_return, nullptr);
+    double version = PR_strtod((char*) data_return, nullptr);
     XFree(data_return);
 
     if (aSupportsCommandLine && !(version >= 5.1 && version < 6))
       continue;
 
     data_return = 0;
 
     if (status != Success || type == None)
--- a/xpcom/base/VisualEventTracer.cpp
+++ b/xpcom/base/VisualEventTracer.cpp
@@ -160,17 +160,17 @@ EventFilter::Build(const char * filterVa
 {
   if (!filterVar || !*filterVar)
     return nullptr;
 
   // Reads a comma serpatated list of events.
 
   // Copied from nspr logging code (read of NSPR_LOG_MODULES)
   char eventName[64];
-  PRIntn evlen = strlen(filterVar), pos = 0, count, delta = 0;
+  int evlen = strlen(filterVar), pos = 0, count, delta = 0;
 
   // Read up to a comma or EOF -> get name of an event first in the list
   count = sscanf(filterVar, "%63[^,]%n", eventName, &delta);
   if (count == 0) 
     return nullptr;
 
   pos = delta;
 
@@ -252,17 +252,17 @@ void FlushingThread(void * aArg)
     while (batch) {
       if (!firstBatch) {
         const char threadDelimiter[] = ",\n";
         rv = PR_Write(logFile, threadDelimiter, sizeof(threadDelimiter) - 1);
         ioError |= (rv < 0);
       }
       firstBatch = false;
 
-      static const PRIntn kBufferSize = 2048;
+      static const int kBufferSize = 2048;
       char buf[kBufferSize];
 
       PR_snprintf(buf, kBufferSize, "{\"thread\":\"%s\",\"log\":[\n", 
                   batch->mThreadNameCopy);
 
       rv = PR_Write(logFile, buf, strlen(buf));
       ioError |= (rv < 0);
 
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -250,17 +250,17 @@ static nsAssertBehavior GetAssertBehavio
 struct FixedBuffer
 {
   FixedBuffer() : curlen(0) { buffer[0] = '\0'; }
 
   char buffer[1000];
   PRUint32 curlen;
 };
 
-static PRIntn
+static int
 StuffFixedBuffer(void *closure, const char *buf, PRUint32 len)
 {
   if (!len)
     return 0;
   
   FixedBuffer *fb = (FixedBuffer*) closure;
 
   // strip the trailing null, we add it again later
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -21,23 +21,23 @@
 #include "nsString.h"
 #include "mozilla/Services.h"
 
 static nsMemoryImpl sGlobalMemory;
 
 NS_IMPL_QUERY_INTERFACE1(nsMemoryImpl, nsIMemory)
 
 NS_IMETHODIMP_(void*)
-nsMemoryImpl::Alloc(PRSize size)
+nsMemoryImpl::Alloc(size_t size)
 {
     return NS_Alloc(size);
 }
 
 NS_IMETHODIMP_(void*)
-nsMemoryImpl::Realloc(void* ptr, PRSize size)
+nsMemoryImpl::Realloc(void* ptr, size_t size)
 {
     return NS_Realloc(ptr, size);
 }
 
 NS_IMETHODIMP_(void)
 nsMemoryImpl::Free(void* ptr)
 {
     NS_Free(ptr);
@@ -153,23 +153,23 @@ nsMemoryImpl::sIsFlushing = 0;
 
 PRIntervalTime
 nsMemoryImpl::sLastFlushTime = 0;
 
 nsMemoryImpl::FlushEvent
 nsMemoryImpl::sFlushEvent;
 
 XPCOM_API(void*)
-NS_Alloc(PRSize size)
+NS_Alloc(size_t size)
 {
     return moz_xmalloc(size);
 }
 
 XPCOM_API(void*)
-NS_Realloc(void* ptr, PRSize size)
+NS_Realloc(void* ptr, size_t size)
 {
     return moz_xrealloc(ptr, size);
 }
 
 XPCOM_API(void)
 NS_Free(void* ptr)
 {
     moz_free(ptr);
--- a/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/xpcom/base/nsTraceRefcntImpl.cpp
@@ -150,17 +150,17 @@ AssertActivityIsLegal()
 #  define ASSERT_ACTIVITY_IS_LEGAL PR_BEGIN_MACRO PR_END_MACRO
 #endif  // DEBUG
 
 // These functions are copied from nsprpub/lib/ds/plhash.c, with changes
 // to the functions not called Default* to free the serialNumberRecord or
 // the BloatEntry.
 
 static void *
-DefaultAllocTable(void *pool, PRSize size)
+DefaultAllocTable(void *pool, size_t size)
 {
     return PR_MALLOC(size);
 }
 
 static void
 DefaultFreeTable(void *pool, void *item)
 {
     PR_Free(item);
@@ -276,26 +276,26 @@ public:
   }
 
   void AccountObjs() {
     PRUint64 cnt = (mNewStats.mCreates - mNewStats.mDestroys);
     mNewStats.mObjsOutstandingTotal += cnt;
     mNewStats.mObjsOutstandingSquared += cnt * cnt;
   }
 
-  static PRIntn DumpEntry(PLHashEntry *he, PRIntn i, void *arg) {
+  static int DumpEntry(PLHashEntry *he, int i, void *arg) {
     BloatEntry* entry = (BloatEntry*)he->value;
     if (entry) {
       entry->Accumulate();
       static_cast<nsTArray<BloatEntry*>*>(arg)->AppendElement(entry);
     }
     return HT_ENUMERATE_NEXT;
   }
 
-  static PRIntn TotalEntries(PLHashEntry *he, PRIntn i, void *arg) {
+  static int TotalEntries(PLHashEntry *he, int i, void *arg) {
     BloatEntry* entry = (BloatEntry*)he->value;
     if (entry && nsCRT::strcmp(entry->mClassName, "TOTAL") != 0) {
       entry->Total((BloatEntry*)arg);
     }
     return HT_ENUMERATE_NEXT;
   }
 
   void Total(BloatEntry* total) {
@@ -337,17 +337,17 @@ public:
         "     |<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->|\n" \
         "                                              Per-Inst   Leaked    Total      Rem      Mean       StdDev     Total      Rem      Mean       StdDev\n");
 
     this->DumpTotal(out);
 
     return true;
   }
 
-  void Dump(PRIntn i, FILE* out, nsTraceRefcntImpl::StatisticsType type) {
+  void Dump(int i, FILE* out, nsTraceRefcntImpl::StatisticsType type) {
     nsTraceRefcntStats* stats = (type == nsTraceRefcntImpl::NEW_STATS) ? &mNewStats : &mAllStats;
     if (gLogLeaksOnly && !HaveLeaks(stats)) {
       return;
     }
 
     double meanRefs, stddevRefs;
     NS_MeanAndStdDev(stats->mAddRefs + stats->mReleases,
                      stats->mRefsOutstandingTotal,
@@ -439,17 +439,17 @@ GetBloatEntry(const char* aTypeName, PRU
       NS_ASSERTION(aInstanceSize == 0 ||
                    entry->GetClassSize() == aInstanceSize,
                    "bad size recorded");
     }
   }
   return entry;
 }
 
-static PRIntn DumpSerialNumbers(PLHashEntry* aHashEntry, PRIntn aIndex, void* aClosure)
+static int DumpSerialNumbers(PLHashEntry* aHashEntry, int aIndex, void* aClosure)
 {
   serialNumberRecord* record = reinterpret_cast<serialNumberRecord *>(aHashEntry->value);
 #ifdef HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
   fprintf((FILE*) aClosure, "%d @%p (%d references; %d from COMPtrs)\n",
                             record->serialNumber,
                             NS_INT32_TO_PTR(aHashEntry->key),
                             record->refCount,
                             record->COMPtrCount);
--- a/xpcom/base/nsUUIDGenerator.cpp
+++ b/xpcom/base/nsUUIDGenerator.cpp
@@ -35,19 +35,19 @@ nsUUIDGenerator::Init()
 {
     // We're a service, so we're guaranteed that Init() is not going
     // to be reentered while we're inside Init().
     
 #if !defined(XP_WIN) && !defined(XP_MACOSX) && !defined(ANDROID)
     /* initialize random number generator using NSPR random noise */
     unsigned int seed;
 
-    PRSize bytes = 0;
+    size_t bytes = 0;
     while (bytes < sizeof(seed)) {
-        PRSize nbytes = PR_GetRandomNoise(((unsigned char *)&seed)+bytes,
+        size_t nbytes = PR_GetRandomNoise(((unsigned char *)&seed)+bytes,
                                           sizeof(seed)-bytes);
         if (nbytes == 0) {
             return NS_ERROR_FAILURE;
         }
         bytes += nbytes;
     }
 
     /* Initialize a new RNG state, and immediately switch
@@ -115,35 +115,35 @@ nsUUIDGenerator::GenerateUUIDInPlace(nsI
     /* XXX we should be saving the return of setstate here and switching
      * back to it; instead, we use the value returned when we called
      * initstate, since older glibc's have broken setstate() return values
      */
 #ifndef ANDROID
     setstate(mState);
 #endif
 
-    PRSize bytesLeft = sizeof(nsID);
+    size_t bytesLeft = sizeof(nsID);
     while (bytesLeft > 0) {
 #ifdef ANDROID
         long rval = arc4random();
         const int mRBytes = 4;
 #else
         long rval = random();
 #endif
 
 
         PRUint8 *src = (PRUint8*)&rval;
         // We want to grab the mRBytes least significant bytes of rval, since
         // mRBytes less than sizeof(rval) means the high bytes are 0.
 #ifdef IS_BIG_ENDIAN
         src += sizeof(rval) - mRBytes;
 #endif
         PRUint8 *dst = ((PRUint8*) id) + (sizeof(nsID) - bytesLeft);
-        PRSize toWrite = (bytesLeft < mRBytes ? bytesLeft : mRBytes);
-        for (PRSize i = 0; i < toWrite; i++)
+        size_t toWrite = (bytesLeft < mRBytes ? bytesLeft : mRBytes);
+        for (size_t i = 0; i < toWrite; i++)
             dst[i] = src[i];
 
         bytesLeft -= toWrite;
     }
 
     /* Put in the version */
     id->m2 &= 0x0fff;
     id->m2 |= 0x4000;
--- a/xpcom/build/nsXPCOM.h
+++ b/xpcom/build/nsXPCOM.h
@@ -209,17 +209,17 @@ NS_NewNativeLocalFile(const nsACString &
  * Allocates a block of memory of a particular size. If the memory cannot
  * be allocated (because of an out-of-memory condition), the process aborts.
  *
  * @param size   The size of the block to allocate
  * @result       The block of memory
  * @note         This function is thread-safe.
  */
 XPCOM_API(void*)
-NS_Alloc(PRSize size);
+NS_Alloc(size_t size);
 
 /**
  * Reallocates a block of memory to a new size.
  *
  * @param ptr     The block of memory to reallocate. This block must originally
                   have been allocated by NS_Alloc or NS_Realloc
  * @param size    The new size. If 0, frees the block like NS_Free
  * @result        The reallocated block of memory
@@ -227,17 +227,17 @@ NS_Alloc(PRSize size);
  *
  * If ptr is null, this function behaves like NS_Alloc.
  * If s is the size of the block to which ptr points, the first min(s, size)
  * bytes of ptr's block are copied to the new block. If the allocation
  * succeeds, ptr is freed and a pointer to the new block is returned. If the
  * allocation fails, the process aborts.
  */
 XPCOM_API(void*)
-NS_Realloc(void* ptr, PRSize size);
+NS_Realloc(void* ptr, size_t size);
 
 /**
  * Frees a block of memory. Null is a permissible value, in which case no
  * action is taken.
  *
  * @param ptr   The block of memory to free. This block must originally have
  *              been allocated by NS_Alloc or NS_Realloc
  * @note        This function is thread-safe.
--- a/xpcom/build/nsXPCOMPrivate.h
+++ b/xpcom/build/nsXPCOMPrivate.h
@@ -63,18 +63,18 @@ typedef nsresult   (* CStringSetDataFunc
 typedef nsresult   (* CStringSetDataRangeFunc)(nsACString&, PRUint32, PRUint32, const char*, PRUint32);
 typedef nsresult   (* CStringCopyFunc)(nsACString &, const nsACString &);
 typedef void       (* CStringSetIsVoidFunc)(nsACString &, const bool);
 typedef bool       (* CStringGetIsVoidFunc)(const nsACString &);
 
 typedef nsresult   (* CStringToUTF16)(const nsACString &, nsCStringEncoding, nsAString &);
 typedef nsresult   (* UTF16ToCString)(const nsAString &, nsCStringEncoding, nsACString &);
 
-typedef void*      (* AllocFunc)(PRSize size);
-typedef void*      (* ReallocFunc)(void* ptr, PRSize size);
+typedef void*      (* AllocFunc)(size_t size);
+typedef void*      (* ReallocFunc)(void* ptr, size_t size);
 typedef void       (* FreeFunc)(void* ptr);
 
 typedef void       (* DebugBreakFunc)(PRUint32 aSeverity,
                                       const char *aStr, const char *aExpr,
                                       const char *aFile, PRInt32 aLine);
 
 typedef void       (* xpcomVoidFunc)();
 typedef void       (* LogAddRefFunc)(void*, nsrefcnt, const char*, PRUint32);
--- a/xpcom/ds/nsCRT.h
+++ b/xpcom/ds/nsCRT.h
@@ -175,18 +175,21 @@ public:
   static bool IsAsciiAlpha(PRUnichar aChar) { return NS_IsAsciiAlpha(aChar); }
   static bool IsAsciiDigit(PRUnichar aChar) { return NS_IsAsciiDigit(aChar); }
   static bool IsAsciiSpace(PRUnichar aChar) { return NS_IsAsciiWhitespace(aChar); }
   static bool IsAscii(const char* aString) { return NS_IsAscii(aString); }
   static bool IsAscii(const char* aString, PRUint32 aLength) { return NS_IsAscii(aString, aLength); }
 };
 
 
-#define NS_IS_SPACE(VAL) \
-  (((((intn)(VAL)) & 0x7f) == ((intn)(VAL))) && isspace((intn)(VAL)) )
+inline bool
+NS_IS_SPACE(PRUnichar c)
+{
+  return ((int(c) & 0x7f) == int(c)) && isspace(int(c));
+}
 
 #define NS_IS_CNTRL(i)   ((((unsigned int) (i)) > 0x7f) ? (int) 0 : iscntrl(i))
 #define NS_IS_DIGIT(i)   ((((unsigned int) (i)) > 0x7f) ? (int) 0 : isdigit(i))
 #if defined(XP_WIN) || defined(XP_OS2)
 #define NS_IS_ALPHA(VAL) (isascii((int)(VAL)) && isalpha((int)(VAL)))
 #else
 #define NS_IS_ALPHA(VAL) ((((unsigned int) (VAL)) > 0x7f) ? (int) 0 : isalpha((int)(VAL)))
 #endif
--- a/xpcom/glue/DeadlockDetector.h
+++ b/xpcom/glue/DeadlockDetector.h
@@ -198,17 +198,17 @@ private:
         ~OrderingEntry()
         {
         }
 
         CallStack mFirstSeen; // first site from which the resource appeared
         HashEntryArray mOrderedLT; // this <_o Other
     };
 
-    static void* TableAlloc(void* /*pool*/, PRSize size)
+    static void* TableAlloc(void* /*pool*/, size_t size)
     {
         return operator new(size);
     }
     static void TableFree(void* /*pool*/, void* item)
     {
         operator delete(item);
     }
     static PLHashEntry* EntryAlloc(void* /*pool*/, const void* key)
--- a/xpcom/glue/nsMemory.cpp
+++ b/xpcom/glue/nsMemory.cpp
@@ -19,17 +19,17 @@ nsMemory::HeapMinimize(bool aImmediate)
     nsCOMPtr<nsIMemory> mem;
     nsresult rv = NS_GetMemoryManager(getter_AddRefs(mem));
     NS_ENSURE_SUCCESS(rv, rv);
 
     return mem->HeapMinimize(aImmediate);
 }
 
 NS_COM_GLUE void*
-nsMemory::Clone(const void* ptr, PRSize size)
+nsMemory::Clone(const void* ptr, size_t size)
 {
     void* newPtr = NS_Alloc(size);
     if (newPtr)
         memcpy(newPtr, ptr, size);
     return newPtr;
 }
 
 NS_COM_GLUE nsIMemory*
--- a/xpcom/glue/nsMemory.h
+++ b/xpcom/glue/nsMemory.h
@@ -30,24 +30,24 @@
  * thread.
  */
 class nsMemory
 {
 public:
     static NS_HIDDEN_(void*) Alloc(size_t size)
         { return NS_Alloc(size); }
 
-    static NS_HIDDEN_(void*) Realloc(void* ptr, PRSize size)
+    static NS_HIDDEN_(void*) Realloc(void* ptr, size_t size)
         { return NS_Realloc(ptr, size); }
 
     static NS_HIDDEN_(void) Free(void* ptr)
         { NS_Free(ptr); }
 
     static NS_COM_GLUE nsresult   HeapMinimize(bool aImmediate);
-    static NS_COM_GLUE void*      Clone(const void* ptr, PRSize size);
+    static NS_COM_GLUE void*      Clone(const void* ptr, size_t size);
     static NS_COM_GLUE nsIMemory* GetGlobalMemoryService();       // AddRefs
 };
 
 /** 
  * Macro to free all elements of an XPCOM array of a given size using
  * freeFunc, then frees the array itself using nsMemory::Free().  
  *
  * Note that this macro (and its wrappers) can be used to deallocate a
--- a/xpcom/glue/nsTArray-inl.h
+++ b/xpcom/glue/nsTArray-inl.h
@@ -82,17 +82,17 @@ bool nsTArray_base<Alloc>::UsesAutoArray
   // nsTArray, because GetAutoArrayBuffer(16) could lie outside the memory
   // owned by this nsAutoTArray.  We statically assert that elem_type's
   // alignment is 8 bytes or less in nsAutoArrayBase.
 
   MOZ_STATIC_ASSERT(sizeof(nsTArrayHeader) > 4,
                     "see comment above");
 
 #ifdef DEBUG
-  PRPtrdiff diff = reinterpret_cast<const char*>(GetAutoArrayBuffer(8)) -
+  ptrdiff_t diff = reinterpret_cast<const char*>(GetAutoArrayBuffer(8)) -
                    reinterpret_cast<const char*>(GetAutoArrayBuffer(4));
   NS_ABORT_IF_FALSE(diff >= 0 && diff <= 4, "GetAutoArrayBuffer doesn't do what we expect.");
 #endif
 
   return mHdr == GetAutoArrayBuffer(4) || mHdr == GetAutoArrayBuffer(8);
 }
 
 
--- a/xpcom/glue/nsTextFormatter.cpp
+++ b/xpcom/glue/nsTextFormatter.cpp
@@ -703,17 +703,17 @@ static struct NumArgState* BuildArgArray
 	    break;
 
 	case 'p':
 	    /* XXX should use cpp */
 	    if (sizeof(void *) == sizeof(PRInt32)) {
 		nas[cn].type = TYPE_UINT32;
 	    } else if (sizeof(void *) == sizeof(PRInt64)) {
 	        nas[cn].type = TYPE_UINT64;
-	    } else if (sizeof(void *) == sizeof(PRIntn)) {
+	    } else if (sizeof(void *) == sizeof(int)) {
 	        nas[cn].type = TYPE_UINTN;
 	    } else {
 	        nas[cn].type = TYPE_UNKNOWN;
 	    }
 	    break;
 
 	case 'C':
 	    /* XXX not supported I suppose */
@@ -766,29 +766,29 @@ static struct NumArgState* BuildArgArray
 	}
 
 	VARARGS_ASSIGN(nas[cn].ap, ap);
 
 	switch (nas[cn].type) {
 	case TYPE_INT16:
 	case TYPE_UINT16:
 	case TYPE_INTN:
-	case TYPE_UINTN:     (void)va_arg(ap, PRIntn);      break;
+	case TYPE_UINTN:     (void)va_arg(ap, int);         break;
 
 	case TYPE_INT32:     (void)va_arg(ap, PRInt32);     break;
 
 	case TYPE_UINT32:    (void)va_arg(ap, PRUint32);    break;
 
 	case TYPE_INT64:     (void)va_arg(ap, PRInt64);     break;
 
 	case TYPE_UINT64:    (void)va_arg(ap, PRUint64);    break;
 
 	case TYPE_STRING:    (void)va_arg(ap, char*);       break;
 
-	case TYPE_INTSTR:    (void)va_arg(ap, PRIntn*);     break;
+	case TYPE_INTSTR:    (void)va_arg(ap, int*);        break;
 
 	case TYPE_DOUBLE:    (void)va_arg(ap, double);      break;
 
 	case TYPE_UNISTRING: (void)va_arg(ap, PRUnichar*);  break;
 
 	default:
 	    if( nas != nasArray ) {
 		PR_DELETE( nas );
--- a/xpcom/glue/pldhash.cpp
+++ b/xpcom/glue/pldhash.cpp
@@ -92,17 +92,17 @@ PLDHashNumber
 PL_DHashStringKey(PLDHashTable *table, const void *key)
 {
     return HashString(static_cast<const char*>(key));
 }
 
 PLDHashNumber
 PL_DHashVoidPtrKeyStub(PLDHashTable *table, const void *key)
 {
-    return (PLDHashNumber)(PRPtrdiff)key >> 2;
+    return (PLDHashNumber)(ptrdiff_t)key >> 2;
 }
 
 bool
 PL_DHashMatchEntryStub(PLDHashTable *table,
                        const PLDHashEntryHdr *entry,
                        const void *key)
 {
     const PLDHashEntryStub *stub = (const PLDHashEntryStub *)entry;
--- a/xpcom/glue/standalone/nsXPCOMGlue.cpp
+++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp
@@ -403,25 +403,25 @@ XPCOM_API(nsresult)
 NS_UTF16ToCString(const nsAString &aSrc, nsCStringEncoding aDestEncoding, nsACString &aDest)
 {
     if (!xpcomFunctions.utf16ToCString)
         return NS_ERROR_NOT_INITIALIZED;
     return xpcomFunctions.utf16ToCString(aSrc, aDestEncoding, aDest);
 }
 
 XPCOM_API(void*)
-NS_Alloc(PRSize size)
+NS_Alloc(size_t size)
 {
     if (!xpcomFunctions.allocFunc)
         return nullptr;
     return xpcomFunctions.allocFunc(size);
 }
 
 XPCOM_API(void*)
-NS_Realloc(void* ptr, PRSize size)
+NS_Realloc(void* ptr, size_t size)
 {
     if (!xpcomFunctions.reallocFunc)
         return nullptr;
     return xpcomFunctions.reallocFunc(ptr, size);
 }
 
 XPCOM_API(void)
 NS_Free(void* ptr)
--- a/xpcom/io/Base64.cpp
+++ b/xpcom/io/Base64.cpp
@@ -15,17 +15,17 @@ namespace {
 // BEGIN base64 encode code copied and modified from NSPR
 const unsigned char *base = (unsigned char *)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
 
 template <typename T>
 static void
 Encode3to4(const unsigned char *src, T *dest)
 {
     PRUint32 b32 = (PRUint32)0;
-    PRIntn i, j = 18;
+    int i, j = 18;
 
     for( i = 0; i < 3; i++ )
     {
         b32 <<= 8;
         b32 |= (PRUint32)src[i];
     }
 
     for( i = 0; i < 4; i++ )
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -412,38 +412,38 @@ nsLocalFile::OpenANSIFileDesc(const char
     *_retval = fopen(mPath.get(), mode);
     if (! *_retval)
         return NS_ERROR_FAILURE;
 
     return NS_OK;
 }
 
 static int
-do_create(const char *path, PRIntn flags, mode_t mode, PRFileDesc **_retval)
+do_create(const char *path, int flags, mode_t mode, PRFileDesc **_retval)
 {
     *_retval = PR_Open(path, flags, mode);
     return *_retval ? 0 : -1;
 }
 
 static int
-do_mkdir(const char *path, PRIntn flags, mode_t mode, PRFileDesc **_retval)
+do_mkdir(const char *path, int flags, mode_t mode, PRFileDesc **_retval)
 {
     *_retval = nullptr;
     return mkdir(path, mode);
 }
 
 nsresult
-nsLocalFile::CreateAndKeepOpen(PRUint32 type, PRIntn flags,
+nsLocalFile::CreateAndKeepOpen(PRUint32 type, int flags,
                                PRUint32 permissions, PRFileDesc **_retval)
 {
     if (type != NORMAL_FILE_TYPE && type != DIRECTORY_TYPE)
         return NS_ERROR_FILE_UNKNOWN_TYPE;
 
     int result;
-    int (*createFunc)(const char *, PRIntn, mode_t, PRFileDesc **) =
+    int (*createFunc)(const char *, int, mode_t, PRFileDesc **) =
         (type == NORMAL_FILE_TYPE) ? do_create : do_mkdir;
 
     result = createFunc(mPath.get(), flags, permissions, _retval);
     if (result == -1 && errno == ENOENT) {
         /*
          * If we failed because of missing ancestor components, try to create
          * them and then retry the original creation.
          *
@@ -986,17 +986,17 @@ nsLocalFile::SetLastModifiedTime(PRInt64
 
     int result;
     if (aLastModTime != 0) {
         ENSURE_STAT_CACHE();
         struct utimbuf ut;
         ut.actime = mCachedStat.st_atime;
 
         // convert milliseconds to seconds since the unix epoch
-        ut.modtime = (time_t)(PRFloat64(aLastModTime) / PR_MSEC_PER_SEC);
+        ut.modtime = (time_t)(double(aLastModTime) / PR_MSEC_PER_SEC);
         result = utime(mPath.get(), &ut);
     } else {
         result = utime(mPath.get(), nullptr);
     }
     return NSRESULT_FOR_RETURN(result);
 }
 
 NS_IMETHODIMP
--- a/xpcom/io/nsLocalFileUnix.h
+++ b/xpcom/io/nsLocalFileUnix.h
@@ -118,13 +118,13 @@ protected:
     nsresult CopyDirectoryTo(nsIFile *newParent);
     nsresult CreateAllAncestors(PRUint32 permissions);
     nsresult GetNativeTargetPathName(nsIFile *newParent,
                                      const nsACString &newName,
                                      nsACString &_retval);
 
     bool FillStatCache();
 
-    nsresult CreateAndKeepOpen(PRUint32 type, PRIntn flags,
+    nsresult CreateAndKeepOpen(PRUint32 type, int flags,
                                PRUint32 permissions, PRFileDesc **_retval);
 };
 
 #endif /* _nsLocalFileUNIX_H_ */
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -571,17 +571,17 @@ struct _MDFileDesc {
     PROsfd osfd;
 };
 
 struct PRFilePrivate {
     PRInt32 state;
     bool nonblocking;
     _PRTriStateBool inheritable;
     PRFileDesc *next;
-    PRIntn lockCount;   /*   0: not locked
+    int lockCount;      /*   0: not locked
                          *  -1: a native lockfile call is in progress
                          * > 0: # times the file is locked */
     bool    appendMode; 
     _MDFileDesc md;
 };
 
 //-----------------------------------------------------------------------------
 // Six static methods defined below (OpenFile,  FileTimeToPRTime, GetFileInfo,
@@ -589,17 +589,17 @@ struct PRFilePrivate {
 // UTF-16 APIs are implemented on all the supported platforms (or at least 
 // Windows 9x/ME) in NSPR. Currently, they're only implemented on 
 // Windows NT4 or later. (bug 330665)
 //-----------------------------------------------------------------------------
 
 // copied from nsprpub/pr/src/{io/prfile.c | md/windows/w95io.c} : 
 // PR_Open and _PR_MD_OPEN
 static nsresult
-OpenFile(const nsAFlatString &name, PRIntn osflags, PRIntn mode,
+OpenFile(const nsAFlatString &name, int osflags, int mode,
          PRFileDesc **fd)
 {
     // XXX : 'mode' is not translated !!!
     PRInt32 access = 0;
     PRInt32 flags = 0;
     PRInt32 flag6 = 0;
 
     if (osflags & PR_SYNC) flag6 = FILE_FLAG_WRITE_THROUGH;
--- a/xpcom/string/public/nsTSubstring.h
+++ b/xpcom/string/public/nsTSubstring.h
@@ -760,17 +760,17 @@ class nsTSubstring_CharT
          * this helper function stores the specified dataFlags in mFlags
          */
       void SetDataFlags(PRUint32 dataFlags)
         {
           NS_ASSERTION((dataFlags & 0xFFFF0000) == 0, "bad flags");
           mFlags = dataFlags | (mFlags & 0xFFFF0000);
         }
 
-      static PRIntn AppendFunc( void* arg, const char* s, PRUint32 len);
+      static int AppendFunc( void* arg, const char* s, PRUint32 len);
       void AppendPrintf( const char* format, va_list ap );
 
     public:
 
       // mFlags is a bitwise combination of the following flags.  the meaning
       // and interpretation of these flags is an implementation detail.
       // 
       // NOTE: these flags are declared public _only_ for convenience inside
--- a/xpcom/string/src/nsTSubstring.cpp
+++ b/xpcom/string/src/nsTSubstring.cpp
@@ -745,17 +745,17 @@ nsTSubstring_CharT::StripChars( const ch
           // Not stripped, copy this char.
           *to++ = theChar;
         }
       }
     *to = char_type(0); // add the null
     mLength = to - mData;
   }
 
-PRIntn
+int
 nsTSubstring_CharT::AppendFunc(void* arg, const char* s, PRUint32 len)
   {
     self_type* self = static_cast<self_type*>(arg);
 
     // NSPR sends us the final null terminator even though we don't want it
     if (len && s[len - 1] == '\0') {
       --len;
     }
@@ -788,17 +788,17 @@ void nsTSubstring_CharT::AppendPrintf( c
  * This is a copy of |PR_cnvtf| with a bug fixed.  (The second argument
  * of PR_dtoa is 2 rather than 1.)
  *
  * XXX(darin): if this is the right thing, then why wasn't it fixed in NSPR?!?
  */
 static void 
 Modified_cnvtf(char *buf, int bufsz, int prcsn, double fval)
 {
-  PRIntn decpt, sign, numdigits;
+  int decpt, sign, numdigits;
   char *num, *nump;
   char *bufp = buf;
   char *endnum;
 
   /* If anything fails, we store an empty string in 'buf' */
   num = (char*)malloc(bufsz);
   if (num == NULL) {
     buf[0] = '\0';
--- a/xpcom/stub/nsXPComStub.cpp
+++ b/xpcom/stub/nsXPComStub.cpp
@@ -191,24 +191,24 @@ NS_GetDebug(nsIDebug **result)
 EXPORT_XPCOM_API(nsresult)
 NS_GetTraceRefcnt(nsITraceRefcnt **result)
 {
   return NS_GetTraceRefcnt_P(result);
 }
 
 #undef NS_Alloc
 EXPORT_XPCOM_API(void*)
-NS_Alloc(PRSize size)
+NS_Alloc(size_t size)
 {
   return NS_Alloc_P(size);
 }
 
 #undef NS_Realloc
 EXPORT_XPCOM_API(void*)
-NS_Realloc(void* ptr, PRSize size)
+NS_Realloc(void* ptr, size_t size)
 {
   return NS_Realloc_P(ptr, size);
 }
 
 #undef NS_Free
 EXPORT_XPCOM_API(void)
 NS_Free(void* ptr)
 {
--- a/xpcom/tests/ShowAlignments.cpp
+++ b/xpcom/tests/ShowAlignments.cpp
@@ -23,17 +23,16 @@ int main()
 
   SHOW_TYPE(char);
   SHOW_TYPE(unsigned short);
   SHOW_TYPE(int);
   SHOW_TYPE(long);
   SHOW_TYPE(PRUint8);
   SHOW_TYPE(PRInt16);
   SHOW_TYPE(PRUint32);
-  SHOW_TYPE(PRFloat64);
   SHOW_TYPE(void*);
   SHOW_TYPE(double);
   SHOW_TYPE(short[7]);
   SHOW_TYPE(S);
   SHOW_TYPE(double S::*);
 
   return 0;
 }
--- a/xpcom/tests/TestCRT.cpp
+++ b/xpcom/tests/TestCRT.cpp
@@ -7,67 +7,67 @@
 #include "nsString.h"
 #include "plstr.h"
 #include <stdlib.h>
 
 namespace TestCRT {
 
 // The return from strcmp etc is only defined to be postive, zero or
 // negative. The magnitude of a non-zero return is irrelevant.
-PRIntn sign(PRIntn val) {
+int sign(int val) {
     if (val == 0)
 	return 0;
     else {
 	if (val > 0)
 	    return 1;
 	else
 	    return -1;
     }
 }
 
 
 // Verify that nsCRT versions of string comparison routines get the
 // same answers as the native non-unicode versions. We only pass in
 // iso-latin-1 strings, so the comparison must be valid.
-static void Check(const char* s1, const char* s2, PRIntn n)
+static void Check(const char* s1, const char* s2, int n)
 {
 #ifdef DEBUG
-  PRIntn clib =
+  int clib =
 #endif
     PL_strcmp(s1, s2);
 
 #ifdef DEBUG
-  PRIntn clib_n =
+  int clib_n =
 #endif
     PL_strncmp(s1, s2, n);
 
   nsAutoString t1,t2; 
   t1.AssignWithConversion(s1);
   t2.AssignWithConversion(s2);
   const PRUnichar* us1 = t1.get();
   const PRUnichar* us2 = t2.get();
 
 #ifdef DEBUG
-  PRIntn u2 =
+  int u2 =
 #endif
     nsCRT::strcmp(us1, us2);
 
 #ifdef DEBUG
-  PRIntn u2_n =
+  int u2_n =
 #endif
     nsCRT::strncmp(us1, us2, n);
 
   NS_ASSERTION(sign(clib) == sign(u2), "strcmp");
   NS_ASSERTION(sign(clib_n) == sign(u2_n), "strncmp");
 }
 
 struct Test {
   const char* s1;
   const char* s2;
-  PRIntn n;
+  int n;
 };
 
 static Test tests[] = {
   { "foo", "foo", 3 },
   { "foo", "fo", 3 },
 
   { "foo", "bar", 3 },
   { "foo", "ba", 3 },
--- a/xpcom/tests/TestTArray.cpp
+++ b/xpcom/tests/TestTArray.cpp
@@ -551,17 +551,17 @@ static bool test_heap() {
 
 //----
 
 // An array |arr| is using its auto buffer if |&arr < arr.Elements()| and
 // |arr.Elements() - &arr| is small.
 
 #define IS_USING_AUTO(arr) \
   ((uintptr_t) &(arr) < (uintptr_t) arr.Elements() && \
-   ((PRPtrdiff)arr.Elements() - (PRPtrdiff)&arr) <= 16)
+   ((ptrdiff_t)arr.Elements() - (ptrdiff_t)&arr) <= 16)
 
 #define CHECK_IS_USING_AUTO(arr) \
   do {                                                    \
     if (!(IS_USING_AUTO(arr))) {                          \
       printf("%s:%d CHECK_IS_USING_AUTO(%s) failed.\n",   \
              __FILE__, __LINE__, #arr);                   \
       return false;                                    \
     }                                                     \