Merge mozilla-central into services-central
authorGregory Szorc <gps@mozilla.com>
Thu, 23 Aug 2012 09:53:48 -0700
changeset 111040 07854b5d6052ae601dcf37f3c1e3137ddb73b8d8
parent 111039 b852b572cd64fc32e195b0b5f0e699ed28c01566 (current diff)
parent 105158 ad7963c93bd8e334e06433b6357fe0a432f107df (diff)
child 111041 c05ca15d97b562914ff885779f393c6ca08a6d74
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
milestone17.0a1
Merge mozilla-central into services-central
browser/components/thumbnails/test/browser_thumbnails_bug753755.js
browser/themes/pinstripe/Secure-Glyph-White.png
browser/themes/pinstripe/hud-style-check-box-checked.png
browser/themes/pinstripe/hud-style-check-box-empty.png
browser/themes/pinstripe/hud-style-dropmarker-double-arrows.png
browser/themes/pinstripe/hud-style-expander-closed.png
browser/themes/pinstripe/hud-style-expander-open.png
browser/themes/pinstripe/hud-style-new-folder-plus-sign.png
browser/themes/pinstripe/hud-style-twisties.png
content/events/src/nsDOMPopupBlockedEvent.cpp
content/events/src/nsDOMPopupBlockedEvent.h
docshell/test/browser/browser_bug435325.js
dom/bluetooth/BluetoothDeviceEvent.cpp
dom/bluetooth/BluetoothDeviceEvent.h
js/src/frontend/SemanticAnalysis.cpp
js/src/frontend/SemanticAnalysis.h
js/src/frontend/TreeContext-inl.h
js/src/frontend/TreeContext.cpp
js/src/frontend/TreeContext.h
js/src/jit-test/tests/arguments/defaults-bug764508.js
layout/reftests/css-namespace/LICENSE
layout/reftests/css-namespace/README
layout/reftests/css-namespace/prefix-001.xml
layout/reftests/css-namespace/prefix-002.xml
layout/reftests/css-namespace/prefix-003.xml
layout/reftests/css-namespace/prefix-004.xml
layout/reftests/css-namespace/prefix-005.xml
layout/reftests/css-namespace/prefix-006.xml
layout/reftests/css-namespace/ref-lime-1-block.xml
layout/reftests/css-namespace/ref-lime-1-generic.xml
layout/reftests/css-namespace/ref-lime-1.xml
layout/reftests/css-namespace/ref-lime-2-generic.xml
layout/reftests/css-namespace/ref-lime-2.xml
layout/reftests/css-namespace/ref-lime-3.xml
layout/reftests/css-namespace/ref-lime-5.xml
layout/reftests/css-namespace/ref-lime-6.xml
layout/reftests/css-namespace/reftest.list
layout/reftests/css-namespace/scope-001.xml
layout/reftests/css-namespace/scope-002.xml
layout/reftests/css-namespace/support/fail.css
layout/reftests/css-namespace/support/scope-002a.css
layout/reftests/css-namespace/support/scope-002b.css
layout/reftests/css-namespace/support/syntax-007.css
layout/reftests/css-namespace/syntax-001.xml
layout/reftests/css-namespace/syntax-002.xml
layout/reftests/css-namespace/syntax-003.xml
layout/reftests/css-namespace/syntax-004.xml
layout/reftests/css-namespace/syntax-005.xml
layout/reftests/css-namespace/syntax-006.xml
layout/reftests/css-namespace/syntax-007.xml
layout/reftests/css-namespace/syntax-008.xml
layout/reftests/css-namespace/syntax-009.xml
layout/reftests/css-namespace/syntax-010.xml
layout/reftests/css-namespace/syntax-011.xml
layout/reftests/css-namespace/syntax-012.xml
layout/reftests/css-namespace/syntax-013.xml
layout/reftests/css-namespace/syntax-014.xml
layout/reftests/css-namespace/syntax-015.xml
layout/reftests/w3c-css/submitted/conditional3/pass.html
media/omx-plugin/include/ics/OMX.h
media/omx-plugin/lib/ics/libstagefright_omx/Makefile.in
media/omx-plugin/lib/ics/libstagefright_omx/libstagefright_omx.cpp
mobile/android/base/resources/drawable-hdpi-v11/ic_menu_clear_site_settings.png
mobile/android/base/resources/drawable-hdpi/abouthome_sync_bg.9.png
mobile/android/base/resources/drawable-hdpi/abouthome_sync_logo.png
mobile/android/base/resources/drawable-hdpi/abouthome_sync_pressed_bg.9.png
mobile/android/base/resources/drawable-mdpi-v11/ic_menu_clear_site_settings.png
mobile/android/base/resources/drawable-xhdpi-v11/ic_menu_clear_site_settings.png
mobile/android/base/resources/drawable-xhdpi/abouthome_sync_bg.9.png
mobile/android/base/resources/drawable-xhdpi/abouthome_sync_logo.png
mobile/android/base/resources/drawable-xhdpi/abouthome_sync_pressed_bg.9.png
mobile/android/base/resources/drawable/abouthome_sync_bg.9.png
mobile/android/base/resources/drawable/abouthome_sync_box.xml
mobile/android/base/resources/drawable/abouthome_sync_logo.png
mobile/android/base/resources/drawable/abouthome_sync_pressed_bg.9.png
modules/libpref/public/PPrefTuple.h
modules/libpref/public/PrefTuple.h
toolkit/components/alerts/mac/nsGrowlAlertsService.h
toolkit/components/alerts/mac/nsGrowlAlertsService.mm
toolkit/themes/pinstripe/global/arrow/arrow-dn-white.png
toolkit/themes/pinstripe/global/arrow/panelarrow-down.png
toolkit/themes/pinstripe/global/arrow/panelarrow-horiz.png
toolkit/themes/pinstripe/global/arrow/panelarrow-up.png
--- a/accessible/public/nsIAccessibilityService.h
+++ b/accessible/public/nsIAccessibilityService.h
@@ -48,17 +48,17 @@ public:
   virtual void RemoveNativeRootAccessible(Accessible* aRootAccessible) = 0;
 
   /**
    * Fire accessible event of the given type for the given target.
    *
    * @param aEvent   [in] accessible event type
    * @param aTarget  [in] target of accessible event
    */
-  virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget) = 0;
+  virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAccessibilityService,
                               NS_IACCESSIBILITYSERVICE_IID)
 
 // for component registration
 // {DE401C37-9A7F-4278-A6F8-3DE2833989EF}
 #define NS_ACCESSIBILITY_SERVICE_CID \
--- a/accessible/public/nsIAccessible.idl
+++ b/accessible/public/nsIAccessible.idl
@@ -241,33 +241,33 @@ interface nsIAccessible : nsISupports
    * will still set focus on that node, although normally that will not be visually 
    * indicated in most style sheets.
    */
   void takeFocus();
 
   /**
    * The number of accessible actions associated with this accessible
    */
-  readonly attribute PRUint8 actionCount;
+  readonly attribute uint8_t actionCount;
 
   /**
    * The name of the accessible action at the given zero-based index
    */
-  AString getActionName(in PRUint8 index);
+  AString getActionName(in uint8_t index);
 
   /**
    * The description of the accessible action at the given zero-based index
    */
-  AString getActionDescription(in PRUint8 aIndex);
+  AString getActionDescription(in uint8_t aIndex);
 
   /**
    * Perform the accessible action at the given zero-based index
    * Action number 0 is the default action
    */
-  void doAction(in PRUint8 index);   
+  void doAction(in uint8_t index);   
 
   /**
    * Makes an object visible on screen.
    *
    * @param scrollType - defines where the object should be placed on
    *                     the screen (see nsIAccessibleScrollType for
    *                     available constants).
    */
--- a/accessible/public/nsIAccessibleText.idl
+++ b/accessible/public/nsIAccessibleText.idl
@@ -12,18 +12,18 @@ interface nsIAccessible;
 interface nsIPersistentProperties;
 
 [scriptable, uuid(0f4633b1-550c-4b50-8c04-0eb1005eef2f)]
 interface nsIAccessibleText : nsISupports
 {
   // In parameters for character offsets:
   //  -1 will be treated as the equal to the end of the text
   //  -2 will be treated as the caret position
-  const PRInt32 TEXT_OFFSET_END_OF_TEXT = -1;
-  const PRInt32 TEXT_OFFSET_CARET       = -2;
+  const int32_t TEXT_OFFSET_END_OF_TEXT = -1;
+  const int32_t TEXT_OFFSET_CARET       = -2;
 
   const AccessibleTextBoundary BOUNDARY_CHAR = 0;
   const AccessibleTextBoundary BOUNDARY_WORD_START = 1;
   const AccessibleTextBoundary BOUNDARY_WORD_END = 2;
   const AccessibleTextBoundary BOUNDARY_SENTENCE_START = 3; // don't use, deprecated
   const AccessibleTextBoundary BOUNDARY_SENTENCE_END = 4;  // don't use, deprecated
   const AccessibleTextBoundary BOUNDARY_LINE_START = 5;
   const AccessibleTextBoundary BOUNDARY_LINE_END = 6;
--- a/accessible/src/atk/AccessibleWrap.cpp
+++ b/accessible/src/atk/AccessibleWrap.cpp
@@ -136,18 +136,18 @@ struct MaiAtkObject
 struct MaiAtkObjectClass
 {
     AtkObjectClass parent_class;
 };
 
 static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, };
 
 #ifdef MAI_LOGGING
-PRInt32 sMaiAtkObjCreated = 0;
-PRInt32 sMaiAtkObjDeleted = 0;
+int32_t sMaiAtkObjCreated = 0;
+int32_t sMaiAtkObjDeleted = 0;
 #endif
 
 G_BEGIN_DECLS
 /* callbacks for MaiAtkObject */
 static void classInitCB(AtkObjectClass *aClass);
 static void initializeCB(AtkObject *aAtkObj, gpointer aData);
 static void finalizeCB(GObject *aObj);
 
@@ -193,18 +193,18 @@ static AtkRelationSet*     refRelationSe
   AtkPropertyValues *values);
   static void                StateChangeCB(AtkObject *aAtkObj,
   const gchar *name,
   gboolean state_set);
   static void                VisibleDataChangedCB(AtkObject *aAtkObj);
 */
 G_END_DECLS
 
-static GType GetMaiAtkType(PRUint16 interfacesBits);
-static const char * GetUniqueMaiAtkTypeName(PRUint16 interfacesBits);
+static GType GetMaiAtkType(uint16_t interfacesBits);
+static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
 
 static gpointer parent_class = NULL;
 
 static GQuark quark_mai_hyperlink = 0;
 
 GType
 mai_atk_object_get_type(void)
 {
@@ -227,18 +227,18 @@ mai_atk_object_get_type(void)
         type = g_type_register_static(ATK_TYPE_OBJECT,
                                       "MaiAtkObject", &tinfo, GTypeFlags(0));
         quark_mai_hyperlink = g_quark_from_static_string("MaiHyperlink");
     }
     return type;
 }
 
 #ifdef MAI_LOGGING
-PRInt32 AccessibleWrap::mAccWrapCreated = 0;
-PRInt32 AccessibleWrap::mAccWrapDeleted = 0;
+int32_t AccessibleWrap::mAccWrapCreated = 0;
+int32_t AccessibleWrap::mAccWrapDeleted = 0;
 #endif
 
 AccessibleWrap::
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
   Accessible(aContent, aDoc), mAtkObject(nullptr)
 {
 #ifdef MAI_LOGGING
   ++mAccWrapCreated;
@@ -358,20 +358,20 @@ AtkObject *
 AccessibleWrap::GetAtkObject(nsIAccessible* acc)
 {
     void *atkObjPtr = nullptr;
     acc->GetNativeInterface(&atkObjPtr);
     return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nullptr;    
 }
 
 /* private */
-PRUint16
+uint16_t
 AccessibleWrap::CreateMaiInterfaces(void)
 {
-  PRUint16 interfacesBits = 0;
+  uint16_t interfacesBits = 0;
     
   // The Component interface is supported by all accessibles.
   interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;
 
   // Add Action interface if the action count is more than zero.
   if (ActionCount() > 0)
     interfacesBits |= 1 << MAI_INTERFACE_ACTION;
 
@@ -417,17 +417,17 @@ AccessibleWrap::CreateMaiInterfaces(void
       interfacesBits |= 1 << MAI_INTERFACE_SELECTION;
     }
   }
 
   return interfacesBits;
 }
 
 static GType
-GetMaiAtkType(PRUint16 interfacesBits)
+GetMaiAtkType(uint16_t interfacesBits)
 {
     GType type;
     static const GTypeInfo tinfo = {
         sizeof(MaiAtkObjectClass),
         (GBaseInitFunc) NULL,
         (GBaseFinalizeFunc) NULL,
         (GClassInitFunc) NULL,
         (GClassFinalizeFunc) NULL,
@@ -449,39 +449,39 @@ GetMaiAtkType(PRUint16 interfacesBits)
     if (type) {
         return type;
     }
 
     /*
      * gobject limits the number of types that can directly derive from any
      * given object type to 4095.
      */
-    static PRUint16 typeRegCount = 0;
+    static uint16_t typeRegCount = 0;
     if (typeRegCount++ >= 4095) {
         return G_TYPE_INVALID;
     }
     type = g_type_register_static(MAI_TYPE_ATK_OBJECT,
                                   atkTypeName,
                                   &tinfo, GTypeFlags(0));
 
-    for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
+    for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
       if (interfacesBits & (1 << index)) {
         g_type_add_interface_static(type,
                                     GetAtkTypeForMai((MaiInterfaceType)index),
                                     &atk_if_infos[index]);
       }
     }
 
     return type;
 }
 
 static const char*
-GetUniqueMaiAtkTypeName(PRUint16 interfacesBits)
+GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
 {
-#define MAI_ATK_TYPE_NAME_LEN (30)     /* 10+sizeof(PRUint16)*8/4+1 < 30 */
+#define MAI_ATK_TYPE_NAME_LEN (30)     /* 10+sizeof(uint16_t)*8/4+1 < 30 */
 
     static gchar namePrefix[] = "MaiAtkType";   /* size = 10 */
     static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
 
     PR_snprintf(name, MAI_ATK_TYPE_NAME_LEN, "%s%x", namePrefix,
                 interfacesBits);
     name[MAI_ATK_TYPE_NAME_LEN] = '\0';
 
@@ -843,22 +843,22 @@ getIndexInParentCB(AtkObject *aAtkObj)
     Accessible* parent = accWrap->Parent();
     if (!parent)
         return -1; // No parent
 
     return parent->GetIndexOfEmbeddedChild(accWrap);
 }
 
 static void
-TranslateStates(PRUint64 aState, AtkStateSet* aStateSet)
+TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
 {
 
   // Convert every state to an entry in AtkStateMap
-  PRUint32 stateIndex = 0;
-  PRUint64 bitMask = 1;
+  uint32_t stateIndex = 0;
+  uint64_t bitMask = 1;
   while (gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState) {
     if (gAtkStateMap[stateIndex].atkState) { // There's potentially an ATK state for this
       bool isStateOn = (aState & bitMask) != 0;
       if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite) {
         isStateOn = !isStateOn;
       }
       if (isStateOn) {
         atk_state_set_add_state(aStateSet, gAtkStateMap[stateIndex].atkState);
@@ -892,30 +892,30 @@ refRelationSetCB(AtkObject *aAtkObj)
 {
   AtkRelationSet* relation_set =
     ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
 
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (!accWrap)
     return relation_set;
 
-  PRUint32 relationTypes[] = {
+  uint32_t relationTypes[] = {
     nsIAccessibleRelation::RELATION_LABELLED_BY,
     nsIAccessibleRelation::RELATION_LABEL_FOR,
     nsIAccessibleRelation::RELATION_NODE_CHILD_OF,
     nsIAccessibleRelation::RELATION_CONTROLLED_BY,
     nsIAccessibleRelation::RELATION_CONTROLLER_FOR,
     nsIAccessibleRelation::RELATION_EMBEDS,
     nsIAccessibleRelation::RELATION_FLOWS_TO,
     nsIAccessibleRelation::RELATION_FLOWS_FROM,
     nsIAccessibleRelation::RELATION_DESCRIBED_BY,
     nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
   };
 
-  for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) {
+  for (uint32_t i = 0; i < ArrayLength(relationTypes); i++) {
     AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]);
     AtkRelation* atkRelation =
       atk_relation_set_get_relation_by_type(relation_set, atkType);
     if (atkRelation)
       atk_relation_set_remove(relation_set, atkRelation);
 
     Relation rel(accWrap->RelationByType(relationTypes[i]));
     nsTArray<AtkObject*> targets;
@@ -964,17 +964,17 @@ AccessibleWrap::HandleAccEvent(AccEvent*
 }
 
 nsresult
 AccessibleWrap::FirePlatformEvent(AccEvent* aEvent)
 {
     Accessible* accessible = aEvent->GetAccessible();
     NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
 
-    PRUint32 type = aEvent->GetEventType();
+    uint32_t type = aEvent->GetEventType();
 
     AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
 
     // We don't create ATK objects for nsIAccessible plain text leaves,
     // just return NS_OK in such case
     if (!atkObj) {
         NS_ASSERTION(type == nsIAccessibleEvent::EVENT_SHOW ||
                      type == nsIAccessibleEvent::EVENT_HIDE,
@@ -1057,17 +1057,17 @@ AccessibleWrap::FirePlatformEvent(AccEve
       {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_CARET_MOVED\n"));
 
         AccCaretMoveEvent* caretMoveEvent = downcast_accEvent(aEvent);
         NS_ASSERTION(caretMoveEvent, "Event needs event data");
         if (!caretMoveEvent)
             break;
 
-        PRInt32 caretOffset = caretMoveEvent->GetCaretOffset();
+        int32_t caretOffset = caretMoveEvent->GetCaretOffset();
 
         MAI_LOG_DEBUG(("\n\nCaret postion: %d", caretOffset));
         g_signal_emit_by_name(atkObj,
                               "text_caret_moved",
                               // Curent caret position
                               caretOffset);
       } break;
 
@@ -1084,35 +1084,35 @@ AccessibleWrap::FirePlatformEvent(AccEve
         break;
 
     case nsIAccessibleEvent::EVENT_TABLE_ROW_INSERT:
       {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_INSERT\n"));
         AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
         NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        PRInt32 rowIndex = tableEvent->GetIndex();
-        PRInt32 numRows = tableEvent->GetCount();
+        int32_t rowIndex = tableEvent->GetIndex();
+        int32_t numRows = tableEvent->GetCount();
 
         g_signal_emit_by_name(atkObj,
                               "row_inserted",
                               // After which the rows are inserted
                               rowIndex,
                               // The number of the inserted
                               numRows);
      } break;
 
    case nsIAccessibleEvent::EVENT_TABLE_ROW_DELETE:
      {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_DELETE\n"));
         AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
         NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        PRInt32 rowIndex = tableEvent->GetIndex();
-        PRInt32 numRows = tableEvent->GetCount();
+        int32_t rowIndex = tableEvent->GetIndex();
+        int32_t numRows = tableEvent->GetCount();
 
         g_signal_emit_by_name(atkObj,
                               "row_deleted",
                               // After which the rows are deleted
                               rowIndex,
                               // The number of the deleted
                               numRows);
       } break;
@@ -1125,35 +1125,35 @@ AccessibleWrap::FirePlatformEvent(AccEve
       }
 
     case nsIAccessibleEvent::EVENT_TABLE_COLUMN_INSERT:
       {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_INSERT\n"));
         AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
         NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        PRInt32 colIndex = tableEvent->GetIndex();
-        PRInt32 numCols = tableEvent->GetCount();
+        int32_t colIndex = tableEvent->GetIndex();
+        int32_t numCols = tableEvent->GetCount();
 
         g_signal_emit_by_name(atkObj,
                               "column_inserted",
                               // After which the columns are inserted
                               colIndex,
                               // The number of the inserted
                               numCols);
       } break;
 
     case nsIAccessibleEvent::EVENT_TABLE_COLUMN_DELETE:
       {
         MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_DELETE\n"));
         AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
         NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        PRInt32 colIndex = tableEvent->GetIndex();
-        PRInt32 numCols = tableEvent->GetCount();
+        int32_t colIndex = tableEvent->GetIndex();
+        int32_t numCols = tableEvent->GetCount();
 
         g_signal_emit_by_name(atkObj,
                               "column_deleted",
                               // After which the columns are deleted
                               colIndex,
                               // The number of the deleted
                               numCols);
       } break;
@@ -1268,17 +1268,17 @@ AccessibleWrap::FireAtkStateChangeEvent(
                                         AtkObject* aObject)
 {
     MAI_LOG_DEBUG(("\n\nReceived: EVENT_STATE_CHANGE\n"));
 
     AccStateChangeEvent* event = downcast_accEvent(aEvent);
     NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
 
     bool isEnabled = event->IsStateEnabled();
-    PRInt32 stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
+    int32_t stateIndex = AtkStateMap::GetStateIndexFor(event->GetState());
     if (stateIndex >= 0) {
         NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoSuchState,
                      "No such state");
 
         if (gAtkStateMap[stateIndex].atkState != kNone) {
             NS_ASSERTION(gAtkStateMap[stateIndex].stateMapEntryType != kNoStateChange,
                          "State changes should not fired for this state");
 
@@ -1299,18 +1299,18 @@ nsresult
 AccessibleWrap::FireAtkTextChangedEvent(AccEvent* aEvent,
                                         AtkObject* aObject)
 {
     MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_REMOVED/INSERTED\n"));
 
     AccTextChangeEvent* event = downcast_accEvent(aEvent);
     NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
 
-    PRInt32 start = event->GetStartOffset();
-    PRUint32 length = event->GetLength();
+    int32_t start = event->GetStartOffset();
+    uint32_t length = event->GetLength();
     bool isInserted = event->IsTextInserted();
     bool isFromUserInput = aEvent->IsFromUserInput();
     char* signal_name = nullptr;
 
   if (gAvailableAtkSignals == eUnknown)
     gAvailableAtkSignals =
       g_signal_lookup("text-insert", G_OBJECT_TYPE(aObject)) ?
         eHaveNewAtkTextSignals : eNoNewAtkSignals;
@@ -1341,17 +1341,17 @@ AccessibleWrap::FireAtkShowHideEvent(Acc
                                      AtkObject* aObject, bool aIsAdded)
 {
     if (aIsAdded) {
         MAI_LOG_DEBUG(("\n\nReceived: Show event\n"));
     } else {
         MAI_LOG_DEBUG(("\n\nReceived: Hide event\n"));
     }
 
-    PRInt32 indexInParent = getIndexInParentCB(aObject);
+    int32_t indexInParent = getIndexInParentCB(aObject);
     AtkObject *parentObject = getParentCB(aObject);
     NS_ENSURE_STATE(parentObject);
 
     bool isFromUserInput = aEvent->IsFromUserInput();
     char *signal_name = g_strconcat(aIsAdded ? "children_changed::add" :  "children_changed::remove",
                                     isFromUserInput ? "" : kNonUserInputEvent, NULL);
     g_signal_emit_by_name(parentObject, signal_name, indexInParent, aObject, NULL);
     g_free(signal_name);
--- a/accessible/src/atk/AccessibleWrap.h
+++ b/accessible/src/atk/AccessibleWrap.h
@@ -31,17 +31,17 @@ enum AtkProperty {
   PROP_TABLE_COLUMN_HEADER,
   PROP_TABLE_ROW_DESCRIPTION,
   PROP_TABLE_ROW_HEADER,
   PROP_TABLE_SUMMARY,
   PROP_LAST         // gobject convention
 };
 
 struct AtkPropertyChange {
-  PRInt32 type;     // property type as listed above
+  int32_t type;     // property type as listed above
   void *oldvalue;
   void *newvalue;
 };
 
 class MaiHyperlink;
 
 /**
  * AccessibleWrap, and its descendents in atk directory provide the
@@ -54,18 +54,18 @@ public:
   virtual ~AccessibleWrap();
   void ShutdownAtkObject();
 
   // nsAccessNode
   virtual void Shutdown();
 
 #ifdef MAI_LOGGING
   virtual void DumpAccessibleWrapInfo(int aDepth) {}
-  static PRInt32 mAccWrapCreated;
-  static PRInt32 mAccWrapDeleted;
+  static int32_t mAccWrapCreated;
+  static int32_t mAccWrapDeleted;
 #endif
 
   // return the atk object for this AccessibleWrap
   NS_IMETHOD GetNativeInterface(void **aOutAccessible);
   virtual nsresult HandleAccEvent(AccEvent* aEvent);
 
   AtkObject * GetAtkObject(void);
   static AtkObject * GetAtkObject(nsIAccessible * acc);
@@ -102,12 +102,12 @@ private:
   enum EAvailableAtkSignals {
     eUnknown,
     eHaveNewAtkTextSignals,
     eNoNewAtkSignals
   };
 
   static EAvailableAtkSignals gAvailableAtkSignals;
 
-  PRUint16 CreateMaiInterfaces(void);
+  uint16_t CreateMaiInterfaces(void);
 };
 
 #endif /* __NS_ACCESSIBLE_WRAP_H__ */
--- a/accessible/src/atk/ApplicationAccessibleWrap.cpp
+++ b/accessible/src/atk/ApplicationAccessibleWrap.cpp
@@ -685,17 +685,17 @@ ApplicationAccessibleWrap::GetNativeInte
 
     *aOutAccessible = mAtkObject;
     return NS_OK;
 }
 
 struct AtkRootAccessibleAddedEvent {
   AtkObject *app_accessible;
   AtkObject *root_accessible;
-  PRUint32 index;
+  uint32_t index;
 };
 
 gboolean fireRootAccessibleAddedCB(gpointer data)
 {
     AtkRootAccessibleAddedEvent* eventData = (AtkRootAccessibleAddedEvent*)data;
     g_signal_emit_by_name(eventData->app_accessible, "children_changed::add",
                           eventData->index, eventData->root_accessible, NULL);
     g_object_unref(eventData->app_accessible);
@@ -709,17 +709,17 @@ bool
 ApplicationAccessibleWrap::AppendChild(Accessible* aChild)
 {
   if (!ApplicationAccessible::AppendChild(aChild))
     return false;
 
   AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
   atk_object_set_parent(atkAccessible, mAtkObject);
 
-    PRUint32 count = mChildren.Length();
+    uint32_t count = mChildren.Length();
 
     // Emit children_changed::add in a timeout
     // to make sure aRootAccWrap is fully initialized.
     AtkRootAccessibleAddedEvent* eventData = (AtkRootAccessibleAddedEvent*)
       malloc(sizeof(AtkRootAccessibleAddedEvent));
     if (eventData) {
       eventData->app_accessible = mAtkObject;
       eventData->root_accessible = atkAccessible;
@@ -730,17 +730,17 @@ ApplicationAccessibleWrap::AppendChild(A
     }
 
     return true;
 }
 
 bool
 ApplicationAccessibleWrap::RemoveChild(Accessible* aChild)
 {
-  PRInt32 index = aChild->IndexInParent();
+  int32_t index = aChild->IndexInParent();
 
   AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
   atk_object_set_parent(atkAccessible, NULL);
   g_signal_emit_by_name(mAtkObject, "children_changed::remove", index,
                         atkAccessible, NULL);
 
   return ApplicationAccessible::RemoveChild(aChild);
 }
@@ -790,18 +790,18 @@ LoadGtkModule(GnomeAccessibilityModule& 
 #if defined(LINUX) && defined(__x86_64__)
         libPath.Append(":/usr/lib64:/usr/lib");
 #else
         libPath.Append(":/usr/lib");
 #endif
         MAI_LOG_DEBUG(("Current Lib path=%s\n", libPath.get()));
         PR_FreeLibraryName(curLibPath);
 
-        PRInt16 loc1 = 0, loc2 = 0;
-        PRInt16 subLen = 0;
+        int16_t loc1 = 0, loc2 = 0;
+        int16_t subLen = 0;
         while (loc2 >= 0) {
             loc2 = libPath.FindChar(':', loc1);
             if (loc2 < 0)
                 subLen = libPath.Length() - loc1;
             else
                 subLen = loc2 - loc1;
             nsCAutoString sub(Substring(libPath, loc1, subLen));
             sub.Append("/gtk-2.0/modules/");
--- a/accessible/src/atk/nsMaiInterfaceComponent.cpp
+++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp
@@ -72,17 +72,17 @@ getExtentsHelper(AccessibleWrap* aAccWra
                  gint* aX, gint* aY, gint* aWidth, gint* aHeight,
                  AtkCoordType aCoordType)
 {
   *aX = *aY = *aWidth = *aHeight = 0;
 
   if (!aAccWrap || aAccWrap->IsDefunct())
     return;
 
-  PRInt32 x = 0, y = 0, width = 0, height = 0;
+  int32_t x = 0, y = 0, width = 0, height = 0;
   // Returned in screen coordinates
   nsresult rv = aAccWrap->GetBounds(&x, &y, &width, &height);
   if (NS_FAILED(rv))
     return;
 
   if (aCoordType == ATK_XY_WINDOW) {
     nsIntPoint winCoords =
       nsCoreUtils::GetScreenCoordsForWindow(aAccWrap->GetNode());
--- a/accessible/src/atk/nsMaiInterfaceEditableText.cpp
+++ b/accessible/src/atk/nsMaiInterfaceEditableText.cpp
@@ -66,17 +66,17 @@ insertTextCB(AtkEditableText *aText,
                             getter_AddRefs(accText));
     if (!accText)
         return;
 
     NS_ConvertUTF8toUTF16 strContent(aString, aLength);
 
     // interface changed in nsIAccessibleEditableText.idl ???
     //
-    // PRInt32 pos = *aPosition;
+    // int32_t pos = *aPosition;
     // nsresult rv = accText->InsertText(strContent, aLength, &pos);
     // *aPosition = pos;
 
     accText->InsertText(strContent, *aPosition);
 
     MAI_LOG_DEBUG(("EditableText: insert aString=%s, aLength=%d, aPosition=%d",
                    aString, aLength, *aPosition));
 }
--- a/accessible/src/atk/nsMaiInterfaceHypertext.cpp
+++ b/accessible/src/atk/nsMaiInterfaceHypertext.cpp
@@ -53,17 +53,17 @@ getLinkIndexCB(AtkHypertext *aText, gint
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (!accWrap)
     return -1;
 
   HyperTextAccessible* hyperText = accWrap->AsHyperText();
   NS_ENSURE_TRUE(hyperText, -1);
 
-  PRInt32 index = -1;
+  int32_t index = -1;
   nsresult rv = hyperText->GetLinkIndexAtOffset(aCharIndex, &index);
   NS_ENSURE_SUCCESS(rv, -1);
 
   return index;
 }
 }
 
 void
--- a/accessible/src/atk/nsMaiInterfaceImage.cpp
+++ b/accessible/src/atk/nsMaiInterfaceImage.cpp
@@ -20,17 +20,17 @@ static void
 getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
                    AtkCoordType aCoordType)
 {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
   if (!accWrap || !accWrap->IsImage())
     return;
 
   ImageAccessible* image = accWrap->AsImage();
-  PRUint32 geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
+  uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
     nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
     nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
   // Returned in screen coordinates
   image->GetImagePosition(geckoCoordType, aAccX, aAccY);
 }
 
 static const gchar*
 getImageDescriptionCB(AtkImage* aImage)
--- a/accessible/src/atk/nsMaiInterfaceTable.cpp
+++ b/accessible/src/atk/nsMaiInterfaceTable.cpp
@@ -61,17 +61,17 @@ getColumnAtIndexCB(AtkTable *aTable, gin
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, -1);
 
-    PRInt32 col;
+    int32_t col;
     nsresult rv = accTable->GetColumnIndexAt(aIndex, &col);
     NS_ENSURE_SUCCESS(rv, -1);
 
     return static_cast<gint>(col);
 }
 
 static gint
 getRowAtIndexCB(AtkTable *aTable, gint aIndex)
@@ -80,17 +80,17 @@ getRowAtIndexCB(AtkTable *aTable, gint a
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, -1);
 
-    PRInt32 row;
+    int32_t row;
     nsresult rv = accTable->GetRowIndexAt(aIndex, &row);
     NS_ENSURE_SUCCESS(rv, -1);
 
     return static_cast<gint>(row);
 }
 
 static gint
 getColumnCountCB(AtkTable *aTable)
@@ -99,17 +99,17 @@ getColumnCountCB(AtkTable *aTable)
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, -1);
 
-    PRInt32 count;
+    int32_t count;
     nsresult rv = accTable->GetColumnCount(&count);
     NS_ENSURE_SUCCESS(rv, -1);
 
     return static_cast<gint>(count);
 }
 
 static gint
 getRowCountCB(AtkTable *aTable)
@@ -118,17 +118,17 @@ getRowCountCB(AtkTable *aTable)
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, -1);
 
-    PRInt32 count;
+    int32_t count;
     nsresult rv = accTable->GetRowCount(&count);
     NS_ENSURE_SUCCESS(rv, -1);
 
     return static_cast<gint>(count);
 }
 
 static gint
 getColumnExtentAtCB(AtkTable *aTable,
@@ -138,17 +138,17 @@ getColumnExtentAtCB(AtkTable *aTable,
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, -1);
 
-    PRInt32 extent;
+    int32_t extent;
     nsresult rv = accTable->GetColumnExtentAt(aRow, aColumn, &extent);
     NS_ENSURE_SUCCESS(rv, -1);
 
     return static_cast<gint>(extent);
 }
 
 static gint
 getRowExtentAtCB(AtkTable *aTable,
@@ -158,17 +158,17 @@ getRowExtentAtCB(AtkTable *aTable,
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, -1);
 
-    PRInt32 extent;
+    int32_t extent;
     nsresult rv = accTable->GetRowExtentAt(aRow, aColumn, &extent);
     NS_ENSURE_SUCCESS(rv, -1);
 
     return static_cast<gint>(extent);
 }
 
 static AtkObject*
 getCaptionCB(AtkTable* aTable)
@@ -323,32 +323,32 @@ getSelectedColumnsCB(AtkTable *aTable, g
   if (!accWrap)
     return 0;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, 0);
 
-    PRUint32 size = 0;
-    PRInt32 *columns = NULL;
+    uint32_t size = 0;
+    int32_t *columns = NULL;
     nsresult rv = accTable->GetSelectedColumnIndices(&size, &columns);
     if (NS_FAILED(rv) || (size == 0) || !columns) {
         *aSelected = nullptr;
         return 0;
     }
 
     gint *atkColumns = g_new(gint, size);
     if (!atkColumns) {
         NS_WARNING("OUT OF MEMORY");
         return 0;
     }
 
     //copy
-    for (PRUint32 index = 0; index < size; ++index)
+    for (uint32_t index = 0; index < size; ++index)
         atkColumns[index] = static_cast<gint>(columns[index]);
     nsMemory::Free(columns);
 
     *aSelected = atkColumns;
     return size;
 }
 
 static gint
@@ -358,32 +358,32 @@ getSelectedRowsCB(AtkTable *aTable, gint
     if (!accWrap)
         return 0;
 
     nsCOMPtr<nsIAccessibleTable> accTable;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
                             getter_AddRefs(accTable));
     NS_ENSURE_TRUE(accTable, 0);
 
-    PRUint32 size = 0;
-    PRInt32 *rows = NULL;
+    uint32_t size = 0;
+    int32_t *rows = NULL;
     nsresult rv = accTable->GetSelectedRowIndices(&size, &rows);
     if (NS_FAILED(rv) || (size == 0) || !rows) {
         *aSelected = nullptr;
         return 0;
     }
 
     gint *atkRows = g_new(gint, size);
     if (!atkRows) {
         NS_WARNING("OUT OF MEMORY");
         return 0;
     }
 
     //copy
-    for (PRUint32 index = 0; index < size; ++index)
+    for (uint32_t index = 0; index < size; ++index)
         atkRows[index] = static_cast<gint>(rows[index]);
     nsMemory::Free(rows);
 
     *aSelected = atkRows;
     return size;
 }
 
 static gboolean
--- a/accessible/src/atk/nsMaiInterfaceText.cpp
+++ b/accessible/src/atk/nsMaiInterfaceText.cpp
@@ -15,17 +15,17 @@ using namespace mozilla::a11y;
 
 AtkAttributeSet* ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes);
 
 static void
 ConvertTexttoAsterisks(AccessibleWrap* accWrap, nsAString& aString)
 {
   // convert each char to "*" when it's "password text" 
   if (accWrap->NativeRole() == roles::PASSWORD_TEXT) {
-    for (PRUint32 i = 0; i < aString.Length(); i++)
+    for (uint32_t i = 0; i < aString.Length(); i++)
       aString.Replace(i, 1, NS_LITERAL_STRING("*"));
   }
 }
 
 extern "C" {
 
 static gchar*
 getTextCB(AtkText *aText, gint aStartOffset, gint aEndOffset)
@@ -60,17 +60,17 @@ getTextAfterOffsetCB(AtkText *aText, gin
     return nullptr;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, nullptr);
 
     nsAutoString autoStr;
-    PRInt32 startOffset = 0, endOffset = 0;
+    int32_t startOffset = 0, endOffset = 0;
     nsresult rv =
         accText->GetTextAfterOffset(aOffset, aBoundaryType,
                                     &startOffset, &endOffset, autoStr);
     *aStartOffset = startOffset;
     *aEndOffset = endOffset;
 
     NS_ENSURE_SUCCESS(rv, nullptr);
 
@@ -89,17 +89,17 @@ getTextAtOffsetCB(AtkText *aText, gint a
     return nullptr;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, nullptr);
 
     nsAutoString autoStr;
-    PRInt32 startOffset = 0, endOffset = 0;
+    int32_t startOffset = 0, endOffset = 0;
     nsresult rv =
         accText->GetTextAtOffset(aOffset, aBoundaryType,
                                  &startOffset, &endOffset, autoStr);
     *aStartOffset = startOffset;
     *aEndOffset = endOffset;
 
     NS_ENSURE_SUCCESS(rv, nullptr);
 
@@ -144,17 +144,17 @@ getTextBeforeOffsetCB(AtkText *aText, gi
     return nullptr;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, nullptr);
 
     nsAutoString autoStr;
-    PRInt32 startOffset = 0, endOffset = 0;
+    int32_t startOffset = 0, endOffset = 0;
     nsresult rv =
         accText->GetTextBeforeOffset(aOffset, aBoundaryType,
                                      &startOffset, &endOffset, autoStr);
     *aStartOffset = startOffset;
     *aEndOffset = endOffset;
 
     NS_ENSURE_SUCCESS(rv, nullptr);
 
@@ -170,17 +170,17 @@ getCaretOffsetCB(AtkText *aText)
   if (!accWrap)
     return 0;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, 0);
 
-    PRInt32 offset;
+    int32_t offset;
     nsresult rv = accText->GetCaretOffset(&offset);
     return (NS_FAILED(rv)) ? 0 : static_cast<gint>(offset);
 }
 
 static AtkAttributeSet*
 getRunAttributesCB(AtkText *aText, gint aOffset,
                    gint *aStartOffset,
                    gint *aEndOffset)
@@ -193,17 +193,17 @@ getRunAttributesCB(AtkText *aText, gint 
     return nullptr;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, nullptr);
 
     nsCOMPtr<nsIPersistentProperties> attributes;
-    PRInt32 startOffset = 0, endOffset = 0;
+    int32_t startOffset = 0, endOffset = 0;
     nsresult rv = accText->GetTextAttributes(false, aOffset,
                                              &startOffset, &endOffset,
                                              getter_AddRefs(attributes));
     NS_ENSURE_SUCCESS(rv, nullptr);
 
     *aStartOffset = startOffset;
     *aEndOffset = endOffset;
 
@@ -241,20 +241,20 @@ getCharacterExtentsCB(AtkText *aText, gi
     return;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     if (!accText)
         return;
 
-    PRInt32 extY = 0, extX = 0;
-    PRInt32 extWidth = 0, extHeight = 0;
+    int32_t extY = 0, extX = 0;
+    int32_t extWidth = 0, extHeight = 0;
 
-    PRUint32 geckoCoordType;
+    uint32_t geckoCoordType;
     if (aCoords == ATK_XY_SCREEN)
         geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
     else
         geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
 
 #ifdef DEBUG
     nsresult rv =
 #endif
@@ -278,20 +278,20 @@ getRangeExtentsCB(AtkText *aText, gint a
     return;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     if (!accText)
         return;
 
-    PRInt32 extY = 0, extX = 0;
-    PRInt32 extWidth = 0, extHeight = 0;
+    int32_t extY = 0, extX = 0;
+    int32_t extWidth = 0, extHeight = 0;
 
-    PRUint32 geckoCoordType;
+    uint32_t geckoCoordType;
     if (aCoords == ATK_XY_SCREEN)
         geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
     else
         geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
 
 #ifdef DEBUG
     nsresult rv =
 #endif
@@ -328,18 +328,18 @@ getOffsetAtPointCB(AtkText *aText,
   if (!accWrap)
     return -1;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, -1);
 
-    PRInt32 offset = 0;
-    PRUint32 geckoCoordType;
+    int32_t offset = 0;
+    uint32_t geckoCoordType;
     if (aCoords == ATK_XY_SCREEN)
         geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
     else
         geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
 
     accText->GetOffsetAtPoint(aX, aY, geckoCoordType, &offset);
     return static_cast<gint>(offset);
 }
@@ -351,17 +351,17 @@ getTextSelectionCountCB(AtkText *aText)
   if (!accWrap)
     return 0;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, 0);
 
-    PRInt32 selectionCount;
+    int32_t selectionCount;
     nsresult rv = accText->GetSelectionCount(&selectionCount);
  
     return NS_FAILED(rv) ? 0 : selectionCount;
 }
 
 static gchar*
 getTextSelectionCB(AtkText *aText, gint aSelectionNum,
                    gint *aStartOffset, gint *aEndOffset)
@@ -370,17 +370,17 @@ getTextSelectionCB(AtkText *aText, gint 
   if (!accWrap)
     return nullptr;
 
     nsCOMPtr<nsIAccessibleText> accText;
     accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
                             getter_AddRefs(accText));
     NS_ENSURE_TRUE(accText, nullptr);
 
-    PRInt32 startOffset = 0, endOffset = 0;
+    int32_t startOffset = 0, endOffset = 0;
     nsresult rv = accText->GetSelectionBounds(aSelectionNum,
                                               &startOffset, &endOffset);
 
     *aStartOffset = startOffset;
     *aEndOffset = endOffset;
 
     NS_ENSURE_SUCCESS(rv, nullptr);
 
--- a/accessible/src/atk/nsStateMap.h
+++ b/accessible/src/atk/nsStateMap.h
@@ -42,19 +42,19 @@ enum EStateMapEntryType {
 };
 
 const AtkStateType kNone = ATK_STATE_INVALID;
 
 struct AtkStateMap {
   AtkStateType atkState;
   EStateMapEntryType stateMapEntryType;
 
-  static PRInt32 GetStateIndexFor(PRUint64 aState)
+  static int32_t GetStateIndexFor(uint64_t aState)
   {
-    PRInt32 stateIndex = -1;
+    int32_t stateIndex = -1;
     while (aState > 0) {
       ++ stateIndex;
       aState >>= 1;
     }
     return stateIndex;  // Returns -1 if not mapped
   }
 };
 
--- a/accessible/src/base/ARIAStateMap.cpp
+++ b/accessible/src/base/ARIAStateMap.cpp
@@ -16,38 +16,38 @@ using namespace mozilla::a11y;
 using namespace mozilla::a11y::aria;
 
 /**
  * Used to store state map rule data for ARIA attribute of enum type.
  */
 struct EnumTypeData
 {
   EnumTypeData(nsIAtom* aAttrName,
-               nsIAtom** aValue1, PRUint64 aState1,
-               nsIAtom** aValue2, PRUint64 aState2,
-               nsIAtom** aValue3 = 0, PRUint64 aState3 = 0) :
+               nsIAtom** aValue1, uint64_t aState1,
+               nsIAtom** aValue2, uint64_t aState2,
+               nsIAtom** aValue3 = 0, uint64_t aState3 = 0) :
     mState1(aState1), mState2(aState2), mState3(aState3), mDefaultState(0),
     mAttrName(aAttrName), mValue1(aValue1), mValue2(aValue2), mValue3(aValue3),
     mNullValue(nullptr)
   { }
 
-  EnumTypeData(nsIAtom* aAttrName, PRUint64 aDefaultState,
-               nsIAtom** aValue1, PRUint64 aState1) :
+  EnumTypeData(nsIAtom* aAttrName, uint64_t aDefaultState,
+               nsIAtom** aValue1, uint64_t aState1) :
     mState1(aState1), mState2(0), mState3(0), mDefaultState(aDefaultState),
     mAttrName(aAttrName), mValue1(aValue1), mValue2(nullptr), mValue3(nullptr),
     mNullValue(nullptr)
   { }
 
   // States applied if corresponding enum values are matched.
-  const PRUint64 mState1;
-  const PRUint64 mState2;
-  const PRUint64 mState3;
+  const uint64_t mState1;
+  const uint64_t mState2;
+  const uint64_t mState3;
 
   // Default state if no one enum value is matched.
-  const PRUint64 mDefaultState;
+  const uint64_t mDefaultState;
 
   // ARIA attribute name.
   nsIAtom* const mAttrName;
 
   // States if the attribute value is matched to the enum value. Used as
   // nsIContent::AttrValuesArray.
   nsIAtom* const* const mValue1;
   nsIAtom* const* const mValue2;
@@ -63,53 +63,53 @@ enum ETokenType
 };
 
 /**
  * Used to store state map rule data for ARIA attribute of token type (including
  * mixed value).
  */
 struct TokenTypeData
 {
-  TokenTypeData(nsIAtom* aAttrName, PRUint32 aType,
-                PRUint64 aPermanentState,
-                PRUint64 aTrueState,
-                PRUint64 aFalseState = 0) :
+  TokenTypeData(nsIAtom* aAttrName, uint32_t aType,
+                uint64_t aPermanentState,
+                uint64_t aTrueState,
+                uint64_t aFalseState = 0) :
   mAttrName(aAttrName), mType(aType), mPermanentState(aPermanentState),
   mTrueState(aTrueState), mFalseState(aFalseState)
   { }
 
   // ARIA attribute name.
   nsIAtom* const mAttrName;
 
   // Type.
-  const PRUint32 mType;
+  const uint32_t mType;
 
   // State applied if the attribute is defined or mType doesn't have
   // eDefinedIfAbsent flag set.
-  const PRUint64 mPermanentState;
+  const uint64_t mPermanentState;
 
   // States applied if the attribute value is true/false.
-  const PRUint64 mTrueState;
-  const PRUint64 mFalseState;
+  const uint64_t mTrueState;
+  const uint64_t mFalseState;
 };
 
 /**
  * Map enum type attribute value to accessible state.
  */
-static void MapEnumType(dom::Element* aElement, PRUint64* aState,
+static void MapEnumType(dom::Element* aElement, uint64_t* aState,
                         const EnumTypeData& aData);
 
 /**
  * Map token type attribute value to states.
  */
-static void MapTokenType(dom::Element* aContent, PRUint64* aState,
+static void MapTokenType(dom::Element* aContent, uint64_t* aState,
                          const TokenTypeData& aData);
 
 bool
-aria::MapToState(EStateRule aRule, dom::Element* aElement, PRUint64* aState)
+aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
 {
   switch (aRule) {
     case eARIAAutoComplete:
     {
       static const EnumTypeData data(
         nsGkAtoms::aria_autocomplete,
         &nsGkAtoms::inlinevalue, states::SUPPORTS_AUTOCOMPLETION,
         &nsGkAtoms::list, states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION,
@@ -310,17 +310,17 @@ aria::MapToState(EStateRule aRule, dom::
     }
 
     default:
       return false;
   }
 }
 
 static void
-MapEnumType(dom::Element* aElement, PRUint64* aState, const EnumTypeData& aData)
+MapEnumType(dom::Element* aElement, uint64_t* aState, const EnumTypeData& aData)
 {
   switch (aElement->FindAttrValueIn(kNameSpaceID_None, aData.mAttrName,
                                     &aData.mValue1, eCaseMatters)) {
     case 0:
       *aState |= aData.mState1;
       return;
     case 1:
       *aState |= aData.mState2;
@@ -329,17 +329,17 @@ MapEnumType(dom::Element* aElement, PRUi
       *aState |= aData.mState3;
       return;
   }
 
   *aState |= aData.mDefaultState;
 }
 
 static void
-MapTokenType(dom::Element* aElement, PRUint64* aState,
+MapTokenType(dom::Element* aElement, uint64_t* aState,
              const TokenTypeData& aData)
 {
   if (aElement->HasAttr(kNameSpaceID_None, aData.mAttrName)) {
     if ((aData.mType & eMixedType) &&
         aElement->AttrValueIs(kNameSpaceID_None, aData.mAttrName,
                               nsGkAtoms::mixed, eCaseMatters)) {
       *aState |= aData.mPermanentState | states::MIXED;
       return;
--- a/accessible/src/base/ARIAStateMap.h
+++ b/accessible/src/base/ARIAStateMap.h
@@ -2,17 +2,17 @@
 /* vim: set ts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef _mozilla_a11y_aria_ARIAStateMap_h_
 #define _mozilla_a11y_aria_ARIAStateMap_h_
 
-#include "prtypes.h"
+#include "mozilla/StandardInteger.h"
 
 namespace mozilla {
 
 namespace dom {
 class Element;
 }
 
 namespace a11y {
@@ -49,15 +49,15 @@ enum EStateRule
  * Expose the accessible states for the given element accordingly to state
  * mapping rule.
  *
  * @param  aRule     [in] state mapping rule ID
  * @param  aElement  [in] node of the accessible
  * @param  aState    [in/out] accessible states
  * @return            true if state map rule ID is valid
  */
-bool MapToState(EStateRule aRule, dom::Element* aElement, PRUint64* aState);
+bool MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState);
 
 } // namespace aria
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/src/base/AccCollector.cpp
+++ b/accessible/src/base/AccCollector.cpp
@@ -15,67 +15,67 @@ AccCollector::
   mFilterFunc(aFilterFunc), mRoot(aRoot), mRootChildIdx(0)
 {
 }
 
 AccCollector::~AccCollector()
 {
 }
 
-PRUint32
+uint32_t
 AccCollector::Count()
 {
   EnsureNGetIndex(nullptr);
   return mObjects.Length();
 }
 
 Accessible*
-AccCollector::GetAccessibleAt(PRUint32 aIndex)
+AccCollector::GetAccessibleAt(uint32_t aIndex)
 {
   Accessible* accessible = mObjects.SafeElementAt(aIndex, nullptr);
   if (accessible)
     return accessible;
 
   return EnsureNGetObject(aIndex);
 }
 
-PRInt32
+int32_t
 AccCollector::GetIndexAt(Accessible* aAccessible)
 {
-  PRInt32 index = mObjects.IndexOf(aAccessible);
+  int32_t index = mObjects.IndexOf(aAccessible);
   if (index != -1)
     return index;
 
   return EnsureNGetIndex(aAccessible);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccCollector protected
 
 Accessible*
-AccCollector::EnsureNGetObject(PRUint32 aIndex)
+AccCollector::EnsureNGetObject(uint32_t aIndex)
 {
-  PRUint32 childCount = mRoot->ChildCount();
+  uint32_t childCount = mRoot->ChildCount();
   while (mRootChildIdx < childCount) {
     Accessible* child = mRoot->GetChildAt(mRootChildIdx++);
     if (!mFilterFunc(child))
       continue;
 
     AppendObject(child);
     if (mObjects.Length() - 1 == aIndex)
       return mObjects[aIndex];
   }
 
   return nullptr;
 }
 
-PRInt32
+int32_t
 AccCollector::EnsureNGetIndex(Accessible* aAccessible)
 {
-  PRUint32 childCount = mRoot->ChildCount();
+  uint32_t childCount = mRoot->ChildCount();
   while (mRootChildIdx < childCount) {
     Accessible* child = mRoot->GetChildAt(mRootChildIdx++);
     if (!mFilterFunc(child))
       continue;
 
     AppendObject(child);
     if (child == aAccessible)
       return mObjects.Length() - 1;
@@ -89,17 +89,17 @@ AccCollector::AppendObject(Accessible* a
 {
   mObjects.AppendElement(aAccessible);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // EmbeddedObjCollector
 ////////////////////////////////////////////////////////////////////////////////
 
-PRInt32
+int32_t
 EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible)
 {
   if (aAccessible->mParent != mRoot)
     return -1;
 
   if (aAccessible->mIndexOfEmbeddedChild != -1)
     return aAccessible->mIndexOfEmbeddedChild;
 
--- a/accessible/src/base/AccCollector.h
+++ b/accessible/src/base/AccCollector.h
@@ -18,47 +18,47 @@ class AccCollector
 {
 public:
   AccCollector(Accessible* aRoot, filters::FilterFuncPtr aFilterFunc);
   virtual ~AccCollector();
 
   /**
    * Return accessible count within the collection.
    */
-  PRUint32 Count();
+  uint32_t Count();
 
   /**
    * Return an accessible from the collection at the given index.
    */
-  Accessible* GetAccessibleAt(PRUint32 aIndex);
+  Accessible* GetAccessibleAt(uint32_t aIndex);
 
   /**
    * Return index of the given accessible within the collection.
    */
-  virtual PRInt32 GetIndexAt(Accessible* aAccessible);
+  virtual int32_t GetIndexAt(Accessible* aAccessible);
 
 protected:
   /**
    * Ensure accessible at the given index is stored and return it.
    */
-  Accessible* EnsureNGetObject(PRUint32 aIndex);
+  Accessible* EnsureNGetObject(uint32_t aIndex);
 
   /**
    * Ensure index for the given accessible is stored and return it.
    */
-  PRInt32 EnsureNGetIndex(Accessible* aAccessible);
+  int32_t EnsureNGetIndex(Accessible* aAccessible);
 
   /**
    * Append the object to collection.
    */
   virtual void AppendObject(Accessible* aAccessible);
 
   filters::FilterFuncPtr mFilterFunc;
   Accessible* mRoot;
-  PRUint32 mRootChildIdx;
+  uint32_t mRootChildIdx;
 
   nsTArray<Accessible*> mObjects;
 
 private:
   AccCollector();
   AccCollector(const AccCollector&);
   AccCollector& operator =(const AccCollector&);
 };
@@ -68,17 +68,17 @@ private:
  * vice versa.
  */
 class EmbeddedObjCollector : public AccCollector
 {
 public:
   virtual ~EmbeddedObjCollector() { };
 
 public:
-  virtual PRInt32 GetIndexAt(Accessible* aAccessible);
+  virtual int32_t GetIndexAt(Accessible* aAccessible);
 
 protected:
   // Make sure it's used by Accessible class only.
   EmbeddedObjCollector(Accessible* aRoot) :
     AccCollector(aRoot, filters::GetEmbeddedObject) { }
 
   virtual void AppendObject(Accessible* aAccessible);
 
--- a/accessible/src/base/AccEvent.cpp
+++ b/accessible/src/base/AccEvent.cpp
@@ -23,24 +23,24 @@ using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccEvent constructors
 
-AccEvent::AccEvent(PRUint32 aEventType, Accessible* aAccessible,
+AccEvent::AccEvent(uint32_t aEventType, Accessible* aAccessible,
                    EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) :
   mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible)
 {
   CaptureIsFromUserInput(aIsFromUserInput);
 }
 
-AccEvent::AccEvent(PRUint32 aEventType, nsINode* aNode,
+AccEvent::AccEvent(uint32_t aEventType, nsINode* aNode,
                    EIsFromUserInput aIsFromUserInput, EEventRule aEventRule) :
   mEventType(aEventType), mEventRule(aEventRule), mNode(aNode)
 {
   CaptureIsFromUserInput(aIsFromUserInput);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccEvent public methods
@@ -162,34 +162,34 @@ AccEvent::CaptureIsFromUserInput(EIsFrom
 ////////////////////////////////////////////////////////////////////////////////
 // AccStateChangeEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 // Note: we pass in eAllowDupes to the base class because we don't currently
 // support correct state change coalescence (XXX Bug 569356). Also we need to
 // decide how to coalesce events created via accessible (instead of node).
 AccStateChangeEvent::
-  AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState,
+  AccStateChangeEvent(Accessible* aAccessible, uint64_t aState,
                       bool aIsEnabled, EIsFromUserInput aIsFromUserInput):
   AccEvent(nsIAccessibleEvent::EVENT_STATE_CHANGE, aAccessible,
            aIsFromUserInput, eAllowDupes),
   mState(aState), mIsEnabled(aIsEnabled)
 {
 }
 
 AccStateChangeEvent::
-  AccStateChangeEvent(nsINode* aNode, PRUint64 aState, bool aIsEnabled):
+  AccStateChangeEvent(nsINode* aNode, uint64_t aState, bool aIsEnabled):
   AccEvent(::nsIAccessibleEvent::EVENT_STATE_CHANGE, aNode,
            eAutoDetect, eAllowDupes),
   mState(aState), mIsEnabled(aIsEnabled)
 {
 }
 
 AccStateChangeEvent::
-  AccStateChangeEvent(nsINode* aNode, PRUint64 aState) :
+  AccStateChangeEvent(nsINode* aNode, uint64_t aState) :
   AccEvent(::nsIAccessibleEvent::EVENT_STATE_CHANGE, aNode,
            eAutoDetect, eAllowDupes),
   mState(aState)
 {
   // Use GetAccessibleForNode() because we do not want to store an accessible
   // since it leads to problems with delayed events in the case when
   // an accessible gets reorder event before delayed event is processed.
   Accessible* accessible = GetAccessibleForNode();
@@ -213,22 +213,22 @@ AccStateChangeEvent::CreateXPCOMObject()
 // events coalescence. We fire delayed text change events in DocAccessible but
 // we continue to base the event off the accessible object rather than just the
 // node. This means we won't try to create an accessible based on the node when
 // we are ready to fire the event and so we will no longer assert at that point
 // if the node was removed from the document. Either way, the AT won't work with
 // a defunct accessible so the behaviour should be equivalent.
 // XXX revisit this when coalescence is faster (eCoalesceFromSameSubtree)
 AccTextChangeEvent::
-  AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart,
+  AccTextChangeEvent(Accessible* aAccessible, int32_t aStart,
                      const nsAString& aModifiedText, bool aIsInserted,
                      EIsFromUserInput aIsFromUserInput)
   : AccEvent(aIsInserted ?
-             static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_INSERTED) :
-             static_cast<PRUint32>(nsIAccessibleEvent::EVENT_TEXT_REMOVED),
+             static_cast<uint32_t>(nsIAccessibleEvent::EVENT_TEXT_INSERTED) :
+             static_cast<uint32_t>(nsIAccessibleEvent::EVENT_TEXT_REMOVED),
              aAccessible, aIsFromUserInput, eAllowDupes)
   , mStart(aStart)
   , mIsInserted(aIsInserted)
   , mModifiedText(aModifiedText)
 {
   // XXX We should use IsFromUserInput here, but that isn't always correct
   // when the text change isn't related to content insertion or removal.
    mIsFromUserInput = mAccessible->State() &
@@ -244,17 +244,17 @@ AccTextChangeEvent::CreateXPCOMObject()
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccMutationEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 AccMutationEvent::
-  AccMutationEvent(PRUint32 aEventType, Accessible* aTarget,
+  AccMutationEvent(uint32_t aEventType, Accessible* aTarget,
                    nsINode* aTargetNode) :
   AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceFromSameSubtree)
 {
   mNode = aTargetNode;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -290,17 +290,17 @@ AccShowEvent::
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccCaretMoveEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 AccCaretMoveEvent::
-  AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset) :
+  AccCaretMoveEvent(Accessible* aAccessible, int32_t aCaretOffset) :
   AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aAccessible),
   mCaretOffset(aCaretOffset)
 {
 }
 
 AccCaretMoveEvent::
   AccCaretMoveEvent(nsINode* aNode) :
   AccEvent(::nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED, aNode),
@@ -339,18 +339,18 @@ AccSelChangeEvent::
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccTableChangeEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 AccTableChangeEvent::
-  AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType,
-                      PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols) :
+  AccTableChangeEvent(Accessible* aAccessible, uint32_t aEventType,
+                      int32_t aRowOrColIndex, int32_t aNumRowsOrCols) :
   AccEvent(aEventType, aAccessible),
   mRowOrColIndex(aRowOrColIndex), mNumRowsOrCols(aNumRowsOrCols)
 {
 }
 
 already_AddRefed<nsAccEvent>
 AccTableChangeEvent::CreateXPCOMObject()
 {
@@ -362,18 +362,18 @@ AccTableChangeEvent::CreateXPCOMObject()
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccVCChangeEvent
 ////////////////////////////////////////////////////////////////////////////////
 
 AccVCChangeEvent::
   AccVCChangeEvent(Accessible* aAccessible,
                    nsIAccessible* aOldAccessible,
-                   PRInt32 aOldStart, PRInt32 aOldEnd,
-                   PRInt16 aReason) :
+                   int32_t aOldStart, int32_t aOldEnd,
+                   int16_t aReason) :
     AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible),
     mOldAccessible(aOldAccessible), mOldStart(aOldStart), mOldEnd(aOldEnd),
     mReason(aReason)
 {
 }
 
 already_AddRefed<nsAccEvent>
 AccVCChangeEvent::CreateXPCOMObject()
--- a/accessible/src/base/AccEvent.h
+++ b/accessible/src/base/AccEvent.h
@@ -54,27 +54,27 @@ public:
      //    will be emitted.
      eRemoveDupes,
 
      // eDoNotEmit : This event is confirmed as a duplicate, do not emit it.
      eDoNotEmit
   };
 
   // Initialize with an nsIAccessible
-  AccEvent(PRUint32 aEventType, Accessible* aAccessible,
+  AccEvent(uint32_t aEventType, Accessible* aAccessible,
            EIsFromUserInput aIsFromUserInput = eAutoDetect,
            EEventRule aEventRule = eRemoveDupes);
   // Initialize with an nsIDOMNode
-  AccEvent(PRUint32 aEventType, nsINode* aNode,
+  AccEvent(uint32_t aEventType, nsINode* aNode,
            EIsFromUserInput aIsFromUserInput = eAutoDetect,
            EEventRule aEventRule = eRemoveDupes);
   virtual ~AccEvent() {}
 
   // AccEvent
-  PRUint32 GetEventType() const { return mEventType; }
+  uint32_t GetEventType() const { return mEventType; }
   EEventRule GetEventRule() const { return mEventRule; }
   bool IsFromUserInput() const { return mIsFromUserInput; }
 
   Accessible* GetAccessible();
   DocAccessible* GetDocAccessible();
   nsINode* GetNode();
 
   /**
@@ -118,100 +118,100 @@ protected:
 
   /**
    * Determine whether the event is from user input by event state manager if
    * it's not pointed explicetly.
    */
   void CaptureIsFromUserInput(EIsFromUserInput aIsFromUserInput);
 
   bool mIsFromUserInput;
-  PRUint32 mEventType;
+  uint32_t mEventType;
   EEventRule mEventRule;
   nsRefPtr<Accessible> mAccessible;
   nsCOMPtr<nsINode> mNode;
 
   friend class NotificationController;
 };
 
 
 /**
  * Accessible state change event.
  */
 class AccStateChangeEvent: public AccEvent
 {
 public:
-  AccStateChangeEvent(Accessible* aAccessible, PRUint64 aState,
+  AccStateChangeEvent(Accessible* aAccessible, uint64_t aState,
                       bool aIsEnabled,
                       EIsFromUserInput aIsFromUserInput = eAutoDetect);
 
-  AccStateChangeEvent(nsINode* aNode, PRUint64 aState, bool aIsEnabled);
+  AccStateChangeEvent(nsINode* aNode, uint64_t aState, bool aIsEnabled);
 
-  AccStateChangeEvent(nsINode* aNode, PRUint64 aState);
+  AccStateChangeEvent(nsINode* aNode, uint64_t aState);
 
   // AccEvent
   virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
 
   static const EventGroup kEventGroup = eStateChangeEvent;
   virtual unsigned int GetEventGroups() const
   {
     return AccEvent::GetEventGroups() | (1U << eStateChangeEvent);
   }
 
   // AccStateChangeEvent
-  PRUint64 GetState() const { return mState; }
+  uint64_t GetState() const { return mState; }
   bool IsStateEnabled() const { return mIsEnabled; }
 
 private:
-  PRUint64 mState;
+  uint64_t mState;
   bool mIsEnabled;
 };
 
 
 /**
  * Accessible text change event.
  */
 class AccTextChangeEvent: public AccEvent
 {
 public:
-  AccTextChangeEvent(Accessible* aAccessible, PRInt32 aStart,
+  AccTextChangeEvent(Accessible* aAccessible, int32_t aStart,
                      const nsAString& aModifiedText, bool aIsInserted,
                      EIsFromUserInput aIsFromUserInput = eAutoDetect);
 
   // AccEvent
   virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
 
   static const EventGroup kEventGroup = eTextChangeEvent;
   virtual unsigned int GetEventGroups() const
   {
     return AccEvent::GetEventGroups() | (1U << eTextChangeEvent);
   }
 
   // AccTextChangeEvent
-  PRInt32 GetStartOffset() const { return mStart; }
-  PRUint32 GetLength() const { return mModifiedText.Length(); }
+  int32_t GetStartOffset() const { return mStart; }
+  uint32_t GetLength() const { return mModifiedText.Length(); }
   bool IsTextInserted() const { return mIsInserted; }
   void GetModifiedText(nsAString& aModifiedText)
     { aModifiedText = mModifiedText; }
 
 private:
-  PRInt32 mStart;
+  int32_t mStart;
   bool mIsInserted;
   nsString mModifiedText;
 
   friend class NotificationController;
 };
 
 
 /**
  * Base class for show and hide accessible events.
  */
 class AccMutationEvent: public AccEvent
 {
 public:
-  AccMutationEvent(PRUint32 aEventType, Accessible* aTarget,
+  AccMutationEvent(uint32_t aEventType, Accessible* aTarget,
                    nsINode* aTargetNode);
 
   // Event
   static const EventGroup kEventGroup = eMutationEvent;
   virtual unsigned int GetEventGroups() const
   {
     return AccEvent::GetEventGroups() | (1U << eMutationEvent);
   }
@@ -276,33 +276,33 @@ public:
 
 
 /**
  * Accessible caret move event.
  */
 class AccCaretMoveEvent: public AccEvent
 {
 public:
-  AccCaretMoveEvent(Accessible* aAccessible, PRInt32 aCaretOffset);
+  AccCaretMoveEvent(Accessible* aAccessible, int32_t aCaretOffset);
   AccCaretMoveEvent(nsINode* aNode);
 
   // AccEvent
   virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
 
   static const EventGroup kEventGroup = eCaretMoveEvent;
   virtual unsigned int GetEventGroups() const
   {
     return AccEvent::GetEventGroups() | (1U << eCaretMoveEvent);
   }
 
   // AccCaretMoveEvent
-  PRInt32 GetCaretOffset() const { return mCaretOffset; }
+  int32_t GetCaretOffset() const { return mCaretOffset; }
 
 private:
-  PRInt32 mCaretOffset;
+  int32_t mCaretOffset;
 };
 
 
 /**
  * Accessible widget selection change event.
  */
 class AccSelChangeEvent : public AccEvent
 {
@@ -326,83 +326,83 @@ public:
 
   // AccSelChangeEvent
   Accessible* Widget() const { return mWidget; }
 
 private:
   nsRefPtr<Accessible> mWidget;
   nsRefPtr<Accessible> mItem;
   SelChangeType mSelChangeType;
-  PRUint32 mPreceedingCount;
+  uint32_t mPreceedingCount;
   AccSelChangeEvent* mPackedEvent;
 
   friend class NotificationController;
 };
 
 
 /**
  * Accessible table change event.
  */
 class AccTableChangeEvent : public AccEvent
 {
 public:
-  AccTableChangeEvent(Accessible* aAccessible, PRUint32 aEventType,
-                      PRInt32 aRowOrColIndex, PRInt32 aNumRowsOrCols);
+  AccTableChangeEvent(Accessible* aAccessible, uint32_t aEventType,
+                      int32_t aRowOrColIndex, int32_t aNumRowsOrCols);
 
   // AccEvent
   virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
 
   static const EventGroup kEventGroup = eTableChangeEvent;
   virtual unsigned int GetEventGroups() const
   {
     return AccEvent::GetEventGroups() | (1U << eTableChangeEvent);
   }
 
   // AccTableChangeEvent
-  PRUint32 GetIndex() const { return mRowOrColIndex; }
-  PRUint32 GetCount() const { return mNumRowsOrCols; }
+  uint32_t GetIndex() const { return mRowOrColIndex; }
+  uint32_t GetCount() const { return mNumRowsOrCols; }
 
 private:
-  PRUint32 mRowOrColIndex;   // the start row/column after which the rows are inserted/deleted.
-  PRUint32 mNumRowsOrCols;   // the number of inserted/deleted rows/columns
+  uint32_t mRowOrColIndex;   // the start row/column after which the rows are inserted/deleted.
+  uint32_t mNumRowsOrCols;   // the number of inserted/deleted rows/columns
 };
 
 /**
  * Accessible virtual cursor change event.
  */
 class AccVCChangeEvent : public AccEvent
 {
 public:
   AccVCChangeEvent(Accessible* aAccessible,
                    nsIAccessible* aOldAccessible,
-                   PRInt32 aOldStart, PRInt32 aOldEnd,
-                   PRInt16 aReason);
+                   int32_t aOldStart, int32_t aOldEnd,
+                   int16_t aReason);
 
   virtual ~AccVCChangeEvent() { }
 
   // AccEvent
   virtual already_AddRefed<nsAccEvent> CreateXPCOMObject();
 
   static const EventGroup kEventGroup = eVirtualCursorChangeEvent;
   virtual unsigned int GetEventGroups() const
   {
     return AccEvent::GetEventGroups() | (1U << eVirtualCursorChangeEvent);
   }
 
   // AccTableChangeEvent
   nsIAccessible* OldAccessible() const { return mOldAccessible; }
-  PRInt32 OldStartOffset() const { return mOldStart; }
-  PRInt32 OldEndOffset() const { return mOldEnd; }
-  PRInt32 Reason() const { return mReason; }
+  int32_t OldStartOffset() const { return mOldStart; }
+  int32_t OldEndOffset() const { return mOldEnd; }
+  int32_t Reason() const { return mReason; }
 
 private:
   nsRefPtr<nsIAccessible> mOldAccessible;
-  PRInt32 mOldStart;
-  PRInt32 mOldEnd;
-  PRInt16 mReason;
+  int32_t mOldStart;
+  int32_t mOldEnd;
+  int16_t mReason;
 };
 
 /**
  * Downcast the generic accessible event object to derived type.
  */
 class downcast_accEvent
 {
 public:
--- a/accessible/src/base/AccGroupInfo.cpp
+++ b/accessible/src/base/AccGroupInfo.cpp
@@ -12,45 +12,45 @@ using namespace mozilla::a11y;
 AccGroupInfo::AccGroupInfo(Accessible* aItem, role aRole) :
   mPosInSet(0), mSetSize(0), mParent(nullptr)
 {
   MOZ_COUNT_CTOR(AccGroupInfo);
   Accessible* parent = aItem->Parent();
   if (!parent)
     return;
 
-  PRInt32 indexInParent = aItem->IndexInParent();
-  PRUint32 siblingCount = parent->ChildCount();
+  int32_t indexInParent = aItem->IndexInParent();
+  uint32_t siblingCount = parent->ChildCount();
   if (indexInParent == -1 ||
-      indexInParent >= static_cast<PRInt32>(siblingCount)) {
+      indexInParent >= static_cast<int32_t>(siblingCount)) {
     NS_ERROR("Wrong index in parent! Tree invalidation problem.");
     return;
   }
 
-  PRInt32 level = nsAccUtils::GetARIAOrDefaultLevel(aItem);
+  int32_t level = nsAccUtils::GetARIAOrDefaultLevel(aItem);
 
   // Compute position in set.
   mPosInSet = 1;
-  for (PRInt32 idx = indexInParent - 1; idx >= 0 ; idx--) {
+  for (int32_t idx = indexInParent - 1; idx >= 0 ; idx--) {
     Accessible* sibling = parent->GetChildAt(idx);
     roles::Role siblingRole = sibling->Role();
 
     // If the sibling is separator then the group is ended.
     if (siblingRole == roles::SEPARATOR)
       break;
 
     // If sibling is not visible and hasn't the same base role.
     if (BaseRole(siblingRole) != aRole || sibling->State() & states::INVISIBLE)
       continue;
 
     // Check if it's hierarchical flatten structure, i.e. if the sibling
     // level is lesser than this one then group is ended, if the sibling level
     // is greater than this one then the group is split by some child elements
     // (group will be continued).
-    PRInt32 siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
+    int32_t siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
     if (siblingLevel < level) {
       mParent = sibling;
       break;
     }
 
     // Skip subset.
     if (siblingLevel > level)
       continue;
@@ -65,31 +65,31 @@ AccGroupInfo::AccGroupInfo(Accessible* a
     }
 
     mPosInSet++;
   }
 
   // Compute set size.
   mSetSize = mPosInSet;
 
-  for (PRUint32 idx = indexInParent + 1; idx < siblingCount; idx++) {
+  for (uint32_t idx = indexInParent + 1; idx < siblingCount; idx++) {
     Accessible* sibling = parent->GetChildAt(idx);
 
     roles::Role siblingRole = sibling->Role();
 
     // If the sibling is separator then the group is ended.
     if (siblingRole == roles::SEPARATOR)
       break;
 
     // If sibling is visible and has the same base role
     if (BaseRole(siblingRole) != aRole || sibling->State() & states::INVISIBLE)
       continue;
 
     // and check if it's hierarchical flatten structure.
-    PRInt32 siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
+    int32_t siblingLevel = nsAccUtils::GetARIAOrDefaultLevel(sibling);
     if (siblingLevel < level)
       break;
 
     // Skip subset.
     if (siblingLevel > level)
       continue;
 
     // If the next item in the group has calculated group information then
--- a/accessible/src/base/AccGroupInfo.h
+++ b/accessible/src/base/AccGroupInfo.h
@@ -12,18 +12,18 @@
  * Calculate and store group information.
  */
 class AccGroupInfo
 {
 public:
   AccGroupInfo(Accessible* aItem, mozilla::a11y::role aRole);
   ~AccGroupInfo() { MOZ_COUNT_DTOR(AccGroupInfo); }
 
-  PRInt32 PosInSet() const { return mPosInSet; }
-  PRUint32 SetSize() const { return mSetSize; }
+  int32_t PosInSet() const { return mPosInSet; }
+  uint32_t SetSize() const { return mSetSize; }
   Accessible* ConceptualParent() const { return mParent; }
 
   /**
    * Create group info.
    */
   static AccGroupInfo* CreateGroupInfo(Accessible* aAccessible)
   {
     mozilla::a11y::role role = aAccessible->Role();
@@ -66,14 +66,14 @@ private:
 
   /**
    * Return true if the given parent role is conceptual parent of the given
    * role.
    */
   static bool IsConceptualParent(mozilla::a11y::role aRole,
 				 mozilla::a11y::role aParentRole);
 
-  PRUint32 mPosInSet;
-  PRUint32 mSetSize;
+  uint32_t mPosInSet;
+  uint32_t mSetSize;
   Accessible* mParent;
 };
 
 #endif
--- a/accessible/src/base/AccIterator.h
+++ b/accessible/src/base/AccIterator.h
@@ -64,17 +64,17 @@ private:
   AccIterator(const AccIterator&);
   AccIterator& operator =(const AccIterator&);
 
   struct IteratorState
   {
     IteratorState(Accessible* aParent, IteratorState* mParentState = nullptr);
 
     Accessible* mParent;
-    PRInt32 mIndex;
+    int32_t mIndex;
     IteratorState *mParentState;
   };
 
   filters::FilterFuncPtr mFilterFunc;
   bool mIsDeep;
   IteratorState *mState;
 };
 
@@ -110,17 +110,17 @@ private:
   RelatedAccIterator();
   RelatedAccIterator(const RelatedAccIterator&);
   RelatedAccIterator& operator = (const RelatedAccIterator&);
 
   DocAccessible* mDocument;
   nsIAtom* mRelAttr;
   DocAccessible::AttrRelProviderArray* mProviders;
   nsIContent* mBindingParent;
-  PRUint32 mIndex;
+  uint32_t mIndex;
 };
 
 
 /**
  * Used to iterate through HTML labels associated with the given accessible.
  */
 class HTMLLabelIterator : public AccIterable
 {
--- a/accessible/src/base/FocusManager.h
+++ b/accessible/src/base/FocusManager.h
@@ -141,19 +141,19 @@ private:
   printf("\n  }\n");
 
 #define A11YDEBUG_FOCUS_BLOCKOFFSET                                            \
   printf("    ");
 
 #define A11YDEBUG_FOCUS_LOG_TIME                                               \
   {                                                                            \
     PRIntervalTime time = PR_IntervalNow();                                    \
-    PRUint32 mins = (PR_IntervalToSeconds(time) / 60) % 60;                    \
-    PRUint32 secs = PR_IntervalToSeconds(time) % 60;                           \
-    PRUint32 msecs = PR_IntervalToMilliseconds(time) % 1000;                   \
+    uint32_t mins = (PR_IntervalToSeconds(time) / 60) % 60;                    \
+    uint32_t secs = PR_IntervalToSeconds(time) % 60;                           \
+    uint32_t msecs = PR_IntervalToMilliseconds(time) % 1000;                   \
     printf("Time: %2d:%2d.%3d\n", mins, secs, msecs);                          \
   }
 
 #define A11YDEBUG_FOCUS_LOG_DOMNODE(aNode)                                     \
   if (aNode) {                                                                 \
     if (aNode->IsElement()) {                                                  \
       dom::Element* targetElm = aNode->AsElement();                            \
       nsCAutoString tag;                                                       \
--- a/accessible/src/base/Logging.cpp
+++ b/accessible/src/base/Logging.cpp
@@ -22,17 +22,17 @@
 #include "nsIDocShellTreeItem.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Logging helpers
 
-static PRUint32 sModules = 0;
+static uint32_t sModules = 0;
 
 struct ModuleRep {
   const char* mStr;
   logging::EModules mModule;
 };
 
 static void
 EnableLogging(const char* aModulesStr)
@@ -89,17 +89,17 @@ static void
 LogDocShellState(nsIDocument* aDocumentNode)
 {
   printf("docshell busy: ");
 
   nsCAutoString docShellBusy;
   nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
   if (container) {
     nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
-    PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
+    uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
     docShell->GetBusyFlags(&busyFlags);
     if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)
       printf("'none'");
     if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)
       printf("'busy'");
     if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)
       printf(", 'before page load'");
     if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)
@@ -219,17 +219,17 @@ LogDocInfo(nsIDocument* aDocumentNode, D
   }
 }
 
 static void
 LogShellLoadType(nsIDocShell* aDocShell)
 {
   printf("load type: ");
 
-  PRUint32 loadType = 0;
+  uint32_t loadType = 0;
   aDocShell->GetLoadType(&loadType);
   switch (loadType) {
     case LOAD_NORMAL:
       printf("normal; ");
       break;
     case LOAD_NORMAL_REPLACE:
       printf("normal replace; ");
       break;
@@ -294,17 +294,17 @@ LogShellLoadType(nsIDocShell* aDocShell)
 
 static void
 LogRequest(nsIRequest* aRequest)
 {
   if (aRequest) {
     nsCAutoString name;
     aRequest->GetName(name);
     printf("    request spec: %s\n", name.get());
-    PRUint32 loadFlags = 0;
+    uint32_t loadFlags = 0;
     aRequest->GetLoadFlags(&loadFlags);
     printf("    request load flags: %x; ", loadFlags);
     if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI)
       printf("document uri; ");
     if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)
       printf("retargeted document uri; ");
     if (loadFlags & nsIChannel::LOAD_REPLACE)
       printf("replace; ");
@@ -319,17 +319,17 @@ LogRequest(nsIRequest* aRequest)
   } else {
     printf("    no request");
   }
 }
 
 static void
 GetDocLoadEventType(AccEvent* aEvent, nsACString& aEventType)
 {
-  PRUint32 type = aEvent->GetEventType();
+  uint32_t type = aEvent->GetEventType();
   if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED) {
     aEventType.AssignLiteral("load stopped");
   } else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE) {
     aEventType.AssignLiteral("load complete");
   } else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD) {
     aEventType.AssignLiteral("reload");
   } else if (type == nsIAccessibleEvent::EVENT_STATE_CHANGE) {
     AccStateChangeEvent* event = downcast_accEvent(aEvent);
@@ -348,17 +348,17 @@ GetDocLoadEventType(AccEvent* aEvent, ns
 
 static const char* sDocLoadTitle = "DOCLOAD";
 static const char* sDocCreateTitle = "DOCCREATE";
 static const char* sDocDestroyTitle = "DOCDESTROY";
 static const char* sDocEventTitle = "DOCEVENT";
 
 void
 logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
-                 nsIRequest* aRequest, PRUint32 aStateFlags)
+                 nsIRequest* aRequest, uint32_t aStateFlags)
 {
   MsgBegin(sDocLoadTitle, aMsg);
 
   nsCOMPtr<nsIDOMWindow> DOMWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
   if (!DOMWindow) {
     MsgEnd();
     return;
@@ -465,17 +465,17 @@ logging::OuterDocDestroy(OuterDocAccessi
   MsgEnd();
 }
 
 void
 logging::SelChange(nsISelection* aSelection, DocAccessible* aDocument)
 {
   nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(aSelection));
 
-  PRInt16 type = 0;
+  int16_t type = 0;
   privSel->GetType(&type);
 
   const char* strType = 0;
   if (type == nsISelectionController::SELECTION_NORMAL)
     strType = "normal";
   else if (type == nsISelectionController::SELECTION_SPELLCHECK)
     strType = "spellcheck";
   else
@@ -553,17 +553,17 @@ logging::Node(const char* aDescr, nsINod
   }
 
   if (aNode->IsNodeOfType(nsINode::eDOCUMENT)) {
     printf("%s: %p, document\n", aDescr, static_cast<void*>(aNode));
     return;
   }
 
   nsINode* parentNode = aNode->GetNodeParent();
-  PRInt32 idxInParent = parentNode ? parentNode->IndexOf(aNode) : - 1;
+  int32_t idxInParent = parentNode ? parentNode->IndexOf(aNode) : - 1;
 
   if (aNode->IsNodeOfType(nsINode::eTEXT)) {
     printf("%s: %p, text node, idx in parent: %d\n",
            aDescr, static_cast<void*>(aNode), idxInParent);
     return;
   }
 
   if (!aNode->IsElement()) {
@@ -594,17 +594,17 @@ logging::Stack()
     nsTraceRefcntImpl::WalkTheStack(stdout);
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // namespace logging:: initialization
 
 bool
-logging::IsEnabled(PRUint32 aModules)
+logging::IsEnabled(uint32_t aModules)
 {
   return sModules & aModules;
 }
 
 void
 logging::Enable(const nsAFlatCString& aModules)
 {
   EnableLogging(aModules.get());
--- a/accessible/src/base/Logging.h
+++ b/accessible/src/base/Logging.h
@@ -43,23 +43,23 @@ enum EModules {
   eFocus = 1 << 9,
   eSelection = 1 << 10,
   eNotifications = eDOMEvents | eSelection | eFocus
 };
 
 /**
  * Return true if any of the given modules is logged.
  */
-bool IsEnabled(PRUint32 aModules);
+bool IsEnabled(uint32_t aModules);
 
 /**
  * Log the document loading progress.
  */
 void DocLoad(const char* aMsg, nsIWebProgress* aWebProgress,
-             nsIRequest* aRequest, PRUint32 aStateFlags);
+             nsIRequest* aRequest, uint32_t aStateFlags);
 void DocLoad(const char* aMsg, nsIDocument* aDocumentNode);
 
 /**
  * Log that document load event was fired.
  */
 void DocLoadEventFired(AccEvent* aEvent);
 
 /**
--- a/accessible/src/base/NotificationController.cpp
+++ b/accessible/src/base/NotificationController.cpp
@@ -85,18 +85,18 @@ void
 NotificationController::Shutdown()
 {
   if (mObservingState != eNotObservingRefresh &&
       mPresShell->RemoveRefreshObserver(this, Flush_Display)) {
     mObservingState = eNotObservingRefresh;
   }
 
   // Shutdown handling child documents.
-  PRInt32 childDocCount = mHangingChildDocuments.Length();
-  for (PRInt32 idx = childDocCount - 1; idx >= 0; idx--) {
+  int32_t childDocCount = mHangingChildDocuments.Length();
+  for (int32_t idx = childDocCount - 1; idx >= 0; idx--) {
     if (!mHangingChildDocuments[idx]->IsDefunct())
       mHangingChildDocuments[idx]->Shutdown();
   }
 
   mHangingChildDocuments.Clear();
 
   mDocument = nullptr;
   mPresShell = nullptr;
@@ -220,30 +220,30 @@ NotificationController::WillRefresh(mozi
   // then new events are processed on next refresh.
   // Note: notification processing or event handling may shut down the owning
   // document accessible.
 
   // Process only currently queued content inserted notifications.
   nsTArray<nsRefPtr<ContentInsertion> > contentInsertions;
   contentInsertions.SwapElements(mContentInsertions);
 
-  PRUint32 insertionCount = contentInsertions.Length();
-  for (PRUint32 idx = 0; idx < insertionCount; idx++) {
+  uint32_t insertionCount = contentInsertions.Length();
+  for (uint32_t idx = 0; idx < insertionCount; idx++) {
     contentInsertions[idx]->Process();
     if (!mDocument)
       return;
   }
 
   // Process rendered text change notifications.
   mTextHash.EnumerateEntries(TextEnumerator, mDocument);
   mTextHash.Clear();
 
   // Bind hanging child documents.
-  PRUint32 hangingDocCnt = mHangingChildDocuments.Length();
-  for (PRUint32 idx = 0; idx < hangingDocCnt; idx++) {
+  uint32_t hangingDocCnt = mHangingChildDocuments.Length();
+  for (uint32_t idx = 0; idx < hangingDocCnt; idx++) {
     DocAccessible* childDoc = mHangingChildDocuments[idx];
     if (childDoc->IsDefunct())
       continue;
 
     nsIContent* ownerContent = mDocument->GetDocumentNode()->
       FindContentForSubDocument(childDoc->GetDocumentNode());
     if (ownerContent) {
       Accessible* outerDocAcc = mDocument->GetAccessible(ownerContent);
@@ -260,17 +260,17 @@ NotificationController::WillRefresh(mozi
   }
   mHangingChildDocuments.Clear();
 
   // If the document is ready and all its subdocuments are completely loaded
   // then process the document load.
   if (mDocument->HasLoadState(DocAccessible::eReady) &&
       !mDocument->HasLoadState(DocAccessible::eCompletelyLoaded) &&
       hangingDocCnt == 0) {
-    PRUint32 childDocCnt = mDocument->ChildDocumentCount(), childDocIdx = 0;
+    uint32_t childDocCnt = mDocument->ChildDocumentCount(), childDocIdx = 0;
     for (; childDocIdx < childDocCnt; childDocIdx++) {
       DocAccessible* childDoc = mDocument->GetChildDocumentAt(childDocIdx);
       if (!childDoc->HasLoadState(DocAccessible::eCompletelyLoaded))
         break;
     }
 
     if (childDocIdx == childDocCnt) {
       mDocument->ProcessLoad();
@@ -278,18 +278,18 @@ NotificationController::WillRefresh(mozi
         return;
     }
   }
 
   // Process only currently queued generic notifications.
   nsTArray < nsRefPtr<Notification> > notifications;
   notifications.SwapElements(mNotifications);
 
-  PRUint32 notificationCount = notifications.Length();
-  for (PRUint32 idx = 0; idx < notificationCount; idx++) {
+  uint32_t notificationCount = notifications.Length();
+  for (uint32_t idx = 0; idx < notificationCount; idx++) {
     notifications[idx]->Process();
     if (!mDocument)
       return;
   }
 
   // Process invalidation list of the document after all accessible tree
   // modification are done.
   mDocument->ProcessInvalidationList();
@@ -297,26 +297,26 @@ NotificationController::WillRefresh(mozi
   // If a generic notification occurs after this point then we may be allowed to
   // process it synchronously.
   mObservingState = eRefreshObserving;
 
   // Process only currently queued events.
   nsTArray<nsRefPtr<AccEvent> > events;
   events.SwapElements(mEvents);
 
-  PRUint32 eventCount = events.Length();
+  uint32_t eventCount = events.Length();
 #ifdef DEBUG
   if (eventCount > 0 && logging::IsEnabled(logging::eEvents)) {
     logging::MsgBegin("EVENTS", "events processing");
     logging::Address("document", mDocument);
     logging::MsgEnd();
   }
 #endif
 
-  for (PRUint32 idx = 0; idx < eventCount; idx++) {
+  for (uint32_t idx = 0; idx < eventCount; idx++) {
     AccEvent* accEvent = events[idx];
     if (accEvent->mEventRule != AccEvent::eDoNotEmit) {
       Accessible* target = accEvent->GetAccessible();
       if (!target || target->IsDefunct())
         continue;
 
       // Dispatch the focus event if target is still focused.
       if (accEvent->mEventType == nsIAccessibleEvent::EVENT_FOCUS) {
@@ -349,29 +349,29 @@ NotificationController::WillRefresh(mozi
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // NotificationController: event queue
 
 void
 NotificationController::CoalesceEvents()
 {
-  PRUint32 numQueuedEvents = mEvents.Length();
-  PRInt32 tail = numQueuedEvents - 1;
+  uint32_t numQueuedEvents = mEvents.Length();
+  int32_t tail = numQueuedEvents - 1;
   AccEvent* tailEvent = mEvents[tail];
 
   switch(tailEvent->mEventRule) {
     case AccEvent::eCoalesceFromSameSubtree:
     {
       // No node means this is application accessible (which is a subject of
       // reorder events), we do not coalesce events for it currently.
       if (!tailEvent->mNode)
         return;
 
-      for (PRInt32 index = tail - 1; index >= 0; index--) {
+      for (int32_t index = tail - 1; index >= 0; index--) {
         AccEvent* thisEvent = mEvents[index];
 
         if (thisEvent->mEventType != tailEvent->mEventType)
           continue; // Different type
 
         // Skip event for application accessible since no coalescence for it
         // is supported. Ignore events from different documents since we don't
         // coalesce them.
@@ -457,45 +457,45 @@ NotificationController::CoalesceEvents()
 
       } // for (index)
 
     } break; // case eCoalesceFromSameSubtree
 
     case AccEvent::eCoalesceOfSameType:
     {
       // Coalesce old events by newer event.
-      for (PRInt32 index = tail - 1; index >= 0; index--) {
+      for (int32_t index = tail - 1; index >= 0; index--) {
         AccEvent* accEvent = mEvents[index];
         if (accEvent->mEventType == tailEvent->mEventType &&
             accEvent->mEventRule == tailEvent->mEventRule) {
           accEvent->mEventRule = AccEvent::eDoNotEmit;
           return;
         }
       }
     } break; // case eCoalesceOfSameType
 
     case AccEvent::eRemoveDupes:
     {
       // Check for repeat events, coalesce newly appended event by more older
       // event.
-      for (PRInt32 index = tail - 1; index >= 0; index--) {
+      for (int32_t index = tail - 1; index >= 0; index--) {
         AccEvent* accEvent = mEvents[index];
         if (accEvent->mEventType == tailEvent->mEventType &&
             accEvent->mEventRule == tailEvent->mEventRule &&
             accEvent->mNode == tailEvent->mNode) {
           tailEvent->mEventRule = AccEvent::eDoNotEmit;
           return;
         }
       }
     } break; // case eRemoveDupes
 
     case AccEvent::eCoalesceSelectionChange:
     {
       AccSelChangeEvent* tailSelChangeEvent = downcast_accEvent(tailEvent);
-      PRInt32 index = tail - 1;
+      int32_t index = tail - 1;
       for (; index >= 0; index--) {
         AccEvent* thisEvent = mEvents[index];
         if (thisEvent->mEventRule == tailEvent->mEventRule) {
           AccSelChangeEvent* thisSelChangeEvent =
             downcast_accEvent(thisEvent);
 
           // Coalesce selection change events within same control.
           if (tailSelChangeEvent->mWidget == thisSelChangeEvent->mWidget) {
@@ -508,48 +508,48 @@ NotificationController::CoalesceEvents()
     } break; // eCoalesceSelectionChange
 
     default:
       break; // case eAllowDupes, eDoNotEmit
   } // switch
 }
 
 void
-NotificationController::ApplyToSiblings(PRUint32 aStart, PRUint32 aEnd,
-                                        PRUint32 aEventType, nsINode* aNode,
+NotificationController::ApplyToSiblings(uint32_t aStart, uint32_t aEnd,
+                                        uint32_t aEventType, nsINode* aNode,
                                         AccEvent::EEventRule aEventRule)
 {
-  for (PRUint32 index = aStart; index < aEnd; index ++) {
+  for (uint32_t index = aStart; index < aEnd; index ++) {
     AccEvent* accEvent = mEvents[index];
     if (accEvent->mEventType == aEventType &&
         accEvent->mEventRule != AccEvent::eDoNotEmit && accEvent->mNode &&
         accEvent->mNode->GetNodeParent() == aNode->GetNodeParent()) {
       accEvent->mEventRule = aEventRule;
     }
   }
 }
 
 void
 NotificationController::CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent,
                                                 AccSelChangeEvent* aThisEvent,
-                                                PRInt32 aThisIndex)
+                                                int32_t aThisIndex)
 {
   aTailEvent->mPreceedingCount = aThisEvent->mPreceedingCount + 1;
 
   // Pack all preceding events into single selection within event
   // when we receive too much selection add/remove events.
   if (aTailEvent->mPreceedingCount >= kSelChangeCountToPack) {
     aTailEvent->mEventType = nsIAccessibleEvent::EVENT_SELECTION_WITHIN;
     aTailEvent->mAccessible = aTailEvent->mWidget;
     aThisEvent->mEventRule = AccEvent::eDoNotEmit;
 
     // Do not emit any preceding selection events for same widget if they
     // weren't coalesced yet.
     if (aThisEvent->mEventType != nsIAccessibleEvent::EVENT_SELECTION_WITHIN) {
-      for (PRInt32 jdx = aThisIndex - 1; jdx >= 0; jdx--) {
+      for (int32_t jdx = aThisIndex - 1; jdx >= 0; jdx--) {
         AccEvent* prevEvent = mEvents[jdx];
         if (prevEvent->mEventRule == aTailEvent->mEventRule) {
           AccSelChangeEvent* prevSelChangeEvent =
             downcast_accEvent(prevEvent);
           if (prevSelChangeEvent->mWidget == aTailEvent->mWidget)
             prevSelChangeEvent->mEventRule = AccEvent::eDoNotEmit;
         }
       }
@@ -617,17 +617,17 @@ NotificationController::CoalesceTextChan
   AccTextChangeEvent* textEvent = aThisEvent->mTextChangeEvent;
   if (!textEvent)
     return;
 
   if (aThisEvent->mNextSibling == aTailEvent->mAccessible) {
     aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);
 
   } else if (aThisEvent->mPrevSibling == aTailEvent->mAccessible) {
-    PRUint32 oldLen = textEvent->GetLength();
+    uint32_t oldLen = textEvent->GetLength();
     aTailEvent->mAccessible->AppendTextTo(textEvent->mModifiedText);
     textEvent->mStart -= textEvent->GetLength() - oldLen;
   }
 
   aTailEvent->mTextChangeEvent.swap(aThisEvent->mTextChangeEvent);
 }
 
 void
@@ -675,17 +675,17 @@ NotificationController::CreateTextChange
     if (editor) {
       bool isEmpty = false;
       editor->GetDocumentIsEmpty(&isEmpty);
       if (isEmpty)
         return;
     }
   }
 
-  PRInt32 offset = textAccessible->GetChildOffset(aEvent->mAccessible);
+  int32_t offset = textAccessible->GetChildOffset(aEvent->mAccessible);
 
   nsAutoString text;
   aEvent->mAccessible->AppendTextTo(text);
   if (text.IsEmpty())
     return;
 
   aEvent->mTextChangeEvent =
     new AccTextChangeEvent(textAccessible, offset, text, aEvent->IsShow(),
--- a/accessible/src/base/NotificationController.h
+++ b/accessible/src/base/NotificationController.h
@@ -205,26 +205,26 @@ private:
    * @param aEventsToFire    array of pending events
    * @param aStart           start index of pending events to be scanned
    * @param aEnd             end index to be scanned (not included)
    * @param aEventType       target event type
    * @param aDOMNode         target are siblings of this node
    * @param aEventRule       the event rule to be applied
    *                         (should be eDoNotEmit or eAllowDupes)
    */
-  void ApplyToSiblings(PRUint32 aStart, PRUint32 aEnd,
-                       PRUint32 aEventType, nsINode* aNode,
+  void ApplyToSiblings(uint32_t aStart, uint32_t aEnd,
+                       uint32_t aEventType, nsINode* aNode,
                        AccEvent::EEventRule aEventRule);
 
   /**
    * Coalesce two selection change events within the same select control.
    */
   void CoalesceSelChangeEvents(AccSelChangeEvent* aTailEvent,
                                AccSelChangeEvent* aThisEvent,
-                               PRInt32 aThisIndex);
+                               int32_t aThisIndex);
 
   /**
    * Coalesce text change events caused by sibling hide events.
    */
   void CoalesceTextChangeEventsFor(AccHideEvent* aTailEvent,
                                    AccHideEvent* aThisEvent);
   void CoalesceTextChangeEventsFor(AccShowEvent* aTailEvent,
                                    AccShowEvent* aThisEvent);
--- a/accessible/src/base/States.h
+++ b/accessible/src/base/States.h
@@ -2,279 +2,279 @@
 /* vim: set expandtab shiftwidth=2 tabstop=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/. */
 
 #ifndef _states_h_
 #define _states_h_
 
-#include <prtypes.h>
+#include "mozilla/StandardInteger.h"
 
 namespace mozilla {
 namespace a11y {
 namespace states {
 
   /**
    * The object is disabled, opposite to enabled and sensitive.
    */
-  const PRUint64 UNAVAILABLE = ((PRUint64) 0x1) << 0;
+  const uint64_t UNAVAILABLE = ((uint64_t) 0x1) << 0;
 
   /**
    * The object is selected.
    */
-  const PRUint64 SELECTED = ((PRUint64) 0x1) << 1;
+  const uint64_t SELECTED = ((uint64_t) 0x1) << 1;
 
   /**
    * The object has the keyboard focus.
    */
-  const PRUint64 FOCUSED = ((PRUint64) 0x1) << 2;
+  const uint64_t FOCUSED = ((uint64_t) 0x1) << 2;
 
   /**
    * The object is pressed.
    */
-  const PRUint64 PRESSED = ((PRUint64) 0x1) << 3;
+  const uint64_t PRESSED = ((uint64_t) 0x1) << 3;
 
   /**
    * The checkable object is checked, applied to check box controls,
    * @see CHECKABLE and MIXED states.
    */
-  const PRUint64 CHECKED = ((PRUint64) 0x1) << 4;
+  const uint64_t CHECKED = ((uint64_t) 0x1) << 4;
 
   /**
    * Indicates that the state of a three-state check box or tool bar button is
    * undetermined.  The check box is neither checked or unchecked, and is
    * in the third or mixed state.
    */
-  const PRUint64 MIXED = ((PRUint64) 0x1) << 5;
+  const uint64_t MIXED = ((uint64_t) 0x1) << 5;
 
   /**
    * The object is designated read-only, so it can't be edited.
    */
-  const PRUint64 READONLY = ((PRUint64) 0x1) << 6;
+  const uint64_t READONLY = ((uint64_t) 0x1) << 6;
 
   /**
    * The object is hot-tracked by the mouse, which means that its appearance
    * has changed to indicate that the mouse pointer is located over it.
    *
    * This is currently unused.
    */
-  const PRUint64 HOTTRACKED = ((PRUint64) 0x1) << 7;
+  const uint64_t HOTTRACKED = ((uint64_t) 0x1) << 7;
 
   /**
    * This object is the default button in a window.
    */
-  const PRUint64 DEFAULT = ((PRUint64) 0x1) << 8;
+  const uint64_t DEFAULT = ((uint64_t) 0x1) << 8;
 
   /**
    * The expandable object's children are displayed, the opposite of collapsed,
    * applied to trees, list and other controls.
    * @see COLLAPSED state
    */
-  const PRUint64 EXPANDED = ((PRUint64) 0x1) << 9;
+  const uint64_t EXPANDED = ((uint64_t) 0x1) << 9;
 
   /**
    * The expandable object's children are not displayed, the opposite of
    * expanded, applied to tree lists and other controls, 
    * @see EXPANDED state.
    */
-  const PRUint64 COLLAPSED = ((PRUint64) 0x1) << 10;
+  const uint64_t COLLAPSED = ((uint64_t) 0x1) << 10;
 
   /**
    * The control or document can not accept input at this time.
    */
-  const PRUint64 BUSY = ((PRUint64) 0x1) << 11;
+  const uint64_t BUSY = ((uint64_t) 0x1) << 11;
 
   /**
    * The object is out of normal flow, may be outside of boundaries of its
    * parent.
    */
-  const PRUint64 FLOATING = ((PRUint64) 0x1) << 12;
+  const uint64_t FLOATING = ((uint64_t) 0x1) << 12;
 
   /**
    * The object can be checked.
    */
-  const PRUint64 CHECKABLE = ((PRUint64) 0x1) << 13;
+  const uint64_t CHECKABLE = ((uint64_t) 0x1) << 13;
 
   /**
    * This object is a graphic which is rapidly changing appearance.
    */
-  const PRUint64 ANIMATED = ((PRUint64) 0x1) << 14;
+  const uint64_t ANIMATED = ((uint64_t) 0x1) << 14;
 
   /**
    * The object is programmatically hidden.
    * So user action like scrolling or switching tabs won't make this visible.
    */
-  const PRUint64 INVISIBLE = ((PRUint64) 0x1) << 15;
+  const uint64_t INVISIBLE = ((uint64_t) 0x1) << 15;
 
   /**
    * The object is scrolled off screen.
    * User action such as scrolling or changing tab may make the object
    * visible.
    */
-  const PRUint64 OFFSCREEN = ((PRUint64) 0x1) << 16;
+  const uint64_t OFFSCREEN = ((uint64_t) 0x1) << 16;
 
   /**
    * The object can be resized.
    */
-  const PRUint64 SIZEABLE = ((PRUint64) 0x1) << 17;
+  const uint64_t SIZEABLE = ((uint64_t) 0x1) << 17;
 
   /**
    * The object can be moved to a different position.
    */
-  const PRUint64 MOVEABLE = ((PRUint64) 0x1) << 18;
+  const uint64_t MOVEABLE = ((uint64_t) 0x1) << 18;
 
   /**
    * The object describes itself with speech.
    * Other speech related assistive technology may want to avoid speaking
    * information about this object, because the object is already doing this.
    */
-  const PRUint64 SELFVOICING = ((PRUint64) 0x1) << 19;
+  const uint64_t SELFVOICING = ((uint64_t) 0x1) << 19;
 
   /**
    * The object can have the focus and become focused.
    */
-  const PRUint64 FOCUSABLE = ((PRUint64) 0x1) << 20;
+  const uint64_t FOCUSABLE = ((uint64_t) 0x1) << 20;
 
   /**
    * The object can be selected.
    */
-  const PRUint64 SELECTABLE = ((PRUint64) 0x1) << 21;
+  const uint64_t SELECTABLE = ((uint64_t) 0x1) << 21;
 
   /**
    * This object is a link.
    */
-  const PRUint64 LINKED = ((PRUint64) 0x1) << 22;
+  const uint64_t LINKED = ((uint64_t) 0x1) << 22;
 
   /**
    * This is used for links that have been traversed
    * i.e. the linked page has been visited.
    */
-  const PRUint64 TRAVERSED = ((PRUint64) 0x1) << 23;
+  const uint64_t TRAVERSED = ((uint64_t) 0x1) << 23;
 
   /**
    * Supports multiple selection.
    */
-  const PRUint64 MULTISELECTABLE = ((PRUint64) 0x1) << 24;
+  const uint64_t MULTISELECTABLE = ((uint64_t) 0x1) << 24;
 
   /**
    * Supports extended selection.
    * All objects supporting this are also multipselectable.
    * This only makes sense for msaa see bug 635690.
    */
-  const PRUint64 EXTSELECTABLE = ((PRUint64) 0x1) << 25;
+  const uint64_t EXTSELECTABLE = ((uint64_t) 0x1) << 25;
 
   /**
    * The user is required to interact with this object.
    */
-  const PRUint64 REQUIRED = ((PRUint64) 0x1) << 26;
+  const uint64_t REQUIRED = ((uint64_t) 0x1) << 26;
 
   /**
    * The object is an alert, notifying the user of something important.
    */
-  const PRUint64 ALERT = ((PRUint64) 0x1) << 27;
+  const uint64_t ALERT = ((uint64_t) 0x1) << 27;
 
   /**
    * Used for text fields containing invalid values.
    */
-  const PRUint64 INVALID = ((PRUint64) 0x1) << 28;
+  const uint64_t INVALID = ((uint64_t) 0x1) << 28;
 
   /**
    * The controls value can not be obtained, and is returned as a set of "*"s.
    */
-  const PRUint64 PROTECTED = ((PRUint64) 0x1) << 29;
+  const uint64_t PROTECTED = ((uint64_t) 0x1) << 29;
 
   /**
    * The object can be invoked to show a pop up menu or window.
    */
- const PRUint64 HASPOPUP = ((PRUint64) 0x1) << 30;
+ const uint64_t HASPOPUP = ((uint64_t) 0x1) << 30;
 
  /**
   * The editable area has some kind of autocompletion.
   */
-  const PRUint64 SUPPORTS_AUTOCOMPLETION = ((PRUint64) 0x1) << 31;
+  const uint64_t SUPPORTS_AUTOCOMPLETION = ((uint64_t) 0x1) << 31;
 
   /**
    * The object is no longer available to be queried.
    */
-  const PRUint64 DEFUNCT = ((PRUint64) 0x1) << 32;
+  const uint64_t DEFUNCT = ((uint64_t) 0x1) << 32;
 
   /**
    * The text is selectable, the object must implement the text interface.
    */
-  const PRUint64 SELECTABLE_TEXT = ((PRUint64) 0x1) << 33;
+  const uint64_t SELECTABLE_TEXT = ((uint64_t) 0x1) << 33;
 
   /**
    * The text in this object can be edited.
    */
-  const PRUint64 EDITABLE = ((PRUint64) 0x1) << 34;
+  const uint64_t EDITABLE = ((uint64_t) 0x1) << 34;
 
   /**
    * This window is currently the active window.
    */
-  const PRUint64 ACTIVE = ((PRUint64) 0x1) << 35;
+  const uint64_t ACTIVE = ((uint64_t) 0x1) << 35;
 
   /**
    * Indicates that the object is modal. Modal objects have the behavior
    * that something must be done with the object before the user can
    * interact with an object in a different window.
    */
-  const PRUint64 MODAL = ((PRUint64) 0x1) << 36;
+  const uint64_t MODAL = ((uint64_t) 0x1) << 36;
 
   /**
    * Edit control that can take multiple lines.
   */
-  const PRUint64 MULTI_LINE = ((PRUint64) 0x1) << 37;
+  const uint64_t MULTI_LINE = ((uint64_t) 0x1) << 37;
 
   /**
    * Uses horizontal layout.
    */
-  const PRUint64 HORIZONTAL = ((PRUint64) 0x1) << 38;
+  const uint64_t HORIZONTAL = ((uint64_t) 0x1) << 38;
 
   /**
    * Indicates this object paints every pixel within its rectangular region.
    */
-  const PRUint64 OPAQUE1 = ((PRUint64) 0x1) << 39;
+  const uint64_t OPAQUE1 = ((uint64_t) 0x1) << 39;
 
   /**
    * This text object can only contain 1 line of text.
    */
-  const PRUint64 SINGLE_LINE = ((PRUint64) 0x1) << 40;
+  const uint64_t SINGLE_LINE = ((uint64_t) 0x1) << 40;
 
   /**
    * The parent object manages descendants, and this object may only exist
    * while it is visible or has focus.
    * For example the focused cell of a table or the current element of a list box may have this state.
    */
-  const PRUint64 TRANSIENT = ((PRUint64) 0x1) << 41;
+  const uint64_t TRANSIENT = ((uint64_t) 0x1) << 41;
 
   /**
    * Uses vertical layout.
    * Especially used for sliders and scrollbars.
    */
-  const PRUint64 VERTICAL = ((PRUint64) 0x1) << 42;
+  const uint64_t VERTICAL = ((uint64_t) 0x1) << 42;
 
   /**
    * Object not dead, but not up-to-date either.
    */
-  const PRUint64 STALE = ((PRUint64) 0x1) << 43;
+  const uint64_t STALE = ((uint64_t) 0x1) << 43;
 
   /**
    * A widget that is not unavailable.
    */
-  const PRUint64 ENABLED = ((PRUint64) 0x1) << 44;
+  const uint64_t ENABLED = ((uint64_t) 0x1) << 44;
 
   /**
    * Same as ENABLED state for now see bug 636158
    */
-  const PRUint64 SENSITIVE = ((PRUint64) 0x1) << 45;
+  const uint64_t SENSITIVE = ((uint64_t) 0x1) << 45;
 
   /**
    * The object is expandable, provides a UI to expand/collapse its children
    * @see EXPANDED and COLLAPSED states.
    */
-  const PRUint64 EXPANDABLE = ((PRUint64) 0x1) << 46;
+  const uint64_t EXPANDABLE = ((uint64_t) 0x1) << 46;
 } // namespace states
 } // namespace a11y
 } // namespace mozilla
 
 #endif
 	
--- a/accessible/src/base/Statistics.h
+++ b/accessible/src/base/Statistics.h
@@ -11,17 +11,17 @@
 
 namespace mozilla {
 namespace a11y {
 namespace statistics {
 
   inline void A11yInitialized()
     { Telemetry::Accumulate(Telemetry::A11Y_INSTANTIATED_FLAG, true); }
 
-  inline void A11yConsumers(PRUint32 aConsumer)
+  inline void A11yConsumers(uint32_t aConsumer)
     { Telemetry::Accumulate(Telemetry::A11Y_CONSUMERS, aConsumer); }
 
   /**
    * Report that ISimpleDOM* has been used.
    */
   inline void ISimpleDOMUsed()
     { Telemetry::Accumulate(Telemetry::A11Y_ISIMPLEDOM_USAGE_FLAG, true); }
 
--- a/accessible/src/base/StyleInfo.cpp
+++ b/accessible/src/base/StyleInfo.cpp
@@ -110,15 +110,15 @@ void
 StyleInfo::FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue)
 {
   nsCSSKeyword keyword =
     nsCSSProps::ValueToKeywordEnum(aValue, nsCSSProps::kFontStyleKTable);
   AppendUTF8toUTF16(nsCSSKeywords::GetStringValue(keyword), aFormattedValue);
 }
 
 void
-StyleInfo::FormatTextDecorationStyle(PRUint8 aValue, nsAString& aFormattedValue)
+StyleInfo::FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue)
 {
   nsCSSKeyword keyword =
     nsCSSProps::ValueToKeywordEnum(aValue,
                                    nsCSSProps::kTextDecorationStyleKTable);
   AppendUTF8toUTF16(nsCSSKeywords::GetStringValue(keyword), aFormattedValue);
 }
--- a/accessible/src/base/StyleInfo.h
+++ b/accessible/src/base/StyleInfo.h
@@ -24,17 +24,17 @@ public:
   void TextIndent(nsAString& aValue);
   void MarginLeft(nsAString& aValue) { Margin(css::eSideLeft, aValue); }
   void MarginRight(nsAString& aValue) { Margin(css::eSideRight, aValue); }
   void MarginTop(nsAString& aValue) { Margin(css::eSideTop, aValue); }
   void MarginBottom(nsAString& aValue) { Margin(css::eSideBottom, aValue); }
 
   static void FormatColor(const nscolor& aValue, nsString& aFormattedValue);
   static void FormatFontStyle(const nscoord& aValue, nsAString& aFormattedValue);
-  static void FormatTextDecorationStyle(PRUint8 aValue, nsAString& aFormattedValue);
+  static void FormatTextDecorationStyle(uint8_t aValue, nsAString& aFormattedValue);
 
 private:
   StyleInfo() MOZ_DELETE;
   StyleInfo(const StyleInfo&) MOZ_DELETE;
   StyleInfo& operator = (const StyleInfo&) MOZ_DELETE;
 
   void Margin(css::Side aSide, nsAString& aValue);
 
--- a/accessible/src/base/TextAttrs.cpp
+++ b/accessible/src/base/TextAttrs.cpp
@@ -19,18 +19,18 @@ using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // TextAttrsMgr
 ////////////////////////////////////////////////////////////////////////////////
 
 void
 TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
-                            PRInt32* aStartHTOffset,
-                            PRInt32* aEndHTOffset)
+                            int32_t* aStartHTOffset,
+                            int32_t* aEndHTOffset)
 {
   // 1. Hyper text accessible must be specified always.
   // 2. Offset accessible and result hyper text offsets must be specified in
   // the case of text attributes.
   // 3. Offset accessible and result hyper text offsets must not be specified
   // but include default text attributes flag and attributes list must be
   // specified in the case of default text attributes.
   NS_PRECONDITION(mHyperTextAcc &&
@@ -38,26 +38,26 @@ TextAttrsMgr::GetAttributes(nsIPersisten
                     aStartHTOffset && aEndHTOffset) ||
                   (!mOffsetAcc && mOffsetAccIdx == -1 &&
                     !aStartHTOffset && !aEndHTOffset &&
                    mIncludeDefAttrs && aAttributes)),
                   "Wrong usage of TextAttrsMgr!");
 
   // Embedded objects are combined into own range with empty attributes set.
   if (mOffsetAcc && nsAccUtils::IsEmbeddedObject(mOffsetAcc)) {
-    for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
+    for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
       Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
       if (!nsAccUtils::IsEmbeddedObject(currAcc))
         break;
 
       (*aStartHTOffset)--;
     }
 
-    PRUint32 childCount = mHyperTextAcc->ChildCount();
-    for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childCount;
+    uint32_t childCount = mHyperTextAcc->ChildCount();
+    for (uint32_t childIdx = mOffsetAccIdx + 1; childIdx < childCount;
          childIdx++) {
       Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
       if (!nsAccUtils::IsEmbeddedObject(currAcc))
         break;
 
       (*aEndHTOffset)++;
     }
 
@@ -121,62 +121,62 @@ TextAttrsMgr::GetAttributes(nsIPersisten
     &fontWeightTextAttr,
     &autoGenTextAttr,
     &textDecorTextAttr,
     &textPosTextAttr
   };
 
   // Expose text attributes if applicable.
   if (aAttributes) {
-    for (PRUint32 idx = 0; idx < ArrayLength(attrArray); idx++)
+    for (uint32_t idx = 0; idx < ArrayLength(attrArray); idx++)
       attrArray[idx]->Expose(aAttributes, mIncludeDefAttrs);
   }
 
   // Expose text attributes range where they are applied if applicable.
   if (mOffsetAcc)
     GetRange(attrArray, ArrayLength(attrArray), aStartHTOffset, aEndHTOffset);
 }
 
 void
-TextAttrsMgr::GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
-                       PRInt32* aStartHTOffset, PRInt32* aEndHTOffset)
+TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
+                       int32_t* aStartHTOffset, int32_t* aEndHTOffset)
 {
   // Navigate backward from anchor accessible to find start offset.
-  for (PRInt32 childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
+  for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
     Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
 
     // Stop on embedded accessible since embedded accessibles are combined into
     // own range.
     if (nsAccUtils::IsEmbeddedObject(currAcc))
       break;
 
     bool offsetFound = false;
-    for (PRUint32 attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
+    for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
       TextAttr* textAttr = aAttrArray[attrIdx];
       if (!textAttr->Equal(currAcc)) {
         offsetFound = true;
         break;
       }
     }
 
     if (offsetFound)
       break;
 
     *(aStartHTOffset) -= nsAccUtils::TextLength(currAcc);
   }
 
   // Navigate forward from anchor accessible to find end offset.
-  PRUint32 childLen = mHyperTextAcc->ChildCount();
-  for (PRUint32 childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
+  uint32_t childLen = mHyperTextAcc->ChildCount();
+  for (uint32_t childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) {
     Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx);
     if (nsAccUtils::IsEmbeddedObject(currAcc))
       break;
 
     bool offsetFound = false;
-    for (PRUint32 attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
+    for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) {
       TextAttr* textAttr = aAttrArray[attrIdx];
 
       // Alter the end offset when text attribute changes its value and stop
       // the search.
       if (!textAttr->Equal(currAcc)) {
         offsetFound = true;
         break;
       }
@@ -473,52 +473,52 @@ TextAttrsMgr::FontStyleTextAttr::
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // FontWeightTextAttr
 ////////////////////////////////////////////////////////////////////////////////
 
 TextAttrsMgr::FontWeightTextAttr::
   FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame) :
-  TTextAttr<PRInt32>(!aFrame)
+  TTextAttr<int32_t>(!aFrame)
 {
   mRootNativeValue = GetFontWeight(aRootFrame);
   mIsRootDefined = true;
 
   if (aFrame) {
     mNativeValue = GetFontWeight(aFrame);
     mIsDefined = true;
   }
 }
 
 bool
 TextAttrsMgr::FontWeightTextAttr::
-  GetValueFor(Accessible* aAccessible, PRInt32* aValue)
+  GetValueFor(Accessible* aAccessible, int32_t* aValue)
 {
   nsIContent* elm = nsCoreUtils::GetDOMElementFor(aAccessible->GetContent());
   nsIFrame* frame = elm->GetPrimaryFrame();
   if (frame) {
     *aValue = GetFontWeight(frame);
     return true;
   }
 
   return false;
 }
 
 void
 TextAttrsMgr::FontWeightTextAttr::
-  ExposeValue(nsIPersistentProperties* aAttributes, const PRInt32& aValue)
+  ExposeValue(nsIPersistentProperties* aAttributes, const int32_t& aValue)
 {
   nsAutoString formattedValue;
   formattedValue.AppendInt(aValue);
 
   nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::fontWeight, formattedValue);
 }
 
-PRInt32
+int32_t
 TextAttrsMgr::FontWeightTextAttr::
   GetFontWeight(nsIFrame* aFrame)
 {
   // nsFont::width isn't suitable here because it's necessary to expose real
   // value of font weight (used font might not have some font weight values).
   nsRefPtr<nsFontMetrics> fm;
   nsLayoutUtils::GetFontMetricsForFrame(aFrame, getter_AddRefs(fm));
 
--- a/accessible/src/base/TextAttrs.h
+++ b/accessible/src/base/TextAttrs.h
@@ -47,54 +47,54 @@ public:
    *                          text attributes
    * @param oOffsetAcc       [optional] offset an accessible the text attributes
    *                          should be calculated for
    * @param oOffsetAccIdx    [optional] index in parent of offset accessible
    */
   TextAttrsMgr(HyperTextAccessible* aHyperTextAcc,
                bool aIncludeDefAttrs,
                Accessible* aOffsetAcc,
-               PRInt32 aOffsetAccIdx) :
+               int32_t aOffsetAccIdx) :
     mOffsetAcc(aOffsetAcc), mHyperTextAcc(aHyperTextAcc),
     mOffsetAccIdx(aOffsetAccIdx), mIncludeDefAttrs(aIncludeDefAttrs) { }
 
   /*
    * Return text attributes and hyper text offsets where these attributes are
    * applied. Offsets are calculated in the case of non default attributes.
    *
    * @note In the case of default attributes pointers on hyper text offsets
    *       must be skipped.
    *
    * @param aAttributes    [in, out] text attributes list
    * @param aStartHTOffset [out, optional] start hyper text offset
    * @param aEndHTOffset   [out, optional] end hyper text offset
    */
   void GetAttributes(nsIPersistentProperties* aAttributes,
-                     PRInt32* aStartHTOffset = nullptr,
-                     PRInt32* aEndHTOffset = nullptr);
+                     int32_t* aStartHTOffset = nullptr,
+                     int32_t* aEndHTOffset = nullptr);
 
 protected:
   /**
    * Calculates range (start and end offsets) of text where the text attributes
    * are stretched. New offsets may be smaller if one of text attributes changes
    * its value before or after the given offsets.
    *
    * @param aTextAttrArray  [in] text attributes array
    * @param aAttrArrayLen   [in] text attributes array length
    * @param aStartHTOffset  [in, out] the start offset
    * @param aEndHTOffset    [in, out] the end offset
    */
   class TextAttr;
-  void GetRange(TextAttr* aAttrArray[], PRUint32 aAttrArrayLen,
-                PRInt32* aStartHTOffset, PRInt32* aEndHTOffset);
+  void GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
+                int32_t* aStartHTOffset, int32_t* aEndHTOffset);
 
 private:
   Accessible* mOffsetAcc;
   HyperTextAccessible* mHyperTextAcc;
-  PRInt32 mOffsetAccIdx;
+  int32_t mOffsetAccIdx;
   bool mIncludeDefAttrs;
 
 protected:
 
   /**
    * Interface class of text attribute class implementations.
    */
   class TextAttr
@@ -310,31 +310,31 @@ protected:
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
                              const nscoord& aValue);
   };
 
 
   /**
    * Class is used for the work with "font-weight" text attribute.
    */
-  class FontWeightTextAttr : public TTextAttr<PRInt32>
+  class FontWeightTextAttr : public TTextAttr<int32_t>
   {
   public:
     FontWeightTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~FontWeightTextAttr() { }
 
   protected:
 
     // TTextAttr
-    virtual bool GetValueFor(Accessible* aAccessible, PRInt32* aValue);
+    virtual bool GetValueFor(Accessible* aAccessible, int32_t* aValue);
     virtual void ExposeValue(nsIPersistentProperties* aAttributes,
-                             const PRInt32& aValue);
+                             const int32_t& aValue);
 
   private:
-    PRInt32 GetFontWeight(nsIFrame* aFrame);
+    int32_t GetFontWeight(nsIFrame* aFrame);
   };
 
   /**
    * Class is used for the work with 'auto-generated' text attribute.
    */
   class AutoGeneratedTextAttr : public TTextAttr<bool>
   {
   public:
@@ -358,17 +358,17 @@ protected:
 
   class TextDecorValue
   {
   public:
     TextDecorValue() { }
     TextDecorValue(nsIFrame* aFrame);
 
     nscolor Color() const { return mColor; }
-    PRUint8 Style() const { return mStyle; }
+    uint8_t Style() const { return mStyle; }
 
     bool IsDefined() const
       { return IsUnderline() || IsLineThrough(); }
     bool IsUnderline() const
       { return mLine & NS_STYLE_TEXT_DECORATION_LINE_UNDERLINE; }
     bool IsLineThrough() const
       { return mLine & NS_STYLE_TEXT_DECORATION_LINE_LINE_THROUGH; }
 
@@ -377,18 +377,18 @@ protected:
       return mColor == aValue.mColor && mLine == aValue.mLine &&
         mStyle == aValue.mStyle;
     }
     bool operator !=(const TextDecorValue& aValue)
       { return !(*this == aValue); }
 
   private:
     nscolor mColor;
-    PRUint8 mLine;
-    PRUint8 mStyle;
+    uint8_t mLine;
+    uint8_t mStyle;
   };
 
   class TextDecorTextAttr : public TTextAttr<TextDecorValue>
   {
   public:
     TextDecorTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
     virtual ~TextDecorTextAttr() { }
 
--- a/accessible/src/base/TextUpdater.cpp
+++ b/accessible/src/base/TextUpdater.cpp
@@ -13,64 +13,64 @@ using namespace mozilla::a11y;
 
 void
 TextUpdater::Run(DocAccessible* aDocument, TextLeafAccessible* aTextLeaf,
                  const nsAString& aNewText)
 {
   NS_ASSERTION(aTextLeaf, "No text leaf accessible?");
 
   const nsString& oldText = aTextLeaf->Text();
-  PRUint32 oldLen = oldText.Length(), newLen = aNewText.Length();
-  PRUint32 minLen = NS_MIN(oldLen, newLen);
+  uint32_t oldLen = oldText.Length(), newLen = aNewText.Length();
+  uint32_t minLen = NS_MIN(oldLen, newLen);
 
   // Skip coinciding begin substrings.
-  PRUint32 skipStart = 0;
+  uint32_t skipStart = 0;
   for (; skipStart < minLen; skipStart++) {
     if (aNewText[skipStart] != oldText[skipStart])
       break;
   }
 
   // The text was changed. Do update.
   if (skipStart != minLen || oldLen != newLen) {
     TextUpdater updater(aDocument, aTextLeaf);
     updater.DoUpdate(aNewText, oldText, skipStart);
   }
 }
 
 void
 TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
-                      PRUint32 aSkipStart)
+                      uint32_t aSkipStart)
 {
   Accessible* parent = mTextLeaf->Parent();
   if (!parent)
     return;
 
   mHyperText = parent->AsHyperText();
   if (!mHyperText) {
     NS_ERROR("Text leaf parent is not hypertext!");
     return;
   }
 
   // Get the text leaf accessible offset and invalidate cached offsets after it.
   mTextOffset = mHyperText->GetChildOffset(mTextLeaf, true);
   NS_ASSERTION(mTextOffset != -1,
                "Text leaf hasn't offset within hyper text!");
 
-  PRUint32 oldLen = aOldText.Length(), newLen = aNewText.Length();
-  PRUint32 minLen = NS_MIN(oldLen, newLen);
+  uint32_t oldLen = aOldText.Length(), newLen = aNewText.Length();
+  uint32_t minLen = NS_MIN(oldLen, newLen);
 
   // Trim coinciding substrings from the end.
-  PRUint32 skipEnd = 0;
+  uint32_t skipEnd = 0;
   while (minLen - skipEnd > aSkipStart &&
          aNewText[newLen - skipEnd - 1] == aOldText[oldLen - skipEnd - 1]) {
     skipEnd++;
   }
 
-  PRUint32 strLen1 = oldLen - aSkipStart - skipEnd;
-  PRUint32 strLen2 = newLen - aSkipStart - skipEnd;
+  uint32_t strLen1 = oldLen - aSkipStart - skipEnd;
+  uint32_t strLen2 = newLen - aSkipStart - skipEnd;
 
   const nsAString& str1 = Substring(aOldText, aSkipStart, strLen1);
   const nsAString& str2 = Substring(aNewText, aSkipStart, strLen2);
 
   // Increase offset of the text leaf on skipped characters amount.
   mTextOffset += aSkipStart;
 
   // It could be single insertion or removal or the case of long strings. Do not
@@ -99,70 +99,70 @@ TextUpdater::DoUpdate(const nsAString& a
     return;
   }
 
   // Otherwise find the difference between strings and fire events.
   // Note: we can skip initial and final coinciding characters since they don't
   // affect the Levenshtein distance.
 
   // Compute the flat structured matrix need to compute the difference.
-  PRUint32 len1 = strLen1 + 1, len2 = strLen2 + 1;
-  PRUint32* entries = new PRUint32[len1 * len2];
+  uint32_t len1 = strLen1 + 1, len2 = strLen2 + 1;
+  uint32_t* entries = new uint32_t[len1 * len2];
 
-  for (PRUint32 colIdx = 0; colIdx < len1; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < len1; colIdx++)
     entries[colIdx] = colIdx;
 
-  PRUint32* row = entries;
-  for (PRUint32 rowIdx = 1; rowIdx < len2; rowIdx++) {
-    PRUint32* prevRow = row;
+  uint32_t* row = entries;
+  for (uint32_t rowIdx = 1; rowIdx < len2; rowIdx++) {
+    uint32_t* prevRow = row;
     row += len1;
     row[0] = rowIdx;
-    for (PRUint32 colIdx = 1; colIdx < len1; colIdx++) {
+    for (uint32_t colIdx = 1; colIdx < len1; colIdx++) {
       if (str1[colIdx - 1] != str2[rowIdx - 1]) {
-        PRUint32 left = row[colIdx - 1];
-        PRUint32 up = prevRow[colIdx];
-        PRUint32 upleft = prevRow[colIdx - 1];
+        uint32_t left = row[colIdx - 1];
+        uint32_t up = prevRow[colIdx];
+        uint32_t upleft = prevRow[colIdx - 1];
         row[colIdx] = NS_MIN(upleft, NS_MIN(left, up)) + 1;
       } else {
         row[colIdx] = prevRow[colIdx - 1];
       }
     }
   }
 
   // Compute events based on the difference.
   nsTArray<nsRefPtr<AccEvent> > events;
   ComputeTextChangeEvents(str1, str2, entries, events);
 
   delete [] entries;
 
   // Fire events.
-  for (PRInt32 idx = events.Length() - 1; idx >= 0; idx--)
+  for (int32_t idx = events.Length() - 1; idx >= 0; idx--)
     mDocument->FireDelayedAccessibleEvent(events[idx]);
 
   mDocument->MaybeNotifyOfValueChange(mHyperText);
 
   // Update the text.
   mTextLeaf->SetText(aNewText);
 }
 
 void
 TextUpdater::ComputeTextChangeEvents(const nsAString& aStr1,
                                      const nsAString& aStr2,
-                                     PRUint32* aEntries,
+                                     uint32_t* aEntries,
                                      nsTArray<nsRefPtr<AccEvent> >& aEvents)
 {
-  PRInt32 colIdx = aStr1.Length(), rowIdx = aStr2.Length();
+  int32_t colIdx = aStr1.Length(), rowIdx = aStr2.Length();
 
   // Point at which strings last matched.
-  PRInt32 colEnd = colIdx;
-  PRInt32 rowEnd = rowIdx;
+  int32_t colEnd = colIdx;
+  int32_t rowEnd = rowIdx;
 
-  PRInt32 colLen = colEnd + 1;
-  PRUint32* row = aEntries + rowIdx * colLen;
-  PRUint32 dist = row[colIdx]; // current Levenshtein distance
+  int32_t colLen = colEnd + 1;
+  uint32_t* row = aEntries + rowIdx * colLen;
+  uint32_t dist = row[colIdx]; // current Levenshtein distance
   while (rowIdx && colIdx) { // stop when we can't move diagonally
     if (aStr1[colIdx - 1] == aStr2[rowIdx - 1]) { // match
       if (rowIdx < rowEnd) { // deal with any pending insertion
         FireInsertEvent(Substring(aStr2, rowIdx, rowEnd - rowIdx),
                         rowIdx, aEvents);
       }
       if (colIdx < colEnd) { // deal with any pending deletion
         FireDeleteEvent(Substring(aStr1, colIdx, colEnd - colIdx),
--- a/accessible/src/base/TextUpdater.h
+++ b/accessible/src/base/TextUpdater.h
@@ -33,64 +33,64 @@ private:
   ~TextUpdater()
     { mDocument = nullptr; mTextLeaf = nullptr; mHyperText = nullptr; }
 
   /**
    * Update text of the text leaf accessible, fire text change and value change
    * (if applicable) events for its container hypertext accessible.
    */
   void DoUpdate(const nsAString& aNewText, const nsAString& aOldText,
-                PRUint32 aSkipStart);
+                uint32_t aSkipStart);
 
 private:
   TextUpdater();
   TextUpdater(const TextUpdater&);
   TextUpdater& operator=(const TextUpdater&);
 
   /**
    * Fire text change events based on difference between strings.
    */
   void ComputeTextChangeEvents(const nsAString& aStr1,
                                const nsAString& aStr2,
-                               PRUint32* aEntries,
+                               uint32_t* aEntries,
                                nsTArray<nsRefPtr<AccEvent> >& aEvents);
 
   /**
    * Helper to create text change events for inserted text.
    */
-  inline void FireInsertEvent(const nsAString& aText, PRUint32 aAddlOffset,
+  inline void FireInsertEvent(const nsAString& aText, uint32_t aAddlOffset,
                               nsTArray<nsRefPtr<AccEvent> >& aEvents)
   {
     nsRefPtr<AccEvent> event =
       new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
                              aText, true);
     aEvents.AppendElement(event);
   }
 
   /**
    * Helper to create text change events for removed text.
    */
-  inline void FireDeleteEvent(const nsAString& aText, PRUint32 aAddlOffset,
+  inline void FireDeleteEvent(const nsAString& aText, uint32_t aAddlOffset,
                               nsTArray<nsRefPtr<AccEvent> >& aEvents)
   {
     nsRefPtr<AccEvent> event =
       new AccTextChangeEvent(mHyperText, mTextOffset + aAddlOffset,
                              aText, false);
     aEvents.AppendElement(event);
   }
 
   /**
    * The constant used to skip string difference calculation in case of long
    * strings.
    */
-  const static PRUint32 kMaxStrLen = 1 << 6;
+  const static uint32_t kMaxStrLen = 1 << 6;
 
 private:
   DocAccessible* mDocument;
   TextLeafAccessible* mTextLeaf;
   HyperTextAccessible* mHyperText;
-  PRInt32 mTextOffset;
+  int32_t mTextOffset;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/src/base/nsARIAMap.cpp
+++ b/accessible/src/base/nsARIAMap.cpp
@@ -631,17 +631,17 @@ nsAttributeCharacteristics nsARIAMap::gW
   {&nsGkAtoms::aria_setsize,           ATTR_BYPASSOBJ                 }, /* handled via groupPosition */
   {&nsGkAtoms::aria_sort,                               ATTR_VALTOKEN },
   {&nsGkAtoms::aria_valuenow,          ATTR_BYPASSOBJ                 },
   {&nsGkAtoms::aria_valuemin,          ATTR_BYPASSOBJ                 },
   {&nsGkAtoms::aria_valuemax,          ATTR_BYPASSOBJ                 },
   {&nsGkAtoms::aria_valuetext,         ATTR_BYPASSOBJ                 }
 };
 
-PRUint32
+uint32_t
 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap);
 
 nsRoleMapEntry*
 aria::GetRoleMap(nsINode* aNode)
 {
   nsIContent* content = nsCoreUtils::GetRoleContent(aNode);
   nsAutoString roles;
   if (!content ||
@@ -650,41 +650,41 @@ aria::GetRoleMap(nsINode* aNode)
     // We treat role="" as if the role attribute is absent (per aria spec:8.1.1)
     return nullptr;
   }
 
   nsWhitespaceTokenizer tokenizer(roles);
   while (tokenizer.hasMoreTokens()) {
     // Do a binary search through table for the next role in role list
     const nsDependentSubstring role = tokenizer.nextToken();
-    PRUint32 low = 0;
-    PRUint32 high = ArrayLength(sWAIRoleMaps);
+    uint32_t low = 0;
+    uint32_t high = ArrayLength(sWAIRoleMaps);
     while (low < high) {
-      PRUint32 idx = (low + high) / 2;
-      PRInt32 compare = Compare(role, sWAIRoleMaps[idx].ARIARoleString());
+      uint32_t idx = (low + high) / 2;
+      int32_t compare = Compare(role, sWAIRoleMaps[idx].ARIARoleString());
       if (compare == 0)
         return sWAIRoleMaps + idx;
 
       if (compare < 0)
         high = idx;
       else
         low = idx + 1;
     }
   }
 
   // Always use some entry if there is a non-empty role string
   // To ensure an accessible object is created
   return &sLandmarkRoleMap;
 }
 
-PRUint64
+uint64_t
 aria::UniversalStatesFor(mozilla::dom::Element* aElement)
 {
-  PRUint64 state = 0;
-  PRUint32 index = 0;
+  uint64_t state = 0;
+  uint32_t index = 0;
   while (MapToState(sWAIUnivStateMap[index], aElement, &state))
     index++;
 
   return state;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // AttrIterator class
@@ -696,17 +696,17 @@ AttrIterator::Next(nsAString& aAttrName,
     const nsAttrName* attr = mContent->GetAttrNameAt(mAttrIdx);
     mAttrIdx++;
     if (attr->NamespaceEquals(kNameSpaceID_None)) {
       nsIAtom* attrAtom = attr->Atom();
       nsDependentAtomString attrStr(attrAtom);
       if (!StringBeginsWith(attrStr, NS_LITERAL_STRING("aria-")))
         continue; // Not ARIA
 
-      PRUint8 attrFlags = nsAccUtils::GetAttributeCharacteristics(attrAtom);
+      uint8_t attrFlags = nsAccUtils::GetAttributeCharacteristics(attrAtom);
       if (attrFlags & ATTR_BYPASSOBJ)
         continue; // No need to handle exposing as obj attribute here
 
       if ((attrFlags & ATTR_VALTOKEN) &&
            !nsAccUtils::HasDefinedARIAToken(mContent, attrAtom))
         continue; // only expose token based attributes if they are defined
 
       nsAutoString value;
--- a/accessible/src/base/nsARIAMap.h
+++ b/accessible/src/base/nsARIAMap.h
@@ -91,31 +91,31 @@ const bool kUseNativeRole = false;
 // ARIA attribute characteristic masks
 
 /**
  * This mask indicates the attribute should not be exposed as an object
  * attribute via the catch-all logic in Accessible::GetAttributes.
  * This means it either isn't mean't to be exposed as an object attribute, or
  * that it should, but is already handled in other code.
  */
-const PRUint8 ATTR_BYPASSOBJ  = 0x0001;
+const uint8_t ATTR_BYPASSOBJ  = 0x0001;
 
 /**
  * This mask indicates the attribute is expected to have an NMTOKEN or bool value.
  * (See for example usage in Accessible::GetAttributes)
  */
-const PRUint8 ATTR_VALTOKEN   = 0x0010;
+const uint8_t ATTR_VALTOKEN   = 0x0010;
 
 /**
  * Small footprint storage of persistent aria attribute characteristics.
  */
 struct nsAttributeCharacteristics
 {
   nsIAtom** attributeName;
-  const PRUint8 characteristics;
+  const uint8_t characteristics;
 };
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // State map entry
 
 /**
  * Used in nsRoleMapEntry.state if no nsIAccessibleStates are automatic for
@@ -164,17 +164,17 @@ struct nsRoleMapEntry
   // Action mapping rule, how to expose nsIAccessible action
   EActionRule actionRule;
 
   // 'live' and 'container-live' object attributes mapping rule: how to expose
   // these object attributes if ARIA 'live' attribute is missed.
   ELiveAttrRule liveAttRule;
 
   // Automatic state mapping rule: always include in nsIAccessibleStates
-  PRUint64 state;   // or kNoReqStates if no nsIAccessibleStates are automatic for this role.
+  uint64_t state;   // or kNoReqStates if no nsIAccessibleStates are automatic for this role.
 
   // ARIA properties supported for this role
   // (in other words, the aria-foo attribute to nsIAccessibleStates mapping rules)
   // Currently you cannot have unlimited mappings, because
   // a variable sized array would not allow the use of
   // C++'s struct initialization feature.
   mozilla::a11y::aria::EStateRule attributeMap1;
   mozilla::a11y::aria::EStateRule attributeMap2;
@@ -198,17 +198,17 @@ struct nsARIAMap
    * it is used for table cells that aren't contained by table.
    */
   static nsRoleMapEntry gEmptyRoleMap;
 
   /**
    * Map of attribute to attribute characteristics.
    */
   static nsAttributeCharacteristics gWAIUnivAttrMap[];
-  static PRUint32 gWAIUnivAttrMapLength;
+  static uint32_t gWAIUnivAttrMapLength;
 };
 
 namespace mozilla {
 namespace a11y {
 namespace aria {
 
 /**
  * Get the role map entry for a given DOM node. This will use the first
@@ -219,17 +219,17 @@ namespace aria {
  *                if none
  */
 nsRoleMapEntry* GetRoleMap(nsINode* aNode);
 
 /**
  * Return accessible state from ARIA universal states applied to the given
  * element.
  */
-PRUint64 UniversalStatesFor(mozilla::dom::Element* aElement);
+uint64_t UniversalStatesFor(mozilla::dom::Element* aElement);
 
  /**
   * Represents a simple enumerator for iterating through ARIA attributes 
   * exposed as object attributes on a given accessible. 
   */
 class AttrIterator
 {
 public:
@@ -242,17 +242,17 @@ public:
   bool Next(nsAString& aAttrName, nsAString& aAttrValue);
 
 private:
   AttrIterator() MOZ_DELETE;
   AttrIterator(const AttrIterator&) MOZ_DELETE;
   AttrIterator& operator= (const AttrIterator&) MOZ_DELETE;
 
   nsIContent* mContent;
-  PRUint32 mAttrIdx;
-  PRUint32 mAttrCount;
+  uint32_t mAttrIdx;
+  uint32_t mAttrCount;
 };
 
 } // namespace aria
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/src/base/nsAccDocManager.cpp
+++ b/accessible/src/base/nsAccDocManager.cpp
@@ -119,17 +119,17 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(nsAccDocMa
                               nsIDOMEventListener,
                               nsISupportsWeakReference)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIWebProgressListener
 
 NS_IMETHODIMP
 nsAccDocManager::OnStateChange(nsIWebProgress *aWebProgress,
-                               nsIRequest *aRequest, PRUint32 aStateFlags,
+                               nsIRequest *aRequest, uint32_t aStateFlags,
                                nsresult aStatus)
 {
   NS_ASSERTION(aStateFlags & STATE_IS_DOCUMENT, "Other notifications excluded");
 
   if (nsAccessibilityService::IsShutdown() || !aWebProgress ||
       (aStateFlags & (STATE_START | STATE_STOP)) == 0)
     return NS_OK;
 
@@ -146,29 +146,29 @@ nsAccDocManager::OnStateChange(nsIWebPro
   // Document was loaded.
   if (aStateFlags & STATE_STOP) {
 #ifdef DEBUG
     if (logging::IsEnabled(logging::eDocLoad))
       logging::DocLoad("document loaded", aWebProgress, aRequest, aStateFlags);
 #endif
 
     // Figure out an event type to notify the document has been loaded.
-    PRUint32 eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED;
+    uint32_t eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED;
 
     // Some XUL documents get start state and then stop state with failure
     // status when everything is ok. Fire document load complete event in this
     // case.
     if (NS_SUCCEEDED(aStatus) || !nsCoreUtils::IsContentDocument(document))
       eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE;
 
     // If end consumer has been retargeted for loaded content then do not fire
     // any event because it means no new document has been loaded, for example,
     // it happens when user clicks on file link.
     if (aRequest) {
-      PRUint32 loadFlags = 0;
+      uint32_t loadFlags = 0;
       aRequest->GetLoadFlags(&loadFlags);
       if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)
         eventType = 0;
     }
 
     HandleDOMDocumentLoad(document, eventType);
     return NS_OK;
   }
@@ -183,45 +183,45 @@ nsAccDocManager::OnStateChange(nsIWebPro
   if (!docAcc)
     return NS_OK;
 
   nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(DOMWindow));
   nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(webNav));
   NS_ENSURE_STATE(docShell);
 
   bool isReloading = false;
-  PRUint32 loadType;
+  uint32_t loadType;
   docShell->GetLoadType(&loadType);
   if (loadType == LOAD_RELOAD_NORMAL ||
       loadType == LOAD_RELOAD_BYPASS_CACHE ||
       loadType == LOAD_RELOAD_BYPASS_PROXY ||
       loadType == LOAD_RELOAD_BYPASS_PROXY_AND_CACHE) {
     isReloading = true;
   }
 
   docAcc->NotifyOfLoading(isReloading);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccDocManager::OnProgressChange(nsIWebProgress *aWebProgress,
                                   nsIRequest *aRequest,
-                                  PRInt32 aCurSelfProgress,
-                                  PRInt32 aMaxSelfProgress,
-                                  PRInt32 aCurTotalProgress,
-                                  PRInt32 aMaxTotalProgress)
+                                  int32_t aCurSelfProgress,
+                                  int32_t aMaxSelfProgress,
+                                  int32_t aCurTotalProgress,
+                                  int32_t aMaxTotalProgress)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccDocManager::OnLocationChange(nsIWebProgress *aWebProgress,
                                   nsIRequest *aRequest, nsIURI *aLocation,
-                                  PRUint32 aFlags)
+                                  uint32_t aFlags)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccDocManager::OnStatusChange(nsIWebProgress *aWebProgress,
                                 nsIRequest *aRequest, nsresult aStatus,
@@ -229,17 +229,17 @@ nsAccDocManager::OnStatusChange(nsIWebPr
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccDocManager::OnSecurityChange(nsIWebProgress *aWebProgress,
                                   nsIRequest *aRequest,
-                                  PRUint32 aState)
+                                  uint32_t aState)
 {
   NS_NOTREACHED("notification excluded in AddProgressListener(...)");
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIDOMEventListener
 
@@ -301,17 +301,17 @@ nsAccDocManager::HandleEvent(nsIDOMEvent
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccDocManager private
 
 void
 nsAccDocManager::HandleDOMDocumentLoad(nsIDocument *aDocument,
-                                       PRUint32 aLoadEventType)
+                                       uint32_t aLoadEventType)
 {
   // Document accessible can be created before we were notified the DOM document
   // was loaded completely. However if it's not created yet then create it.
   DocAccessible* docAcc = mDocAccessibleCache.GetWeak(aDocument);
   if (!docAcc) {
     docAcc = CreateDocOrRootAccessible(aDocument);
     if (!docAcc)
       return;
--- a/accessible/src/base/nsAccDocManager.h
+++ b/accessible/src/base/nsAccDocManager.h
@@ -91,17 +91,17 @@ private:
    * Create an accessible document if it was't created and fire accessibility
    * events if needed.
    *
    * @param  aDocument       [in] loaded DOM document
    * @param  aLoadEventType  [in] specifies the event type to fire load event,
    *                           if 0 then no event is fired
    */
   void HandleDOMDocumentLoad(nsIDocument* aDocument,
-                             PRUint32 aLoadEventType);
+                             uint32_t aLoadEventType);
 
   /**
    * Add 'pagehide' and 'DOMContentLoaded' event listeners.
    */
   void AddListeners(nsIDocument *aDocument, bool aAddPageShowListener);
 
   /**
    * Create document or root accessible.
--- a/accessible/src/base/nsAccTreeWalker.cpp
+++ b/accessible/src/base/nsAccTreeWalker.cpp
@@ -17,17 +17,17 @@
 
 struct WalkState
 {
   WalkState(nsIContent *aContent) :
     content(aContent), childIdx(0), prevState(nullptr) {}
 
   nsCOMPtr<nsIContent> content;
   nsCOMPtr<nsINodeList> childList;
-  PRUint32 childIdx;
+  uint32_t childIdx;
   WalkState *prevState;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccTreeWalker
 ////////////////////////////////////////////////////////////////////////////////
 
 nsAccTreeWalker::
@@ -64,17 +64,17 @@ Accessible*
 nsAccTreeWalker::NextChildInternal(bool aNoWalkUp)
 {
   if (!mState || !mState->content)
     return nullptr;
 
   if (!mState->childList)
     mState->childList = mState->content->GetChildren(mChildFilter);
 
-  PRUint32 length = 0;
+  uint32_t length = 0;
   if (mState->childList)
     mState->childList->GetLength(&length);
 
   while (mState->childIdx < length) {
     nsIContent* childNode = mState->childList->GetNodeAt(mState->childIdx);
     mState->childIdx++;
 
     bool isSubtreeHidden = false;
--- a/accessible/src/base/nsAccTreeWalker.h
+++ b/accessible/src/base/nsAccTreeWalker.h
@@ -55,14 +55,14 @@ private:
   bool PushState(nsIContent *aNode);
 
   /**
    * Pop state from stack.
    */
   void PopState();
 
   DocAccessible* mDoc;
-  PRInt32 mChildFilter;
+  int32_t mChildFilter;
   bool mWalkCache;
   WalkState* mState;
 };
 
 #endif 
--- a/accessible/src/base/nsAccUtils.cpp
+++ b/accessible/src/base/nsAccUtils.cpp
@@ -42,18 +42,18 @@ nsAccUtils::SetAccAttr(nsIPersistentProp
   nsAutoString oldValue;
   nsCAutoString attrName;
 
   aAttributes->SetStringProperty(nsAtomCString(aAttrName), aAttrValue, oldValue);
 }
 
 void
 nsAccUtils::SetAccGroupAttrs(nsIPersistentProperties *aAttributes,
-                             PRInt32 aLevel, PRInt32 aSetSize,
-                             PRInt32 aPosInSet)
+                             int32_t aLevel, int32_t aSetSize,
+                             int32_t aPosInSet)
 {
   nsAutoString value;
 
   if (aLevel) {
     value.AppendInt(aLevel);
     SetAccAttr(aAttributes, nsGkAtoms::level, value);
   }
 
@@ -63,17 +63,17 @@ nsAccUtils::SetAccGroupAttrs(nsIPersiste
     SetAccAttr(aAttributes, nsGkAtoms::posinset, value);
 
     value.Truncate();
     value.AppendInt(aSetSize);
     SetAccAttr(aAttributes, nsGkAtoms::setsize, value);
   }
 }
 
-PRInt32
+int32_t
 nsAccUtils::GetDefaultLevel(Accessible* aAccessible)
 {
   roles::Role role = aAccessible->Role();
 
   if (role == roles::OUTLINEITEM)
     return 1;
 
   if (role == roles::ROW) {
@@ -82,43 +82,43 @@ nsAccUtils::GetDefaultLevel(Accessible* 
     // is overriden by aria-level attribute.
     if (parent && parent->Role() == roles::TREE_TABLE) 
       return 1;
   }
 
   return 0;
 }
 
-PRInt32
+int32_t
 nsAccUtils::GetARIAOrDefaultLevel(Accessible* aAccessible)
 {
-  PRInt32 level = 0;
+  int32_t level = 0;
   nsCoreUtils::GetUIntAttr(aAccessible->GetContent(),
                            nsGkAtoms::aria_level, &level);
 
   if (level != 0)
     return level;
 
   return GetDefaultLevel(aAccessible);
 }
 
-PRInt32
+int32_t
 nsAccUtils::GetLevelForXULContainerItem(nsIContent *aContent)
 {
   nsCOMPtr<nsIDOMXULContainerItemElement> item(do_QueryInterface(aContent));
   if (!item)
     return 0;
 
   nsCOMPtr<nsIDOMXULContainerElement> container;
   item->GetParentContainer(getter_AddRefs(container));
   if (!container)
     return 0;
 
   // Get level of the item.
-  PRInt32 level = -1;
+  int32_t level = -1;
   while (container) {
     level++;
 
     nsCOMPtr<nsIDOMXULContainerElement> parentContainer;
     container->GetParentContainer(getter_AddRefs(parentContainer));
     parentContainer.swap(container);
   }
 
@@ -200,42 +200,42 @@ nsAccUtils::GetARIAToken(dom::Element* a
 {
   if (!nsAccUtils::HasDefinedARIAToken(aElement, aAttr))
     return nsGkAtoms::_empty;
 
   static nsIContent::AttrValuesArray tokens[] =
     { &nsGkAtoms::_false, &nsGkAtoms::_true,
       &nsGkAtoms::mixed, nullptr};
 
-  PRInt32 idx = aElement->FindAttrValueIn(kNameSpaceID_None,
+  int32_t idx = aElement->FindAttrValueIn(kNameSpaceID_None,
                                           aAttr, tokens, eCaseMatters);
   if (idx >= 0)
     return *(tokens[idx]);
 
   return nullptr;
 }
 
 Accessible*
-nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, PRUint32 aRole)
+nsAccUtils::GetAncestorWithRole(Accessible* aDescendant, uint32_t aRole)
 {
   Accessible* document = aDescendant->Document();
   Accessible* parent = aDescendant;
   while ((parent = parent->Parent())) {
-    PRUint32 testRole = parent->Role();
+    uint32_t testRole = parent->Role();
     if (testRole == aRole)
       return parent;
 
     if (parent == document)
       break;
   }
   return nullptr;
 }
 
 Accessible*
-nsAccUtils::GetSelectableContainer(Accessible* aAccessible, PRUint64 aState)
+nsAccUtils::GetSelectableContainer(Accessible* aAccessible, uint64_t aState)
 {
   if (!aAccessible)
     return nullptr;
 
   if (!(aState & states::SELECTABLE))
     return nullptr;
 
   Accessible* parent = aAccessible;
@@ -260,17 +260,17 @@ nsAccUtils::GetTextAccessibleFromSelecti
   // Get accessible from selection's focus DOM point (the DOM point where
   // selection is ended).
 
   nsCOMPtr<nsIDOMNode> focusDOMNode;
   aSelection->GetFocusNode(getter_AddRefs(focusDOMNode));
   if (!focusDOMNode)
     return nullptr;
 
-  PRInt32 focusOffset = 0;
+  int32_t focusOffset = 0;
   aSelection->GetFocusOffset(&focusOffset);
 
   nsCOMPtr<nsINode> focusNode(do_QueryInterface(focusDOMNode));
   nsCOMPtr<nsINode> resultNode =
     nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset);
 
   // Get text accessible containing the result node.
   DocAccessible* doc = 
@@ -290,18 +290,18 @@ nsAccUtils::GetTextAccessibleFromSelecti
     accessible = accessible->Parent();
   } while (accessible);
 
   NS_NOTREACHED("We must reach document accessible implementing nsIAccessibleText!");
   return nullptr;
 }
 
 nsresult
-nsAccUtils::ConvertToScreenCoords(PRInt32 aX, PRInt32 aY,
-                                  PRUint32 aCoordinateType,
+nsAccUtils::ConvertToScreenCoords(int32_t aX, int32_t aY,
+                                  uint32_t aCoordinateType,
                                   nsAccessNode *aAccessNode,
                                   nsIntPoint *aCoords)
 {
   NS_ENSURE_ARG_POINTER(aCoords);
 
   aCoords->MoveTo(aX, aY);
 
   switch (aCoordinateType) {
@@ -325,18 +325,18 @@ nsAccUtils::ConvertToScreenCoords(PRInt3
     default:
       return NS_ERROR_INVALID_ARG;
   }
 
   return NS_OK;
 }
 
 nsresult
-nsAccUtils::ConvertScreenCoordsTo(PRInt32 *aX, PRInt32 *aY,
-                                  PRUint32 aCoordinateType,
+nsAccUtils::ConvertScreenCoordsTo(int32_t *aX, int32_t *aY,
+                                  uint32_t aCoordinateType,
                                   nsAccessNode *aAccessNode)
 {
   switch (aCoordinateType) {
     case nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE:
       break;
 
     case nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE:
     {
@@ -380,28 +380,28 @@ nsAccUtils::GetScreenCoordsForParent(nsA
   nsIFrame *parentFrame = parent->GetFrame();
   if (!parentFrame)
     return nsIntPoint(0, 0);
 
   nsIntRect parentRect = parentFrame->GetScreenRectExternal();
   return nsIntPoint(parentRect.x, parentRect.y);
 }
 
-PRUint8
+uint8_t
 nsAccUtils::GetAttributeCharacteristics(nsIAtom* aAtom)
 {
-    for (PRUint32 i = 0; i < nsARIAMap::gWAIUnivAttrMapLength; i++)
+    for (uint32_t i = 0; i < nsARIAMap::gWAIUnivAttrMapLength; i++)
       if (*nsARIAMap::gWAIUnivAttrMap[i].attributeName == aAtom)
         return nsARIAMap::gWAIUnivAttrMap[i].characteristics;
 
     return 0;
 }
 
 bool
-nsAccUtils::GetLiveAttrValue(PRUint32 aRule, nsAString& aValue)
+nsAccUtils::GetLiveAttrValue(uint32_t aRule, nsAString& aValue)
 {
   switch (aRule) {
     case eOffLiveAttr:
       aValue = NS_LITERAL_STRING("off");
       return true;
     case ePoliteLiveAttr:
       aValue = NS_LITERAL_STRING("polite");
       return true;
@@ -416,18 +416,18 @@ bool
 nsAccUtils::IsTextInterfaceSupportCorrect(Accessible* aAccessible)
 {
   // Don't test for accessible docs, it makes us create accessibles too
   // early and fire mutation events before we need to
   if (aAccessible->IsDoc())
     return true;
 
   bool foundText = false;
-  PRUint32 childCount = aAccessible->ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  uint32_t childCount = aAccessible->ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = aAccessible->GetChildAt(childIdx);
     if (IsText(child)) {
       foundText = true;
       break;
     }
   }
 
   if (foundText) {
@@ -436,17 +436,17 @@ nsAccUtils::IsTextInterfaceSupportCorrec
     if (!text)
       return false;
   }
 
   return true;
 }
 #endif
 
-PRUint32
+uint32_t
 nsAccUtils::TextLength(Accessible* aAccessible)
 {
   if (!IsText(aAccessible))
     return 1;
 
   TextLeafAccessible* textLeaf = aAccessible->AsTextLeaf();
   if (textLeaf)
     return textLeaf->Text().Length();
@@ -479,58 +479,58 @@ nsAccUtils::MustPrune(Accessible* aAcces
     role == roles::SLIDER ||
     role == roles::PROGRESSBAR ||
     role == roles::SEPARATOR;
 }
 
 nsresult
 nsAccUtils::GetHeaderCellsFor(nsIAccessibleTable *aTable,
                               nsIAccessibleTableCell *aCell,
-                              PRInt32 aRowOrColHeaderCells, nsIArray **aCells)
+                              int32_t aRowOrColHeaderCells, nsIArray **aCells)
 {
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> cells = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  PRInt32 rowIdx = -1;
+  int32_t rowIdx = -1;
   rv = aCell->GetRowIndex(&rowIdx);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  PRInt32 colIdx = -1;
+  int32_t colIdx = -1;
   rv = aCell->GetColumnIndex(&colIdx);
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool moveToLeft = aRowOrColHeaderCells == eRowHeaderCells;
 
   // Move to the left or top to find row header cells or column header cells.
-  PRInt32 index = (moveToLeft ? colIdx : rowIdx) - 1;
+  int32_t index = (moveToLeft ? colIdx : rowIdx) - 1;
   for (; index >= 0; index--) {
-    PRInt32 curRowIdx = moveToLeft ? rowIdx : index;
-    PRInt32 curColIdx = moveToLeft ? index : colIdx;
+    int32_t curRowIdx = moveToLeft ? rowIdx : index;
+    int32_t curColIdx = moveToLeft ? index : colIdx;
 
     nsCOMPtr<nsIAccessible> cell;
     rv = aTable->GetCellAt(curRowIdx, curColIdx, getter_AddRefs(cell));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIAccessibleTableCell> tableCellAcc =
       do_QueryInterface(cell);
 
     // GetCellAt should always return an nsIAccessibleTableCell (XXX Bug 587529)
     NS_ENSURE_STATE(tableCellAcc);
 
-    PRInt32 origIdx = 1;
+    int32_t origIdx = 1;
     if (moveToLeft)
       rv = tableCellAcc->GetColumnIndex(&origIdx);
     else
       rv = tableCellAcc->GetRowIndex(&origIdx);
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (origIdx == index) {
       // Append original header cells only.
-      PRUint32 role = Role(cell);
+      uint32_t role = Role(cell);
       bool isHeader = moveToLeft ?
         role == nsIAccessibleRole::ROLE_ROWHEADER :
         role == nsIAccessibleRole::ROLE_COLUMNHEADER;
 
       if (isHeader)
         cells->AppendElement(cell, false);
     }
   }
--- a/accessible/src/base/nsAccUtils.h
+++ b/accessible/src/base/nsAccUtils.h
@@ -52,34 +52,34 @@ public:
   static void SetAccAttr(nsIPersistentProperties *aAttributes,
                          nsIAtom *aAttrName,
                          const nsAString& aAttrValue);
 
   /**
    * Set group attributes ('level', 'setsize', 'posinset').
    */
   static void SetAccGroupAttrs(nsIPersistentProperties *aAttributes,
-                               PRInt32 aLevel, PRInt32 aSetSize,
-                               PRInt32 aPosInSet);
+                               int32_t aLevel, int32_t aSetSize,
+                               int32_t aPosInSet);
 
   /**
    * Get default value of the level for the given accessible.
    */
-  static PRInt32 GetDefaultLevel(Accessible* aAcc);
+  static int32_t GetDefaultLevel(Accessible* aAcc);
 
   /**
    * Return ARIA level value or the default one if ARIA is missed for the
    * given accessible.
    */
-  static PRInt32 GetARIAOrDefaultLevel(Accessible* aAccessible);
+  static int32_t GetARIAOrDefaultLevel(Accessible* aAccessible);
 
   /**
    * Compute group level for nsIDOMXULContainerItemElement node.
    */
-  static PRInt32 GetLevelForXULContainerItem(nsIContent *aContent);
+  static int32_t GetLevelForXULContainerItem(nsIContent *aContent);
 
   /**
    * Set container-foo live region attributes for the given node.
    *
    * @param aAttributes    where to store the attributes
    * @param aStartContent  node to start from
    * @param aTopContent    node to end at
    */
@@ -125,26 +125,26 @@ public:
     * Return ancestor in this document with the given role if it exists.
     *
     * @param  aDescendant  [in] descendant to start search with
     * @param  aRole        [in] role to find matching ancestor for
     * @return               the ancestor accessible with the given role, or
     *                       nullptr if no match is found
     */
    static Accessible* GetAncestorWithRole(Accessible* aDescendant,
-                                          PRUint32 aRole);
+                                          uint32_t aRole);
 
   /**
    * Return single or multi selectable container for the given item.
    *
    * @param  aAccessible  [in] the item accessible
    * @param  aState       [in] the state of the item accessible
    */
   static Accessible* GetSelectableContainer(Accessible* aAccessible,
-                                            PRUint64 aState);
+                                            uint64_t aState);
 
   /**
    * Return true if the DOM node of given accessible has aria-selected="true"
    * attribute.
    */
   static bool IsARIASelected(Accessible* aAccessible);
 
   /**
@@ -163,34 +163,34 @@ public:
    * @param aX               [in] the given x coord
    * @param aY               [in] the given y coord
    * @param aCoordinateType  [in] specifies coordinates origin (refer to
    *                         nsIAccessibleCoordinateType)
    * @param aAccessNode      [in] the accessible if coordinates are given
    *                         relative it.
    * @param aCoords          [out] converted coordinates
    */
-  static nsresult ConvertToScreenCoords(PRInt32 aX, PRInt32 aY,
-                                        PRUint32 aCoordinateType,
+  static nsresult ConvertToScreenCoords(int32_t aX, int32_t aY,
+                                        uint32_t aCoordinateType,
                                         nsAccessNode *aAccessNode,
                                         nsIntPoint *aCoords);
 
   /**
    * Converts the given coordinates relative screen to another coordinate
    * system.
    *
    * @param aX               [in, out] the given x coord
    * @param aY               [in, out] the given y coord
    * @param aCoordinateType  [in] specifies coordinates origin (refer to
    *                         nsIAccessibleCoordinateType)
    * @param aAccessNode      [in] the accessible if coordinates are given
    *                         relative it
    */
-  static nsresult ConvertScreenCoordsTo(PRInt32 *aX, PRInt32 *aY,
-                                        PRUint32 aCoordinateType,
+  static nsresult ConvertScreenCoordsTo(int32_t *aX, int32_t *aY,
+                                        uint32_t aCoordinateType,
                                         nsAccessNode *aAccessNode);
 
   /**
    * Returns coordinates relative screen for the top level window.
    *
    * @param aAccessNode  the accessible hosted in the window
    */
   static nsIntPoint GetScreenCoordsForWindow(nsAccessNode *aAccessNode);
@@ -200,97 +200,97 @@ public:
    *
    * @param aAccessNode  the accessible
    */
   static nsIntPoint GetScreenCoordsForParent(nsAccessNode *aAccessNode);
 
   /**
    * Return the role of the given accessible.
    */
-  static PRUint32 Role(nsIAccessible *aAcc)
+  static uint32_t Role(nsIAccessible *aAcc)
   {
-    PRUint32 role = nsIAccessibleRole::ROLE_NOTHING;
+    uint32_t role = nsIAccessibleRole::ROLE_NOTHING;
     if (aAcc)
       aAcc->GetRole(&role);
 
     return role;
   }
 
   /**
    * Get the ARIA attribute characteristics for a given ARIA attribute.
    * 
    * @param aAtom  ARIA attribute
    * @return       A bitflag representing the attribute characteristics
    *               (see nsARIAMap.h for possible bit masks, prefixed "ARIA_")
    */
-  static PRUint8 GetAttributeCharacteristics(nsIAtom* aAtom);
+  static uint8_t GetAttributeCharacteristics(nsIAtom* aAtom);
 
   /**
    * Get the 'live' or 'container-live' object attribute value from the given
    * ELiveAttrRule constant.
    *
    * @param  aRule   [in] rule constant (see ELiveAttrRule in nsAccMap.h)
    * @param  aValue  [out] object attribute value
    *
    * @return         true if object attribute should be exposed
    */
-  static bool GetLiveAttrValue(PRUint32 aRule, nsAString& aValue);
+  static bool GetLiveAttrValue(uint32_t aRule, nsAString& aValue);
 
 #ifdef DEBUG
   /**
    * Detect whether the given accessible object implements nsIAccessibleText,
    * when it is text or has text child node.
    */
   static bool IsTextInterfaceSupportCorrect(Accessible* aAccessible);
 #endif
 
   /**
    * Return true if the given accessible has text role.
    */
   static bool IsText(nsIAccessible *aAcc)
   {
-    PRUint32 role = Role(aAcc);
+    uint32_t role = Role(aAcc);
     return role == nsIAccessibleRole::ROLE_TEXT_LEAF ||
            role == nsIAccessibleRole::ROLE_STATICTEXT;
   }
 
   /**
    * Return text length of the given accessible, return 0 on failure.
    */
-  static PRUint32 TextLength(Accessible* aAccessible);
+  static uint32_t TextLength(Accessible* aAccessible);
 
   /**
    * Return true if the given accessible is embedded object.
    */
   static bool IsEmbeddedObject(nsIAccessible *aAcc)
   {
-    PRUint32 role = Role(aAcc);
+    uint32_t role = Role(aAcc);
     return role != nsIAccessibleRole::ROLE_TEXT_LEAF &&
            role != nsIAccessibleRole::ROLE_WHITESPACE &&
            role != nsIAccessibleRole::ROLE_STATICTEXT;
   }
 
   /**
    * Transform nsIAccessibleStates constants to internal state constant.
    */
-  static inline PRUint64 To64State(PRUint32 aState1, PRUint32 aState2)
+  static inline uint64_t To64State(uint32_t aState1, uint32_t aState2)
   {
-    return static_cast<PRUint64>(aState1) +
-        (static_cast<PRUint64>(aState2) << 31);
+    return static_cast<uint64_t>(aState1) +
+        (static_cast<uint64_t>(aState2) << 31);
   }
 
   /**
    * Transform internal state constant to nsIAccessibleStates constants.
    */
-  static inline void To32States(PRUint64 aState64,
-                                PRUint32* aState1, PRUint32* aState2)
+  static inline void To32States(uint64_t aState64,
+                                uint32_t* aState1, uint32_t* aState2)
   {
     *aState1 = aState64 & 0x7fffffff;
     if (aState2)
-      *aState2 = static_cast<PRUint32>(aState64 >> 31);
+      *aState2 = static_cast<uint32_t>(aState64 >> 31);
   }
 
   /**
    * Return true if the given accessible can't have children. Used when exposing
    * to platform accessibility APIs, should the children be pruned off?
    */
   static bool MustPrune(Accessible* aAccessible);
 
@@ -312,13 +312,13 @@ public:
    *                               get header cells
    * @param aRowOrColHeaderCells  [in] specifies whether column or row header
    *                               cells are returned (see enum constants
    *                               above)
    * @param aCells                [out] array of header cell accessibles
    */
   static nsresult GetHeaderCellsFor(nsIAccessibleTable *aTable,
                                     nsIAccessibleTableCell *aCell,
-                                    PRInt32 aRowOrColHeaderCells,
+                                    int32_t aRowOrColHeaderCells,
                                     nsIArray **aCells);
 };
 
 #endif
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -127,17 +127,17 @@ nsAccessibilityService::NotifyOfAnchorJu
     DocAccessible* document = GetDocAccessible(documentNode);
     if (document)
       document->SetAnchorJump(aTargetNode);
   }
 }
 
 // nsIAccessibilityService
 void
-nsAccessibilityService::FireAccessibleEvent(PRUint32 aEvent,
+nsAccessibilityService::FireAccessibleEvent(uint32_t aEvent,
                                             Accessible* aTarget)
 {
   nsEventShell::FireEvent(aEvent, aTarget);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibilityService
 
@@ -622,17 +622,17 @@ nsAccessibilityService::GetAccessibleFor
   DocAccessible* document = GetDocAccessible(node->OwnerDoc());
   if (document)
     NS_IF_ADDREF(*aAccessible = document->GetAccessible(node));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString)
+nsAccessibilityService::GetStringRole(uint32_t aRole, nsAString& aString)
 {
 #define ROLE(geckoRole, stringRole, atkRole, \
              macRole, msaaRole, ia2Role, nameRule) \
   case roles::geckoRole: \
     CopyUTF8toUTF16(stringRole, aString); \
     return NS_OK;
 
   switch (aRole) {
@@ -641,23 +641,23 @@ nsAccessibilityService::GetStringRole(PR
       aString.AssignLiteral("unknown");
       return NS_OK;
   }
 
 #undef ROLE
 }
 
 NS_IMETHODIMP
-nsAccessibilityService::GetStringStates(PRUint32 aState, PRUint32 aExtraState,
+nsAccessibilityService::GetStringStates(uint32_t aState, uint32_t aExtraState,
                                         nsIDOMDOMStringList **aStringStates)
 {
   nsAccessibleDOMStringList* stringStates = new nsAccessibleDOMStringList();
   NS_ENSURE_TRUE(stringStates, NS_ERROR_OUT_OF_MEMORY);
 
-  PRUint64 state = nsAccUtils::To64State(aState, aExtraState);
+  uint64_t state = nsAccUtils::To64State(aState, aExtraState);
 
   // states
   if (state & states::UNAVAILABLE)
     stringStates->Add(NS_LITERAL_STRING("unavailable"));
   if (state & states::SELECTED)
     stringStates->Add(NS_LITERAL_STRING("selected"));
   if (state & states::FOCUSED)
     stringStates->Add(NS_LITERAL_STRING("focused"));
@@ -748,45 +748,45 @@ nsAccessibilityService::GetStringStates(
   if (state & states::ENABLED)
     stringStates->Add(NS_LITERAL_STRING("enabled"));
   if (state & states::SENSITIVE)
     stringStates->Add(NS_LITERAL_STRING("sensitive"));
   if (state & states::EXPANDABLE)
     stringStates->Add(NS_LITERAL_STRING("expandable"));
 
   //unknown states
-  PRUint32 stringStatesLength = 0;
+  uint32_t stringStatesLength = 0;
   stringStates->GetLength(&stringStatesLength);
   if (!stringStatesLength)
     stringStates->Add(NS_LITERAL_STRING("unknown"));
 
   NS_ADDREF(*aStringStates = stringStates);
   return NS_OK;
 }
 
 // nsIAccessibleRetrieval::getStringEventType()
 NS_IMETHODIMP
-nsAccessibilityService::GetStringEventType(PRUint32 aEventType,
+nsAccessibilityService::GetStringEventType(uint32_t aEventType,
                                            nsAString& aString)
 {
   NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
                "nsIAccessibleEvent constants are out of sync to kEventTypeNames");
 
   if (aEventType >= ArrayLength(kEventTypeNames)) {
     aString.AssignLiteral("unknown");
     return NS_OK;
   }
 
   CopyUTF8toUTF16(kEventTypeNames[aEventType], aString);
   return NS_OK;
 }
 
 // nsIAccessibleRetrieval::getStringRelationType()
 NS_IMETHODIMP
-nsAccessibilityService::GetStringRelationType(PRUint32 aRelationType,
+nsAccessibilityService::GetStringRelationType(uint32_t aRelationType,
                                               nsAString& aString)
 {
   if (aRelationType >= ArrayLength(kRelationTypeNames)) {
     aString.AssignLiteral("unknown");
     return NS_OK;
   }
 
   CopyUTF8toUTF16(kRelationTypeNames[aRelationType], aString);
@@ -1268,17 +1268,17 @@ nsAccessibilityService::HasUniversalAria
 already_AddRefed<Accessible>
 nsAccessibilityService::CreateAccessibleByType(nsIContent* aContent,
                                                DocAccessible* aDoc)
 {
   nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aContent));
   if (!accessibleProvider)
     return nullptr;
 
-  PRInt32 type;
+  int32_t type;
   nsresult rv = accessibleProvider->GetAccessibleType(&type);
   if (NS_FAILED(rv))
     return nullptr;
 
   if (type == nsIAccessibleProvider::OuterDoc) {
     Accessible* accessible = new OuterDocAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
     return accessible;
@@ -1773,17 +1773,17 @@ nsAccessibilityService::CreateAccessible
   if (!treeBoxObj)
     return nullptr;
 
   nsCOMPtr<nsITreeColumns> treeColumns;
   treeBoxObj->GetColumns(getter_AddRefs(treeColumns));
   if (!treeColumns)
     return nullptr;
 
-  PRInt32 count = 0;
+  int32_t count = 0;
   treeColumns->GetCount(&count);
 
   // Outline of list accessible.
   if (count == 1) {
     Accessible* accessible = new XULTreeAccessible(aContent, aDoc);
     NS_IF_ADDREF(accessible);
     return accessible;
   }
--- a/accessible/src/base/nsAccessibilityService.h
+++ b/accessible/src/base/nsAccessibilityService.h
@@ -173,17 +173,17 @@ public:
    */
   virtual void PresShellActivated(nsIPresShell* aPresShell);
 
   /**
    * Recreate an accessible for the given content node in the presshell.
    */
   void RecreateAccessible(nsIPresShell* aPresShell, nsIContent* aContent);
 
-  virtual void FireAccessibleEvent(PRUint32 aEvent, Accessible* aTarget);
+  virtual void FireAccessibleEvent(uint32_t aEvent, Accessible* aTarget);
 
   // nsAccessibiltiyService
 
   /**
    * Return true if accessibility service has been shutdown.
    */
   static bool IsShutdown() { return gIsShutdown; }
 
--- a/accessible/src/base/nsAccessiblePivot.cpp
+++ b/accessible/src/base/nsAccessiblePivot.cpp
@@ -27,23 +27,23 @@ class RuleCache
 public:
   RuleCache(nsIAccessibleTraversalRule* aRule) : mRule(aRule),
                                                  mAcceptRoles(nullptr) { }
   ~RuleCache () {
     if (mAcceptRoles)
       nsMemory::Free(mAcceptRoles);
   }
 
-  nsresult ApplyFilter(Accessible* aAccessible, PRUint16* aResult);
+  nsresult ApplyFilter(Accessible* aAccessible, uint16_t* aResult);
 
 private:
   nsCOMPtr<nsIAccessibleTraversalRule> mRule;
-  PRUint32* mAcceptRoles;
-  PRUint32 mAcceptRolesLength;
-  PRUint32 mPreFilter;
+  uint32_t* mAcceptRoles;
+  uint32_t mAcceptRolesLength;
+  uint32_t mPreFilter;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessiblePivot
 
 nsAccessiblePivot::nsAccessiblePivot(Accessible* aRoot) :
   mRoot(aRoot), mPosition(nullptr),
   mStartOffset(-1), mEndOffset(-1)
@@ -54,17 +54,17 @@ nsAccessiblePivot::nsAccessiblePivot(Acc
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsAccessiblePivot)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsAccessiblePivot)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mRoot, nsIAccessible)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mPosition, nsIAccessible)
-  PRUint32 i, length = tmp->mObservers.Length();                               \
+  uint32_t i, length = tmp->mObservers.Length();                               \
   for (i = 0; i < length; ++i) {
     cb.NoteXPCOMChild(tmp->mObservers.ElementAt(i).get());
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsAccessiblePivot)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mRoot)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mPosition)
@@ -111,47 +111,47 @@ nsAccessiblePivot::SetPosition(nsIAccess
   if (aPosition) {
     secondPosition = do_QueryObject(aPosition);
     if (!secondPosition || !IsRootDescendant(secondPosition))
       return NS_ERROR_INVALID_ARG;
   }
 
   // Swap old position with new position, saves us an AddRef/Release.
   mPosition.swap(secondPosition);
-  PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
+  int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
   mStartOffset = mEndOffset = -1;
   NotifyOfPivotChange(secondPosition, oldStart, oldEnd,
                       nsIAccessiblePivot::REASON_NONE);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAccessiblePivot::GetStartOffset(PRInt32* aStartOffset)
+nsAccessiblePivot::GetStartOffset(int32_t* aStartOffset)
 {
   NS_ENSURE_ARG_POINTER(aStartOffset);
 
   *aStartOffset = mStartOffset;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAccessiblePivot::GetEndOffset(PRInt32* aEndOffset)
+nsAccessiblePivot::GetEndOffset(int32_t* aEndOffset)
 {
   NS_ENSURE_ARG_POINTER(aEndOffset);
 
   *aEndOffset = mEndOffset;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
-                                PRInt32 aStartOffset, PRInt32 aEndOffset)
+                                int32_t aStartOffset, int32_t aEndOffset)
 {
   NS_ENSURE_ARG(aTextAccessible);
 
   // Check that start offset is smaller than end offset, and that if a value is
   // smaller than 0, both should be -1.
   NS_ENSURE_TRUE(aStartOffset <= aEndOffset &&
                  (aStartOffset >= 0 || (aStartOffset != -1 && aEndOffset != -1)),
                  NS_ERROR_INVALID_ARG);
@@ -160,22 +160,22 @@ nsAccessiblePivot::SetTextRange(nsIAcces
   if (!acc)
     return NS_ERROR_INVALID_ARG;
 
   HyperTextAccessible* newPosition = acc->AsHyperText();
   if (!newPosition || !IsRootDescendant(newPosition))
     return NS_ERROR_INVALID_ARG;
 
   // Make sure the given offsets don't exceed the character count.
-  PRInt32 charCount = newPosition->CharacterCount();
+  int32_t charCount = newPosition->CharacterCount();
 
   if (aEndOffset > charCount)
     return NS_ERROR_FAILURE;
 
-  PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
+  int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
   mStartOffset = aStartOffset;
   mEndOffset = aEndOffset;
 
   nsRefPtr<Accessible> oldPosition = mPosition.forget();
   mPosition = newPosition;
 
   NotifyOfPivotChange(oldPosition, oldStart, oldEnd,
                       nsIAccessiblePivot::REASON_TEXT);
@@ -183,17 +183,17 @@ nsAccessiblePivot::SetTextRange(nsIAcces
   return NS_OK;
 }
 
 // Traversal functions
 
 NS_IMETHODIMP
 nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule,
                             nsIAccessible* aAnchor, bool aIncludeStart,
-                            PRUint8 aArgc, bool* aResult)
+                            uint8_t aArgc, bool* aResult)
 {
   NS_ENSURE_ARG(aResult);
   NS_ENSURE_ARG(aRule);
 
   *aResult = false;
 
   nsRefPtr<Accessible> anchor =
     (aArgc > 0) ? do_QueryObject(aAnchor) : mPosition;
@@ -210,17 +210,17 @@ nsAccessiblePivot::MoveNext(nsIAccessibl
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessiblePivot::MovePrevious(nsIAccessibleTraversalRule* aRule,
                                 nsIAccessible* aAnchor,
                                 bool aIncludeStart,
-                                PRUint8 aArgc, bool* aResult)
+                                uint8_t aArgc, bool* aResult)
 {
   NS_ENSURE_ARG(aResult);
   NS_ENSURE_ARG(aRule);
 
   *aResult = false;
 
   nsRefPtr<Accessible> anchor =
     (aArgc > 0) ? do_QueryObject(aAnchor) : mPosition;
@@ -304,42 +304,42 @@ nsAccessiblePivot::MovePreviousByText(Te
 
   *aResult = false;
 
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
-                               PRInt32 aX, PRInt32 aY, bool aIgnoreNoMatch,
+                               int32_t aX, int32_t aY, bool aIgnoreNoMatch,
                                bool* aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);
   NS_ENSURE_ARG_POINTER(aRule);
 
   *aResult = false;
 
   if (mRoot && mRoot->IsDefunct())
     return NS_ERROR_NOT_IN_TREE;
 
   RuleCache cache(aRule);
   Accessible* match = nullptr;
   Accessible* child = mRoot->ChildAtPoint(aX, aY, Accessible::eDeepestChild);
   while (child && mRoot != child) {
-    PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
+    uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
     nsresult rv = cache.ApplyFilter(child, &filtered);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Ignore any matching nodes that were below this one
     if (filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE)
       match = nullptr;
 
     // Match if no node below this is a match
     if ((filtered & nsIAccessibleTraversalRule::FILTER_MATCH) && !match) {
-      PRInt32 childX, childY, childWidth, childHeight;
+      int32_t childX, childY, childWidth, childHeight;
       child->GetBounds(&childX, &childY, &childWidth, &childHeight);
       // Double-check child's bounds since the deepest child may have been out
       // of bounds. This assures we don't return a false positive.
       if (aX >= childX && aX < childX + childWidth &&
           aY >= childY && aY < childY + childHeight)
         match = child;
     }
 
@@ -391,17 +391,17 @@ nsAccessiblePivot::IsRootDescendant(Acce
 }
 
 bool
 nsAccessiblePivot::MovePivotInternal(Accessible* aPosition,
                                      PivotMoveReason aReason)
 {
   nsRefPtr<Accessible> oldPosition = mPosition.forget();
   mPosition = aPosition;
-  PRInt32 oldStart = mStartOffset, oldEnd = mEndOffset;
+  int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
   mStartOffset = mEndOffset = -1;
 
   return NotifyOfPivotChange(oldPosition, oldStart, oldEnd, aReason);
 }
 
 Accessible*
 nsAccessiblePivot::SearchBackward(Accessible* aAccessible,
                                   nsIAccessibleTraversalRule* aRule,
@@ -412,28 +412,28 @@ nsAccessiblePivot::SearchBackward(Access
 
   // Initial position could be unset, in that case return null.
   if (!aAccessible)
     return nullptr;
 
   RuleCache cache(aRule);
   Accessible* accessible = aAccessible;
 
-  PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
+  uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
 
   if (aSearchCurrent) {
     *aResult = cache.ApplyFilter(accessible, &filtered);
     NS_ENSURE_SUCCESS(*aResult, nullptr);
     if (filtered & nsIAccessibleTraversalRule::FILTER_MATCH)
       return accessible;
   }
 
   while (accessible != mRoot) {
     Accessible* parent = accessible->Parent();
-    PRInt32 idxInParent = accessible->IndexInParent();
+    int32_t idxInParent = accessible->IndexInParent();
     while (idxInParent > 0) {
       if (!(accessible = parent->GetChildAt(--idxInParent)))
         continue;
 
       *aResult = cache.ApplyFilter(accessible, &filtered);
       NS_ENSURE_SUCCESS(*aResult, nullptr);
 
       Accessible* lastChild = nullptr;
@@ -471,17 +471,17 @@ nsAccessiblePivot::SearchForward(Accessi
 {
   *aResult = NS_OK;
 
   // Initial position could be not set, in that case begin search from root.
   Accessible* accessible = (!aAccessible) ? mRoot.get() : aAccessible;
 
   RuleCache cache(aRule);
 
-  PRUint16 filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
+  uint16_t filtered = nsIAccessibleTraversalRule::FILTER_IGNORE;
   *aResult = cache.ApplyFilter(accessible, &filtered);
   NS_ENSURE_SUCCESS(*aResult, nullptr);
   if (aSearchCurrent && (filtered & nsIAccessibleTraversalRule::FILTER_MATCH))
     return accessible;
 
   while (true) {
     Accessible* firstChild = nullptr;
     while (!(filtered & nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE) &&
@@ -517,64 +517,64 @@ nsAccessiblePivot::SearchForward(Accessi
       return accessible;
   }
 
   return nullptr;
 }
 
 bool
 nsAccessiblePivot::NotifyOfPivotChange(Accessible* aOldPosition,
-                                       PRInt32 aOldStart, PRInt32 aOldEnd,
-                                       PRInt16 aReason)
+                                       int32_t aOldStart, int32_t aOldEnd,
+                                       int16_t aReason)
 {
   if (aOldPosition == mPosition &&
       aOldStart == mStartOffset && aOldEnd == mEndOffset)
     return false;
 
   nsTObserverArray<nsCOMPtr<nsIAccessiblePivotObserver> >::ForwardIterator iter(mObservers);
   while (iter.HasMore()) {
     nsIAccessiblePivotObserver* obs = iter.GetNext();
     obs->OnPivotChanged(this, aOldPosition, aOldStart, aOldEnd, aReason);
   }
 
   return true;
 }
 
 nsresult
-RuleCache::ApplyFilter(Accessible* aAccessible, PRUint16* aResult)
+RuleCache::ApplyFilter(Accessible* aAccessible, uint16_t* aResult)
 {
   *aResult = nsIAccessibleTraversalRule::FILTER_IGNORE;
 
   if (!mAcceptRoles) {
     nsresult rv = mRule->GetMatchRoles(&mAcceptRoles, &mAcceptRolesLength);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = mRule->GetPreFilter(&mPreFilter);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   if (mPreFilter) {
-    PRUint64 state = aAccessible->State();
+    uint64_t state = aAccessible->State();
 
     if ((nsIAccessibleTraversalRule::PREFILTER_INVISIBLE & mPreFilter) &&
         (state & states::INVISIBLE))
       return NS_OK;
 
     if ((nsIAccessibleTraversalRule::PREFILTER_OFFSCREEN & mPreFilter) &&
         (state & states::OFFSCREEN))
       return NS_OK;
 
     if ((nsIAccessibleTraversalRule::PREFILTER_NOT_FOCUSABLE & mPreFilter) &&
         !(state & states::FOCUSABLE))
       return NS_OK;
   }
 
   if (mAcceptRolesLength > 0) {
-    PRUint32 accessibleRole = aAccessible->Role();
+    uint32_t accessibleRole = aAccessible->Role();
     bool matchesRole = false;
-    for (PRUint32 idx = 0; idx < mAcceptRolesLength; idx++) {
+    for (uint32_t idx = 0; idx < mAcceptRolesLength; idx++) {
       matchesRole = mAcceptRoles[idx] == accessibleRole;
       if (matchesRole)
         break;
     }
     if (!matchesRole)
       return NS_OK;
   }
 
--- a/accessible/src/base/nsAccessiblePivot.h
+++ b/accessible/src/base/nsAccessiblePivot.h
@@ -40,17 +40,17 @@ private:
   nsAccessiblePivot(const nsAccessiblePivot&) MOZ_DELETE;
   void operator = (const nsAccessiblePivot&) MOZ_DELETE;
 
   /*
    * Notify all observers on a pivot change. Return true if it has changed and
    * observers have been notified.
    */
   bool NotifyOfPivotChange(Accessible* aOldAccessible,
-                           PRInt32 aOldStart, PRInt32 aOldEnd,
+                           int32_t aOldStart, int32_t aOldEnd,
                            PivotMoveReason aReason);
 
   /*
    * Check to see that the given accessible is in the pivot's subtree.
    */
   bool IsRootDescendant(Accessible* aAccessible);
 
 
@@ -83,22 +83,22 @@ private:
   /*
    * The current pivot position.
    */
   nsRefPtr<Accessible> mPosition;
 
   /*
    * The text start offset ofthe pivot.
    */
-  PRInt32 mStartOffset;
+  int32_t mStartOffset;
 
   /*
    * The text end offset ofthe pivot.
    */
-  PRInt32 mEndOffset;
+  int32_t mEndOffset;
 
   /*
    * The list of pivot-changed observers.
    */
   nsTObserverArray<nsCOMPtr<nsIAccessiblePivotObserver> > mObservers;
 };
 
 #endif
--- a/accessible/src/base/nsCaretAccessible.cpp
+++ b/accessible/src/base/nsCaretAccessible.cpp
@@ -168,17 +168,17 @@ nsCaretAccessible::RemoveDocSelectionLis
   NS_ENSURE_TRUE(selPrivate, NS_ERROR_FAILURE);
 
   return selPrivate->RemoveSelectionListener(this);
 }
 
 NS_IMETHODIMP
 nsCaretAccessible::NotifySelectionChanged(nsIDOMDocument* aDOMDocument,
                                           nsISelection* aSelection,
-                                          PRInt16 aReason)
+                                          int16_t aReason)
 {
   NS_ENSURE_ARG(aDOMDocument);
   NS_ENSURE_STATE(mRootAccessible);
 
   nsCOMPtr<nsIDocument> documentNode(do_QueryInterface(aDOMDocument));
   DocAccessible* document = GetAccService()->GetDocAccessible(documentNode);
 
 #ifdef DEBUG
@@ -199,50 +199,50 @@ nsCaretAccessible::NotifySelectionChange
   return NS_OK;
 }
 
 void
 nsCaretAccessible::ProcessSelectionChanged(nsISelection* aSelection)
 {
   nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(aSelection));
 
-  PRInt16 type = 0;
+  int16_t type = 0;
   privSel->GetType(&type);
 
   if (type == nsISelectionController::SELECTION_NORMAL)
     NormalSelectionChanged(aSelection);
 
   else if (type == nsISelectionController::SELECTION_SPELLCHECK)
     SpellcheckSelectionChanged(aSelection);
 }
 
 void
 nsCaretAccessible::NormalSelectionChanged(nsISelection* aSelection)
 {
   mLastUsedSelection = do_GetWeakReference(aSelection);
 
-  PRInt32 rangeCount = 0;
+  int32_t rangeCount = 0;
   aSelection->GetRangeCount(&rangeCount);
   if (rangeCount == 0) {
     mLastTextAccessible = nullptr;
     return; // No selection
   }
 
   HyperTextAccessible* textAcc =
     nsAccUtils::GetTextAccessibleFromSelection(aSelection);
   if (!textAcc)
     return;
 
-  PRInt32 caretOffset = -1;
+  int32_t caretOffset = -1;
   nsresult rv = textAcc->GetCaretOffset(&caretOffset);
   if (NS_FAILED(rv))
     return;
 
   if (textAcc == mLastTextAccessible && caretOffset == mLastCaretOffset) {
-    PRInt32 selectionCount = 0;
+    int32_t selectionCount = 0;
     textAcc->GetSelectionCount(&selectionCount);   // Don't swallow similar events when selecting text
     if (!selectionCount)
       return;  // Swallow duplicate caret event
   }
 
   mLastCaretOffset = caretOffset;
   mLastTextAccessible = textAcc;
 
@@ -317,17 +317,17 @@ nsCaretAccessible::GetCaretRect(nsIWidge
 
   caretRect = rect.ToOutsidePixels(frame->PresContext()->AppUnitsPerDevPixel());
   // ((content screen origin) - (content offset in the widget)) = widget origin on the screen
   caretRect.MoveBy((*aOutWidget)->WidgetToScreenOffset() - (*aOutWidget)->GetClientOffset());
 
   // Correct for character size, so that caret always matches the size of the character
   // This is important for font size transitions, and is necessary because the Gecko caret uses the
   // previous character's size as the user moves forward in the text by character.
-  PRInt32 charX, charY, charWidth, charHeight;
+  int32_t charX, charY, charWidth, charHeight;
   if (NS_SUCCEEDED(mLastTextAccessible->GetCharacterExtents(mLastCaretOffset, &charX, &charY,
                                                             &charWidth, &charHeight,
                                                             nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE))) {
     caretRect.height -= charY - caretRect.y;
     caretRect.y = charY;
   }
 
   return caretRect;
--- a/accessible/src/base/nsCaretAccessible.h
+++ b/accessible/src/base/nsCaretAccessible.h
@@ -113,14 +113,14 @@ private:
   // Currently focused control.
   nsCOMPtr<nsIContent> mCurrentControl;
 
   // Info for the the last selection event.
   // If it was on a control, then its control's selection. Otherwise, it's for
   // a document where the selection changed.
   nsCOMPtr<nsIWeakReference> mLastUsedSelection; // Weak ref to nsISelection
   nsRefPtr<HyperTextAccessible> mLastTextAccessible;
-  PRInt32 mLastCaretOffset;
+  int32_t mLastCaretOffset;
 
   mozilla::a11y::RootAccessible* mRootAccessible;
 };
 
 #endif
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -52,17 +52,17 @@ nsCoreUtils::HasClickListener(nsIContent
   return listenerManager &&
     (listenerManager->HasListenersFor(NS_LITERAL_STRING("click")) ||
      listenerManager->HasListenersFor(NS_LITERAL_STRING("mousedown")) ||
      listenerManager->HasListenersFor(NS_LITERAL_STRING("mouseup")));
 }
 
 void
 nsCoreUtils::DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
-                                PRInt32 aRowIndex, nsITreeColumn *aColumn,
+                                int32_t aRowIndex, nsITreeColumn *aColumn,
                                 const nsCString& aPseudoElt)
 {
   nsCOMPtr<nsIDOMElement> tcElm;
   aTreeBoxObj->GetTreeBody(getter_AddRefs(tcElm));
   if (!tcElm)
     return;
 
   nsCOMPtr<nsIContent> tcContent(do_QueryInterface(tcElm));
@@ -74,57 +74,57 @@ nsCoreUtils::DispatchClickEvent(nsITreeB
   presShell = document->GetShell();
   if (!presShell)
     return;
 
   // Ensure row is visible.
   aTreeBoxObj->EnsureRowIsVisible(aRowIndex);
 
   // Calculate x and y coordinates.
-  PRInt32 x = 0, y = 0, width = 0, height = 0;
+  int32_t x = 0, y = 0, width = 0, height = 0;
   nsresult rv = aTreeBoxObj->GetCoordsForCellItem(aRowIndex, aColumn,
                                                   aPseudoElt,
                                                   &x, &y, &width, &height);
   if (NS_FAILED(rv))
     return;
 
   nsCOMPtr<nsIDOMXULElement> tcXULElm(do_QueryInterface(tcElm));
   nsCOMPtr<nsIBoxObject> tcBoxObj;
   tcXULElm->GetBoxObject(getter_AddRefs(tcBoxObj));
 
-  PRInt32 tcX = 0;
+  int32_t tcX = 0;
   tcBoxObj->GetX(&tcX);
 
-  PRInt32 tcY = 0;
+  int32_t tcY = 0;
   tcBoxObj->GetY(&tcY);
 
   // Dispatch mouse events.
   nsIFrame* tcFrame = tcContent->GetPrimaryFrame();
   nsIFrame* rootFrame = presShell->GetRootFrame();
 
   nsPoint offset;
   nsIWidget *rootWidget =
     rootFrame->GetViewExternal()->GetNearestWidget(&offset);
 
   nsPresContext* presContext = presShell->GetPresContext();
 
-  PRInt32 cnvdX = presContext->CSSPixelsToDevPixels(tcX + x + 1) +
+  int32_t cnvdX = presContext->CSSPixelsToDevPixels(tcX + x + 1) +
     presContext->AppUnitsToDevPixels(offset.x);
-  PRInt32 cnvdY = presContext->CSSPixelsToDevPixels(tcY + y + 1) +
+  int32_t cnvdY = presContext->CSSPixelsToDevPixels(tcY + y + 1) +
     presContext->AppUnitsToDevPixels(offset.y);
 
   DispatchMouseEvent(NS_MOUSE_BUTTON_DOWN, cnvdX, cnvdY,
                      tcContent, tcFrame, presShell, rootWidget);
 
   DispatchMouseEvent(NS_MOUSE_BUTTON_UP, cnvdX, cnvdY,
                      tcContent, tcFrame, presShell, rootWidget);
 }
 
 bool
-nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType,
+nsCoreUtils::DispatchMouseEvent(uint32_t aEventType,
                                 nsIPresShell *aPresShell,
                                 nsIContent *aContent)
 {
   nsIFrame *frame = aContent->GetPrimaryFrame();
   if (!frame)
     return false;
 
   // Compute x and y coordinates.
@@ -132,43 +132,43 @@ nsCoreUtils::DispatchMouseEvent(PRUint32
   nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget(point);
   if (!widget)
     return false;
 
   nsSize size = frame->GetSize();
 
   nsPresContext* presContext = aPresShell->GetPresContext();
 
-  PRInt32 x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
-  PRInt32 y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);
+  int32_t x = presContext->AppUnitsToDevPixels(point.x + size.width / 2);
+  int32_t y = presContext->AppUnitsToDevPixels(point.y + size.height / 2);
 
   // Fire mouse event.
   DispatchMouseEvent(aEventType, x, y, aContent, frame, aPresShell, widget);
   return true;
 }
 
 void
-nsCoreUtils::DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
+nsCoreUtils::DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
                                 nsIContent *aContent, nsIFrame *aFrame,
                                 nsIPresShell *aPresShell, nsIWidget *aRootWidget)
 {
   nsMouseEvent event(true, aEventType, aRootWidget,
                      nsMouseEvent::eReal, nsMouseEvent::eNormal);
 
   event.refPoint = nsIntPoint(aX, aY);
 
   event.clickCount = 1;
   event.button = nsMouseEvent::eLeftButton;
   event.time = PR_IntervalNow();
 
   nsEventStatus status = nsEventStatus_eIgnore;
   aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status);
 }
 
-PRUint32
+uint32_t
 nsCoreUtils::GetAccessKeyFor(nsIContent *aContent)
 {
   if (!aContent)
     return 0;
 
   // Accesskeys are registered by @accesskey attribute only. At first check
   // whether it is presented on the given element to avoid the slow
   // nsEventStateManager::GetRegisteredAccessKey() method.
@@ -198,20 +198,20 @@ nsCoreUtils::GetDOMElementFor(nsIContent
 
   if (aContent->IsNodeOfType(nsINode::eTEXT))
     return aContent->GetParent();
 
   return nullptr;
 }
 
 nsINode *
-nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, PRUint32 aOffset)
+nsCoreUtils::GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset)
 {
   if (aNode && aNode->IsElement()) {
-    PRUint32 childCount = aNode->GetChildCount();
+    uint32_t childCount = aNode->GetChildCount();
     NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!");
 
     // The offset can be after last child of container node that means DOM point
     // is placed immediately after the last child. In this case use the DOM node
     // from the given DOM point is used as result node.
     if (aOffset != childCount)
       return aNode->GetChildAt(aOffset);
   }
@@ -257,17 +257,17 @@ nsCoreUtils::IsAncestorOf(nsINode *aPoss
       return true;
   }
 
   return false;
 }
 
 nsresult
 nsCoreUtils::ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange,
-                               PRUint32 aScrollType)
+                               uint32_t aScrollType)
 {
   nsIPresShell::ScrollAxis vertical, horizontal;
   ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
 
   return ScrollSubstringTo(aFrame, aRange, vertical, horizontal);
 }
 
 nsresult
@@ -308,35 +308,35 @@ nsCoreUtils::ScrollFrameToPoint(nsIFrame
 {
   nsIScrollableFrame *scrollableFrame = do_QueryFrame(aScrollableFrame);
   if (!scrollableFrame)
     return;
 
   nsPresContext *presContext = aFrame->PresContext();
 
   nsIntRect frameRect = aFrame->GetScreenRectExternal();
-  PRInt32 devDeltaX = aPoint.x - frameRect.x;
-  PRInt32 devDeltaY = aPoint.y - frameRect.y;
+  int32_t devDeltaX = aPoint.x - frameRect.x;
+  int32_t devDeltaY = aPoint.y - frameRect.y;
 
   nsPoint deltaPoint;
   deltaPoint.x = presContext->DevPixelsToAppUnits(devDeltaX);
   deltaPoint.y = presContext->DevPixelsToAppUnits(devDeltaY);
 
   nsPoint scrollPoint = scrollableFrame->GetScrollPosition();
   scrollPoint -= deltaPoint;
 
   scrollableFrame->ScrollTo(scrollPoint, nsIScrollableFrame::INSTANT);
 }
 
 void
-nsCoreUtils::ConvertScrollTypeToPercents(PRUint32 aScrollType,
+nsCoreUtils::ConvertScrollTypeToPercents(uint32_t aScrollType,
                                          nsIPresShell::ScrollAxis *aVertical,
                                          nsIPresShell::ScrollAxis *aHorizontal)
 {
-  PRInt16 whereY, whereX;
+  int16_t whereY, whereX;
   nsIPresShell::WhenToScroll whenY, whenX;
   switch (aScrollType)
   {
     case nsIAccessibleScrollType::SCROLL_TYPE_TOP_LEFT:
       whereY = nsIPresShell::SCROLL_TOP;
       whenY  = nsIPresShell::SCROLL_ALWAYS;
       whereX = nsIPresShell::SCROLL_LEFT;
       whenX  = nsIPresShell::SCROLL_ALWAYS;
@@ -436,17 +436,17 @@ nsCoreUtils::IsRootDocument(nsIDocument 
 bool
 nsCoreUtils::IsContentDocument(nsIDocument *aDocument)
 {
   nsCOMPtr<nsISupports> container = aDocument->GetContainer();
   nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
     do_QueryInterface(container);
   NS_ASSERTION(docShellTreeItem, "No document shell tree item for document!");
 
-  PRInt32 contentType;
+  int32_t contentType;
   docShellTreeItem->GetItemType(&contentType);
   return (contentType == nsIDocShellTreeItem::typeContent);
 }
 
 bool
 nsCoreUtils::IsTabDocument(nsIDocument* aDocumentNode)
 {
   nsCOMPtr<nsISupports> container = aDocumentNode->GetContainer();
@@ -507,23 +507,23 @@ nsCoreUtils::GetDOMNodeForContainer(nsID
 bool
 nsCoreUtils::GetID(nsIContent *aContent, nsAString& aID)
 {
   nsIAtom *idAttribute = aContent->GetIDAttributeName();
   return idAttribute ? aContent->GetAttr(kNameSpaceID_None, idAttribute, aID) : false;
 }
 
 bool
-nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr, PRInt32 *aUInt)
+nsCoreUtils::GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr, int32_t *aUInt)
 {
   nsAutoString value;
   aContent->GetAttr(kNameSpaceID_None, aAttr, value);
   if (!value.IsEmpty()) {
     nsresult error = NS_OK;
-    PRInt32 integer = value.ToInteger(&error);
+    int32_t integer = value.ToInteger(&error);
     if (NS_SUCCEEDED(error) && integer > 0) {
       *aUInt = integer;
       return true;
     }
   }
 
   return false;
 }
@@ -600,20 +600,20 @@ nsCoreUtils::GetFirstSensibleColumn(nsIT
   nsCOMPtr<nsITreeColumn> column;
   cols->GetFirstColumn(getter_AddRefs(column));
   if (column && IsColumnHidden(column))
     return GetNextSensibleColumn(column);
 
   return column.forget();
 }
 
-PRUint32
+uint32_t
 nsCoreUtils::GetSensibleColumnCount(nsITreeBoxObject *aTree)
 {
-  PRUint32 count = 0;
+  uint32_t count = 0;
 
   nsCOMPtr<nsITreeColumns> cols;
   aTree->GetColumns(getter_AddRefs(cols));
   if (!cols)
     return count;
 
   nsCOMPtr<nsITreeColumn> column;
   cols->GetFirstColumn(getter_AddRefs(column));
@@ -626,19 +626,19 @@ nsCoreUtils::GetSensibleColumnCount(nsIT
     column->GetNext(getter_AddRefs(nextColumn));
     column.swap(nextColumn);
   }
 
   return count;
 }
 
 already_AddRefed<nsITreeColumn>
-nsCoreUtils::GetSensibleColumnAt(nsITreeBoxObject *aTree, PRUint32 aIndex)
+nsCoreUtils::GetSensibleColumnAt(nsITreeBoxObject *aTree, uint32_t aIndex)
 {
-  PRUint32 idx = aIndex;
+  uint32_t idx = aIndex;
 
   nsCOMPtr<nsITreeColumn> column = GetFirstSensibleColumn(aTree);
   while (column) {
     if (idx == 0)
       return column.forget();
 
     idx--;
     column = GetNextSensibleColumn(column);
@@ -684,44 +684,44 @@ nsCoreUtils::IsColumnHidden(nsITreeColum
   aColumn->GetElement(getter_AddRefs(element));
   nsCOMPtr<nsIContent> content = do_QueryInterface(element);
   return content->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
                               nsGkAtoms::_true, eCaseMatters);
 }
 
 void
 nsCoreUtils::ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
-                      PRUint32 aScrollType)
+                      uint32_t aScrollType)
 {
   nsIPresShell::ScrollAxis vertical, horizontal;
   ConvertScrollTypeToPercents(aScrollType, &vertical, &horizontal);
   aPresShell->ScrollContentIntoView(aContent, vertical, horizontal,
                                     nsIPresShell::SCROLL_OVERFLOW_HIDDEN);
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibleDOMStringList
 ////////////////////////////////////////////////////////////////////////////////
 
 NS_IMPL_ISUPPORTS1(nsAccessibleDOMStringList, nsIDOMDOMStringList)
 
 NS_IMETHODIMP
-nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult)
+nsAccessibleDOMStringList::Item(uint32_t aIndex, nsAString& aResult)
 {
   if (aIndex >= mNames.Length())
     SetDOMStringToNull(aResult);
   else
     aResult = mNames.ElementAt(aIndex);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsAccessibleDOMStringList::GetLength(PRUint32* aLength)
+nsAccessibleDOMStringList::GetLength(uint32_t* aLength)
 {
   *aLength = mNames.Length();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessibleDOMStringList::Contains(const nsAString& aString, bool* aResult)
--- a/accessible/src/base/nsCoreUtils.h
+++ b/accessible/src/base/nsCoreUtils.h
@@ -40,68 +40,68 @@ public:
    *
    * @param  aTreeBoxObj  [in] tree box object
    * @param  aRowIndex    [in] row index
    * @param  aColumn      [in] column object
    * @param  aPseudoElm   [in] pseudo elemenet inside the cell, see
    *                       nsITreeBoxObject for available values
    */
   static void DispatchClickEvent(nsITreeBoxObject *aTreeBoxObj,
-                                 PRInt32 aRowIndex, nsITreeColumn *aColumn,
+                                 int32_t aRowIndex, nsITreeColumn *aColumn,
                                  const nsCString& aPseudoElt = EmptyCString());
 
   /**
    * Send mouse event to the given element.
    *
    * @param  aEventType  [in] an event type (see nsGUIEvent.h for constants)
    * @param  aPresShell  [in] the presshell for the given element
    * @param  aContent    [in] the element
    */
-  static bool DispatchMouseEvent(PRUint32 aEventType,
+  static bool DispatchMouseEvent(uint32_t aEventType,
                                    nsIPresShell *aPresShell,
                                    nsIContent *aContent);
 
   /**
    * Send mouse event to the given element.
    *
    * @param aEventType   [in] an event type (see nsGUIEvent.h for constants)
    * @param aX           [in] x coordinate in dev pixels
    * @param aY           [in] y coordinate in dev pixels
    * @param aContent     [in] the element
    * @param aFrame       [in] frame of the element
    * @param aPresShell   [in] the presshell for the element
    * @param aRootWidget  [in] the root widget of the element
    */
-  static void DispatchMouseEvent(PRUint32 aEventType, PRInt32 aX, PRInt32 aY,
+  static void DispatchMouseEvent(uint32_t aEventType, int32_t aX, int32_t aY,
                                  nsIContent *aContent, nsIFrame *aFrame,
                                  nsIPresShell *aPresShell,
                                  nsIWidget *aRootWidget);
 
   /**
    * Return an accesskey registered on the given element by
    * nsEventStateManager or 0 if there is no registered accesskey.
    *
    * @param aContent - the given element.
    */
-  static PRUint32 GetAccessKeyFor(nsIContent *aContent);
+  static uint32_t GetAccessKeyFor(nsIContent *aContent);
 
   /**
    * Return DOM element related with the given node, i.e.
    * a) itself if it is DOM element
    * b) parent element if it is text node
    * c) otherwise nullptr
    *
    * @param aNode  [in] the given DOM node
    */
   static nsIContent* GetDOMElementFor(nsIContent *aContent);
 
   /**
    * Return DOM node for the given DOM point.
    */
-  static nsINode *GetDOMNodeFromDOMPoint(nsINode *aNode, PRUint32 aOffset);
+  static nsINode *GetDOMNodeFromDOMPoint(nsINode *aNode, uint32_t aOffset);
 
   /**
    * Return the nsIContent* to check for ARIA attributes on -- this may not
    * always be the DOM node for the accessible. Specifically, for doc
    * accessibles, it is not the document node, but either the root element or
    * <body> in HTML.
    *
    * @param aNode  [in] DOM node for the accessible that may be affected by ARIA
@@ -130,17 +130,17 @@ public:
    * Helper method to scroll range into view, used for implementation of
    * nsIAccessibleText::scrollSubstringTo().
    *
    * @param aFrame        the frame for accessible the range belongs to.
    * @param aRange    the range to scroll to
    * @param aScrollType   the place a range should be scrolled to
    */
   static nsresult ScrollSubstringTo(nsIFrame* aFrame, nsRange* aRange,
-                                    PRUint32 aScrollType);
+                                    uint32_t aScrollType);
 
   /** Helper method to scroll range into view, used for implementation of
    * nsIAccessibleText::scrollSubstringTo[Point]().
    *
    * @param aFrame        the frame for accessible the range belongs to.
    * @param aRange    the range to scroll to
    * @param aVertical     how to align vertically, specified in percents, and when.
    * @param aHorizontal     how to align horizontally, specified in percents, and when.
@@ -159,17 +159,17 @@ public:
    */
   static void ScrollFrameToPoint(nsIFrame *aScrollableFrame,
                                  nsIFrame *aFrame, const nsIntPoint& aPoint);
 
   /**
    * Converts scroll type constant defined in nsIAccessibleScrollType to
    * vertical and horizontal parameters.
    */
-  static void ConvertScrollTypeToPercents(PRUint32 aScrollType,
+  static void ConvertScrollTypeToPercents(uint32_t aScrollType,
                                           nsIPresShell::ScrollAxis *aVertical,
                                           nsIPresShell::ScrollAxis *aHorizontal);
 
   /**
    * Returns coordinates relative screen for the top level window.
    *
    * @param aNode  the DOM node hosted in the window.
    */
@@ -223,17 +223,17 @@ public:
    */
   static bool GetID(nsIContent *aContent, nsAString& aID);
 
   /**
    * Convert attribute value of the given node to positive integer. If no
    * attribute or wrong value then false is returned.
    */
   static bool GetUIntAttr(nsIContent *aContent, nsIAtom *aAttr,
-                            PRInt32 *aUInt);
+                            int32_t *aUInt);
 
   /**
    * Check if the given element is XLink.
    *
    * @param aContent  the given element
    * @return          true if the given element is XLink
    */
   static bool IsXLink(nsIContent *aContent);
@@ -264,23 +264,23 @@ public:
    * Return first sensible column for the given tree box object.
    */
   static already_AddRefed<nsITreeColumn>
     GetFirstSensibleColumn(nsITreeBoxObject *aTree);
 
   /**
    * Return sensible columns count for the given tree box object.
    */
-  static PRUint32 GetSensibleColumnCount(nsITreeBoxObject *aTree);
+  static uint32_t GetSensibleColumnCount(nsITreeBoxObject *aTree);
 
   /**
    * Return sensible column at the given index for the given tree box object.
    */
   static already_AddRefed<nsITreeColumn>
-    GetSensibleColumnAt(nsITreeBoxObject *aTree, PRUint32 aIndex);
+    GetSensibleColumnAt(nsITreeBoxObject *aTree, uint32_t aIndex);
 
   /**
    * Return next sensible column for the given column.
    */
   static already_AddRefed<nsITreeColumn>
     GetNextSensibleColumn(nsITreeColumn *aColumn);
 
   /**
@@ -293,17 +293,17 @@ public:
    * Return true if the given column is hidden (i.e. not sensible).
    */
   static bool IsColumnHidden(nsITreeColumn *aColumn);
 
   /**
    * Scroll content into view.
    */
   static void ScrollTo(nsIPresShell* aPresShell, nsIContent* aContent,
-                       PRUint32 aScrollType);
+                       uint32_t aScrollType);
 
   /**
    * Return true if the given node is table header element.
    */
   static bool IsHTMLTableHeader(nsIContent *aContent)
   {
     return aContent->NodeInfo()->Equals(nsGkAtoms::th) ||
       aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::scope);
--- a/accessible/src/base/nsEventShell.cpp
+++ b/accessible/src/base/nsEventShell.cpp
@@ -27,17 +27,17 @@ nsEventShell::FireEvent(AccEvent* aEvent
   }
 
   accessible->HandleAccEvent(aEvent);
 
   sEventTargetNode = nullptr;
 }
 
 void
-nsEventShell::FireEvent(PRUint32 aEventType, Accessible* aAccessible,
+nsEventShell::FireEvent(uint32_t aEventType, Accessible* aAccessible,
                         EIsFromUserInput aIsFromUserInput)
 {
   NS_ENSURE_TRUE(aAccessible,);
 
   nsRefPtr<AccEvent> event = new AccEvent(aEventType, aAccessible,
                                           aIsFromUserInput);
 
   FireEvent(event);
--- a/accessible/src/base/nsEventShell.h
+++ b/accessible/src/base/nsEventShell.h
@@ -23,17 +23,17 @@ public:
   static void FireEvent(AccEvent* aEvent);
 
   /**
    * Fire accessible event of the given type for the given accessible.
    *
    * @param  aEventType   [in] the event type
    * @param  aAccessible  [in] the event target
    */
-  static void FireEvent(PRUint32 aEventType, Accessible* aAccessible,
+  static void FireEvent(uint32_t aEventType, Accessible* aAccessible,
                         EIsFromUserInput aIsFromUserInput = eAutoDetect);
 
   /**
    * Append 'event-from-input' object attribute if the accessible event has
    * been fired just now for the given node.
    *
    * @param  aNode        [in] the DOM node
    * @param  aAttributes  [in, out] the attributes
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -166,18 +166,18 @@ nsTextEquivUtils::AppendTextEquivFromTex
 nsRefPtr<Accessible> nsTextEquivUtils::gInitiatorAcc;
 
 nsresult
 nsTextEquivUtils::AppendFromAccessibleChildren(Accessible* aAccessible,
                                                nsAString *aString)
 {
   nsresult rv = NS_OK_NO_NAME_CLAUSE_HANDLED;
 
-  PRUint32 childCount = aAccessible->ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  uint32_t childCount = aAccessible->ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = aAccessible->GetChildAt(childIdx);
     rv = AppendFromAccessible(child, aString);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return rv;
 }
 
@@ -207,17 +207,17 @@ nsTextEquivUtils::AppendFromAccessible(A
 
   if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
     isEmptyTextEquiv = false;
 
   // Implementation of g) step of text equivalent computation guide. Go down
   // into subtree if accessible allows "text equivalent from subtree rule" or
   // it's not root and not control.
   if (isEmptyTextEquiv) {
-    PRUint32 nameRule = GetRoleRule(aAccessible->Role());
+    uint32_t nameRule = GetRoleRule(aAccessible->Role());
     if (nameRule & eFromSubtreeIfRec) {
       rv = AppendFromAccessibleChildren(aAccessible, aString);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED)
         isEmptyTextEquiv = false;
     }
   }
@@ -356,17 +356,17 @@ nsTextEquivUtils::IsWhitespaceString(con
 
 bool
 nsTextEquivUtils::IsWhitespace(PRUnichar aChar)
 {
   return aChar == ' ' || aChar == '\n' ||
     aChar == '\r' || aChar == '\t' || aChar == 0xa0;
 }
 
-PRUint32 
+uint32_t 
 nsTextEquivUtils::GetRoleRule(role aRole)
 {
 #define ROLE(geckoRole, stringRole, atkRole, \
              macRole, msaaRole, ia2Role, nameRule) \
   case roles::geckoRole: \
     return nameRule;
 
   switch (aRole) {
--- a/accessible/src/base/nsTextEquivUtils.h
+++ b/accessible/src/base/nsTextEquivUtils.h
@@ -138,17 +138,17 @@ private:
   /**
    * Returns true if the given character is whitespace symbol.
    */
   static bool IsWhitespace(PRUnichar aChar);
 
   /**
    * Returns the rule (constant of ETextEquivRule) for a given role.
    */
-  static PRUint32 GetRoleRule(mozilla::a11y::roles::Role aRole);
+  static uint32_t GetRoleRule(mozilla::a11y::roles::Role aRole);
 
   /**
    * The accessible for which we are computing a text equivalent. It is useful
    * for bailing out during recursive text computation, or for special cases
    * like step f. of the ARIA implementation guide.
    */
   static nsRefPtr<Accessible> gInitiatorAcc;
 };
--- a/accessible/src/generic/ARIAGridAccessible.cpp
+++ b/accessible/src/generic/ARIAGridAccessible.cpp
@@ -46,57 +46,57 @@ ARIAGridAccessible::Shutdown()
 {
   mTable = nullptr;
   AccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleTable
 
-PRUint32
+uint32_t
 ARIAGridAccessible::ColCount()
 {
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = rowIter.Next();
   if (!row)
     return 0;
 
   AccIterator cellIter(row, filters::GetCell);
   Accessible* cell = nullptr;
 
-  PRUint32 colCount = 0;
+  uint32_t colCount = 0;
   while ((cell = cellIter.Next()))
     colCount++;
 
   return colCount;
 }
 
-PRUint32
+uint32_t
 ARIAGridAccessible::RowCount()
 {
-  PRUint32 rowCount = 0;
+  uint32_t rowCount = 0;
   AccIterator rowIter(this, filters::GetRow);
   while (rowIter.Next())
     rowCount++;
 
   return rowCount;
 }
 
 Accessible*
-ARIAGridAccessible::CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex)
+ARIAGridAccessible::CellAt(uint32_t aRowIndex, uint32_t aColumnIndex)
 { 
   Accessible* row = GetRowAt(aRowIndex);
   if (!row)
     return nullptr;
 
   return GetCellInRowAt(row, aColumnIndex);
 }
 
 bool
-ARIAGridAccessible::IsColSelected(PRUint32 aColIdx)
+ARIAGridAccessible::IsColSelected(uint32_t aColIdx)
 {
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = rowIter.Next();
   if (!row)
     return false;
 
   do {
     if (!nsAccUtils::IsARIASelected(row)) {
@@ -105,17 +105,17 @@ ARIAGridAccessible::IsColSelected(PRUint
         return false;
     }
   } while ((row = rowIter.Next()));
 
   return true;
 }
 
 bool
-ARIAGridAccessible::IsRowSelected(PRUint32 aRowIdx)
+ARIAGridAccessible::IsRowSelected(uint32_t aRowIdx)
 {
   Accessible* row = GetRowAt(aRowIdx);
   if(!row)
     return false;
 
   if (!nsAccUtils::IsARIASelected(row)) {
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
@@ -124,35 +124,35 @@ ARIAGridAccessible::IsRowSelected(PRUint
         return false;
     }
   }
 
   return true;
 }
 
 bool
-ARIAGridAccessible::IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx)
+ARIAGridAccessible::IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx)
 {
   Accessible* row = GetRowAt(aRowIdx);
   if(!row)
     return false;
 
   if (!nsAccUtils::IsARIASelected(row)) {
     Accessible* cell = GetCellInRowAt(row, aColIdx);
     if (!cell || !nsAccUtils::IsARIASelected(cell))
       return false;
   }
 
   return true;
 }
 
-PRUint32
+uint32_t
 ARIAGridAccessible::SelectedCellCount()
 {
-  PRUint32 count = 0, colCount = ColCount();
+  uint32_t count = 0, colCount = ColCount();
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = nullptr;
 
   while ((row = rowIter.Next())) {
     if (nsAccUtils::IsARIASelected(row)) {
       count += colCount;
       continue;
@@ -165,54 +165,54 @@ ARIAGridAccessible::SelectedCellCount()
       if (nsAccUtils::IsARIASelected(cell))
         count++;
     }
   }
 
   return count;
 }
 
-PRUint32
+uint32_t
 ARIAGridAccessible::SelectedColCount()
 {
-  PRUint32 colCount = ColCount();
+  uint32_t colCount = ColCount();
   if (!colCount)
     return 0;
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = rowIter.Next();
   if (!row)
     return 0;
 
   nsTArray<bool> isColSelArray(colCount);
   isColSelArray.AppendElements(colCount);
   memset(isColSelArray.Elements(), true, colCount * sizeof(bool));
 
-  PRUint32 selColCount = colCount;
+  uint32_t selColCount = colCount;
   do {
     if (nsAccUtils::IsARIASelected(row))
       continue;
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
-    for (PRUint32 colIdx = 0;
+    for (uint32_t colIdx = 0;
          (cell = cellIter.Next()) && colIdx < colCount; colIdx++)
       if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
         isColSelArray[colIdx] = false;
         selColCount--;
       }
   } while ((row = rowIter.Next()));
 
   return selColCount;
 }
 
-PRUint32
+uint32_t
 ARIAGridAccessible::SelectedRowCount()
 {
-  PRUint32 count = 0;
+  uint32_t count = 0;
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = nullptr;
 
   while ((row = rowIter.Next())) {
     if (nsAccUtils::IsARIASelected(row)) {
       count++;
       continue;
@@ -258,43 +258,43 @@ ARIAGridAccessible::SelectedCells(nsTArr
     while ((cell = cellIter.Next())) {
       if (nsAccUtils::IsARIASelected(cell))
         aCells->AppendElement(cell);
     }
   }
 }
 
 void
-ARIAGridAccessible::SelectedCellIndices(nsTArray<PRUint32>* aCells)
+ARIAGridAccessible::SelectedCellIndices(nsTArray<uint32_t>* aCells)
 {
-  PRUint32 colCount = ColCount();
+  uint32_t colCount = ColCount();
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = nullptr;
-  for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
+  for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
     if (nsAccUtils::IsARIASelected(row)) {
-      for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
+      for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
         aCells->AppendElement(rowIdx * colCount + colIdx);
 
       continue;
     }
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
-    for (PRUint32 colIdx = 0; (cell = cellIter.Next()); colIdx++) {
+    for (uint32_t colIdx = 0; (cell = cellIter.Next()); colIdx++) {
       if (nsAccUtils::IsARIASelected(cell))
         aCells->AppendElement(rowIdx * colCount + colIdx);
     }
   }
 }
 
 void
-ARIAGridAccessible::SelectedColIndices(nsTArray<PRUint32>* aCols)
+ARIAGridAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols)
 {
-  PRUint32 colCount = ColCount();
+  uint32_t colCount = ColCount();
   if (!colCount)
     return;
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = rowIter.Next();
   if (!row)
     return;
 
@@ -303,34 +303,34 @@ ARIAGridAccessible::SelectedColIndices(n
   memset(isColSelArray.Elements(), true, colCount * sizeof(bool));
 
   do {
     if (nsAccUtils::IsARIASelected(row))
       continue;
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
-    for (PRUint32 colIdx = 0;
+    for (uint32_t colIdx = 0;
          (cell = cellIter.Next()) && colIdx < colCount; colIdx++)
       if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
         isColSelArray[colIdx] = false;
       }
   } while ((row = rowIter.Next()));
 
-  for (PRUint32 colIdx = 0; colIdx < colCount; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
     if (isColSelArray[colIdx])
       aCols->AppendElement(colIdx);
 }
 
 void
-ARIAGridAccessible::SelectedRowIndices(nsTArray<PRUint32>* aRows)
+ARIAGridAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows)
 {
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = nullptr;
-  for (PRUint32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
+  for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
     if (nsAccUtils::IsARIASelected(row)) {
       aRows->AppendElement(rowIdx);
       continue;
     }
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = cellIter.Next();
     if (!cell)
@@ -345,29 +345,29 @@ ARIAGridAccessible::SelectedRowIndices(n
     } while ((cell = cellIter.Next()));
 
     if (isRowSelected)
       aRows->AppendElement(rowIdx);
   }
 }
 
 void
-ARIAGridAccessible::SelectRow(PRUint32 aRowIdx)
+ARIAGridAccessible::SelectRow(uint32_t aRowIdx)
 {
   AccIterator rowIter(this, filters::GetRow);
 
   Accessible* row = nullptr;
-  for (PRInt32 rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
+  for (int32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
     nsresult rv = SetARIASelected(row, rowIdx == aRowIdx);
     NS_ASSERTION(NS_SUCCEEDED(rv), "SetARIASelected() Shouldn't fail!");
   }
 }
 
 void
-ARIAGridAccessible::SelectCol(PRUint32 aColIdx)
+ARIAGridAccessible::SelectCol(uint32_t aColIdx)
 {
   AccIterator rowIter(this, filters::GetRow);
 
   Accessible* row = nullptr;
   while ((row = rowIter.Next())) {
     // Unselect all cells in the row.
     nsresult rv = SetARIASelected(row, false);
     NS_ASSERTION(NS_SUCCEEDED(rv), "SetARIASelected() Shouldn't fail!");
@@ -375,80 +375,80 @@ ARIAGridAccessible::SelectCol(PRUint32 a
     // Select cell at the column index.
     Accessible* cell = GetCellInRowAt(row, aColIdx);
     if (cell)
       SetARIASelected(cell, true);
   }
 }
 
 void
-ARIAGridAccessible::UnselectRow(PRUint32 aRowIdx)
+ARIAGridAccessible::UnselectRow(uint32_t aRowIdx)
 {
   Accessible* row = GetRowAt(aRowIdx);
 
   if (row)
     SetARIASelected(row, false);
 }
 
 void
-ARIAGridAccessible::UnselectCol(PRUint32 aColIdx)
+ARIAGridAccessible::UnselectCol(uint32_t aColIdx)
 {
   AccIterator rowIter(this, filters::GetRow);
 
   Accessible* row = nullptr;
   while ((row = rowIter.Next())) {
     Accessible* cell = GetCellInRowAt(row, aColIdx);
     if (cell)
       SetARIASelected(cell, false);
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Protected
 
 bool
-ARIAGridAccessible::IsValidRow(PRInt32 aRow)
+ARIAGridAccessible::IsValidRow(int32_t aRow)
 {
   if (aRow < 0)
     return false;
   
-  PRInt32 rowCount = 0;
+  int32_t rowCount = 0;
   GetRowCount(&rowCount);
   return aRow < rowCount;
 }
 
 bool
-ARIAGridAccessible::IsValidColumn(PRInt32 aColumn)
+ARIAGridAccessible::IsValidColumn(int32_t aColumn)
 {
   if (aColumn < 0)
     return false;
 
-  PRInt32 colCount = 0;
+  int32_t colCount = 0;
   GetColumnCount(&colCount);
   return aColumn < colCount;
 }
 
 Accessible*
-ARIAGridAccessible::GetRowAt(PRInt32 aRow)
+ARIAGridAccessible::GetRowAt(int32_t aRow)
 {
-  PRInt32 rowIdx = aRow;
+  int32_t rowIdx = aRow;
 
   AccIterator rowIter(this, filters::GetRow);
 
   Accessible* row = rowIter.Next();
   while (rowIdx != 0 && (row = rowIter.Next()))
     rowIdx--;
 
   return row;
 }
 
 Accessible*
-ARIAGridAccessible::GetCellInRowAt(Accessible* aRow, PRInt32 aColumn)
+ARIAGridAccessible::GetCellInRowAt(Accessible* aRow, int32_t aColumn)
 {
-  PRInt32 colIdx = aColumn;
+  int32_t colIdx = aColumn;
 
   AccIterator cellIter(aRow, filters::GetCell);
   Accessible* cell = cellIter.Next();
   while (colIdx != 0 && (cell = cellIter.Next()))
     colIdx--;
 
   return cell;
 }
@@ -563,44 +563,44 @@ ARIAGridCellAccessible::GetTable(nsIAcce
   if (tableRole != roles::TABLE && tableRole != roles::TREE_TABLE)
     return NS_OK;
 
   CallQueryInterface(table, aTable);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ARIAGridCellAccessible::GetColumnIndex(PRInt32* aColumnIndex)
+ARIAGridCellAccessible::GetColumnIndex(int32_t* aColumnIndex)
 {
   NS_ENSURE_ARG_POINTER(aColumnIndex);
   *aColumnIndex = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   Accessible* row = Parent();
   if (!row)
     return NS_OK;
 
   *aColumnIndex = 0;
 
-  PRInt32 indexInRow = IndexInParent();
-  for (PRInt32 idx = 0; idx < indexInRow; idx++) {
+  int32_t indexInRow = IndexInParent();
+  for (int32_t idx = 0; idx < indexInRow; idx++) {
     Accessible* cell = row->GetChildAt(idx);
     roles::Role role = cell->Role();
     if (role == roles::GRID_CELL || role == roles::ROWHEADER ||
         role == roles::COLUMNHEADER)
       (*aColumnIndex)++;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ARIAGridCellAccessible::GetRowIndex(PRInt32* aRowIndex)
+ARIAGridCellAccessible::GetRowIndex(int32_t* aRowIndex)
 {
   NS_ENSURE_ARG_POINTER(aRowIndex);
   *aRowIndex = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   Accessible* row = Parent();
@@ -608,41 +608,41 @@ ARIAGridCellAccessible::GetRowIndex(PRIn
     return NS_OK;
 
   Accessible* table = row->Parent();
   if (!table)
     return NS_OK;
 
   *aRowIndex = 0;
 
-  PRInt32 indexInTable = row->IndexInParent();
-  for (PRInt32 idx = 0; idx < indexInTable; idx++) {
+  int32_t indexInTable = row->IndexInParent();
+  for (int32_t idx = 0; idx < indexInTable; idx++) {
     row = table->GetChildAt(idx);
     if (row->Role() == roles::ROW)
       (*aRowIndex)++;
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ARIAGridCellAccessible::GetColumnExtent(PRInt32* aExtentCount)
+ARIAGridCellAccessible::GetColumnExtent(int32_t* aExtentCount)
 {
   NS_ENSURE_ARG_POINTER(aExtentCount);
   *aExtentCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aExtentCount = 1;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ARIAGridCellAccessible::GetRowExtent(PRInt32* aExtentCount)
+ARIAGridCellAccessible::GetRowExtent(int32_t* aExtentCount)
 {
   NS_ENSURE_ARG_POINTER(aExtentCount);
   *aExtentCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aExtentCount = 1;
@@ -706,17 +706,17 @@ ARIAGridCellAccessible::IsSelected(bool*
   *aIsSelected = true;
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
 
 void
-ARIAGridCellAccessible::ApplyARIAState(PRUint64* aState) const
+ARIAGridCellAccessible::ApplyARIAState(uint64_t* aState) const
 {
   HyperTextAccessibleWrap::ApplyARIAState(aState);
 
   // Return if the gridcell has aria-selected="true".
   if (*aState & states::SELECTED)
     return;
 
   // Check aria-selected="true" on the row.
@@ -743,19 +743,19 @@ ARIAGridCellAccessible::GetAttributesInt
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Expose "table-cell-index" attribute.
 
   Accessible* thisRow = Parent();
   if (!thisRow || thisRow->Role() != roles::ROW)
     return NS_OK;
 
-  PRInt32 colIdx = 0, colCount = 0;
-  PRUint32 childCount = thisRow->ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  int32_t colIdx = 0, colCount = 0;
+  uint32_t childCount = thisRow->ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = thisRow->GetChildAt(childIdx);
     if (child == this)
       colIdx = colCount;
 
     roles::Role role = child->Role();
     if (role == roles::GRID_CELL || role == roles::ROWHEADER ||
         role == roles::COLUMNHEADER)
       colCount++;
@@ -764,28 +764,28 @@ ARIAGridCellAccessible::GetAttributesInt
   Accessible* table = thisRow->Parent();
   if (!table)
     return NS_OK;
 
   roles::Role tableRole = table->Role();
   if (tableRole != roles::TABLE && tableRole != roles::TREE_TABLE)
     return NS_OK;
 
-  PRInt32 rowIdx = 0;
+  int32_t rowIdx = 0;
   childCount = table->ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = table->GetChildAt(childIdx);
     if (child == thisRow)
       break;
 
     if (child->Role() == roles::ROW)
       rowIdx++;
   }
 
-  PRInt32 idx = rowIdx * colCount + colIdx;
+  int32_t idx = rowIdx * colCount + colIdx;
 
   nsAutoString stringIdx;
   stringIdx.AppendInt(idx);
   nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::tableCellIndex,
                          stringIdx);
 
   return NS_OK;
 }
--- a/accessible/src/generic/ARIAGridAccessible.h
+++ b/accessible/src/generic/ARIAGridAccessible.h
@@ -36,54 +36,54 @@ public:
 
   // Accessible
   virtual TableAccessible* AsTable() { return this; }
 
   // nsAccessNode
   virtual void Shutdown();
 
   // TableAccessible
-  virtual PRUint32 ColCount();
-  virtual PRUint32 RowCount();
-  virtual Accessible* CellAt(PRUint32 aRowIndex, PRUint32 aColumnIndex);
-  virtual bool IsColSelected(PRUint32 aColIdx);
-  virtual bool IsRowSelected(PRUint32 aRowIdx);
-  virtual bool IsCellSelected(PRUint32 aRowIdx, PRUint32 aColIdx);
-  virtual PRUint32 SelectedCellCount();
-  virtual PRUint32 SelectedColCount();
-  virtual PRUint32 SelectedRowCount();
+  virtual uint32_t ColCount();
+  virtual uint32_t RowCount();
+  virtual Accessible* CellAt(uint32_t aRowIndex, uint32_t aColumnIndex);
+  virtual bool IsColSelected(uint32_t aColIdx);
+  virtual bool IsRowSelected(uint32_t aRowIdx);
+  virtual bool IsCellSelected(uint32_t aRowIdx, uint32_t aColIdx);
+  virtual uint32_t SelectedCellCount();
+  virtual uint32_t SelectedColCount();
+  virtual uint32_t SelectedRowCount();
   virtual void SelectedCells(nsTArray<Accessible*>* aCells);
-  virtual void SelectedCellIndices(nsTArray<PRUint32>* aCells);
-  virtual void SelectedColIndices(nsTArray<PRUint32>* aCols);
-  virtual void SelectedRowIndices(nsTArray<PRUint32>* aRows);
-  virtual void SelectCol(PRUint32 aColIdx);
-  virtual void SelectRow(PRUint32 aRowIdx);
-  virtual void UnselectCol(PRUint32 aColIdx);
-  virtual void UnselectRow(PRUint32 aRowIdx);
+  virtual void SelectedCellIndices(nsTArray<uint32_t>* aCells);
+  virtual void SelectedColIndices(nsTArray<uint32_t>* aCols);
+  virtual void SelectedRowIndices(nsTArray<uint32_t>* aRows);
+  virtual void SelectCol(uint32_t aColIdx);
+  virtual void SelectRow(uint32_t aRowIdx);
+  virtual void UnselectCol(uint32_t aColIdx);
+  virtual void UnselectRow(uint32_t aRowIdx);
 
 protected:
   /**
    * Return true if the given row index is valid.
    */
-  bool IsValidRow(PRInt32 aRow);
+  bool IsValidRow(int32_t aRow);
 
   /**
    * Retrn true if the given column index is valid.
    */
-  bool IsValidColumn(PRInt32 aColumn);
+  bool IsValidColumn(int32_t aColumn);
 
   /**
    * Return row accessible at the given row index.
    */
-  Accessible* GetRowAt(PRInt32 aRow);
+  Accessible* GetRowAt(int32_t aRow);
 
   /**
    * Return cell accessible at the given column index in the row.
    */
-  Accessible* GetCellInRowAt(Accessible* aRow, PRInt32 aColumn);
+  Accessible* GetCellInRowAt(Accessible* aRow, int32_t aColumn);
 
   /**
    * Set aria-selected attribute value on DOM node of the given accessible.
    *
    * @param  aAccessible  [in] accessible
    * @param  aIsSelected  [in] new value of aria-selected attribute
    * @param  aNotify      [in, optional] specifies if DOM should be notified
    *                       about attribute change (used internally).
@@ -107,16 +107,16 @@ public:
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessibleTableCell
   NS_DECL_OR_FORWARD_NSIACCESSIBLETABLECELL_WITH_XPCACCESSIBLETABLECELL
 
   // Accessible
   virtual void Shutdown();
-  virtual void ApplyARIAState(PRUint64* aState) const;
+  virtual void ApplyARIAState(uint64_t* aState) const;
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 #endif
--- a/accessible/src/generic/Accessible.cpp
+++ b/accessible/src/generic/Accessible.cpp
@@ -84,17 +84,17 @@ using namespace mozilla::a11y;
 // Accessible. nsISupports
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(Accessible)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(Accessible, nsAccessNode)
   NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mParent");
   cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mParent.get()));
 
-  PRUint32 i, length = tmp->mChildren.Length();
+  uint32_t i, length = tmp->mChildren.Length();
   for (i = 0; i < length; ++i) {
     NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mChildren[i]");
     cb.NoteXPCOMChild(static_cast<nsIAccessible*>(tmp->mChildren[i].get()));
   }
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(Accessible, nsAccessNode)
   NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mParent)
@@ -360,17 +360,17 @@ Accessible::GetAccessKey(nsAString& aAcc
 
   AccessKey().ToString(aAccessKey);
   return NS_OK;
 }
 
 KeyBinding
 Accessible::AccessKey() const
 {
-  PRUint32 key = nsCoreUtils::GetAccessKeyFor(mContent);
+  uint32_t key = nsCoreUtils::GetAccessKeyFor(mContent);
   if (!key && mContent->IsElement()) {
     Accessible* label = nullptr;
 
     // Copy access key from label node.
     if (mContent->IsHTML()) {
       // Unless it is labeled via an ancestor <label>, in which case that would
       // be redundant.
       HTMLLabelIterator iter(Document(), this,
@@ -412,17 +412,17 @@ Accessible::AccessKey() const
   nsCOMPtr<nsISupports> container = document->GetContainer();
   if (!container)
     return KeyBinding();
   nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
   if (!treeItem)
     return KeyBinding();
 
   nsresult rv = NS_ERROR_FAILURE;
-  PRInt32 itemType = 0, modifierMask = 0;
+  int32_t itemType = 0, modifierMask = 0;
   treeItem->GetItemType(&itemType);
   switch (itemType) {
     case nsIDocShellTreeItem::typeChrome:
       rv = Preferences::GetInt("ui.key.chromeAccess", &modifierMask);
       break;
     case nsIDocShellTreeItem::typeContent:
       rv = Preferences::GetInt("ui.key.contentAccess", &modifierMask);
       break;
@@ -502,17 +502,17 @@ Accessible::GetLastChild(nsIAccessible**
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   NS_IF_ADDREF(*aLastChild = LastChild());
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Accessible::GetChildAt(PRInt32 aChildIndex, nsIAccessible** aChild)
+Accessible::GetChildAt(int32_t aChildIndex, nsIAccessible** aChild)
 {
   NS_ENSURE_ARG_POINTER(aChild);
   *aChild = nullptr;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // If child index is negative, then return last child.
@@ -538,48 +538,48 @@ Accessible::GetChildren(nsIArray** aOutC
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> children =
     do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  PRUint32 childCount = ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  uint32_t childCount = ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     nsIAccessible* child = GetChildAt(childIdx);
     children->AppendElement(child, false);
   }
 
   NS_ADDREF(*aOutChildren = children);
   return NS_OK;
 }
 
 bool
 Accessible::CanHaveAnonChildren()
 {
   return true;
 }
 
 /* readonly attribute long childCount; */
 NS_IMETHODIMP
-Accessible::GetChildCount(PRInt32* aChildCount)
+Accessible::GetChildCount(int32_t* aChildCount)
 {
   NS_ENSURE_ARG_POINTER(aChildCount);
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aChildCount = ChildCount();
   return NS_OK;
 }
 
 /* readonly attribute long indexInParent; */
 NS_IMETHODIMP
-Accessible::GetIndexInParent(PRInt32* aIndexInParent)
+Accessible::GetIndexInParent(int32_t* aIndexInParent)
 {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
 
   *aIndexInParent = IndexInParent();
   return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 void 
@@ -598,32 +598,32 @@ Accessible::TranslateString(const nsStri
     return;
 
   nsXPIDLString xsValue;
   nsresult rv = stringBundle->GetStringFromName(aKey.get(), getter_Copies(xsValue));
   if (NS_SUCCEEDED(rv))
     aStringOut.Assign(xsValue);
 }
 
-PRUint64
+uint64_t
 Accessible::VisibilityState()
 {
-  PRUint64 vstates = states::INVISIBLE | states::OFFSCREEN;
+  uint64_t vstates = states::INVISIBLE | states::OFFSCREEN;
 
   nsIFrame* frame = GetFrame();
   if (!frame)
     return vstates;
 
   nsIPresShell* shell(mDoc->PresShell());
   if (!shell)
     return vstates;
 
   // We need to know if at least a kMinPixels around the object is visible,
   // otherwise it will be marked states::OFFSCREEN.
-  const PRUint16 kMinPixels  = 12;
+  const uint16_t kMinPixels  = 12;
   const nsSize frameSize = frame->GetSize();
   const nsRectVisibility rectVisibility =
     shell->GetRectVisibility(frame, nsRect(nsPoint(0,0), frameSize),
                              nsPresContext::CSSPixelsToAppUnits(kMinPixels));
 
   if (rectVisibility == nsRectVisibility_kVisible)
     vstates &= ~states::OFFSCREEN;
 
@@ -645,20 +645,20 @@ Accessible::VisibilityState()
   // XXX Do we really need to cross from content to chrome ancestor?
   if (!frame->IsVisibleConsideringAncestors(nsIFrame::VISIBILITY_CROSS_CHROME_CONTENT_BOUNDARY))
     return vstates;
 
   // Assume we are visible enough.
   return vstates &= ~states::INVISIBLE;
 }
 
-PRUint64
+uint64_t
 Accessible::NativeState()
 {
-  PRUint64 state = 0;
+  uint64_t state = 0;
 
   if (!IsInDocument())
     state |= states::STALE;
 
   if (mContent->IsElement()) {
     nsEventStates elementState = mContent->AsElement()->State();
 
     if (elementState.HasState(NS_EVENT_STATE_INVALID))
@@ -702,33 +702,33 @@ Accessible::NativeState()
   // Bypass the link states specialization for non links.
   if (!mRoleMapEntry || mRoleMapEntry->roleRule == kUseNativeRole ||
       mRoleMapEntry->role == roles::LINK)
     state |= NativeLinkState();
 
   return state;
 }
 
-PRUint64
+uint64_t
 Accessible::NativeInteractiveState() const
 {
   if (!mContent->IsElement())
     return 0;
 
   if (NativelyUnavailable())
     return states::UNAVAILABLE;
 
   nsIFrame* frame = GetFrame();
   if (frame && frame->IsFocusable())
     return states::FOCUSABLE;
 
   return 0;
 }
 
-PRUint64
+uint64_t
 Accessible::NativeLinkState() const
 {
   // Expose linked state for simple xlink.
   return nsCoreUtils::IsXLink(mContent) ? states::LINKED : 0;
 }
 
 bool
 Accessible::NativelyUnavailable() const
@@ -760,22 +760,22 @@ Accessible::FocusedChild()
   Accessible* focus = FocusMgr()->FocusedAccessible();
   if (focus && (focus == this || focus->Parent() == this))
     return focus;
 
   return nullptr;
 }
 
 Accessible*
-Accessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+Accessible::ChildAtPoint(int32_t aX, int32_t aY,
                          EWhichChildAtPoint aWhichChild)
 {
   // If we can't find the point in a child, we will return the fallback answer:
   // we return |this| if the point is within it, otherwise nullptr.
-  PRInt32 x = 0, y = 0, width = 0, height = 0;
+  int32_t x = 0, y = 0, width = 0, height = 0;
   nsresult rv = GetBounds(&x, &y, &width, &height);
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   Accessible* fallbackAnswer = nullptr;
   if (aX >= x && aX < x + width && aY >= y && aY < y + height)
     fallbackAnswer = this;
 
   if (nsAccUtils::MustPrune(this))  // Do not dig any further
@@ -840,21 +840,21 @@ Accessible::ChildAtPoint(PRInt32 aX, PRI
     child = parent;
   }
 
   // Manually walk through accessible children and see if the are within this
   // point. Skip offscreen or invisible accessibles. This takes care of cases
   // where layout won't walk into things for us, such as image map areas and
   // sub documents (XXX: subdocuments should be handled by methods of
   // OuterDocAccessibles).
-  PRUint32 childCount = accessible->ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  uint32_t childCount = accessible->ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = accessible->GetChildAt(childIdx);
 
-    PRInt32 childX, childY, childWidth, childHeight;
+    int32_t childX, childY, childWidth, childHeight;
     child->GetBounds(&childX, &childY, &childWidth, &childHeight);
     if (aX >= childX && aX < childX + childWidth &&
         aY >= childY && aY < childY + childHeight &&
         (child->State() & states::INVISIBLE) == 0) {
 
       if (aWhichChild == eDeepestChild)
         return child->ChildAtPoint(aX, aY, eDeepestChild);
 
@@ -862,32 +862,32 @@ Accessible::ChildAtPoint(PRInt32 aX, PRI
     }
   }
 
   return accessible;
 }
 
 // nsIAccessible getChildAtPoint(in long x, in long y)
 NS_IMETHODIMP
-Accessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
+Accessible::GetChildAtPoint(int32_t aX, int32_t aY,
                             nsIAccessible** aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   NS_IF_ADDREF(*aAccessible = ChildAtPoint(aX, aY, eDirectChild));
   return NS_OK;
 }
 
 // nsIAccessible getDeepestChildAtPoint(in long x, in long y)
 NS_IMETHODIMP
-Accessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
+Accessible::GetDeepestChildAtPoint(int32_t aX, int32_t aY,
                                    nsIAccessible** aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
@@ -904,18 +904,18 @@ Accessible::GetBoundsRect(nsRect& aTotal
     aTotalBounds = nsLayoutUtils::
       GetAllInFlowRectsUnion(frame, *aBoundingFrame,
                              nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
   }
 }
 
 /* void getBounds (out long x, out long y, out long width, out long height); */
 NS_IMETHODIMP
-Accessible::GetBounds(PRInt32* aX, PRInt32* aY,
-                      PRInt32* aWidth, PRInt32* aHeight)
+Accessible::GetBounds(int32_t* aX, int32_t* aY,
+                      int32_t* aWidth, int32_t* aHeight)
 {
   NS_ENSURE_ARG_POINTER(aX);
   *aX = 0;
   NS_ENSURE_ARG_POINTER(aY);
   *aY = 0;
   NS_ENSURE_ARG_POINTER(aWidth);
   *aWidth = 0;
   NS_ENSURE_ARG_POINTER(aHeight);
@@ -1156,17 +1156,17 @@ Accessible::HandleAccEvent(AccEvent* aEv
     nsRefPtr<nsAccEvent> evnt(aEvent->CreateXPCOMObject());
     return obsService->NotifyObservers(evnt, NS_ACCESSIBLE_EVENT_TOPIC, nullptr);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Accessible::GetRole(PRUint32 *aRole)
+Accessible::GetRole(uint32_t *aRole)
 {
   NS_ENSURE_ARG_POINTER(aRole);
   *aRole = nsIAccessibleRole::ROLE_NOTHING;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aRole = Role();
@@ -1371,41 +1371,41 @@ Accessible::GroupPosition()
 
   // If ARIA is missed and the accessible is visible then calculate group
   // position from hierarchy.
   if (State() & states::INVISIBLE)
     return groupPos;
 
   // Calculate group level if ARIA is missed.
   if (groupPos.level == 0) {
-    PRInt32 level = GetLevelInternal();
+    int32_t level = GetLevelInternal();
     if (level != 0)
       groupPos.level = level;
   }
 
   // Calculate position in group and group size if ARIA is missed.
   if (groupPos.posInSet == 0 || groupPos.setSize == 0) {
-    PRInt32 posInSet = 0, setSize = 0;
+    int32_t posInSet = 0, setSize = 0;
     GetPositionAndSizeInternal(&posInSet, &setSize);
     if (posInSet != 0 && setSize != 0) {
       if (groupPos.posInSet == 0)
         groupPos.posInSet = posInSet;
 
       if (groupPos.setSize == 0)
         groupPos.setSize = setSize;
     }
   }
 
   return groupPos;
 }
 
 NS_IMETHODIMP
-Accessible::GroupPosition(PRInt32* aGroupLevel,
-                          PRInt32* aSimilarItemsInGroup,
-                          PRInt32* aPositionInGroup)
+Accessible::GroupPosition(int32_t* aGroupLevel,
+                          int32_t* aSimilarItemsInGroup,
+                          int32_t* aPositionInGroup)
 {
   NS_ENSURE_ARG_POINTER(aGroupLevel);
   *aGroupLevel = 0;
 
   NS_ENSURE_ARG_POINTER(aSimilarItemsInGroup);
   *aSimilarItemsInGroup = 0;
 
   NS_ENSURE_ARG_POINTER(aPositionInGroup);
@@ -1419,31 +1419,31 @@ Accessible::GroupPosition(PRInt32* aGrou
   *aGroupLevel = groupPos.level;
   *aSimilarItemsInGroup = groupPos.setSize;
   *aPositionInGroup = groupPos.posInSet;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Accessible::GetState(PRUint32* aState, PRUint32* aExtraState)
+Accessible::GetState(uint32_t* aState, uint32_t* aExtraState)
 {
   NS_ENSURE_ARG_POINTER(aState);
 
   nsAccUtils::To32States(State(), aState, aExtraState);
   return NS_OK;
 }
 
-PRUint64
+uint64_t
 Accessible::State()
 {
   if (IsDefunct())
     return states::DEFUNCT;
 
-  PRUint64 state = NativeState();
+  uint64_t state = NativeState();
   // Apply ARIA states to be sure accessible states will be overridden.
   ApplyARIAState(&state);
 
   // If this is an ARIA item of the selectable widget and if it's focused and
   // not marked unselected explicitly (i.e. aria-selected="false") then expose
   // it as selected to make ARIA widget authors life easier.
   if (mRoleMapEntry && !(state & states::SELECTED) &&
       !mContent->AttrValueIs(kNameSpaceID_None,
@@ -1469,17 +1469,17 @@ Accessible::State()
       if (container &&
           !nsAccUtils::HasDefinedARIAToken(container->GetContent(),
                                            nsGkAtoms::aria_multiselectable)) {
         state |= states::SELECTED;
       }
     }
   }
 
-  const PRUint32 kExpandCollapseStates = states::COLLAPSED | states::EXPANDED;
+  const uint32_t kExpandCollapseStates = states::COLLAPSED | states::EXPANDED;
   if ((state & kExpandCollapseStates) == kExpandCollapseStates) {
     // Cannot be both expanded and collapsed -- this happens in ARIA expanded
     // combobox because of limitation of nsARIAMap.
     // XXX: Perhaps we will be able to make this less hacky if we support
     // extended states in nsARIAMap, e.g. derive COLLAPSED from
     // EXPANDABLE && !EXPANDED.
     state &= ~states::COLLAPSED;
   }
@@ -1510,17 +1510,17 @@ Accessible::State()
       !(state & states::INVISIBLE)) {
     state |= states::OPAQUE1;
   }
 
   return state;
 }
 
 void
-Accessible::ApplyARIAState(PRUint64* aState) const
+Accessible::ApplyARIAState(uint64_t* aState) const
 {
   if (!mContent->IsElement())
     return;
 
   dom::Element* element = mContent->AsElement();
 
   // Test for universal states first
   *aState |= aria::UniversalStatesFor(element);
@@ -1639,17 +1639,17 @@ NS_IMETHODIMP
 Accessible::SetCurrentValue(double aValue)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (!mRoleMapEntry || mRoleMapEntry->valueRule == eNoValue)
     return NS_OK_NO_ARIA_VALUE;
 
-  const PRUint32 kValueCannotChange = states::READONLY | states::UNAVAILABLE;
+  const uint32_t kValueCannotChange = states::READONLY | states::UNAVAILABLE;
 
   if (State() & kValueCannotChange)
     return NS_ERROR_FAILURE;
 
   double minValue = 0;
   if (NS_SUCCEEDED(GetMinimumValue(&minValue)) && aValue < minValue)
     return NS_ERROR_INVALID_ARG;
 
@@ -1723,65 +1723,65 @@ Accessible::ARIATransformRole(role aRole
 }
 
 role
 Accessible::NativeRole()
 {
   return nsCoreUtils::IsXLink(mContent) ? roles::LINK : roles::NOTHING;
 }
 
-// readonly attribute PRUint8 actionCount
+// readonly attribute uint8_t actionCount
 NS_IMETHODIMP
-Accessible::GetActionCount(PRUint8* aActionCount)
+Accessible::GetActionCount(uint8_t* aActionCount)
 {
   NS_ENSURE_ARG_POINTER(aActionCount);
   *aActionCount = 0;
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aActionCount = ActionCount();
   return NS_OK;
 }
 
-PRUint8
+uint8_t
 Accessible::ActionCount()
 {
   return GetActionRule() == eNoAction ? 0 : 1;
 }
 
-/* DOMString getAccActionName (in PRUint8 index); */
+/* DOMString getAccActionName (in uint8_t index); */
 NS_IMETHODIMP
-Accessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+Accessible::GetActionName(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   if (aIndex != 0)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  PRUint32 actionRule = GetActionRule();
+  uint32_t actionRule = GetActionRule();
 
  switch (actionRule) {
    case eActivateAction:
      aName.AssignLiteral("activate");
      return NS_OK;
 
    case eClickAction:
      aName.AssignLiteral("click");
      return NS_OK;
 
    case ePressAction:
      aName.AssignLiteral("press");
      return NS_OK;
 
    case eCheckUncheckAction:
    {
-     PRUint64 state = State();
+     uint64_t state = State();
      if (state & states::CHECKED)
        aName.AssignLiteral("uncheck");
      else if (state & states::MIXED)
        aName.AssignLiteral("cycle");
      else
        aName.AssignLiteral("check");
      return NS_OK;
    }
@@ -1815,32 +1815,32 @@ Accessible::GetActionName(PRUint8 aIndex
      else
        aName.AssignLiteral("collapse");
      return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
-// AString getActionDescription(in PRUint8 index)
+// AString getActionDescription(in uint8_t index)
 NS_IMETHODIMP
-Accessible::GetActionDescription(PRUint8 aIndex, nsAString& aDescription)
+Accessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription)
 {
   // default to localized action name.
   nsAutoString name;
   nsresult rv = GetActionName(aIndex, name);
   NS_ENSURE_SUCCESS(rv, rv);
 
   TranslateString(name, aDescription);
   return NS_OK;
 }
 
-// void doAction(in PRUint8 index)
+// void doAction(in uint8_t index)
 NS_IMETHODIMP
-Accessible::DoAction(PRUint8 aIndex)
+Accessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != 0)
     return NS_ERROR_INVALID_ARG;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   if (GetActionRule() != eNoAction) {
@@ -1865,31 +1865,31 @@ Accessible::GetAtomicRegion() const
   while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_atomic, atomic))
     loopContent = loopContent->GetParent();
 
   return atomic.EqualsLiteral("true") ? loopContent : nullptr;
 }
 
 // nsIAccessible getRelationByType()
 NS_IMETHODIMP
-Accessible::GetRelationByType(PRUint32 aType,
+Accessible::GetRelationByType(uint32_t aType,
                                 nsIAccessibleRelation** aRelation)
 {
   NS_ENSURE_ARG_POINTER(aRelation);
   *aRelation = nullptr;
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   Relation rel = RelationByType(aType);
   NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
   return *aRelation ? NS_OK : NS_ERROR_FAILURE;
 }
 
 Relation
-Accessible::RelationByType(PRUint32 aType)
+Accessible::RelationByType(uint32_t aType)
 {
   // Relationships are defined on the same content node that the role would be
   // defined on.
   switch (aType) {
     case nsIAccessibleRelation::RELATION_LABEL_FOR: {
       Relation rel(new RelatedAccIterator(Document(), mContent,
                                           nsGkAtoms::aria_labelledby));
       if (mContent->Tag() == nsGkAtoms::label)
@@ -1998,21 +1998,21 @@ Accessible::RelationByType(PRUint32 aTyp
           do_QueryInterface(mContent->OwnerDoc());
         nsCOMPtr<nsIDOMXULButtonElement> buttonEl;
         if (xulDoc) {
           nsCOMPtr<nsIDOMNodeList> possibleDefaultButtons;
           xulDoc->GetElementsByAttribute(NS_LITERAL_STRING("default"),
                                          NS_LITERAL_STRING("true"),
                                          getter_AddRefs(possibleDefaultButtons));
           if (possibleDefaultButtons) {
-            PRUint32 length;
+            uint32_t length;
             possibleDefaultButtons->GetLength(&length);
             nsCOMPtr<nsIDOMNode> possibleButton;
             // Check for button in list of default="true" elements
-            for (PRUint32 count = 0; count < length && !buttonEl; count ++) {
+            for (uint32_t count = 0; count < length && !buttonEl; count ++) {
               possibleDefaultButtons->Item(count, getter_AddRefs(possibleButton));
               buttonEl = do_QueryInterface(possibleButton);
             }
           }
           if (!buttonEl) { // Check for anonymous accept button in <dialog>
             dom::Element* rootElm = mContent->OwnerDoc()->GetRootElement();
             if (rootElm) {
               nsIContent* possibleButtonEl = rootElm->OwnerDoc()->
@@ -2046,25 +2046,25 @@ Accessible::GetRelations(nsIArray **aRel
   *aRelations = nullptr;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
   NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
 
-  for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
+  for (uint32_t relType = nsIAccessibleRelation::RELATION_FIRST;
        relType < nsIAccessibleRelation::RELATION_LAST;
        ++relType) {
 
     nsCOMPtr<nsIAccessibleRelation> relation;
     nsresult rv = GetRelationByType(relType, getter_AddRefs(relation));
 
     if (NS_SUCCEEDED(rv) && relation) {
-      PRUint32 targets = 0;
+      uint32_t targets = 0;
       relation->GetTargetsCount(&targets);
       if (targets)
         relations->AppendElement(relation, false);
     }
   }
 
   NS_ADDREF(*aRelations = relations);
   return NS_OK;
@@ -2079,25 +2079,25 @@ NS_IMETHODIMP Accessible::ExtendSelectio
 
 /* [noscript] void getNativeInterface(out voidPtr aOutAccessible); */
 NS_IMETHODIMP Accessible::GetNativeInterface(void **aOutAccessible)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 void
-Accessible::DoCommand(nsIContent *aContent, PRUint32 aActionIndex)
+Accessible::DoCommand(nsIContent *aContent, uint32_t aActionIndex)
 {
   nsIContent* content = aContent ? aContent : mContent.get();
   NS_DISPATCH_RUNNABLEMETHOD_ARG2(DispatchClickEvent, this, content,
                                   aActionIndex);
 }
 
 void
-Accessible::DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex)
+Accessible::DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex)
 {
   if (IsDefunct())
     return;
 
   nsIPresShell* presShell = mDoc->PresShell();
 
   // Scroll into view.
   presShell->ScrollContentIntoView(aContent,
@@ -2110,27 +2110,27 @@ Accessible::DispatchClickEvent(nsIConten
                                                aContent);
   if (!res)
     return;
 
   nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, presShell, aContent);
 }
 
 NS_IMETHODIMP
-Accessible::ScrollTo(PRUint32 aHow)
+Accessible::ScrollTo(uint32_t aHow)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCoreUtils::ScrollTo(mDoc->PresShell(), mContent, aHow);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Accessible::ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY)
+Accessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY)
 {
   nsIFrame *frame = GetFrame();
   if (!frame)
     return NS_ERROR_FAILURE;
 
   nsIntPoint coords;
   nsresult rv = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType,
                                                   this, &coords);
@@ -2150,28 +2150,28 @@ Accessible::GetSelectedChildren(nsIArray
   NS_ENSURE_ARG_POINTER(aSelectedAccessibles);
   *aSelectedAccessibles = nullptr;
 
   if (IsDefunct() || !IsSelect())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIArray> items = SelectedItems();
   if (items) {
-    PRUint32 length = 0;
+    uint32_t length = 0;
     items->GetLength(&length);
     if (length)
       items.swap(*aSelectedAccessibles);
   }
 
   return NS_OK;
 }
 
 // return the nth selected descendant nsIAccessible object
 NS_IMETHODIMP
-Accessible::RefSelection(PRInt32 aIndex, nsIAccessible** aSelected)
+Accessible::RefSelection(int32_t aIndex, nsIAccessible** aSelected)
 {
   NS_ENSURE_ARG_POINTER(aSelected);
   *aSelected = nullptr;
 
   if (IsDefunct() || !IsSelect())
     return NS_ERROR_FAILURE;
 
   if (aIndex < 0) {
@@ -2183,47 +2183,47 @@ Accessible::RefSelection(PRInt32 aIndex,
     NS_ADDREF(*aSelected);
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-Accessible::GetSelectionCount(PRInt32* aSelectionCount)
+Accessible::GetSelectionCount(int32_t* aSelectionCount)
 {
   NS_ENSURE_ARG_POINTER(aSelectionCount);
   *aSelectionCount = 0;
 
   if (IsDefunct() || !IsSelect())
     return NS_ERROR_FAILURE;
 
   *aSelectionCount = SelectedItemCount();
   return NS_OK;
 }
 
-NS_IMETHODIMP Accessible::AddChildToSelection(PRInt32 aIndex)
+NS_IMETHODIMP Accessible::AddChildToSelection(int32_t aIndex)
 {
   if (IsDefunct() || !IsSelect())
     return NS_ERROR_FAILURE;
 
   return aIndex >= 0 && AddItemToSelection(aIndex) ?
     NS_OK : NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP Accessible::RemoveChildFromSelection(PRInt32 aIndex)
+NS_IMETHODIMP Accessible::RemoveChildFromSelection(int32_t aIndex)
 {
   if (IsDefunct() || !IsSelect())
     return NS_ERROR_FAILURE;
 
   return aIndex >=0 && RemoveItemFromSelection(aIndex) ?
     NS_OK : NS_ERROR_INVALID_ARG;
 }
 
-NS_IMETHODIMP Accessible::IsChildSelected(PRInt32 aIndex, bool *aIsSelected)
+NS_IMETHODIMP Accessible::IsChildSelected(int32_t aIndex, bool *aIsSelected)
 {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (IsDefunct() || !IsSelect())
     return NS_ERROR_FAILURE;
 
   NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
@@ -2257,82 +2257,82 @@ Accessible::SelectAllSelection(bool* aIs
 
 // nsIAccessibleHyperLink
 // Because of new-atk design, any embedded object in text can implement
 // nsIAccessibleHyperLink, which helps determine where it is located
 // within containing text
 
 // readonly attribute long nsIAccessibleHyperLink::anchorCount
 NS_IMETHODIMP
-Accessible::GetAnchorCount(PRInt32 *aAnchorCount)
+Accessible::GetAnchorCount(int32_t *aAnchorCount)
 {
   NS_ENSURE_ARG_POINTER(aAnchorCount);
   *aAnchorCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aAnchorCount = AnchorCount();
   return NS_OK;
 }
 
 // readonly attribute long nsIAccessibleHyperLink::startIndex
 NS_IMETHODIMP
-Accessible::GetStartIndex(PRInt32 *aStartIndex)
+Accessible::GetStartIndex(int32_t *aStartIndex)
 {
   NS_ENSURE_ARG_POINTER(aStartIndex);
   *aStartIndex = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aStartIndex = StartOffset();
   return NS_OK;
 }
 
 // readonly attribute long nsIAccessibleHyperLink::endIndex
 NS_IMETHODIMP
-Accessible::GetEndIndex(PRInt32 *aEndIndex)
+Accessible::GetEndIndex(int32_t *aEndIndex)
 {
   NS_ENSURE_ARG_POINTER(aEndIndex);
   *aEndIndex = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aEndIndex = EndOffset();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-Accessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
+Accessible::GetURI(int32_t aIndex, nsIURI **aURI)
 {
   NS_ENSURE_ARG_POINTER(aURI);
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
+  if (aIndex < 0 || aIndex >= static_cast<int32_t>(AnchorCount()))
     return NS_ERROR_INVALID_ARG;
 
   nsRefPtr<nsIURI>(AnchorURIAt(aIndex)).forget(aURI);
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
-Accessible::GetAnchor(PRInt32 aIndex, nsIAccessible** aAccessible)
+Accessible::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible)
 {
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  if (aIndex < 0 || aIndex >= static_cast<PRInt32>(AnchorCount()))
+  if (aIndex < 0 || aIndex >= static_cast<int32_t>(AnchorCount()))
     return NS_ERROR_INVALID_ARG;
 
   NS_IF_ADDREF(*aAccessible = AnchorAt(aIndex));
   return NS_OK;
 }
 
 // readonly attribute boolean nsIAccessibleHyperLink::valid
 NS_IMETHODIMP
@@ -2359,18 +2359,18 @@ Accessible::GetSelected(bool *aSelected)
     return NS_ERROR_FAILURE;
 
   *aSelected = IsLinkSelected();
   return NS_OK;
 
 }
 
 void
-Accessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset,
-                         PRUint32 aLength)
+Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
+                         uint32_t aLength)
 {
   // Return text representation of non-text accessible within hypertext
   // accessible. Text accessible overrides this method to return enclosed text.
   if (aStartOffset != 0 || aLength == 0)
     return;
 
   nsIFrame *frame = GetFrame();
   if (!frame)
@@ -2443,17 +2443,17 @@ Accessible::GetNameInternal(nsAString& a
   if (mContent->IsXUL())
     return GetXULName(aName);
 
   return NS_OK;
 }
 
 // Accessible protected
 void
-Accessible::BindToParent(Accessible* aParent, PRUint32 aIndexInParent)
+Accessible::BindToParent(Accessible* aParent, uint32_t aIndexInParent)
 {
   NS_PRECONDITION(aParent, "This method isn't used to set null parent!");
 
   if (mParent) {
     if (mParent != aParent) {
       NS_ERROR("Adopting child!");
       mParent->RemoveChild(this);
     } else {
@@ -2473,18 +2473,18 @@ Accessible::UnbindFromParent()
   mIndexInParent = -1;
   mIndexOfEmbeddedChild = -1;
   mGroupInfo = nullptr;
 }
 
 void
 Accessible::InvalidateChildren()
 {
-  PRInt32 childCount = mChildren.Length();
-  for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
+  int32_t childCount = mChildren.Length();
+  for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = mChildren.ElementAt(childIdx);
     child->UnbindFromParent();
   }
 
   mEmbeddedObjCollector = nullptr;
   mChildren.Clear();
   SetChildrenFlag(eChildrenUninitialized);
 }
@@ -2501,25 +2501,25 @@ Accessible::AppendChild(Accessible* aChi
   if (!nsAccUtils::IsEmbeddedObject(aChild))
     SetChildrenFlag(eMixedChildren);
 
   aChild->BindToParent(this, mChildren.Length() - 1);
   return true;
 }
 
 bool
-Accessible::InsertChildAt(PRUint32 aIndex, Accessible* aChild)
+Accessible::InsertChildAt(uint32_t aIndex, Accessible* aChild)
 {
   if (!aChild)
     return false;
 
   if (!mChildren.InsertElementAt(aIndex, aChild))
     return false;
 
-  for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++) {
+  for (uint32_t idx = aIndex + 1; idx < mChildren.Length(); idx++) {
     NS_ASSERTION(mChildren[idx]->mIndexInParent == idx - 1, "Accessible child index doesn't match");
     mChildren[idx]->mIndexInParent = idx;
   }
 
   if (nsAccUtils::IsText(aChild))
     SetChildrenFlag(eMixedChildren);
 
   mEmbeddedObjCollector = nullptr;
@@ -2532,95 +2532,95 @@ bool
 Accessible::RemoveChild(Accessible* aChild)
 {
   if (!aChild)
     return false;
 
   if (aChild->mParent != this || aChild->mIndexInParent == -1)
     return false;
 
-  PRUint32 index = static_cast<PRUint32>(aChild->mIndexInParent);
+  uint32_t index = static_cast<uint32_t>(aChild->mIndexInParent);
   if (index >= mChildren.Length() || mChildren[index] != aChild) {
     NS_ERROR("Child is bound to parent but parent hasn't this child at its index!");
     aChild->UnbindFromParent();
     return false;
   }
 
-  for (PRUint32 idx = index + 1; idx < mChildren.Length(); idx++) {
+  for (uint32_t idx = index + 1; idx < mChildren.Length(); idx++) {
     NS_ASSERTION(mChildren[idx]->mIndexInParent == idx, "Accessible child index doesn't match");
     mChildren[idx]->mIndexInParent = idx - 1;
   }
 
   aChild->UnbindFromParent();
   mChildren.RemoveElementAt(index);
   mEmbeddedObjCollector = nullptr;
 
   return true;
 }
 
 Accessible*
-Accessible::GetChildAt(PRUint32 aIndex)
+Accessible::GetChildAt(uint32_t aIndex)
 {
   Accessible* child = mChildren.SafeElementAt(aIndex, nullptr);
   if (!child)
     return nullptr;
 
 #ifdef DEBUG
   Accessible* realParent = child->mParent;
   NS_ASSERTION(!realParent || realParent == this,
                "Two accessibles have the same first child accessible!");
 #endif
 
   return child;
 }
 
-PRUint32
+uint32_t
 Accessible::ChildCount() const
 {
   return mChildren.Length();
 }
 
-PRInt32
+int32_t
 Accessible::GetIndexOf(Accessible* aChild)
 {
   return (aChild->mParent != this) ? -1 : aChild->IndexInParent();
 }
 
-PRInt32
+int32_t
 Accessible::IndexInParent() const
 {
   return mIndexInParent;
 }
 
-PRUint32
+uint32_t
 Accessible::EmbeddedChildCount()
 {
   if (IsChildrenFlag(eMixedChildren)) {
     if (!mEmbeddedObjCollector)
       mEmbeddedObjCollector = new EmbeddedObjCollector(this);
     return mEmbeddedObjCollector->Count();
   }
 
   return ChildCount();
 }
 
 Accessible*
-Accessible::GetEmbeddedChildAt(PRUint32 aIndex)
+Accessible::GetEmbeddedChildAt(uint32_t aIndex)
 {
   if (IsChildrenFlag(eMixedChildren)) {
     if (!mEmbeddedObjCollector)
       mEmbeddedObjCollector = new EmbeddedObjCollector(this);
     return mEmbeddedObjCollector ?
       mEmbeddedObjCollector->GetAccessibleAt(aIndex) : nullptr;
   }
 
   return GetChildAt(aIndex);
 }
 
-PRInt32
+int32_t
 Accessible::GetIndexOfEmbeddedChild(Accessible* aChild)
 {
   if (IsChildrenFlag(eMixedChildren)) {
     if (!mEmbeddedObjCollector)
       mEmbeddedObjCollector = new EmbeddedObjCollector(this);
     return mEmbeddedObjCollector ?
       mEmbeddedObjCollector->GetIndexAt(aChild) : -1;
   }
@@ -2634,58 +2634,58 @@ Accessible::GetIndexOfEmbeddedChild(Acce
 bool
 Accessible::IsLink()
 {
   // Every embedded accessible within hypertext accessible implements
   // hyperlink interface.
   return mParent && mParent->IsHyperText() && nsAccUtils::IsEmbeddedObject(this);
 }
 
-PRUint32
+uint32_t
 Accessible::StartOffset()
 {
   NS_PRECONDITION(IsLink(), "StartOffset is called not on hyper link!");
 
   HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nullptr;
   return hyperText ? hyperText->GetChildOffset(this) : 0;
 }
 
-PRUint32
+uint32_t
 Accessible::EndOffset()
 {
   NS_PRECONDITION(IsLink(), "EndOffset is called on not hyper link!");
 
   HyperTextAccessible* hyperText = mParent ? mParent->AsHyperText() : nullptr;
   return hyperText ? (hyperText->GetChildOffset(this) + 1) : 0;
 }
 
 bool
 Accessible::IsLinkSelected()
 {
   NS_PRECONDITION(IsLink(),
                   "IsLinkSelected() called on something that is not a hyper link!");
   return FocusMgr()->IsFocused(this);
 }
 
-PRUint32
+uint32_t
 Accessible::AnchorCount()
 {
   NS_PRECONDITION(IsLink(), "AnchorCount is called on not hyper link!");
   return 1;
 }
 
 Accessible*
-Accessible::AnchorAt(PRUint32 aAnchorIndex)
+Accessible::AnchorAt(uint32_t aAnchorIndex)
 {
   NS_PRECONDITION(IsLink(), "GetAnchor is called on not hyper link!");
   return aAnchorIndex == 0 ? this : nullptr;
 }
 
 already_AddRefed<nsIURI>
-Accessible::AnchorURIAt(PRUint32 aAnchorIndex)
+Accessible::AnchorURIAt(uint32_t aAnchorIndex)
 {
   NS_PRECONDITION(IsLink(), "AnchorURIAt is called on not hyper link!");
 
   if (aAnchorIndex != 0)
     return nullptr;
 
   // Check if it's a simple xlink.
   if (nsCoreUtils::IsXLink(mContent)) {
@@ -2734,73 +2734,73 @@ Accessible::SelectedItems()
   while ((selected = iter.Next()))
     selectedItems->AppendElement(selected, false);
 
   nsIMutableArray* items = nullptr;
   selectedItems.forget(&items);
   return items;
 }
 
-PRUint32
+uint32_t
 Accessible::SelectedItemCount()
 {
-  PRUint32 count = 0;
+  uint32_t count = 0;
   AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
   Accessible* selected = nullptr;
   while ((selected = iter.Next()))
     ++count;
 
   return count;
 }
 
 Accessible*
-Accessible::GetSelectedItem(PRUint32 aIndex)
+Accessible::GetSelectedItem(uint32_t aIndex)
 {
   AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
   Accessible* selected = nullptr;
 
-  PRUint32 index = 0;
+  uint32_t index = 0;
   while ((selected = iter.Next()) && index < aIndex)
     index++;
 
   return selected;
 }
 
 bool
-Accessible::IsItemSelected(PRUint32 aIndex)
+Accessible::IsItemSelected(uint32_t aIndex)
 {
-  PRUint32 index = 0;
+  uint32_t index = 0;
   AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
   Accessible* selected = nullptr;
   while ((selected = iter.Next()) && index < aIndex)
     index++;
 
   return selected &&
     selected->State() & states::SELECTED;
 }
 
 bool
-Accessible::AddItemToSelection(PRUint32 aIndex)
+Accessible::AddItemToSelection(uint32_t aIndex)
 {
-  PRUint32 index = 0;
+  uint32_t index = 0;
   AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
   Accessible* selected = nullptr;
   while ((selected = iter.Next()) && index < aIndex)
     index++;
 
   if (selected)
     selected->SetSelected(true);
 
   return static_cast<bool>(selected);
 }
 
 bool
-Accessible::RemoveItemFromSelection(PRUint32 aIndex)
+Accessible::RemoveItemFromSelection(uint32_t aIndex)
 {
-  PRUint32 index = 0;
+  uint32_t index = 0;
   AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
   Accessible* selected = nullptr;
   while ((selected = iter.Next()) && index < aIndex)
     index++;
 
   if (selected)
     selected->SetSelected(false);
 
@@ -2923,25 +2923,25 @@ Accessible::CacheChildren()
   Accessible* child = nullptr;
   while ((child = walker.NextChild()) && AppendChild(child));
 }
 
 void
 Accessible::TestChildCache(Accessible* aCachedChild) const
 {
 #ifdef DEBUG
-  PRInt32 childCount = mChildren.Length();
+  int32_t childCount = mChildren.Length();
   if (childCount == 0) {
     NS_ASSERTION(IsChildrenFlag(eChildrenUninitialized),
                  "No children but initialized!");
     return;
   }
 
   Accessible* child = nullptr;
-  for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
+  for (int32_t childIdx = 0; childIdx < childCount; childIdx++) {
     child = mChildren[childIdx];
     if (child == aCachedChild)
       break;
   }
 
   NS_ASSERTION(child == aCachedChild,
                "[TestChildCache] cached accessible wasn't found. Wrong accessible tree!");  
 #endif
@@ -2962,27 +2962,27 @@ Accessible::EnsureChildren()
   // State is embedded children until text leaf accessible is appended.
   SetChildrenFlag(eEmbeddedChildren); // Prevent reentry
 
   CacheChildren();
   return false;
 }
 
 Accessible*
-Accessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError) const
+Accessible::GetSiblingAtOffset(int32_t aOffset, nsresult* aError) const
 {
   if (!mParent || mIndexInParent == -1) {
     if (aError)
       *aError = NS_ERROR_UNEXPECTED;
 
     return nullptr;
   }
 
   if (aError &&
-      mIndexInParent + aOffset >= static_cast<PRInt32>(mParent->ChildCount())) {
+      mIndexInParent + aOffset >= static_cast<int32_t>(mParent->ChildCount())) {
     *aError = NS_OK; // fail peacefully
     return nullptr;
   }
 
   Accessible* child = mParent->GetChildAt(mIndexInParent + aOffset);
   if (aError && !child)
     *aError = NS_ERROR_UNEXPECTED;
 
@@ -3044,17 +3044,17 @@ Accessible::GetAttrValue(nsIAtom *aPrope
   nsresult error = NS_OK;
   double value = attrValue.ToDouble(&error);
   if (NS_SUCCEEDED(error))
     *aValue = value;
 
   return NS_OK;
 }
 
-PRUint32
+uint32_t
 Accessible::GetActionRule()
 {
   if (InteractiveState() & states::UNAVAILABLE)
     return eNoAction;
 
   // Check if it's simple xlink.
   if (nsCoreUtils::IsXLink(mContent))
     return eJumpAction;
@@ -3089,29 +3089,29 @@ Accessible::GetGroupInfo()
   if (mGroupInfo)
     return mGroupInfo;
 
   mGroupInfo = AccGroupInfo::CreateGroupInfo(this);
   return mGroupInfo;
 }
 
 void
-Accessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet, PRInt32 *aSetSize)
+Accessible::GetPositionAndSizeInternal(int32_t *aPosInSet, int32_t *aSetSize)
 {
   AccGroupInfo* groupInfo = GetGroupInfo();
   if (groupInfo) {
     *aPosInSet = groupInfo->PosInSet();
     *aSetSize = groupInfo->SetSize();
   }
 }
 
-PRInt32
+int32_t
 Accessible::GetLevelInternal()
 {
-  PRInt32 level = nsAccUtils::GetDefaultLevel(this);
+  int32_t level = nsAccUtils::GetDefaultLevel(this);
 
   if (!IsBoundToParent())
     return level;
 
   roles::Role role = Role();
   if (role == roles::OUTLINEITEM) {
     // Always expose 'level' attribute for 'outlineitem' accessible. The number
     // of nested 'grouping' accessibles containing 'outlineitem' accessible is
@@ -3147,18 +3147,18 @@ Accessible::GetLevelInternal()
         break;
 
     }
 
     if (level == 0) {
       // If this listitem is on top of nested lists then expose 'level'
       // attribute.
       parent = Parent();
-      PRUint32 siblingCount = parent->ChildCount();
-      for (PRUint32 siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
+      uint32_t siblingCount = parent->ChildCount();
+      for (uint32_t siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
         Accessible* sibling = parent->GetChildAt(siblingIdx);
 
         Accessible* siblingChild = sibling->LastChild();
         if (siblingChild && siblingChild->Role() == roles::LIST)
           return 1;
       }
     } else {
       ++ level; // level is 1-index based
--- a/accessible/src/generic/Accessible.h
+++ b/accessible/src/generic/Accessible.h
@@ -56,19 +56,19 @@ enum ENameValueFlag {
 
 /**
  * Group position (level, position in set and set size).
  */
 struct GroupPos
 {
   GroupPos() : level(0), posInSet(0), setSize(0) { }
 
-  PRInt32 level;
-  PRInt32 posInSet;
-  PRInt32 setSize;
+  int32_t level;
+  int32_t posInSet;
+  int32_t setSize;
 };
 
 } // namespace a11y
 } // namespace mozilla
 
 struct nsRect;
 class nsIContent;
 class nsIFrame;
@@ -152,17 +152,17 @@ public:
 
   /**
    * Maps ARIA state attributes to state of accessible. Note the given state
    * argument should hold states for accessible before you pass it into this
    * method.
    *
    * @param  [in/out] where to fill the states into.
    */
-  virtual void ApplyARIAState(PRUint64* aState) const;
+  virtual void ApplyARIAState(uint64_t* aState) const;
 
   /**
    * Returns the accessible name provided by native markup. It doesn't take
    * into account ARIA markup used to specify the name.
    *
    * @param  aName             [out] the accessible name
    *
    * @return NS_OK_EMPTY_NAME  points empty name was specified by native markup
@@ -192,59 +192,59 @@ public:
    * Returns enumerated accessible role from native markup (see constants in
    * Role.h). Doesn't take into account ARIA roles.
    */
   virtual mozilla::a11y::role NativeRole();
 
   /**
    * Return all states of accessible (including ARIA states).
    */
-  virtual PRUint64 State();
+  virtual uint64_t State();
 
   /**
    * Return interactive states present on the accessible
    * (@see NativeInteractiveState).
    */
-  PRUint64 InteractiveState() const
+  uint64_t InteractiveState() const
   {
-    PRUint64 state = NativeInteractiveState();
+    uint64_t state = NativeInteractiveState();
     ApplyARIAState(&state);
     return state;
   }
 
   /**
    * Return link states present on the accessible.
    */
-  PRUint64 LinkState() const
+  uint64_t LinkState() const
   {
-    PRUint64 state = NativeLinkState();
+    uint64_t state = NativeLinkState();
     ApplyARIAState(&state);
     return state;
   }
 
   /**
    * Return the states of accessible, not taking into account ARIA states.
    * Use State() to get complete set of states.
    */
-  virtual PRUint64 NativeState();
+  virtual uint64_t NativeState();
 
   /**
    * Return native interactice state (unavailable, focusable or selectable).
    */
-  virtual PRUint64 NativeInteractiveState() const;
+  virtual uint64_t NativeInteractiveState() const;
 
   /**
    * Return native link states present on the accessible.
    */
-  virtual PRUint64 NativeLinkState() const;
+  virtual uint64_t NativeLinkState() const;
 
   /**
    * Return bit set of invisible and offscreen states.
    */
-  PRUint64 VisibilityState();
+  uint64_t VisibilityState();
 
   /**
    * Return true if native unavailable state present.
    */
   virtual bool NativelyUnavailable() const;
 
   /**
    * Returns attributes for accessible without explicitly setted ARIA
@@ -268,43 +268,43 @@ public:
   /**
    * Return direct or deepest child at the given point.
    *
    * @param  aX           [in] x coordinate relative screen
    * @param  aY           [in] y coordinate relative screen
    * @param  aWhichChild  [in] flag points if deepest or direct child
    *                        should be returned
    */
-  virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+  virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
   /**
    * Return the focused child if any.
    */
   virtual Accessible* FocusedChild();
 
   /**
    * Return calculated group level based on accessible hierarchy.
    */
-  virtual PRInt32 GetLevelInternal();
+  virtual int32_t GetLevelInternal();
 
   /**
    * Calculate position in group and group size ('posinset' and 'setsize') based
    * on accessible hierarchy.
    *
    * @param  aPosInSet  [out] accessible position in the group
    * @param  aSetSize   [out] the group size
    */
-  virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
-                                          PRInt32 *aSetSize);
+  virtual void GetPositionAndSizeInternal(int32_t *aPosInSet,
+                                          int32_t *aSetSize);
 
   /**
    * Get the relation of the given type.
    */
-  virtual mozilla::a11y::Relation RelationByType(PRUint32 aType);
+  virtual mozilla::a11y::Relation RelationByType(uint32_t aType);
 
   //////////////////////////////////////////////////////////////////////////////
   // Initializing methods
 
   /**
    * Set the ARIA role map entry for a new accessible.
    * For a newly created accessible, specify which role map entry should be used.
    *
@@ -334,46 +334,46 @@ public:
    * itself should override this method to do nothing.
    */
   virtual void InvalidateChildren();
 
   /**
    * Append/insert/remove a child. Return true if operation was successful.
    */
   virtual bool AppendChild(Accessible* aChild);
-  virtual bool InsertChildAt(PRUint32 aIndex, Accessible* aChild);
+  virtual bool InsertChildAt(uint32_t aIndex, Accessible* aChild);
   virtual bool RemoveChild(Accessible* aChild);
 
   //////////////////////////////////////////////////////////////////////////////
   // Accessible tree traverse methods
 
   /**
    * Return parent accessible.
    */
   Accessible* Parent() const { return mParent; }
 
   /**
    * Return child accessible at the given index.
    */
-  virtual Accessible* GetChildAt(PRUint32 aIndex);
+  virtual Accessible* GetChildAt(uint32_t aIndex);
 
   /**
    * Return child accessible count.
    */
-  virtual PRUint32 ChildCount() const;
+  virtual uint32_t ChildCount() const;
 
   /**
    * Return index of the given child accessible.
    */
-  virtual PRInt32 GetIndexOf(Accessible* aChild);
+  virtual int32_t GetIndexOf(Accessible* aChild);
 
   /**
    * Return index in parent accessible.
    */
-  virtual PRInt32 IndexInParent() const;
+  virtual int32_t IndexInParent() const;
 
   /**
    * Return true if accessible has children;
    */
   bool HasChildren() { return !!GetChildAt(0); }
 
   /**
    * Return first/last/next/previous sibling of the accessible.
@@ -381,43 +381,43 @@ public:
   inline Accessible* NextSibling() const
     {  return GetSiblingAtOffset(1); }
   inline Accessible* PrevSibling() const
     { return GetSiblingAtOffset(-1); }
   inline Accessible* FirstChild()
     { return GetChildAt(0); }
   inline Accessible* LastChild()
   {
-    PRUint32 childCount = ChildCount();
+    uint32_t childCount = ChildCount();
     return childCount != 0 ? GetChildAt(childCount - 1) : nullptr;
   }
 
 
   /**
    * Return embedded accessible children count.
    */
-  PRUint32 EmbeddedChildCount();
+  uint32_t EmbeddedChildCount();
 
   /**
    * Return embedded accessible child at the given index.
    */
-  Accessible* GetEmbeddedChildAt(PRUint32 aIndex);
+  Accessible* GetEmbeddedChildAt(uint32_t aIndex);
 
   /**
    * Return index of the given embedded accessible child.
    */
-  PRInt32 GetIndexOfEmbeddedChild(Accessible* aChild);
+  int32_t GetIndexOfEmbeddedChild(Accessible* aChild);
 
   /**
    * Return number of content children/content child at index. The content
    * child is created from markup in contrast to it's never constructed by its
    * parent accessible (like treeitem accessibles for XUL trees).
    */
-  PRUint32 ContentChildCount() const { return mChildren.Length(); }
-  Accessible* ContentChildAt(PRUint32 aIndex) const
+  uint32_t ContentChildCount() const { return mChildren.Length(); }
+  Accessible* ContentChildAt(uint32_t aIndex) const
     { return mChildren.ElementAt(aIndex); }
 
   /**
    * Return true if children were initialized.
    */
   inline bool AreChildrenCached() const
     { return !IsChildrenFlag(eChildrenUninitialized); }
 
@@ -445,18 +445,18 @@ public:
    * string.
    *
    * @param aText         [in] returned text of the accessible
    * @param aStartOffset  [in, optional] start offset inside of the accessible,
    *                        if missed entire text is appended
    * @param aLength       [in, optional] required length of text, if missed
    *                        then text form start offset till the end is appended
    */
-  virtual void AppendTextTo(nsAString& aText, PRUint32 aStartOffset = 0,
-                            PRUint32 aLength = PR_UINT32_MAX);
+  virtual void AppendTextTo(nsAString& aText, uint32_t aStartOffset = 0,
+                            uint32_t aLength = PR_UINT32_MAX);
 
   /**
    * Assert if child not in parent's cache if the cache was initialized at this
    * point.
    */
   void TestChildCache(Accessible* aCachedChild) const;
 
   /**
@@ -518,17 +518,17 @@ public:
   mozilla::a11y::TextLeafAccessible* AsTextLeaf();
 
   //////////////////////////////////////////////////////////////////////////////
   // ActionAccessible
 
   /**
    * Return the number of actions that can be performed on this accessible.
    */
-  virtual PRUint8 ActionCount();
+  virtual uint8_t ActionCount();
 
   /**
    * Return access key, such as Alt+D.
    */
   virtual KeyBinding AccessKey() const;
 
   /**
    * Return global keyboard shortcut for default action, such as Ctrl+O for
@@ -542,22 +542,22 @@ public:
   /**
    * Return true if the accessible is hyper link accessible.
    */
   virtual bool IsLink();
 
   /**
    * Return the start offset of the link within the parent accessible.
    */
-  virtual PRUint32 StartOffset();
+  virtual uint32_t StartOffset();
 
   /**
    * Return the end offset of the link within the parent accessible.
    */
-  virtual PRUint32 EndOffset();
+  virtual uint32_t EndOffset();
 
   /**
    * Return true if the link is valid (e. g. points to a valid URL).
    */
   inline bool IsLinkValid()
   {
     NS_PRECONDITION(IsLink(), "IsLinkValid is called on not hyper link!");
 
@@ -571,27 +571,27 @@ public:
   /**
    * Return true if the link currently has the focus.
    */
   bool IsLinkSelected();
 
   /**
    * Return the number of anchors within the link.
    */
-  virtual PRUint32 AnchorCount();
+  virtual uint32_t AnchorCount();
 
   /**
    * Returns an anchor accessible at the given index.
    */
-  virtual Accessible* AnchorAt(PRUint32 aAnchorIndex);
+  virtual Accessible* AnchorAt(uint32_t aAnchorIndex);
 
   /**
    * Returns an anchor URI at the given index.
    */
-  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
+  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
 
   //////////////////////////////////////////////////////////////////////////////
   // SelectAccessible
 
   /**
    * Return true if the accessible is a select control containing selectable
    * items.
    */
@@ -600,37 +600,37 @@ public:
   /**
    * Return an array of selected items.
    */
   virtual already_AddRefed<nsIArray> SelectedItems();
 
   /**
    * Return the number of selected items.
    */
-  virtual PRUint32 SelectedItemCount();
+  virtual uint32_t SelectedItemCount();
 
   /**
    * Return selected item at the given index.
    */
-  virtual Accessible* GetSelectedItem(PRUint32 aIndex);
+  virtual Accessible* GetSelectedItem(uint32_t aIndex);
 
   /**
    * Determine if item at the given index is selected.
    */
-  virtual bool IsItemSelected(PRUint32 aIndex);
+  virtual bool IsItemSelected(uint32_t aIndex);
 
   /**
    * Add item at the given index the selection. Return true if success.
    */
-  virtual bool AddItemToSelection(PRUint32 aIndex);
+  virtual bool AddItemToSelection(uint32_t aIndex);
 
   /**
    * Remove item at the given index from the selection. Return if success.
    */
-  virtual bool RemoveItemFromSelection(PRUint32 aIndex);
+  virtual bool RemoveItemFromSelection(uint32_t aIndex);
 
   /**
    * Select all items. Return true if success.
    */
   virtual bool SelectAll();
 
   /**
    * Unselect all items. Return true if success.
@@ -697,23 +697,23 @@ protected:
   /**
    * Cache accessible children.
    */
   virtual void CacheChildren();
 
   /**
    * Set accessible parent and index in parent.
    */
-  virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent);
+  virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent);
   virtual void UnbindFromParent();
 
   /**
    * Return sibling accessible at the given offset.
    */
-  virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
+  virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
                                          nsresult *aError = nullptr) const;
 
   /**
    * Flags used to describe the state and type of children.
    */
   enum ChildrenFlags {
     eChildrenUninitialized = 0, // children aren't initialized
     eMixedChildren = 1 << 0, // text leaf children are presented
@@ -809,25 +809,25 @@ protected:
    *  command opens a modal dialog/window, it won't return until the
    *  dialog/window is closed. If executing action command directly in
    *  nsIAccessible::DoAction() method, it will block AT tools (e.g. GOK) that
    *  invoke action of mozilla accessibles direclty (see bug 277888 for details).
    *
    * @param  aContent      [in, optional] element to click
    * @param  aActionIndex  [in, optional] index of accessible action
    */
-  void DoCommand(nsIContent *aContent = nullptr, PRUint32 aActionIndex = 0);
+  void DoCommand(nsIContent *aContent = nullptr, uint32_t aActionIndex = 0);
 
   /**
    * Dispatch click event.
    */
-  virtual void DispatchClickEvent(nsIContent *aContent, PRUint32 aActionIndex);
+  virtual void DispatchClickEvent(nsIContent *aContent, uint32_t aActionIndex);
 
   NS_DECL_RUNNABLEMETHOD_ARG2(Accessible, DispatchClickEvent,
-                              nsCOMPtr<nsIContent>, PRUint32)
+                              nsCOMPtr<nsIContent>, uint32_t)
 
   //////////////////////////////////////////////////////////////////////////////
   // Helpers
 
   /**
    *  Get the container node for an atomic region, defined by aria-atomic="true"
    *  @return the container node
    */
@@ -842,17 +842,17 @@ protected:
    * @return - NS_OK_NO_ARIA_VALUE if there is no setted ARIA attribute
    */
   nsresult GetAttrValue(nsIAtom *aAriaProperty, double *aValue);
 
   /**
    * Return the action rule based on ARIA enum constants EActionRule
    * (see nsARIAMap.h). Used by ActionCount() and GetActionName().
    */
-  PRUint32 GetActionRule();
+  uint32_t GetActionRule();
 
   /**
    * Return group info.
    */
   AccGroupInfo* GetGroupInfo();
 
   /**
    * Fires platform accessible event. It's notification method only. It does
@@ -862,26 +862,26 @@ protected:
    *
    * @param aEvent  the accessible event to fire.
    */
   virtual nsresult FirePlatformEvent(AccEvent* aEvent) = 0;
 
   // Data Members
   nsRefPtr<Accessible> mParent;
   nsTArray<nsRefPtr<Accessible> > mChildren;
-  PRInt32 mIndexInParent;
+  int32_t mIndexInParent;
 
-  static const PRUint32 kChildrenFlagsMask =
+  static const uint32_t kChildrenFlagsMask =
     eChildrenUninitialized | eMixedChildren | eEmbeddedChildren;
 
-  PRUint32 mFlags;
+  uint32_t mFlags;
   friend class DocAccessible;
 
   nsAutoPtr<EmbeddedObjCollector> mEmbeddedObjCollector;
-  PRInt32 mIndexOfEmbeddedChild;
+  int32_t mIndexOfEmbeddedChild;
   friend class EmbeddedObjCollector;
 
   nsAutoPtr<AccGroupInfo> mGroupInfo;
   friend class AccGroupInfo;
 
   /**
    * Non-null indicates author-supplied role; possibly state & value as well
    */
@@ -897,29 +897,29 @@ NS_DEFINE_STATIC_IID_ACCESSOR(Accessible
  * global keyboard shortcuts).
  */
 class KeyBinding
 {
 public:
   /**
    * Modifier mask values.
    */
-  static const PRUint32 kShift = 1;
-  static const PRUint32 kControl = 2;
-  static const PRUint32 kAlt = 4;
-  static const PRUint32 kMeta = 8;
-  static const PRUint32 kOS = 16;
+  static const uint32_t kShift = 1;
+  static const uint32_t kControl = 2;
+  static const uint32_t kAlt = 4;
+  static const uint32_t kMeta = 8;
+  static const uint32_t kOS = 16;
 
   KeyBinding() : mKey(0), mModifierMask(0) {}
-  KeyBinding(PRUint32 aKey, PRUint32 aModifierMask) :
+  KeyBinding(uint32_t aKey, uint32_t aModifierMask) :
     mKey(aKey), mModifierMask(aModifierMask) {};
 
   inline bool IsEmpty() const { return !mKey; }
-  inline PRUint32 Key() const { return mKey; }
-  inline PRUint32 ModifierMask() const { return mModifierMask; }
+  inline uint32_t Key() const { return mKey; }
+  inline uint32_t ModifierMask() const { return mModifierMask; }
 
   enum Format {
     ePlatformFormat,
     eAtkFormat
   };
 
   /**
    * Return formatted string for this key binding depending on the given format.
@@ -940,13 +940,13 @@ public:
         ToAtkFormat(aValue);
     }
   }
 
 private:
   void ToPlatformFormat(nsAString& aValue) const;
   void ToAtkFormat(nsAString& aValue) const;
 
-  PRUint32 mKey;
-  PRUint32 mModifierMask;
+  uint32_t mKey;
+  uint32_t mModifierMask;
 };
 
 #endif
--- a/accessible/src/generic/ApplicationAccessible.cpp
+++ b/accessible/src/generic/ApplicationAccessible.cpp
@@ -99,17 +99,17 @@ ApplicationAccessible::Description(nsStr
 }
 
 void
 ApplicationAccessible::Value(nsString& aValue)
 {
   aValue.Truncate();
 }
 
-PRUint64
+uint64_t
 ApplicationAccessible::State()
 {
   return IsDefunct() ? states::DEFUNCT : 0;
 }
 
 NS_IMETHODIMP
 ApplicationAccessible::GetAttributes(nsIPersistentProperties** aAttributes)
 {
@@ -120,41 +120,41 @@ ApplicationAccessible::GetAttributes(nsI
 
 GroupPos
 ApplicationAccessible::GroupPosition()
 {
   return GroupPos();
 }
 
 Accessible*
-ApplicationAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+ApplicationAccessible::ChildAtPoint(int32_t aX, int32_t aY,
                                     EWhichChildAtPoint aWhichChild)
 {
   return nullptr;
 }
 
 Accessible*
 ApplicationAccessible::FocusedChild()
 {
   Accessible* focus = FocusMgr()->FocusedAccessible();
   if (focus && focus->Parent() == this)
     return focus;
 
   return nullptr;
 }
 
 Relation
-ApplicationAccessible::RelationByType(PRUint32 aRelationType)
+ApplicationAccessible::RelationByType(uint32_t aRelationType)
 {
   return Relation();
 }
 
 NS_IMETHODIMP
-ApplicationAccessible::GetBounds(PRInt32* aX, PRInt32* aY,
-                                 PRInt32* aWidth, PRInt32* aHeight)
+ApplicationAccessible::GetBounds(int32_t* aX, int32_t* aY,
+                                 int32_t* aWidth, int32_t* aHeight)
 {
   NS_ENSURE_ARG_POINTER(aX);
   *aX = 0;
   NS_ENSURE_ARG_POINTER(aY);
   *aY = 0;
   NS_ENSURE_ARG_POINTER(aWidth);
   *aWidth = 0;
   NS_ENSURE_ARG_POINTER(aHeight);
@@ -175,39 +175,39 @@ ApplicationAccessible::TakeSelection()
 }
 
 NS_IMETHODIMP
 ApplicationAccessible::TakeFocus()
 {
   return NS_OK;
 }
 
-PRUint8
+uint8_t
 ApplicationAccessible::ActionCount()
 {
   return 0;
 }
 
 NS_IMETHODIMP
-ApplicationAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+ApplicationAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-ApplicationAccessible::GetActionDescription(PRUint8 aIndex,
+ApplicationAccessible::GetActionDescription(uint8_t aIndex,
                                             nsAString& aDescription)
 {
   aDescription.Truncate();
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-ApplicationAccessible::DoAction(PRUint8 aIndex)
+ApplicationAccessible::DoAction(uint8_t aIndex)
 {
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleApplication
 
 NS_IMETHODIMP
@@ -285,27 +285,27 @@ ApplicationAccessible::IsPrimaryForNode(
 {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible public methods
 
 void
-ApplicationAccessible::ApplyARIAState(PRUint64* aState) const
+ApplicationAccessible::ApplyARIAState(uint64_t* aState) const
 {
 }
 
 role
 ApplicationAccessible::NativeRole()
 {
   return roles::APP_ROOT;
 }
 
-PRUint64
+uint64_t
 ApplicationAccessible::NativeState()
 {
   return 0;
 }
 
 void
 ApplicationAccessible::InvalidateChildren()
 {
@@ -358,17 +358,17 @@ ApplicationAccessible::CacheChildren()
         GetAccService()->GetDocAccessible(docNode); // ensure creation
       }
     }
     windowEnumerator->HasMoreElements(&hasMore);
   }
 }
 
 Accessible*
-ApplicationAccessible::GetSiblingAtOffset(PRInt32 aOffset,
+ApplicationAccessible::GetSiblingAtOffset(int32_t aOffset,
                                           nsresult* aError) const
 {
   if (aError)
     *aError = NS_OK; // fail peacefully
 
   return nullptr;
 }
 
@@ -395,24 +395,24 @@ NS_IMETHODIMP
 ApplicationAccessible::GetRootDocument(nsIAccessibleDocument** aRootDocument)
 {
   NS_ENSURE_ARG_POINTER(aRootDocument);
   *aRootDocument = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ApplicationAccessible::ScrollTo(PRUint32 aScrollType)
+ApplicationAccessible::ScrollTo(uint32_t aScrollType)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-ApplicationAccessible::ScrollToPoint(PRUint32 aCoordinateType,
-                                     PRInt32 aX, PRInt32 aY)
+ApplicationAccessible::ScrollToPoint(uint32_t aCoordinateType,
+                                     int32_t aX, int32_t aY)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
 ApplicationAccessible::GetLanguage(nsAString& aLanguage)
 {
   aLanguage.Truncate();
--- a/accessible/src/generic/ApplicationAccessible.h
+++ b/accessible/src/generic/ApplicationAccessible.h
@@ -36,66 +36,66 @@ public:
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
   NS_IMETHOD GetDOMNode(nsIDOMNode** aDOMNode);
   NS_IMETHOD GetDocument(nsIAccessibleDocument** aDocument);
   NS_IMETHOD GetRootDocument(nsIAccessibleDocument** aRootDocument);
-  NS_IMETHOD ScrollTo(PRUint32 aScrollType);
-  NS_IMETHOD ScrollToPoint(PRUint32 aCoordinateType, PRInt32 aX, PRInt32 aY);
+  NS_IMETHOD ScrollTo(uint32_t aScrollType);
+  NS_IMETHOD ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY);
   NS_IMETHOD GetLanguage(nsAString& aLanguage);
   NS_IMETHOD GetParent(nsIAccessible **aParent);
   NS_IMETHOD GetNextSibling(nsIAccessible **aNextSibling);
   NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
   NS_IMETHOD GetAttributes(nsIPersistentProperties **aAttributes);
-  NS_IMETHOD GetBounds(PRInt32 *aX, PRInt32 *aY,
-                       PRInt32 *aWidth, PRInt32 *aHeight);
+  NS_IMETHOD GetBounds(int32_t *aX, int32_t *aY,
+                       int32_t *aWidth, int32_t *aHeight);
   NS_IMETHOD SetSelected(bool aIsSelected);
   NS_IMETHOD TakeSelection();
   NS_IMETHOD TakeFocus();
-  NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString &aName);
-  NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString &aDescription);
-  NS_IMETHOD DoAction(PRUint8 aIndex);
+  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString &aName);
+  NS_IMETHOD GetActionDescription(uint8_t aIndex, nsAString &aDescription);
+  NS_IMETHOD DoAction(uint8_t aIndex);
 
   // nsIAccessibleApplication
   NS_DECL_NSIACCESSIBLEAPPLICATION
 
   // nsAccessNode
   virtual void Init();
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // Accessible
   virtual GroupPos GroupPosition();
   virtual ENameValueFlag Name(nsString& aName);
-  virtual void ApplyARIAState(PRUint64* aState) const;
+  virtual void ApplyARIAState(uint64_t* aState) const;
   virtual void Description(nsString& aDescription);
   virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 State();
-  virtual PRUint64 NativeState();
-  virtual Relation RelationByType(PRUint32 aRelType);
+  virtual uint64_t State();
+  virtual uint64_t NativeState();
+  virtual Relation RelationByType(uint32_t aRelType);
 
-  virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+  virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
   virtual Accessible* FocusedChild();
 
   virtual void InvalidateChildren();
 
   // ActionAccessible
-  virtual PRUint8 ActionCount();
+  virtual uint8_t ActionCount();
   virtual KeyBinding AccessKey() const;
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
-  virtual Accessible* GetSiblingAtOffset(PRInt32 aOffset,
+  virtual Accessible* GetSiblingAtOffset(int32_t aOffset,
                                          nsresult *aError = nullptr) const;
 
 private:
   nsCOMPtr<nsIXULAppInfo> mAppInfo;
 };
 
 } // namespace a11y
 } // namespace mozilla
--- a/accessible/src/generic/BaseAccessibles.cpp
+++ b/accessible/src/generic/BaseAccessibles.cpp
@@ -31,17 +31,17 @@ LeafAccessible::
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(LeafAccessible, Accessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // LeafAccessible: Accessible public
 
 Accessible*
-LeafAccessible::ChildAtPoint(PRInt32 aX, PRInt32 aY,
+LeafAccessible::ChildAtPoint(int32_t aX, int32_t aY,
                              EWhichChildAtPoint aWhichChild)
 {
   // Don't walk into leaf accessibles.
   return this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // LeafAccessible: Accessible private
@@ -72,17 +72,17 @@ NS_IMPL_ISUPPORTS_INHERITED0(LinkableAcc
 // LinkableAccessible. nsIAccessible
 
 NS_IMETHODIMP
 LinkableAccessible::TakeFocus()
 {
   return mActionAcc ? mActionAcc->TakeFocus() : AccessibleWrap::TakeFocus();
 }
 
-PRUint64
+uint64_t
 LinkableAccessible::NativeLinkState() const
 {
   if (mIsLink)
     return states::LINKED | (mActionAcc->LinkState() & states::TRAVERSED);
 
   return 0;
 }
 
@@ -95,24 +95,24 @@ LinkableAccessible::Value(nsString& aVal
   if (!aValue.IsEmpty())
     return;
 
   if (aValue.IsEmpty() && mIsLink)
     mActionAcc->Value(aValue);
 }
 
 
-PRUint8
+uint8_t
 LinkableAccessible::ActionCount()
 {
   return (mIsOnclick || mIsLink) ? 1 : 0;
 }
 
 NS_IMETHODIMP
-LinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+LinkableAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
 {
   aName.Truncate();
 
   // Action 0 (default action): Jump to link
   if (aIndex == eAction_Jump) {
     if (mIsLink) {
       aName.AssignLiteral("jump");
       return NS_OK;
@@ -122,17 +122,17 @@ LinkableAccessible::GetActionName(PRUint
       return NS_OK;
     }
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-LinkableAccessible::DoAction(PRUint8 aIndex)
+LinkableAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Jump)
     return NS_ERROR_INVALID_ARG;
 
   return mActionAcc ? mActionAcc->DoAction(aIndex) :
     AccessibleWrap::DoAction(aIndex);
 }
 
@@ -154,17 +154,17 @@ LinkableAccessible::Shutdown()
   mActionAcc = nullptr;
   AccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // LinkableAccessible: HyperLinkAccessible
 
 already_AddRefed<nsIURI>
-LinkableAccessible::AnchorURIAt(PRUint32 aAnchorIndex)
+LinkableAccessible::AnchorURIAt(uint32_t aAnchorIndex)
 {
   if (mIsLink) {
     NS_ASSERTION(mActionAcc->IsLink(),
                  "nsIAccessibleHyperLink isn't implemented.");
 
     if (mActionAcc->IsLink())
       return mActionAcc->AnchorURIAt(aAnchorIndex);
   }
@@ -172,17 +172,17 @@ LinkableAccessible::AnchorURIAt(PRUint32
   return nullptr;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // LinkableAccessible: Accessible protected
 
 void
 LinkableAccessible::BindToParent(Accessible* aParent,
-                                 PRUint32 aIndexInParent)
+                                 uint32_t aIndexInParent)
 {
   AccessibleWrap::BindToParent(aParent, aIndexInParent);
 
   // Cache action content.
   mActionAcc = nullptr;
   mIsLink = false;
   mIsOnclick = false;
 
--- a/accessible/src/generic/BaseAccessibles.h
+++ b/accessible/src/generic/BaseAccessibles.h
@@ -27,17 +27,17 @@ class LeafAccessible : public Accessible
 public:
 
   LeafAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsISupports
   NS_DECL_ISUPPORTS_INHERITED
 
   // Accessible
-  virtual Accessible* ChildAtPoint(PRInt32 aX, PRInt32 aY,
+  virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild);
 
 protected:
 
   // Accessible
   virtual void CacheChildren();
 };
 
@@ -52,37 +52,37 @@ class LinkableAccessible : public Access
 public:
   enum { eAction_Jump = 0 };
 
   LinkableAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIAccessible
-  NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(PRUint8 index);
+  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
+  NS_IMETHOD DoAction(uint8_t index);
   NS_IMETHOD TakeFocus();
 
   // nsAccessNode
   virtual void Shutdown();
 
   // Accessible
   virtual void Value(nsString& aValue);
-  virtual PRUint64 NativeLinkState() const;
+  virtual uint64_t NativeLinkState() const;
 
   // ActionAccessible
-  virtual PRUint8 ActionCount();
+  virtual uint8_t ActionCount();
   virtual KeyBinding AccessKey() const;
 
   // HyperLinkAccessible
-  virtual already_AddRefed<nsIURI> AnchorURIAt(PRUint32 aAnchorIndex);
+  virtual already_AddRefed<nsIURI> AnchorURIAt(uint32_t aAnchorIndex);
 
 protected:
   // Accessible
-  virtual void BindToParent(Accessible* aParent, PRUint32 aIndexInParent);
+  virtual void BindToParent(Accessible* aParent, uint32_t aIndexInParent);
   virtual void UnbindFromParent();
 
   /**
    * Parent accessible that provides an action for this linkable accessible.
    */
   Accessible* mActionAcc;
   bool mIsLink;
   bool mIsOnclick;
--- a/accessible/src/generic/DocAccessible.cpp
+++ b/accessible/src/generic/DocAccessible.cpp
@@ -65,17 +65,17 @@ static nsIAtom** kRelationAttrs[] =
   &nsGkAtoms::aria_describedby,
   &nsGkAtoms::aria_owns,
   &nsGkAtoms::aria_controls,
   &nsGkAtoms::aria_flowto,
   &nsGkAtoms::_for,
   &nsGkAtoms::control
 };
 
-static const PRUint32 kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs);
+static const uint32_t kRelationAttrsLen = NS_ARRAY_LENGTH(kRelationAttrs);
 
 ////////////////////////////////////////////////////////////////////////////////
 // Constructor/desctructor
 
 DocAccessible::
   DocAccessible(nsIDocument* aDocument, nsIContent* aRootContent,
                   nsIPresShell* aPresShell) :
   HyperTextAccessibleWrap(aRootContent, this),
@@ -126,17 +126,17 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mNotificationController,
                                                   NotificationController)
 
   if (tmp->mVirtualCursor) {
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mVirtualCursor,
                                                     nsAccessiblePivot)
   }
 
-  PRUint32 i, length = tmp->mChildDocuments.Length();
+  uint32_t i, length = tmp->mChildDocuments.Length();
   for (i = 0; i < length; ++i) {
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(mChildDocuments[i],
                                                          nsIAccessible)
   }
 
   CycleCollectorTraverseCache(tmp->mAccessibleCache, &cb);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
@@ -213,17 +213,17 @@ DocAccessible::Name(nsString& aName)
 role
 DocAccessible::NativeRole()
 {
   nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
     nsCoreUtils::GetDocShellTreeItemFor(mDocument);
   if (docShellTreeItem) {
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
     docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
-    PRInt32 itemType;
+    int32_t itemType;
     docShellTreeItem->GetItemType(&itemType);
     if (sameTypeRoot == docShellTreeItem) {
       // Root of content or chrome tree
       if (itemType == nsIDocShellTreeItem::typeChrome)
         return roles::CHROME_WINDOW;
 
       if (itemType == nsIDocShellTreeItem::typeContent) {
 #ifdef MOZ_XUL
@@ -273,22 +273,22 @@ DocAccessible::Description(nsString& aDe
 
   if (aDescription.IsEmpty())
     nsTextEquivUtils::
       GetTextEquivFromIDRefs(this, nsGkAtoms::aria_describedby,
                              aDescription);
 }
 
 // Accessible public method
-PRUint64
+uint64_t
 DocAccessible::NativeState()
 {
   // The root content of the document might be removed so that mContent is
   // out of date.
-  PRUint64 state = (mContent->GetCurrentDoc() == mDocument) ?
+  uint64_t state = (mContent->GetCurrentDoc() == mDocument) ?
     0 : states::STALE;
 
   // Document is always focusable.
   state |= states::FOCUSABLE; // keep in sync with NativeIteractiveState() impl
   if (FocusMgr()->IsFocused(this))
     state |= states::FOCUSED;
 
   // Expose stale state until the document is ready (DOM is loaded and tree is
@@ -308,32 +308,32 @@ DocAccessible::NativeState()
   }
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
   state |= editor ? states::EDITABLE : states::READONLY;
 
   return state;
 }
 
-PRUint64
+uint64_t
 DocAccessible::NativeInteractiveState() const
 {
   // Document is always focusable.
   return states::FOCUSABLE;
 }
 
 bool
 DocAccessible::NativelyUnavailable() const
 {
   return false;
 }
 
 // Accessible public method
 void
-DocAccessible::ApplyARIAState(PRUint64* aState) const
+DocAccessible::ApplyARIAState(uint64_t* aState) const
 {
   // Combine with states from outer doc
   // 
   Accessible::ApplyARIAState(aState);
 
   // Allow iframe/frame etc. to have final state override via ARIA
   if (mParent)
     mParent->ApplyARIAState(aState);
@@ -433,17 +433,17 @@ DocAccessible::GetDocType(nsAString& aDo
   if (domDoc && NS_SUCCEEDED(domDoc->GetDoctype(getter_AddRefs(docType))) && docType) {
     return docType->GetPublicId(aDocType);
   }
 
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-DocAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAString& aNameSpaceURI)
+DocAccessible::GetNameSpaceURIForID(int16_t aNameSpaceID, nsAString& aNameSpaceURI)
 {
   if (mDocument) {
     nsCOMPtr<nsINameSpaceManager> nameSpaceManager =
         do_GetService(NS_NAMESPACEMANAGER_CONTRACTID);
     if (nameSpaceManager)
       return nameSpaceManager->GetNameSpaceURI(aNameSpaceID, aNameSpaceURI);
   }
   return NS_ERROR_FAILURE;
@@ -494,29 +494,29 @@ DocAccessible::GetParentDocument(nsIAcce
 
   if (!IsDefunct())
     NS_IF_ADDREF(*aDocument = ParentDocument());
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocAccessible::GetChildDocumentCount(PRUint32* aCount)
+DocAccessible::GetChildDocumentCount(uint32_t* aCount)
 {
   NS_ENSURE_ARG_POINTER(aCount);
   *aCount = 0;
 
   if (!IsDefunct())
     *aCount = ChildDocumentCount();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-DocAccessible::GetChildDocumentAt(PRUint32 aIndex,
+DocAccessible::GetChildDocumentAt(uint32_t aIndex,
                                   nsIAccessibleDocument** aDocument)
 {
   NS_ENSURE_ARG_POINTER(aDocument);
   *aDocument = nullptr;
 
   if (IsDefunct())
     return NS_OK;
 
@@ -656,18 +656,18 @@ DocAccessible::Shutdown()
     if (parentDocument)
       parentDocument->RemoveChildDocument(this);
 
     mParent->RemoveChild(this);
   }
 
   // Walk the array backwards because child documents remove themselves from the
   // array as they are shutdown.
-  PRInt32 childDocCount = mChildDocuments.Length();
-  for (PRInt32 idx = childDocCount - 1; idx >= 0; idx--)
+  int32_t childDocCount = mChildDocuments.Length();
+  for (int32_t idx = childDocCount - 1; idx >= 0; idx--)
     mChildDocuments[idx]->Shutdown();
 
   mChildDocuments.Clear();
 
   if (mVirtualCursor) {
     mVirtualCursor->RemoveObserver(this);
     mVirtualCursor = nullptr;
   }
@@ -745,17 +745,17 @@ DocAccessible::AddEventListeners()
   NS_ENSURE_TRUE(mPresShell, NS_ERROR_FAILURE);
 
   nsCOMPtr<nsISupports> container = mDocument->GetContainer();
   nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
   NS_ENSURE_TRUE(docShellTreeItem, NS_ERROR_FAILURE);
 
   // Make sure we're a content docshell
   // We don't want to listen to chrome progress
-  PRInt32 itemType;
+  int32_t itemType;
   docShellTreeItem->GetItemType(&itemType);
 
   bool isContent = (itemType == nsIDocShellTreeItem::typeContent);
 
   if (isContent) {
     // We're not an editor yet, but we might become one
     nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
     if (commandManager) {
@@ -792,17 +792,17 @@ DocAccessible::RemoveEventListeners()
   if (mDocument) {
     mDocument->RemoveObserver(this);
 
     nsCOMPtr<nsISupports> container = mDocument->GetContainer();
     nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
     NS_ASSERTION(docShellTreeItem, "doc should support nsIDocShellTreeItem.");
 
     if (docShellTreeItem) {
-      PRInt32 itemType;
+      int32_t itemType;
       docShellTreeItem->GetItemType(&itemType);
       if (itemType == nsIDocShellTreeItem::typeContent) {
         nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
         if (commandManager) {
           commandManager->RemoveCommandObserver(this, "obs_documentCreated");
         }
       }
     }
@@ -879,17 +879,17 @@ DocAccessible::RemoveScrollListener()
 ////////////////////////////////////////////////////////////////////////////////
 // nsIScrollPositionListener
 
 void
 DocAccessible::ScrollPositionDidChange(nscoord aX, nscoord aY)
 {
   // Start new timer, if the timer cycles at least 1 full cycle without more scroll position changes,
   // then the ::Notify() method will fire the accessibility event for scroll position changes
-  const PRUint32 kScrollPosCheckWait = 50;
+  const uint32_t kScrollPosCheckWait = 50;
   if (mScrollWatchTimer) {
     mScrollWatchTimer->SetDelay(kScrollPosCheckWait);  // Create new timer, to avoid leaks
   }
   else {
     mScrollWatchTimer = do_CreateInstance("@mozilla.org/timer;1");
     if (mScrollWatchTimer) {
       NS_ADDREF_THIS(); // Kung fu death grip
       mScrollWatchTimer->InitWithFuncCallback(ScrollTimerCallback, this,
@@ -921,17 +921,17 @@ DocAccessible::Observe(nsISupports* aSub
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessiblePivotObserver
 
 NS_IMETHODIMP
 DocAccessible::OnPivotChanged(nsIAccessiblePivot* aPivot,
                               nsIAccessible* aOldAccessible,
-                              PRInt32 aOldStart, PRInt32 aOldEnd,
+                              int32_t aOldStart, int32_t aOldEnd,
                               PivotMoveReason aReason)
 {
   nsRefPtr<AccEvent> event = new AccVCChangeEvent(this, aOldAccessible,
                                                   aOldStart, aOldEnd,
                                                   aReason);
   nsEventShell::FireEvent(event);
 
   return NS_OK;
@@ -942,18 +942,18 @@ DocAccessible::OnPivotChanged(nsIAccessi
 
 NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(DocAccessible)
 NS_IMPL_NSIDOCUMENTOBSERVER_LOAD_STUB(DocAccessible)
 NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(DocAccessible)
 
 void
 DocAccessible::AttributeWillChange(nsIDocument* aDocument,
                                    dom::Element* aElement,
-                                   PRInt32 aNameSpaceID,
-                                   nsIAtom* aAttribute, PRInt32 aModType)
+                                   int32_t aNameSpaceID,
+                                   nsIAtom* aAttribute, int32_t aModType)
 {
   Accessible* accessible = GetAccessible(aElement);
   if (!accessible) {
     if (aElement != mContent)
       return;
 
     accessible = this;
   }
@@ -978,18 +978,18 @@ DocAccessible::AttributeWillChange(nsIDo
     mARIAAttrOldValue = (aModType != nsIDOMMutationEvent::ADDITION) ?
       nsAccUtils::GetARIAToken(aElement, aAttribute) : nullptr;
   }
 }
 
 void
 DocAccessible::AttributeChanged(nsIDocument* aDocument,
                                 dom::Element* aElement,
-                                PRInt32 aNameSpaceID, nsIAtom* aAttribute,
-                                PRInt32 aModType)
+                                int32_t aNameSpaceID, nsIAtom* aAttribute,
+                                int32_t aModType)
 {
   NS_ASSERTION(!IsDefunct(),
                "Attribute changed called on defunct document accessible!");
 
   // Proceed even if the element is not accessible because element may become
   // accessible if it gets certain attribute.
   if (UpdateAccessibleOnAttrChange(aElement, aAttribute))
     return;
@@ -1019,17 +1019,17 @@ DocAccessible::AttributeChanged(nsIDocum
   if (aModType == nsIDOMMutationEvent::MODIFICATION ||
       aModType == nsIDOMMutationEvent::ADDITION) {
     AddDependentIDsFor(accessible, aAttribute);
   }
 }
 
 // DocAccessible protected member
 void
-DocAccessible::AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute)
+DocAccessible::AttributeChangedImpl(nsIContent* aContent, int32_t aNameSpaceID, nsIAtom* aAttribute)
 {
   // Fire accessible event after short timer, because we need to wait for
   // DOM attribute & resulting layout to actually change. Otherwise,
   // assistive technology will retrieve the wrong state/value/selection info.
 
   // XXX todo
   // We still need to handle special HTML cases here
   // For example, if an <img>'s usemap attribute is modified
@@ -1158,33 +1158,33 @@ DocAccessible::ARIAAttributeChanged(nsIC
     nsRefPtr<AccEvent> event =
       new AccStateChangeEvent(aContent, states::EXPANDED);
     FireDelayedAccessibleEvent(event);
     return;
   }
 
   // For aria attributes like drag and drop changes we fire a generic attribute
   // change event; at least until native API comes up with a more meaningful event.
-  PRUint8 attrFlags = nsAccUtils::GetAttributeCharacteristics(aAttribute);
+  uint8_t attrFlags = nsAccUtils::GetAttributeCharacteristics(aAttribute);
   if (!(attrFlags & ATTR_BYPASSOBJ))
     FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED,
                                aContent);
 
   if (!aContent->HasAttr(kNameSpaceID_None, nsGkAtoms::role)) {
     // We don't care about these other ARIA attribute changes unless there is
     // an ARIA role set for the element
     // XXX: we should check the role map to see if the changed property is
     // relevant for that particular role.
     return;
   }
 
   // The following ARIA attributes only take affect when dynamic content role is present
   if (aAttribute == nsGkAtoms::aria_checked ||
       aAttribute == nsGkAtoms::aria_pressed) {
-    const PRUint32 kState = (aAttribute == nsGkAtoms::aria_checked) ?
+    const uint32_t kState = (aAttribute == nsGkAtoms::aria_checked) ?
                             states::CHECKED : states::PRESSED;
     nsRefPtr<AccEvent> event = new AccStateChangeEvent(aContent, kState);
     FireDelayedAccessibleEvent(event);
 
     Accessible* accessible = event->GetAccessible();
     if (accessible) {
       bool wasMixed = (mARIAAttrOldValue == nsGkAtoms::mixed);
       bool isMixed = aContent->AttrValueIs(kNameSpaceID_None, aAttribute,
@@ -1237,17 +1237,17 @@ DocAccessible::ARIAActiveDescendantChang
     }
   }
 }
 
 void
 DocAccessible::ContentAppended(nsIDocument* aDocument,
                                nsIContent* aContainer,
                                nsIContent* aFirstNewContent,
-                               PRInt32 /* unused */)
+                               int32_t /* unused */)
 {
 }
 
 void
 DocAccessible::ContentStateChanged(nsIDocument* aDocument,
                                    nsIContent* aContent,
                                    nsEventStates aStateMask)
 {
@@ -1290,23 +1290,23 @@ void
 DocAccessible::CharacterDataChanged(nsIDocument* aDocument,
                                     nsIContent* aContent,
                                     CharacterDataChangeInfo* aInfo)
 {
 }
 
 void
 DocAccessible::ContentInserted(nsIDocument* aDocument, nsIContent* aContainer,
-                               nsIContent* aChild, PRInt32 /* unused */)
+                               nsIContent* aChild, int32_t /* unused */)
 {
 }
 
 void
 DocAccessible::ContentRemoved(nsIDocument* aDocument, nsIContent* aContainer,
-                              nsIContent* aChild, PRInt32 /* unused */,
+                              nsIContent* aChild, int32_t /* unused */,
                               nsIContent* aPreviousSibling)
 {
 }
 
 void
 DocAccessible::ParentChainChanged(nsIContent* aContent)
 {
 }
@@ -1349,18 +1349,18 @@ DocAccessible::GetNativeWindow() const
 
 Accessible*
 DocAccessible::GetAccessibleByUniqueIDInSubtree(void* aUniqueID)
 {
   Accessible* child = GetAccessibleByUniqueID(aUniqueID);
   if (child)
     return child;
 
-  PRUint32 childDocCount = mChildDocuments.Length();
-  for (PRUint32 childDocIdx= 0; childDocIdx < childDocCount; childDocIdx++) {
+  uint32_t childDocCount = mChildDocuments.Length();
+  for (uint32_t childDocIdx= 0; childDocIdx < childDocCount; childDocIdx++) {
     DocAccessible* childDocument = mChildDocuments.ElementAt(childDocIdx);
     child = childDocument->GetAccessibleByUniqueIDInSubtree(aUniqueID);
     if (child)
       return child;
   }
 
   return nullptr;
 }
@@ -1473,17 +1473,17 @@ DocAccessible::RecreateAccessible(nsICon
 }
 
 void
 DocAccessible::ProcessInvalidationList()
 {
   // Invalidate children of container accessible for each element in
   // invalidation list. Allow invalidation list insertions while container
   // children are recached.
-  for (PRUint32 idx = 0; idx < mInvalidationList.Length(); idx++) {
+  for (uint32_t idx = 0; idx < mInvalidationList.Length(); idx++) {
     nsIContent* content = mInvalidationList[idx];
     Accessible* accessible = GetAccessible(content);
     if (!accessible) {
       Accessible* container = GetContainerAccessible(content);
       if (container) {
         container->UpdateChildren();
         accessible = GetAccessible(content);
       }
@@ -1595,17 +1595,17 @@ DocAccessible::ProcessLoad()
     new AccStateChangeEvent(this, states::BUSY, false);
   nsEventShell::FireEvent(stateEvent);
 }
 
 void
 DocAccessible::AddDependentIDsFor(Accessible* aRelProvider,
                                   nsIAtom* aRelAttr)
 {
-  for (PRUint32 idx = 0; idx < kRelationAttrsLen; idx++) {
+  for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
     nsIAtom* relAttr = *kRelationAttrs[idx];
     if (aRelAttr && aRelAttr != relAttr)
       continue;
 
     if (relAttr == nsGkAtoms::_for) {
       if (!aRelProvider->GetContent()->IsHTML() ||
           (aRelProvider->GetContent()->Tag() != nsGkAtoms::label &&
            aRelProvider->GetContent()->Tag() != nsGkAtoms::output))
@@ -1656,30 +1656,30 @@ DocAccessible::AddDependentIDsFor(Access
       break;
   }
 }
 
 void
 DocAccessible::RemoveDependentIDsFor(Accessible* aRelProvider,
                                      nsIAtom* aRelAttr)
 {
-  for (PRUint32 idx = 0; idx < kRelationAttrsLen; idx++) {
+  for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
     nsIAtom* relAttr = *kRelationAttrs[idx];
     if (aRelAttr && aRelAttr != *kRelationAttrs[idx])
       continue;
 
     IDRefsIterator iter(this, aRelProvider->GetContent(), relAttr);
     while (true) {
       const nsDependentSubstring id = iter.NextID();
       if (id.IsEmpty())
         break;
 
       AttrRelProviderArray* providers = mDependentIDsHash.Get(id);
       if (providers) {
-        for (PRUint32 jdx = 0; jdx < providers->Length(); ) {
+        for (uint32_t jdx = 0; jdx < providers->Length(); ) {
           AttrRelProvider* provider = (*providers)[jdx];
           if (provider->mRelAttr == relAttr &&
               provider->mContent == aRelProvider->GetContent())
             providers->RemoveElement(provider);
           else
             jdx++;
         }
         if (providers->Length() == 0)
@@ -1736,17 +1736,17 @@ DocAccessible::UpdateAccessibleOnAttrCha
     return true;
   }
 
   return false;
 }
 
 // DocAccessible public member
 nsresult
-DocAccessible::FireDelayedAccessibleEvent(PRUint32 aEventType, nsINode* aNode,
+DocAccessible::FireDelayedAccessibleEvent(uint32_t aEventType, nsINode* aNode,
                                           AccEvent::EEventRule aAllowDupes,
                                           EIsFromUserInput aIsFromUserInput)
 {
   nsRefPtr<AccEvent> event =
     new AccEvent(aEventType, aNode, aIsFromUserInput, aAllowDupes);
   NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
 
   return FireDelayedAccessibleEvent(event);
@@ -1767,27 +1767,27 @@ DocAccessible::FireDelayedAccessibleEven
     mNotificationController->QueueEvent(aEvent);
 
   return NS_OK;
 }
 
 void
 DocAccessible::ProcessPendingEvent(AccEvent* aEvent)
 {
-  PRUint32 eventType = aEvent->GetEventType();
+  uint32_t eventType = aEvent->GetEventType();
   if (eventType == nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED) {
     HyperTextAccessible* hyperText = aEvent->GetAccessible()->AsHyperText();
-    PRInt32 caretOffset;
+    int32_t caretOffset;
     if (hyperText &&
         NS_SUCCEEDED(hyperText->GetCaretOffset(&caretOffset))) {
       nsRefPtr<AccEvent> caretMoveEvent =
         new AccCaretMoveEvent(hyperText, caretOffset);
       nsEventShell::FireEvent(caretMoveEvent);
 
-      PRInt32 selectionCount;
+      int32_t selectionCount;
       hyperText->GetSelectionCount(&selectionCount);
       if (selectionCount) {  // There's a selection so fire selection change as well
         nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED,
                                 hyperText);
       }
     }
   }
   else {
@@ -1828,29 +1828,29 @@ DocAccessible::ProcessContentInserted(Ac
   // The container might be changed, for example, because of the subsequent
   // overlapping content insertion (i.e. other content was inserted between this
   // inserted content and its container or the content was reinserted into
   // different container of unrelated part of tree). These cases result in
   // double processing, however generated events are coalesced and we don't
   // harm an AT.
   // Theoretically the element might be not in tree at all at this point what
   // means there's no container.
-  for (PRUint32 idx = 0; idx < aInsertedContent->Length(); idx++) {
+  for (uint32_t idx = 0; idx < aInsertedContent->Length(); idx++) {
     Accessible* directContainer =
       GetContainerAccessible(aInsertedContent->ElementAt(idx));
     if (directContainer)
       UpdateTree(directContainer, aInsertedContent->ElementAt(idx), true);
   }
 }
 
 void
 DocAccessible::UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
                           bool aIsInsert)
 {
-  PRUint32 updateFlags = eNoAccessible;
+  uint32_t updateFlags = eNoAccessible;
 
   // If child node is not accessible then look for its accessible children.
   Accessible* child = GetAccessible(aChildNode);
 #ifdef DEBUG
   if (logging::IsEnabled(logging::eTree)) {
     logging::MsgBegin("TREE", "process content %s",
                       (aIsInsert ? "insertion" : "removal"));
     logging::Node("container", aContainer->GetNode());
@@ -1906,20 +1906,20 @@ DocAccessible::UpdateTree(Accessible* aC
   // the event is used internally by MSAA layer.
   nsRefPtr<AccEvent> reorderEvent =
     new AccEvent(nsIAccessibleEvent::EVENT_REORDER, aContainer->GetNode(),
                  eAutoDetect, AccEvent::eCoalesceFromSameSubtree);
   if (reorderEvent)
     FireDelayedAccessibleEvent(reorderEvent);
 }
 
-PRUint32
+uint32_t
 DocAccessible::UpdateTreeInternal(Accessible* aChild, bool aIsInsert)
 {
-  PRUint32 updateFlags = eAccessible;
+  uint32_t updateFlags = eAccessible;
 
   nsINode* node = aChild->GetNode();
   if (aIsInsert) {
     // Create accessible tree for shown accessible.
     CacheChildrenInSubtree(aChild);
 
   } else {
     // Fire menupopup end event before hide event if a menu goes away.
@@ -1992,18 +1992,18 @@ DocAccessible::UpdateTreeInternal(Access
 void
 DocAccessible::CacheChildrenInSubtree(Accessible* aRoot)
 {
   aRoot->EnsureChildren();
 
   // Make sure we create accessible tree defined in DOM only, i.e. if accessible
   // provides specific tree (like XUL trees) then tree creation is handled by
   // this accessible.
-  PRUint32 count = aRoot->ContentChildCount();
-  for (PRUint32 idx = 0; idx < count; idx++) {
+  uint32_t count = aRoot->ContentChildCount();
+  for (uint32_t idx = 0; idx < count; idx++) {
     Accessible* child = aRoot->ContentChildAt(idx);
     NS_ASSERTION(child, "Illicit tree change while tree is created!");
     // Don't cross document boundaries.
     if (child && child->IsContent())
       CacheChildrenInSubtree(child);
   }
 
   // Fire document load complete on ARIA documents.
@@ -2019,34 +2019,34 @@ DocAccessible::CacheChildrenInSubtree(Ac
 void
 DocAccessible::UncacheChildrenInSubtree(Accessible* aRoot)
 {
   aRoot->mFlags |= eIsNotInDocument;
 
   if (aRoot->IsElement())
     RemoveDependentIDsFor(aRoot);
 
-  PRUint32 count = aRoot->ContentChildCount();
-  for (PRUint32 idx = 0; idx < count; idx++)
+  uint32_t count = aRoot->ContentChildCount();
+  for (uint32_t idx = 0; idx < count; idx++)
     UncacheChildrenInSubtree(aRoot->ContentChildAt(idx));
 
   if (aRoot->IsPrimaryForNode() &&
       mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
     mNodeToAccessibleMap.Remove(aRoot->GetNode());
 }
 
 void
 DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible)
 {
   // Traverse through children and shutdown them before this accessible. When
   // child gets shutdown then it removes itself from children array of its
   //parent. Use jdx index to process the cases if child is not attached to the
   // parent and as result doesn't remove itself from its children.
-  PRUint32 count = aAccessible->ContentChildCount();
-  for (PRUint32 idx = 0, jdx = 0; idx < count; idx++) {
+  uint32_t count = aAccessible->ContentChildCount();
+  for (uint32_t idx = 0, jdx = 0; idx < count; idx++) {
     Accessible* child = aAccessible->ContentChildAt(jdx);
     if (!child->IsBoundToParent()) {
       NS_ERROR("Parent refers to a child, child doesn't refer to parent!");
       jdx++;
     }
 
     ShutdownChildrenInSubtree(child);
   }
@@ -2070,13 +2070,13 @@ DocAccessible::IsLoadEventTarget() const
   // Note: we can get notifications while document is loading (and thus
   // while there's no parent document yet).
   if (parentTreeItem) {
     DocAccessible* parentDoc = ParentDocument();
     return parentDoc && parentDoc->HasLoadState(eCompletelyLoaded);
   }
 
   // It's content (not chrome) root document.
-  PRInt32 contentType;
+  int32_t contentType;
   docShellTreeItem->GetItemType(&contentType);
   return (contentType == nsIDocShellTreeItem::typeContent);
 }
 
--- a/accessible/src/generic/DocAccessible.h
+++ b/accessible/src/generic/DocAccessible.h
@@ -26,17 +26,17 @@
 
 template<class Class, class Arg>
 class TNotification;
 class NotificationController;
 
 class nsIScrollableView;
 class nsAccessiblePivot;
 
-const PRUint32 kDefaultCacheSize = 256;
+const uint32_t kDefaultCacheSize = 256;
 
 class DocAccessible : public HyperTextAccessibleWrap,
                       public nsIAccessibleDocument,
                       public nsIDocumentObserver,
                       public nsIObserver,
                       public nsIScrollPositionListener,
                       public nsSupportsWeakReference,
                       public nsIAccessibleCursorable,
@@ -77,20 +77,20 @@ public:
   virtual nsINode* GetNode() const { return mDocument; }
   virtual nsIDocument* GetDocumentNode() const { return mDocument; }
 
   // Accessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName);
   virtual void Description(nsString& aDescription);
   virtual Accessible* FocusedChild();
   virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 NativeState();
-  virtual PRUint64 NativeInteractiveState() const;
+  virtual uint64_t NativeState();
+  virtual uint64_t NativeInteractiveState() const;
   virtual bool NativelyUnavailable() const;
-  virtual void ApplyARIAState(PRUint64* aState) const;
+  virtual void ApplyARIAState(uint64_t* aState) const;
 
   virtual void SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
 
 #ifdef DEBUG
   virtual nsresult HandleAccEvent(AccEvent* aEvent);
 #endif
 
   virtual void GetBoundsRect(nsRect& aRect, nsIFrame** aRelativeFrame);
@@ -137,50 +137,50 @@ public:
     // document and all its subdocuments are ready
     eCompletelyLoaded = eReady | 1 << 2
   };
 
   /**
    * Return true if the document has given document state.
    */
   bool HasLoadState(LoadState aState) const
-    { return (mLoadState & static_cast<PRUint32>(aState)) == 
-        static_cast<PRUint32>(aState); }
+    { return (mLoadState & static_cast<uint32_t>(aState)) == 
+        static_cast<uint32_t>(aState); }
 
   /**
    * Return a native window handler or pointer depending on platform.
    */
   virtual void* GetNativeWindow() const;
 
   /**
    * Return the parent document.
    */
   DocAccessible* ParentDocument() const
     { return mParent ? mParent->Document() : nullptr; }
 
   /**
    * Return the child document count.
    */
-  PRUint32 ChildDocumentCount() const
+  uint32_t ChildDocumentCount() const
     { return mChildDocuments.Length(); }
 
   /**
    * Return the child document at the given index.
    */
-  DocAccessible* GetChildDocumentAt(PRUint32 aIndex) const
+  DocAccessible* GetChildDocumentAt(uint32_t aIndex) const
     { return mChildDocuments.SafeElementAt(aIndex, nullptr); }
 
   /**
    * Non-virtual method to fire a delayed event after a 0 length timeout.
    *
    * @param aEventType   [in] the nsIAccessibleEvent event type
    * @param aDOMNode     [in] DOM node the accesible event should be fired for
    * @param aAllowDupes  [in] rule to process an event (see EEventRule constants)
    */
-  nsresult FireDelayedAccessibleEvent(PRUint32 aEventType, nsINode *aNode,
+  nsresult FireDelayedAccessibleEvent(uint32_t aEventType, nsINode *aNode,
                                       AccEvent::EEventRule aAllowDupes = AccEvent::eRemoveDupes,
                                       EIsFromUserInput aIsFromUserInput = eAutoDetect);
 
   /**
    * Fire accessible event after timeout.
    *
    * @param aEvent  [in] the event to fire
    */
@@ -319,17 +319,17 @@ protected:
 
   // DocAccessible
   virtual nsresult AddEventListeners();
   virtual nsresult RemoveEventListeners();
 
   /**
    * Marks this document as loaded or loading.
    */
-  void NotifyOfLoad(PRUint32 aLoadEventType)
+  void NotifyOfLoad(uint32_t aLoadEventType)
   {
     mLoadState |= eDOMLoaded;
     mLoadEventType = aLoadEventType;
   }
 
   void NotifyOfLoading(bool aIsReloading);
 
   friend class nsAccDocManager;
@@ -401,17 +401,17 @@ protected:
 
     /**
      * Fires accessible events when attribute is changed.
      *
      * @param aContent - node that attribute is changed for
      * @param aNameSpaceID - namespace of changed attribute
      * @param aAttribute - changed attribute
      */
-    void AttributeChangedImpl(nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute);
+    void AttributeChangedImpl(nsIContent* aContent, int32_t aNameSpaceID, nsIAtom* aAttribute);
 
     /**
      * Fires accessible events when ARIA attribute is changed.
      *
      * @param aContent - node that attribute is changed for
      * @param aAttribute - changed attribute
      */
     void ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute);
@@ -453,17 +453,17 @@ protected:
    * accessible tree. Return one of these flags.
    */
   enum EUpdateTreeFlags {
     eNoAccessible = 0,
     eAccessible = 1,
     eAlertAccessible = 2
   };
 
-  PRUint32 UpdateTreeInternal(Accessible* aChild, bool aIsInsert);
+  uint32_t UpdateTreeInternal(Accessible* aChild, bool aIsInsert);
 
   /**
    * Create accessible tree.
    */
   void CacheChildrenInSubtree(Accessible* aRoot);
 
   /**
    * Remove accessibles in subtree from node to accessible map.
@@ -503,27 +503,27 @@ protected:
    * Cache of accessibles within this document accessible.
    */
   AccessibleHashtable mAccessibleCache;
   nsDataHashtable<nsPtrHashKey<const nsINode>, Accessible*>
     mNodeToAccessibleMap;
 
     nsCOMPtr<nsIDocument> mDocument;
     nsCOMPtr<nsITimer> mScrollWatchTimer;
-    PRUint16 mScrollPositionChangedTicks; // Used for tracking scroll events
+    uint16_t mScrollPositionChangedTicks; // Used for tracking scroll events
 
   /**
    * Bit mask of document load states (@see LoadState).
    */
-  PRUint32 mLoadState;
+  uint32_t mLoadState;
 
   /**
    * Type of document load event fired after the document is loaded completely.
    */
-  PRUint32 mLoadEventType;
+  uint32_t mLoadEventType;
 
   /**
    * Reference to anchor jump element.
    */
   nsCOMPtr<nsIContent> mAnchorJumpElm;
 
   /**
    * Keep the ARIA attribute old value that is initialized by
--- a/accessible/src/generic/FormControlAccessible.cpp
+++ b/accessible/src/generic/FormControlAccessible.cpp
@@ -42,20 +42,20 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(Progr
 template<int Max>
 role
 ProgressMeterAccessible<Max>::NativeRole()
 {
   return roles::PROGRESSBAR;
 }
 
 template<int Max>
-PRUint64
+uint64_t
 ProgressMeterAccessible<Max>::NativeState()
 {
-  PRUint64 state = LeafAccessible::NativeState();
+  uint64_t state = LeafAccessible::NativeState();
 
   // An undetermined progressbar (i.e. without a value) has a mixed state.
   nsAutoString attrValue;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::value, attrValue);
 
   if (attrValue.IsEmpty())
     state |= states::MIXED;
 
@@ -180,34 +180,34 @@ ProgressMeterAccessible<Max>::SetCurrent
 ////////////////////////////////////////////////////////////////////////////////
 
 RadioButtonAccessible::
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   LeafAccessible(aContent, aDoc)
 {
 }
 
-PRUint8
+uint8_t
 RadioButtonAccessible::ActionCount()
 {
   return 1;
 }
 
 NS_IMETHODIMP
-RadioButtonAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
+RadioButtonAccessible::GetActionName(uint8_t aIndex, nsAString& aName)
 {
   if (aIndex == eAction_Click) {
     aName.AssignLiteral("select"); 
     return NS_OK;
   }
   return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP
-RadioButtonAccessible::DoAction(PRUint8 aIndex)
+RadioButtonAccessible::DoAction(uint8_t aIndex)
 {
   if (aIndex != eAction_Click)
     return NS_ERROR_INVALID_ARG;
 
   DoCommand();
   return NS_OK;
 }
 
--- a/accessible/src/generic/FormControlAccessible.h
+++ b/accessible/src/generic/FormControlAccessible.h
@@ -24,40 +24,40 @@ public:
   }
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIACCESSIBLEVALUE
 
   // Accessible
   virtual void Value(nsString& aValue);
   virtual mozilla::a11y::role NativeRole();
-  virtual PRUint64 NativeState();
+  virtual uint64_t NativeState();
 
   // Widgets
   virtual bool IsWidget() const;
 };
 
 /**
   * Generic class used for radio buttons.
   */
 class RadioButtonAccessible : public LeafAccessible
 {
 
 public:
   RadioButtonAccessible(nsIContent* aContent, DocAccessible* aDoc);
 
   // nsIAccessible
-  NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
-  NS_IMETHOD DoAction(PRUint8 aIndex);
+  NS_IMETHOD GetActionName(uint8_t aIndex, nsAString& aName);
+  NS_IMETHOD DoAction(uint8_t aIndex);
 
   // Accessible
   virtual mozilla::a11y::role NativeRole();
 
   // ActionAccessible
-  virtual PRUint8 ActionCount();
+  virtual uint8_t ActionCount();
 
   enum { eAction_Click = 0 };
 
   // Widgets
   virtual bool IsWidget() const;
 };
 
 } // namespace a11y
--- a/accessible/src/generic/HyperTextAccessible.cpp
+++ b/accessible/src/generic/HyperTextAccessible.cpp
@@ -113,20 +113,20 @@ HyperTextAccessible::NativeRole()
   // Treat block frames as paragraphs
   nsIFrame *frame = GetFrame();
   if (frame && frame->GetType() == nsGkAtoms::blockFrame)
     return roles::PARAGRAPH;
 
   return roles::TEXT_CONTAINER; // In ATK this works
 }
 
-PRUint64
+uint64_t
 HyperTextAccessible::NativeState()
 {
-  PRUint64 states = AccessibleWrap::NativeState();
+  uint64_t states = AccessibleWrap::NativeState();
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
   if (editor) {
     states |= states::EDITABLE;
 
   } else if (mContent->Tag() == nsGkAtoms::article) {
     // We want <article> to behave like a document in terms of readonly state.
     states |= states::READONLY;
@@ -135,56 +135,56 @@ HyperTextAccessible::NativeState()
   if (HasChildren())
     states |= states::SELECTABLE_TEXT;
 
   return states;
 }
 
 // Substring must be entirely within the same text node
 nsIntRect
-HyperTextAccessible::GetBoundsForString(nsIFrame* aFrame, PRUint32 aStartRenderedOffset,
-                                        PRUint32 aEndRenderedOffset)
+HyperTextAccessible::GetBoundsForString(nsIFrame* aFrame, uint32_t aStartRenderedOffset,
+                                        uint32_t aEndRenderedOffset)
 {
   nsIntRect screenRect;
   NS_ENSURE_TRUE(aFrame, screenRect);
   if (aFrame->GetType() != nsGkAtoms::textFrame) {
     // XXX fallback for non-text frames, happens for bullets right now
     // but in the future bullets will have proper text frames
     return aFrame->GetScreenRectExternal();
   }
 
-  PRInt32 startContentOffset, endContentOffset;
+  int32_t startContentOffset, endContentOffset;
   nsresult rv = RenderedToContentOffset(aFrame, aStartRenderedOffset, &startContentOffset);
   NS_ENSURE_SUCCESS(rv, screenRect);
   rv = RenderedToContentOffset(aFrame, aEndRenderedOffset, &endContentOffset);
   NS_ENSURE_SUCCESS(rv, screenRect);
 
   nsIFrame *frame;
-  PRInt32 startContentOffsetInFrame;
+  int32_t startContentOffsetInFrame;
   // Get the right frame continuation -- not really a child, but a sibling of
   // the primary frame passed in
   rv = aFrame->GetChildFrameContainingOffset(startContentOffset, false,
                                              &startContentOffsetInFrame, &frame);
   NS_ENSURE_SUCCESS(rv, screenRect);
 
   nsPresContext* context = mDoc->PresContext();
 
   while (frame && startContentOffset < endContentOffset) {
     // Start with this frame's screen rect, which we will 
     // shrink based on the substring we care about within it.
     // We will then add that frame to the total screenRect we
     // are returning.
     nsIntRect frameScreenRect = frame->GetScreenRectExternal();
 
     // Get the length of the substring in this frame that we want the bounds for
-    PRInt32 startFrameTextOffset, endFrameTextOffset;
+    int32_t startFrameTextOffset, endFrameTextOffset;
     frame->GetOffsets(startFrameTextOffset, endFrameTextOffset);
-    PRInt32 frameTotalTextLength = endFrameTextOffset - startFrameTextOffset;
-    PRInt32 seekLength = endContentOffset - startContentOffset;
-    PRInt32 frameSubStringLength = NS_MIN(frameTotalTextLength - startContentOffsetInFrame, seekLength);
+    int32_t frameTotalTextLength = endFrameTextOffset - startFrameTextOffset;
+    int32_t seekLength = endContentOffset - startContentOffset;
+    int32_t frameSubStringLength = NS_MIN(frameTotalTextLength - startContentOffsetInFrame, seekLength);
 
     // Add the point where the string starts to the frameScreenRect
     nsPoint frameTextStartPoint;
     rv = frame->GetPointFromOffset(startContentOffset, &frameTextStartPoint);
     NS_ENSURE_SUCCESS(rv, nsIntRect());
     frameScreenRect.x += context->AppUnitsToDevPixels(frameTextStartPoint.x);
 
     // Use the point for the end offset to calculate the width
@@ -203,17 +203,17 @@ HyperTextAccessible::GetBoundsForString(
 
   return screenRect;
 }
 
 /*
  * Gets the specified text.
  */
 nsIFrame*
-HyperTextAccessible::GetPosAndText(PRInt32& aStartOffset, PRInt32& aEndOffset,
+HyperTextAccessible::GetPosAndText(int32_t& aStartOffset, int32_t& aEndOffset,
                                    nsAString* aText, nsIFrame** aEndFrame,
                                    nsIntRect* aBoundsRect,
                                    Accessible** aStartAcc,
                                    Accessible** aEndAcc)
 {
   if (aStartOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT) {
     aStartOffset = CharacterCount();
   }
@@ -222,27 +222,27 @@ HyperTextAccessible::GetPosAndText(PRInt
   }
   if (aEndOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT) {
     aEndOffset = CharacterCount();
   }
   if (aEndOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
     GetCaretOffset(&aEndOffset);
   }
 
-  PRInt32 startOffset = aStartOffset;
-  PRInt32 endOffset = aEndOffset;
+  int32_t startOffset = aStartOffset;
+  int32_t endOffset = aEndOffset;
   // XXX this prevents text interface usage on <input type="password">
   bool isPassword = (Role() == roles::PASSWORD_TEXT);
 
   // Clear out parameters and set up loop
   if (aText) {
     aText->Truncate();
   }
   if (endOffset < 0) {
-    const PRInt32 kMaxTextLength = 32767;
+    const int32_t kMaxTextLength = 32767;
     endOffset = kMaxTextLength; // Max end offset
   }
   else if (startOffset > endOffset) {
     return nullptr;
   }
 
   nsIFrame *startFrame = nullptr;
   if (aEndFrame) {
@@ -259,32 +259,32 @@ HyperTextAccessible::GetPosAndText(PRInt
   nsIntRect unionRect;
   Accessible* lastAccessible = nullptr;
 
   gfxSkipChars skipChars;
   gfxSkipCharsIterator iter;
 
   // Loop through children and collect valid offsets, text and bounds
   // depending on what we need for out parameters.
-  PRUint32 childCount = ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  uint32_t childCount = ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* childAcc = mChildren[childIdx];
     lastAccessible = childAcc;
 
     nsIFrame *frame = childAcc->GetFrame();
     if (!frame) {
       continue;
     }
     nsIFrame *primaryFrame = frame;
     if (nsAccUtils::IsText(childAcc)) {
       // We only need info up to rendered offset -- that is what we're
       // converting to content offset
-      PRInt32 substringEndOffset = -1;
-      PRUint32 ourRenderedStart = 0;
-      PRInt32 ourContentStart = 0;
+      int32_t substringEndOffset = -1;
+      uint32_t ourRenderedStart = 0;
+      int32_t ourContentStart = 0;
       if (frame->GetType() == nsGkAtoms::textFrame) {
         nsresult rv = frame->GetRenderedText(nullptr, &skipChars, &iter);
         if (NS_SUCCEEDED(rv)) {
           ourRenderedStart = iter.GetSkippedOffset();
           ourContentStart = iter.GetOriginalOffset();
           substringEndOffset =
             iter.ConvertOriginalToSkipped(skipChars.GetOriginalCharCount() +
                                           ourContentStart) - ourRenderedStart;
@@ -295,18 +295,18 @@ HyperTextAccessible::GetPosAndText(PRInt
         // should go away after list bullet rewrite
         substringEndOffset = nsAccUtils::TextLength(childAcc);
       }
       if (startOffset < substringEndOffset) {
         // Our start is within this substring
         if (startOffset > 0 || endOffset < substringEndOffset) {
           // We don't want the whole string for this accessible
           // Get out the continuing text frame with this offset
-          PRInt32 outStartLineUnused;
-          PRInt32 contentOffset;
+          int32_t outStartLineUnused;
+          int32_t contentOffset;
           if (frame->GetType() == nsGkAtoms::textFrame) {
             contentOffset = iter.ConvertSkippedToOriginal(startOffset) +
                             ourRenderedStart - ourContentStart;
           }
           else {
             contentOffset = startOffset;
           }
           frame->GetChildFrameContainingOffset(contentOffset, true,
@@ -319,17 +319,17 @@ HyperTextAccessible::GetPosAndText(PRInt
           if (substringEndOffset > endOffset) {
             // Need to stop before the end of the available text
             substringEndOffset = endOffset;
           }
           aEndOffset = endOffset;
         }
         if (aText) {
           if (isPassword) {
-            for (PRInt32 count = startOffset; count < substringEndOffset; count ++)
+            for (int32_t count = startOffset; count < substringEndOffset; count ++)
               *aText += '*'; // Show *'s only for password text
           }
           else {
             childAcc->AppendTextTo(*aText, startOffset,
                                    substringEndOffset - startOffset);
           }
         }
         if (aBoundsRect) {    // Caller wants the bounds of the text
@@ -402,89 +402,89 @@ HyperTextAccessible::GetPosAndText(PRInt
     if (aStartAcc && aEndAcc)
       NS_IF_ADDREF(*aEndAcc = *aStartAcc);
   }
 
   return startFrame;
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::GetText(PRInt32 aStartOffset, PRInt32 aEndOffset,
+HyperTextAccessible::GetText(int32_t aStartOffset, int32_t aEndOffset,
                              nsAString& aText)
 {
   aText.Truncate();
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
-  PRInt32 startOffset = ConvertMagicOffset(aStartOffset);
-  PRInt32 endOffset = ConvertMagicOffset(aEndOffset);
+  int32_t startOffset = ConvertMagicOffset(aStartOffset);
+  int32_t endOffset = ConvertMagicOffset(aEndOffset);
 
-  PRInt32 startChildIdx = GetChildIndexAtOffset(startOffset);
+  int32_t startChildIdx = GetChildIndexAtOffset(startOffset);
   if (startChildIdx == -1) {
     // 0 offsets are considered valid for empty text.
     return (startOffset == 0 && endOffset == 0) ? NS_OK : NS_ERROR_INVALID_ARG;
   }
 
-  PRInt32 endChildIdx = GetChildIndexAtOffset(endOffset);
+  int32_t endChildIdx = GetChildIndexAtOffset(endOffset);
   if (endChildIdx == -1)
     return NS_ERROR_INVALID_ARG;
 
   if (startChildIdx == endChildIdx) {
-    PRInt32 childOffset =  GetChildOffset(startChildIdx);
+    int32_t childOffset =  GetChildOffset(startChildIdx);
     NS_ENSURE_STATE(childOffset != -1);
 
     Accessible* child = GetChildAt(startChildIdx);
     child->AppendTextTo(aText, startOffset - childOffset,
                         endOffset - startOffset);
 
     return NS_OK;
   }
 
-  PRInt32 startChildOffset =  GetChildOffset(startChildIdx);
+  int32_t startChildOffset =  GetChildOffset(startChildIdx);
   NS_ENSURE_STATE(startChildOffset != -1);
 
   Accessible* startChild = GetChildAt(startChildIdx);
   startChild->AppendTextTo(aText, startOffset - startChildOffset);
 
-  for (PRInt32 childIdx = startChildIdx + 1; childIdx < endChildIdx; childIdx++) {
+  for (int32_t childIdx = startChildIdx + 1; childIdx < endChildIdx; childIdx++) {
     Accessible* child = GetChildAt(childIdx);
     child->AppendTextTo(aText);
   }
 
-  PRInt32 endChildOffset =  GetChildOffset(endChildIdx);
+  int32_t endChildOffset =  GetChildOffset(endChildIdx);
   NS_ENSURE_STATE(endChildOffset != -1);
 
   Accessible* endChild = GetChildAt(endChildIdx);
   endChild->AppendTextTo(aText, 0, endOffset - endChildOffset);
 
   return NS_OK;
 }
 
 /*
  * Gets the character count.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetCharacterCount(PRInt32* aCharacterCount)
+HyperTextAccessible::GetCharacterCount(int32_t* aCharacterCount)
 {
   NS_ENSURE_ARG_POINTER(aCharacterCount);
   *aCharacterCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aCharacterCount = CharacterCount();
   return NS_OK;
 }
 
 /*
  * Gets the specified character.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetCharacterAtOffset(PRInt32 aOffset, PRUnichar* aCharacter)
+HyperTextAccessible::GetCharacterAtOffset(int32_t aOffset, PRUnichar* aCharacter)
 {
   NS_ENSURE_ARG_POINTER(aCharacter);
   *aCharacter = L'\0';
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsAutoString character;
@@ -493,28 +493,28 @@ HyperTextAccessible::GetCharacterAtOffse
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
 Accessible*
 HyperTextAccessible::DOMPointToHypertextOffset(nsINode* aNode,
-                                               PRInt32 aNodeOffset,
-                                               PRInt32* aHyperTextOffset,
+                                               int32_t aNodeOffset,
+                                               int32_t* aHyperTextOffset,
                                                bool aIsEndOffset)
 {
   if (!aHyperTextOffset)
     return nullptr;
   *aHyperTextOffset = 0;
 
   if (!aNode)
     return nullptr;
 
-  PRUint32 addTextOffset = 0;
+  uint32_t addTextOffset = 0;
   nsINode* findNode = nullptr;
 
   if (aNodeOffset == -1) {
     findNode = aNode;
 
   } else if (aNode->IsNodeOfType(nsINode::eTEXT)) {
     // For text nodes, aNodeOffset comes in as a character offset
     // Text offset will be added at the end, if we find the offset in this hypertext
@@ -597,19 +597,19 @@ HyperTextAccessible::DOMPointToHypertext
 
     descendantAcc = parentAcc;
   }
 
   // Loop through, adding offsets until we reach childAccessible
   // If childAccessible is null we will end up adding up the entire length of
   // the hypertext, which is good -- it just means our offset node
   // came after the last accessible child's node
-  PRUint32 childCount = ChildCount();
+  uint32_t childCount = ChildCount();
 
-  PRUint32 childIdx = 0;
+  uint32_t childIdx = 0;
   Accessible* childAcc = nullptr;
   for (; childIdx < childCount; childIdx++) {
     childAcc = mChildren[childIdx];
     if (childAcc == childAccAtOffset)
       break;
 
     *aHyperTextOffset += nsAccUtils::TextLength(childAcc);
   }
@@ -625,18 +625,18 @@ HyperTextAccessible::DOMPointToHypertext
       return childAccAtOffset;
     }
   }
 
   return nullptr;
 }
 
 nsresult
-HyperTextAccessible::HypertextOffsetsToDOMRange(PRInt32 aStartHTOffset,
-                                                PRInt32 aEndHTOffset,
+HyperTextAccessible::HypertextOffsetsToDOMRange(int32_t aStartHTOffset,
+                                                int32_t aEndHTOffset,
                                                 nsRange* aRange)
 {
   // If the given offsets are 0 and associated editor is empty then return
   // collapsed range with editor root element as range container.
   if (aStartHTOffset == 0 && aEndHTOffset == 0) {
     nsCOMPtr<nsIEditor> editor = GetEditor();
     if (editor) {
       bool isEmpty = false;
@@ -652,17 +652,17 @@ HyperTextAccessible::HypertextOffsetsToD
 
           return NS_OK;
         }
       }
     }
   }
 
   nsRefPtr<Accessible> startAcc, endAcc;
-  PRInt32 startOffset = aStartHTOffset, endOffset = aEndHTOffset;
+  int32_t startOffset = aStartHTOffset, endOffset = aEndHTOffset;
   nsIFrame *startFrame = nullptr, *endFrame = nullptr;
 
   startFrame = GetPosAndText(startOffset, endOffset, nullptr, &endFrame, nullptr,
                              getter_AddRefs(startAcc), getter_AddRefs(endAcc));
   if (!startAcc || !endAcc)
     return NS_ERROR_FAILURE;
 
   DOMPoint startPoint, endPoint;
@@ -677,20 +677,20 @@ HyperTextAccessible::HypertextOffsetsToD
     return aRange->SetEnd(startPoint.node, startPoint.idx);
 
   rv = GetDOMPointByFrameOffset(endFrame, endOffset, endAcc, &endPoint);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return aRange->SetEnd(endPoint.node, endPoint.idx);
 }
 
-PRInt32
+int32_t
 HyperTextAccessible::GetRelativeOffset(nsIPresShell* aPresShell,
                                        nsIFrame* aFromFrame,
-                                       PRInt32 aFromOffset,
+                                       int32_t aFromOffset,
                                        Accessible* aFromAccessible,
                                        nsSelectionAmount aAmount,
                                        nsDirection aDirection,
                                        bool aNeedsStart)
 {
   const bool kIsJumpLinesOk = true;          // okay to jump lines
   const bool kIsScrollViewAStop = false;     // do not stop at scroll views
   const bool kIsKeyboardSelect = true;       // is keyboard selection
@@ -699,17 +699,17 @@ HyperTextAccessible::GetRelativeOffset(n
   EWordMovementType wordMovementType = aNeedsStart ? eStartWord : eEndWord;
   if (aAmount == eSelectLine) {
     aAmount = (aDirection == eDirNext) ? eSelectEndLine : eSelectBeginLine;
   }
 
   // Ask layout for the new node and offset, after moving the appropriate amount
 
   nsresult rv;
-  PRInt32 contentOffset = aFromOffset;
+  int32_t contentOffset = aFromOffset;
   if (nsAccUtils::IsText(aFromAccessible)) {
     nsIFrame *frame = aFromAccessible->GetFrame();
     NS_ENSURE_TRUE(frame, -1);
 
     if (frame->GetType() == nsGkAtoms::textFrame) {
       rv = RenderedToContentOffset(frame, aFromOffset, &contentOffset);
       NS_ENSURE_SUCCESS(rv, -1);
     }
@@ -721,26 +721,26 @@ HyperTextAccessible::GetRelativeOffset(n
   rv = aFromFrame->PeekOffset(&pos);
   if (NS_FAILED(rv)) {
     if (aDirection == eDirPrevious) {
       // Use passed-in frame as starting point in failure case for now,
       // this is a hack to deal with starting on a list bullet frame,
       // which fails in PeekOffset() because the line iterator doesn't see it.
       // XXX Need to look at our overall handling of list bullets, which are an odd case
       pos.mResultContent = aFromFrame->GetContent();
-      PRInt32 endOffsetUnused;
+      int32_t endOffsetUnused;
       aFromFrame->GetOffsets(pos.mContentOffset, endOffsetUnused);
     }
     else {
       return -1;
     }
   }
 
   // Turn the resulting node and offset into a hyperTextOffset
-  PRInt32 hyperTextOffset;
+  int32_t hyperTextOffset;
   if (!pos.mResultContent)
     return -1;
 
   // If finalAccessible is nullptr, then DOMPointToHypertextOffset() searched
   // through the hypertext children without finding the node/offset position.
   Accessible* finalAccessible =
     DOMPointToHypertextOffset(pos.mResultContent, pos.mContentOffset,
                               &hyperTextOffset, aDirection == eDirNext);
@@ -750,17 +750,17 @@ HyperTextAccessible::GetRelativeOffset(n
     // and we're actually at the start of the paragraph
     hyperTextOffset = 0;
   }  
   else if (aAmount == eSelectBeginLine) {
     Accessible* firstChild = mChildren.SafeElementAt(0, nullptr);
     // For line selection with needsStart, set start of line exactly to line break
     if (pos.mContentOffset == 0 && firstChild &&
         firstChild->Role() == roles::STATICTEXT &&
-        static_cast<PRInt32>(nsAccUtils::TextLength(firstChild)) == hyperTextOffset) {
+        static_cast<int32_t>(nsAccUtils::TextLength(firstChild)) == hyperTextOffset) {
       // XXX Bullet hack -- we should remove this once list bullets use anonymous content
       hyperTextOffset = 0;
     }
     if (!aNeedsStart && hyperTextOffset > 0) {
       -- hyperTextOffset;
     }
   }
   else if (aAmount == eSelectEndLine && finalAccessible) { 
@@ -788,17 +788,17 @@ BOUNDARY_CHAR             The character 
 BOUNDARY_WORD_START       From the word start before/at/after the offset to the next word start.
 BOUNDARY_WORD_END         From the word end before/at/after the offset to the next work end.
 BOUNDARY_LINE_START       From the line start before/at/after the offset to the next line start.
 BOUNDARY_LINE_END         From the line end before/at/after the offset to the next line start.
 */
 
 nsresult
 HyperTextAccessible::GetTextHelper(EGetTextType aType, AccessibleTextBoundary aBoundaryType,
-                                   PRInt32 aOffset, PRInt32* aStartOffset, PRInt32* aEndOffset,
+                                   int32_t aOffset, int32_t* aStartOffset, int32_t* aEndOffset,
                                    nsAString& aText)
 {
   aText.Truncate();
 
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
 
@@ -873,41 +873,41 @@ HyperTextAccessible::GetTextHelper(EGetT
       
       return GetText(*aStartOffset, *aEndOffset, aText);
     }
 
     default:  // Note, sentence support is deprecated and falls through to here
       return NS_ERROR_INVALID_ARG;
   }
 
-  PRInt32 startOffset = aOffset + (aBoundaryType == BOUNDARY_LINE_END);  // Avoid getting the previous line
-  PRInt32 endOffset = startOffset;
+  int32_t startOffset = aOffset + (aBoundaryType == BOUNDARY_LINE_END);  // Avoid getting the previous line
+  int32_t endOffset = startOffset;
 
   // Convert offsets to frame-relative
   nsRefPtr<Accessible> startAcc;
   nsIFrame *startFrame = GetPosAndText(startOffset, endOffset, nullptr, nullptr,
                                        nullptr, getter_AddRefs(startAcc));
 
   if (!startFrame) {
-    PRInt32 textLength = CharacterCount();
+    int32_t textLength = CharacterCount();
     if (aBoundaryType == BOUNDARY_LINE_START && aOffset > 0 && aOffset == textLength) {
       // Asking for start of line, while on last character
       if (startAcc)
         startFrame = startAcc->GetFrame();
     }
     if (!startFrame) {
       return aOffset > textLength ? NS_ERROR_FAILURE : NS_OK;
     }
     else {
       // We're on the last continuation since we're on the last character
       startFrame = startFrame->GetLastContinuation();
     }
   }
 
-  PRInt32 finalStartOffset, finalEndOffset;
+  int32_t finalStartOffset, finalEndOffset;
 
   // If aType == eGetAt we'll change both the start and end offset from
   // the original offset
   if (aType == eGetAfter) {
     finalStartOffset = aOffset;
   }
   else {
     finalStartOffset = GetRelativeOffset(presShell, startFrame, startOffset,
@@ -946,17 +946,17 @@ HyperTextAccessible::GetTextHelper(EGetT
     NS_ENSURE_TRUE(endOffset >= 0, NS_ERROR_FAILURE);
     if (finalEndOffset == aOffset) {
       if (aType == eGetAt && amount == eSelectWord) { 
         // Fix word error for the first character in word: PeekOffset() will return the previous word when 
         // aOffset points to the first character of the word, but accessibility APIs want the current word 
         // that the first character is in
         return GetTextHelper(eGetAfter, aBoundaryType, aOffset, aStartOffset, aEndOffset, aText);
       }
-      PRInt32 textLength = CharacterCount();
+      int32_t textLength = CharacterCount();
       if (finalEndOffset < textLength) {
         // This happens sometimes when current character at finalStartOffset 
         // is an embedded object character representing another hypertext, that
         // the AT really needs to dig into separately
         ++ finalEndOffset;
       }
     }
   }
@@ -970,65 +970,65 @@ HyperTextAccessible::GetTextHelper(EGetT
   GetPosAndText(finalStartOffset, finalEndOffset, &aText);
   return NS_OK;
 }
 
 /**
   * nsIAccessibleText impl.
   */
 NS_IMETHODIMP
-HyperTextAccessible::GetTextBeforeOffset(PRInt32 aOffset,
+HyperTextAccessible::GetTextBeforeOffset(int32_t aOffset,
                                          AccessibleTextBoundary aBoundaryType,
-                                         PRInt32* aStartOffset,
-                                         PRInt32* aEndOffset, nsAString& aText)
+                                         int32_t* aStartOffset,
+                                         int32_t* aEndOffset, nsAString& aText)
 {
   if (aBoundaryType == BOUNDARY_CHAR) {
     GetCharAt(aOffset, eGetBefore, aText, aStartOffset, aEndOffset);
     return NS_OK;
   }
 
   return GetTextHelper(eGetBefore, aBoundaryType, aOffset, aStartOffset, aEndOffset, aText);
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::GetTextAtOffset(PRInt32 aOffset,
+HyperTextAccessible::GetTextAtOffset(int32_t aOffset,
                                      AccessibleTextBoundary aBoundaryType,
-                                     PRInt32* aStartOffset,
-                                     PRInt32* aEndOffset, nsAString& aText)
+                                     int32_t* aStartOffset,
+                                     int32_t* aEndOffset, nsAString& aText)
 {
   if (aBoundaryType == BOUNDARY_CHAR) {
     GetCharAt(aOffset, eGetAt, aText, aStartOffset, aEndOffset);
     return NS_OK;
   }
 
   return GetTextHelper(eGetAt, aBoundaryType, aOffset, aStartOffset, aEndOffset, aText);
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::GetTextAfterOffset(PRInt32 aOffset, AccessibleTextBoundary aBoundaryType,
-                                        PRInt32* aStartOffset, PRInt32* aEndOffset, nsAString& aText)
+HyperTextAccessible::GetTextAfterOffset(int32_t aOffset, AccessibleTextBoundary aBoundaryType,
+                                        int32_t* aStartOffset, int32_t* aEndOffset, nsAString& aText)
 {
   if (aBoundaryType == BOUNDARY_CHAR) {
     GetCharAt(aOffset, eGetAfter, aText, aStartOffset, aEndOffset);
     return NS_OK;
   }
 
   return GetTextHelper(eGetAfter, aBoundaryType, aOffset, aStartOffset, aEndOffset, aText);
 }
 
 // nsIPersistentProperties
 // nsIAccessibleText::getTextAttributes(in boolean includeDefAttrs,
 //                                      in long offset,
 //                                      out long rangeStartOffset,
 //                                      out long rangeEndOffset);
 NS_IMETHODIMP
 HyperTextAccessible::GetTextAttributes(bool aIncludeDefAttrs,
-                                       PRInt32 aOffset,
-                                       PRInt32* aStartOffset,
-                                       PRInt32* aEndOffset,
+                                       int32_t aOffset,
+                                       int32_t* aStartOffset,
+                                       int32_t* aEndOffset,
                                        nsIPersistentProperties** aAttributes)
 {
   // 1. Get each attribute and its ranges one after another.
   // 2. As we get each new attribute, we pass the current start and end offsets
   //    as in/out parameters. In other words, as attributes are collected,
   //    the attribute range itself can only stay the same or get smaller.
 
   NS_ENSURE_ARG_POINTER(aStartOffset);
@@ -1059,29 +1059,29 @@ HyperTextAccessible::GetTextAttributes(b
         TextAttrsMgr textAttrsMgr(this);
         textAttrsMgr.GetAttributes(*aAttributes);
       }
       return NS_OK;
     }
     return NS_ERROR_INVALID_ARG;
   }
 
-  PRInt32 accAtOffsetIdx = accAtOffset->IndexInParent();
-  PRInt32 startOffset = GetChildOffset(accAtOffsetIdx);
-  PRInt32 endOffset = GetChildOffset(accAtOffsetIdx + 1);
-  PRInt32 offsetInAcc = aOffset - startOffset;
+  int32_t accAtOffsetIdx = accAtOffset->IndexInParent();
+  int32_t startOffset = GetChildOffset(accAtOffsetIdx);
+  int32_t endOffset = GetChildOffset(accAtOffsetIdx + 1);
+  int32_t offsetInAcc = aOffset - startOffset;
 
   TextAttrsMgr textAttrsMgr(this, aIncludeDefAttrs, accAtOffset,
                             accAtOffsetIdx);
   textAttrsMgr.GetAttributes(*aAttributes, &startOffset, &endOffset);
 
   // Compute spelling attributes on text accessible only.
   nsIFrame *offsetFrame = accAtOffset->GetFrame();
   if (offsetFrame && offsetFrame->GetType() == nsGkAtoms::textFrame) {
-    PRInt32 nodeOffset = 0;
+    int32_t nodeOffset = 0;
     nsresult rv = RenderedToContentOffset(offsetFrame, offsetInAcc,
                                           &nodeOffset);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Set 'misspelled' text attribute.
     rv = GetSpellTextAttribute(accAtOffset->GetNode(), nodeOffset,
                                &startOffset, &endOffset,
                                aAttributes ? *aAttributes : nullptr);
@@ -1110,17 +1110,17 @@ HyperTextAccessible::GetDefaultTextAttri
 
   NS_ADDREF(*aAttributes = attributes);
 
   TextAttrsMgr textAttrsMgr(this);
   textAttrsMgr.GetAttributes(*aAttributes);
   return NS_OK;
 }
 
-PRInt32
+int32_t
 HyperTextAccessible::GetLevelInternal()
 {
   nsIAtom *tag = mContent->Tag();
   if (tag == nsGkAtoms::h1)
     return 1;
   if (tag == nsGkAtoms::h2)
     return 2;
   if (tag == nsGkAtoms::h3)
@@ -1148,17 +1148,17 @@ HyperTextAccessible::GetAttributesIntern
   nsIFrame *frame = GetFrame();
   if (frame && frame->GetType() == nsGkAtoms::blockFrame) {
     nsAutoString oldValueUnused;
     aAttributes->SetStringProperty(NS_LITERAL_CSTRING("formatting"), NS_LITERAL_STRING("block"),
                                    oldValueUnused);
   }
 
   if (FocusMgr()->IsFocused(this)) {
-    PRInt32 lineNumber = CaretLineNumber();
+    int32_t lineNumber = CaretLineNumber();
     if (lineNumber >= 1) {
       nsAutoString strLineNumber;
       strLineNumber.AppendInt(lineNumber);
       nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::lineNumber,
                              strLineNumber);
     }
   }
 
@@ -1184,31 +1184,31 @@ HyperTextAccessible::GetAttributesIntern
 
   return  NS_OK;
 }
 
 /*
  * Given an offset, the x, y, width, and height values are filled appropriately.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetCharacterExtents(PRInt32 aOffset, PRInt32* aX, PRInt32* aY,
-                                         PRInt32* aWidth, PRInt32* aHeight,
-                                         PRUint32 aCoordType)
+HyperTextAccessible::GetCharacterExtents(int32_t aOffset, int32_t* aX, int32_t* aY,
+                                         int32_t* aWidth, int32_t* aHeight,
+                                         uint32_t aCoordType)
 {
   return GetRangeExtents(aOffset, aOffset + 1, aX, aY, aWidth, aHeight, aCoordType);
 }
 
 /*
  * Given a start & end offset, the x, y, width, and height values are filled appropriately.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetRangeExtents(PRInt32 aStartOffset, PRInt32 aEndOffset,
-                                     PRInt32* aX, PRInt32* aY,
-                                     PRInt32* aWidth, PRInt32* aHeight,
-                                     PRUint32 aCoordType)
+HyperTextAccessible::GetRangeExtents(int32_t aStartOffset, int32_t aEndOffset,
+                                     int32_t* aX, int32_t* aY,
+                                     int32_t* aWidth, int32_t* aHeight,
+                                     uint32_t aCoordType)
 {
   nsIntRect boundsRect;
   nsIFrame *endFrameUnused;
   if (!GetPosAndText(aStartOffset, aEndOffset, nullptr, &endFrameUnused, &boundsRect) ||
       boundsRect.IsEmpty()) {
     return NS_ERROR_FAILURE;
   }
 
@@ -1220,18 +1220,18 @@ HyperTextAccessible::GetRangeExtents(PRI
   return nsAccUtils::ConvertScreenCoordsTo(aX, aY, aCoordType, this);
 }
 
 /*
  * Gets the offset of the character located at coordinates x and y. x and y are interpreted as being relative to
  * the screen or this widget's window depending on coords.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetOffsetAtPoint(PRInt32 aX, PRInt32 aY,
-                                      PRUint32 aCoordType, PRInt32* aOffset)
+HyperTextAccessible::GetOffsetAtPoint(int32_t aX, int32_t aY,
+                                      uint32_t aCoordType, int32_t* aOffset)
 {
   *aOffset = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsIFrame *hyperFrame = GetFrame();
   if (!hyperFrame) {
@@ -1255,19 +1255,19 @@ HyperTextAccessible::GetOffsetAtPoint(PR
   nsPoint pointInHyperText(context->DevPixelsToAppUnits(pxInHyperText.x),
                            context->DevPixelsToAppUnits(pxInHyperText.y));
 
   // Go through the frames to check if each one has the point.
   // When one does, add up the character offsets until we have a match
 
   // We have an point in an accessible child of this, now we need to add up the
   // offsets before it to what we already have
-  PRInt32 offset = 0;
-  PRUint32 childCount = ChildCount();
-  for (PRUint32 childIdx = 0; childIdx < childCount; childIdx++) {
+  int32_t offset = 0;
+  uint32_t childCount = ChildCount();
+  for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* childAcc = mChildren[childIdx];
 
     nsIFrame *primaryFrame = childAcc->GetFrame();
     NS_ENSURE_TRUE(primaryFrame, NS_ERROR_FAILURE);
 
     nsIFrame *frame = primaryFrame;
     while (frame) {
       nsIContent *content = frame->GetContent();
@@ -1277,17 +1277,17 @@ HyperTextAccessible::GetOffsetAtPoint(PR
       if (pointInFrame.x < frameSize.width && pointInFrame.y < frameSize.height) {
         // Finished
         if (frame->GetType() == nsGkAtoms::textFrame) {
           nsIFrame::ContentOffsets contentOffsets =
             frame->GetContentOffsetsFromPointExternal(pointInFrame, nsIFrame::IGNORE_SELECTION_STYLE);
           if (contentOffsets.IsNull() || contentOffsets.content != content) {
             return NS_OK; // Not found, will return -1
           }
-          PRUint32 addToOffset;
+          uint32_t addToOffset;
           nsresult rv = ContentToRenderedOffset(primaryFrame,
                                                 contentOffsets.offset,
                                                 &addToOffset);
           NS_ENSURE_SUCCESS(rv, rv);
           offset += addToOffset;
         }
         *aOffset = offset;
         return NS_OK;
@@ -1301,155 +1301,155 @@ HyperTextAccessible::GetOffsetAtPoint(PR
   return NS_OK; // Not found, will return -1
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsIAccessibleHyperText
 
 NS_IMETHODIMP
-HyperTextAccessible::GetLinkCount(PRInt32* aLinkCount)
+HyperTextAccessible::GetLinkCount(int32_t* aLinkCount)
 {
   NS_ENSURE_ARG_POINTER(aLinkCount);
   *aLinkCount = 0;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aLinkCount = GetLinkCount();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::GetLinkAt(PRInt32 aIndex, nsIAccessibleHyperLink** aLink)
+HyperTextAccessible::GetLinkAt(int32_t aIndex, nsIAccessibleHyperLink** aLink)
 {
   NS_ENSURE_ARG_POINTER(aLink);
   *aLink = nullptr;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   Accessible* link = GetLinkAt(aIndex);
   if (link)
     CallQueryInterface(link, aLink);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HyperTextAccessible::GetLinkIndex(nsIAccessibleHyperLink* aLink,
-                                  PRInt32* aIndex)
+                                  int32_t* aIndex)
 {
   NS_ENSURE_ARG_POINTER(aLink);
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsRefPtr<Accessible> link(do_QueryObject(aLink));
   *aIndex = GetLinkIndex(link);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::GetLinkIndexAtOffset(PRInt32 aOffset, PRInt32* aLinkIndex)
+HyperTextAccessible::GetLinkIndexAtOffset(int32_t aOffset, int32_t* aLinkIndex)
 {
   NS_ENSURE_ARG_POINTER(aLinkIndex);
   *aLinkIndex = -1; // API says this magic value means 'not found'
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   *aLinkIndex = GetLinkIndexAtOffset(aOffset);
   return NS_OK;
 }
 
 /**
   * nsIAccessibleEditableText impl.
   */
 NS_IMETHODIMP
-HyperTextAccessible::SetAttributes(PRInt32 aStartPos, PRInt32 aEndPos,
+HyperTextAccessible::SetAttributes(int32_t aStartPos, int32_t aEndPos,
                                    nsISupports* aAttributes)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 HyperTextAccessible::SetTextContents(const nsAString& aText)
 {
-  PRInt32 numChars = CharacterCount();
+  int32_t numChars = CharacterCount();
   if (numChars == 0 || NS_SUCCEEDED(DeleteText(0, numChars))) {
     return InsertText(aText, 0);
   }
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::InsertText(const nsAString& aText, PRInt32 aPosition)
+HyperTextAccessible::InsertText(const nsAString& aText, int32_t aPosition)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
 
   nsCOMPtr<nsIPlaintextEditor> peditor(do_QueryInterface(editor));
   NS_ENSURE_STATE(peditor);
 
   nsresult rv = SetSelectionRange(aPosition, aPosition);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return peditor->InsertText(aText);
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::CopyText(PRInt32 aStartPos, PRInt32 aEndPos)
+HyperTextAccessible::CopyText(int32_t aStartPos, int32_t aEndPos)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
   NS_ENSURE_STATE(editor);
 
   nsresult rv = SetSelectionRange(aStartPos, aEndPos);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return editor->Copy();
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::CutText(PRInt32 aStartPos, PRInt32 aEndPos)
+HyperTextAccessible::CutText(int32_t aStartPos, int32_t aEndPos)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
   NS_ENSURE_STATE(editor);
 
   nsresult rv = SetSelectionRange(aStartPos, aEndPos);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return editor->Cut();
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::DeleteText(PRInt32 aStartPos, PRInt32 aEndPos)
+HyperTextAccessible::DeleteText(int32_t aStartPos, int32_t aEndPos)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
   NS_ENSURE_STATE(editor);
 
   nsresult rv = SetSelectionRange(aStartPos, aEndPos);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return editor->DeleteSelection(nsIEditor::eNone, nsIEditor::eStrip);
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::PasteText(PRInt32 aPosition)
+HyperTextAccessible::PasteText(int32_t aPosition)
 {
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIEditor> editor = GetEditor();
   NS_ENSURE_STATE(editor);
 
   nsresult rv = SetSelectionRange(aPosition, aPosition);
@@ -1491,17 +1491,17 @@ HyperTextAccessible::GetEditor() const
   return editor.forget();
 }
 
 /**
   * =================== Caret & Selection ======================
   */
 
 nsresult
-HyperTextAccessible::SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos)
+HyperTextAccessible::SetSelectionRange(int32_t aStartPos, int32_t aEndPos)
 {
   bool isFocusable = InteractiveState() & states::FOCUSABLE;
 
   // If accessible is focusable then focus it before setting the selection to
   // neglect control's selection changes on focus if any (for example, inputs
   // that do select all on focus).
   // some input controls
   if (isFocusable)
@@ -1514,17 +1514,17 @@ HyperTextAccessible::SetSelectionRange(P
   // ranges remaining from previous selection
   nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
   NS_ENSURE_STATE(frameSelection);
 
   Selection* domSel =
     frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
   NS_ENSURE_STATE(domSel);
 
-  for (PRInt32 idx = domSel->GetRangeCount() - 1; idx > 0; idx--)
+  for (int32_t idx = domSel->GetRangeCount() - 1; idx > 0; idx--)
     domSel->RemoveRange(domSel->GetRangeAt(idx));
 
   // When selection is done, move the focus to the selection if accessible is
   // not focusable. That happens when selection is set within hypertext
   // accessible.
   if (isFocusable)
     return NS_OK;
 
@@ -1538,26 +1538,26 @@ HyperTextAccessible::SetSelectionRange(P
     DOMFocusManager->MoveFocus(window, nullptr, nsIFocusManager::MOVEFOCUS_CARET,
                                nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-HyperTextAccessible::SetCaretOffset(PRInt32 aCaretOffset)
+HyperTextAccessible::SetCaretOffset(int32_t aCaretOffset)
 {
   return SetSelectionRange(aCaretOffset, aCaretOffset);
 }
 
 /*
  * Gets the offset position of the caret (cursor).
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetCaretOffset(PRInt32* aCaretOffset)
+HyperTextAccessible::GetCaretOffset(int32_t* aCaretOffset)
 {
   NS_ENSURE_ARG_POINTER(aCaretOffset);
   *aCaretOffset = -1;
 
   if (IsDefunct())
     return NS_ERROR_FAILURE;
 
   // Not focused focusable accessible except document accessible doesn't have
@@ -1579,17 +1579,17 @@ HyperTextAccessible::GetCaretOffset(PRIn
   nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
   NS_ENSURE_STATE(frameSelection);
 
   Selection* domSel =
     frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
   NS_ENSURE_STATE(domSel);
 
   nsINode* focusNode = domSel->GetFocusNode();
-  PRInt32 focusOffset = domSel->GetFocusOffset();
+  int32_t focusOffset = domSel->GetFocusOffset();
 
   // No caret if this DOM node is inside of focused node but the selection's
   // focus point is not inside of this DOM node.
   if (focusDisp == FocusManager::eContainedByFocus) {
     nsINode *resultNode =
       nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset);
 
     nsINode* thisNode = GetNode();
@@ -1597,17 +1597,17 @@ HyperTextAccessible::GetCaretOffset(PRIn
         !nsCoreUtils::IsAncestorOf(thisNode, resultNode))
       return NS_OK;
   }
 
   DOMPointToHypertextOffset(focusNode, focusOffset, aCaretOffset);
   return NS_OK;
 }
 
-PRInt32
+int32_t
 HyperTextAccessible::CaretLineNumber()
 {
   // Provide the line number for the caret, relative to the
   // currently focused node. Use a 1-based index
   nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
   if (!frameSelection)
     return -1;
 
@@ -1619,52 +1619,52 @@ HyperTextAccessible::CaretLineNumber()
   nsINode* caretNode = domSel->GetFocusNode();
   if (!caretNode || !caretNode->IsContent())
     return -1;
 
   nsIContent* caretContent = caretNode->AsContent();
   if (!nsCoreUtils::IsAncestorOf(GetNode(), caretContent))
     return -1;
 
-  PRInt32 returnOffsetUnused;
-  PRInt32 caretOffset = domSel->GetFocusOffset();
+  int32_t returnOffsetUnused;
+  int32_t caretOffset = domSel->GetFocusOffset();
   nsFrameSelection::HINT hint = frameSelection->GetHint();
   nsIFrame *caretFrame = frameSelection->GetFrameForNodeOffset(caretContent, caretOffset,
                                                                hint, &returnOffsetUnused);
   NS_ENSURE_TRUE(caretFrame, -1);
 
-  PRInt32 lineNumber = 1;
+  int32_t lineNumber = 1;
   nsAutoLineIterator lineIterForCaret;
   nsIContent *hyperTextContent = IsContent() ? mContent.get() : nullptr;
   while (caretFrame) {
     if (hyperTextContent == caretFrame->GetContent()) {
       return lineNumber; // Must be in a single line hyper text, there is no line iterator
     }
     nsIFrame *parentFrame = caretFrame->GetParent();
     if (!parentFrame)
       break;
 
     // Add lines for the sibling frames before the caret
     nsIFrame *sibling = parentFrame->GetFirstPrincipalChild();
     while (sibling && sibling != caretFrame) {
       nsAutoLineIterator lineIterForSibling = sibling->GetLineIterator();
       if (lineIterForSibling) {
         // For the frames before that grab all the lines
-        PRInt32 addLines = lineIterForSibling->GetNumLines();
+        int32_t addLines = lineIterForSibling->GetNumLines();
         lineNumber += addLines;
       }
       sibling = sibling->GetNextSibling();
     }
 
     // Get the line number relative to the container with lines
     if (!lineIterForCaret) {   // Add the caret line just once
       lineIterForCaret = parentFrame->GetLineIterator();
       if (lineIterForCaret) {
         // Ancestor of caret
-        PRInt32 addLines = lineIterForCaret->FindLineContaining(caretFrame);
+        int32_t addLines = lineIterForCaret->FindLineContaining(caretFrame);
         lineNumber += addLines;
       }
     }
 
     caretFrame = parentFrame;
   }
 
   NS_NOTREACHED("DOM ancestry had this hypertext but frame ancestry didn't");
@@ -1674,17 +1674,17 @@ HyperTextAccessible::CaretLineNumber()
 already_AddRefed<nsFrameSelection>
 HyperTextAccessible::FrameSelection()
 {
   nsIFrame* frame = GetFrame();
   return frame ? frame->GetFrameSelection() : nullptr;
 }
 
 void
-HyperTextAccessible::GetSelectionDOMRanges(PRInt16 aType,
+HyperTextAccessible::GetSelectionDOMRanges(int16_t aType,
                                            nsTArray<nsRange*>* aRanges)
 {
   nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
   if (!frameSelection)
     return;
 
   Selection* domSel = frameSelection->GetSelection(aType);
   if (!domSel)
@@ -1697,83 +1697,83 @@ HyperTextAccessible::GetSelectionDOMRang
     nsCOMPtr<nsIDOMElement> editorRoot;
     editor->GetRootElement(getter_AddRefs(editorRoot));
     startNode = do_QueryInterface(editorRoot);
   }
 
   if (!startNode)
     return;
 
-  PRUint32 childCount = startNode->GetChildCount();
+  uint32_t childCount = startNode->GetChildCount();
   nsresult rv = domSel->
     GetRangesForIntervalArray(startNode, 0, startNode, childCount, true, aRanges);
   NS_ENSURE_SUCCESS(rv,);
 
   // Remove collapsed ranges
-  PRUint32 numRanges = aRanges->Length();
-  for (PRUint32 idx = 0; idx < numRanges; idx ++) {
+  uint32_t numRanges = aRanges->Length();
+  for (uint32_t idx = 0; idx < numRanges; idx ++) {
     if ((*aRanges)[idx]->Collapsed()) {
       aRanges->RemoveElementAt(idx);
       --numRanges;
       --idx;
     }
   }
 }
 
 /*
  * Gets the number of selected regions.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetSelectionCount(PRInt32* aSelectionCount)
+HyperTextAccessible::GetSelectionCount(int32_t* aSelectionCount)
 {
   NS_ENSURE_ARG_POINTER(aSelectionCount);
   *aSelectionCount = 0;
 
   nsTArray<nsRange*> ranges;
   GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
-  *aSelectionCount = PRInt32(ranges.Length());
+  *aSelectionCount = int32_t(ranges.Length());
 
   return NS_OK;
 }
 
 /*
  * Gets the start and end offset of the specified selection.
  */
 NS_IMETHODIMP
-HyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum,
-                                        PRInt32* aStartOffset,
-                                        PRInt32* aEndOffset)
+HyperTextAccessible::GetSelectionBounds(int32_t aSelectionNum,
+                                        int32_t* aStartOffset,
+                                        int32_t* aEndOffset)
 {
   NS_ENSURE_ARG_POINTER(aStartOffset);
   NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
 
   nsTArray<nsRange*> ranges;
   GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
 
-  PRUint32 rangeCount = ranges.Length();
+  uint32_t rangeCount = ranges.Length();
   if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
     return NS_ERROR_INVALID_ARG;
 
   nsRange* range = ranges[aSelectionNum];
 
   // Get start and end points.
   nsINode* startNode = range->GetStartParent();
   nsINode* endNode = range->GetEndParent();
-  PRInt32 startOffset = range->StartOffset(), endOffset = range->EndOffset();
+  int32_t startOffset = range->StartOffset(), endOffset = range->EndOffset();
 
   // Make sure start is before end, by swapping DOM points.  This occurs when
   // the user selects backwards in the text.
-  PRInt32 rangeCompare = nsContentUtils::ComparePoints(endNode, endOffset,
+  int32_t rangeCompare = nsContentUtils::ComparePoints(endNode, endOffset,
                                                        startNode, startOffset);
   if (rangeCompare < 0) {
     nsINode* tempNode = startNode;
     startNode = endNode;
     endNode = tempNode;
-    PRInt32 tempOffset = startOffset;
+    int32_t tempOffset = startOffset;
     startOffset = endOffset;
     endOffset = tempOffset;
   }
 
   Accessible* startAccessible =
     DOMPointToHypertextOffset(startNode, startOffset, aStartOffset);
   if (!startAccessible) {
     *aStartOffset = 0; // Could not find start point within this hypertext, so starts before
@@ -1782,35 +1782,35 @@ HyperTextAccessible::GetSelectionBounds(
   DOMPointToHypertextOffset(endNode, endOffset, aEndOffset, true);
   return NS_OK;
 }
 
 /*<