Bug 1278282 - Ride along Remove some trailing whitespaces r=lsalzman
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 19 Dec 2017 11:38:59 +0100
changeset 453035 64a1d5998ef049326e6662e74cec56ac656efd2b
parent 453034 07457a9823d374c3ef19b4034c6f56cc6d80bf8d
child 453036 28340f2e26316016f2d450239bfea15069bf8383
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1278282
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1278282 - Ride along Remove some trailing whitespaces r=lsalzman MozReview-Commit-ID: 8W6VKIW8PQV
widget/gtk/IMContextWrapper.cpp
widget/gtk/WidgetStyleCache.cpp
widget/gtk/gtk3drawing.cpp
widget/gtk/gtkdrawing.h
widget/gtk/mozcontainer.cpp
widget/gtk/mozcontainer.h
widget/gtk/nsAppShell.cpp
widget/gtk/nsClipboard.cpp
widget/gtk/nsClipboard.h
widget/gtk/nsColorPicker.cpp
widget/gtk/nsColorPicker.h
widget/gtk/nsDeviceContextSpecG.cpp
widget/gtk/nsDragService.cpp
widget/gtk/nsGTKToolkit.h
widget/gtk/nsGtkKeyUtils.cpp
widget/gtk/nsLookAndFeel.cpp
widget/gtk/nsNativeThemeGTK.cpp
widget/gtk/nsNativeThemeGTK.h
widget/gtk/nsPrintDialogGTK.cpp
widget/gtk/nsPrintOptionsGTK.h
widget/gtk/nsPrintSettingsGTK.cpp
widget/gtk/nsPrintSettingsGTK.h
widget/gtk/nsSound.h
widget/gtk/nsToolkit.cpp
--- a/widget/gtk/IMContextWrapper.cpp
+++ b/widget/gtk/IMContextWrapper.cpp
@@ -1255,17 +1255,17 @@ IMContextWrapper::OnDeleteSurroundingNat
 
     // failed
     MOZ_LOG(gGtkIMLog, LogLevel::Error,
         ("0x%p   OnDeleteSurroundingNative(), FAILED, "
          "cannot delete text",
          this));
     return FALSE;
 }
-                         
+
 /* static */
 void
 IMContextWrapper::OnCommitCompositionCallback(GtkIMContext* aContext,
                                               const gchar* aString,
                                               IMContextWrapper* aModule)
 {
     aModule->OnCommitCompositionNative(aContext, aString);
 }
--- a/widget/gtk/WidgetStyleCache.cpp
+++ b/widget/gtk/WidgetStyleCache.cpp
@@ -633,17 +633,17 @@ CreateWidget(WidgetNodeType aWidgetType)
     case MOZ_GTK_BUTTON:
       return CreateButtonWidget();
     case MOZ_GTK_TOGGLE_BUTTON:
       return CreateToggleButtonWidget();
     case MOZ_GTK_BUTTON_ARROW:
       return CreateButtonArrowWidget();
     case MOZ_GTK_ENTRY:
       return CreateEntryWidget();
-    case MOZ_GTK_SCROLLED_WINDOW: 
+    case MOZ_GTK_SCROLLED_WINDOW:
       return CreateScrolledWindowWidget();
     case MOZ_GTK_TREEVIEW:
       return CreateTreeViewWidget();
     case MOZ_GTK_TREE_HEADER_CELL:
       return CreateTreeHeaderCellWidget();
     case MOZ_GTK_TREE_HEADER_SORTARROW:
       return CreateTreeHeaderSortArrowWidget();
     case MOZ_GTK_SPLITTER_HORIZONTAL:
@@ -1069,21 +1069,21 @@ GetCssNodeStyleInternal(WidgetNodeType a
       break;
     case MOZ_GTK_SCALE_CONTENTS_HORIZONTAL:
       style = CreateChildCSSNode("contents",
                                  MOZ_GTK_SCALE_HORIZONTAL);
       break;
     case MOZ_GTK_SCALE_CONTENTS_VERTICAL:
       style = CreateChildCSSNode("contents",
                                  MOZ_GTK_SCALE_VERTICAL);
-      break; 
+      break;
     case MOZ_GTK_SCALE_TROUGH_HORIZONTAL:
       style = CreateChildCSSNode(GTK_STYLE_CLASS_TROUGH,
                                  MOZ_GTK_SCALE_CONTENTS_HORIZONTAL);
-      break; 
+      break;
     case MOZ_GTK_SCALE_TROUGH_VERTICAL:
       style = CreateChildCSSNode(GTK_STYLE_CLASS_TROUGH,
                                  MOZ_GTK_SCALE_CONTENTS_VERTICAL);
       break;
     case MOZ_GTK_SCALE_THUMB_HORIZONTAL:
       style = CreateChildCSSNode(GTK_STYLE_CLASS_SLIDER,
                                  MOZ_GTK_SCALE_TROUGH_HORIZONTAL);
       break;
@@ -1108,17 +1108,17 @@ GetCssNodeStyleInternal(WidgetNodeType a
       gtk_style_context_add_region(style, GTK_STYLE_REGION_TAB,
                                    static_cast<GtkRegionFlags>(0));
       break;
     }
     case MOZ_GTK_NOTEBOOK:
     case MOZ_GTK_NOTEBOOK_HEADER:
     case MOZ_GTK_TABPANELS:
     case MOZ_GTK_TAB_SCROLLARROW:
-    { 
+    {
       // TODO - create from CSS node
       GtkWidget* widget = GetWidget(MOZ_GTK_NOTEBOOK);
       return gtk_widget_get_style_context(widget);
     }
     default:
       return GetWidgetRootStyle(aNodeType);
   }
 
@@ -1253,17 +1253,17 @@ GetWidgetStyleInternal(WidgetNodeType aN
       style = CreateSubStyleWithClass(MOZ_GTK_NOTEBOOK, GTK_STYLE_CLASS_BOTTOM);
       gtk_style_context_add_region(style, GTK_STYLE_REGION_TAB,
                                    static_cast<GtkRegionFlags>(0));
       break;
     case MOZ_GTK_NOTEBOOK:
     case MOZ_GTK_NOTEBOOK_HEADER:
     case MOZ_GTK_TABPANELS:
     case MOZ_GTK_TAB_SCROLLARROW:
-    { 
+    {
       GtkWidget* widget = GetWidget(MOZ_GTK_NOTEBOOK);
       return gtk_widget_get_style_context(widget);
     }
     default:
       return GetWidgetRootStyle(aNodeType);
   }
 
   MOZ_ASSERT(style);
--- a/widget/gtk/gtk3drawing.cpp
+++ b/widget/gtk/gtk3drawing.cpp
@@ -122,25 +122,25 @@ moz_gtk_add_border_padding(GtkStyleConte
 // that are not expected to change appearance on hover or mouse-down.
 static GtkStateFlags
 GetStateFlagsFromGtkWidgetState(GtkWidgetState* state)
 {
     GtkStateFlags stateFlags = GTK_STATE_FLAG_NORMAL;
 
     if (state->disabled)
         stateFlags = GTK_STATE_FLAG_INSENSITIVE;
-    else {    
+    else {
         if (state->depressed || state->active)
             stateFlags = static_cast<GtkStateFlags>(stateFlags|GTK_STATE_FLAG_ACTIVE);
         if (state->inHover)
             stateFlags = static_cast<GtkStateFlags>(stateFlags|GTK_STATE_FLAG_PRELIGHT);
         if (state->focused)
             stateFlags = static_cast<GtkStateFlags>(stateFlags|GTK_STATE_FLAG_FOCUSED);
     }
-  
+
     return stateFlags;
 }
 
 static GtkStateFlags
 GetStateFlagsFromGtkTabFlags(GtkTabFlags flags)
 {
     return ((flags & MOZ_GTK_TAB_SELECTED) == 0) ?
             GTK_STATE_FLAG_NORMAL : GTK_STATE_FLAG_ACTIVE;
@@ -318,21 +318,21 @@ moz_gtk_window_paint(cairo_t *cr, GdkRec
 
 static gint
 moz_gtk_button_paint(cairo_t *cr, GdkRectangle* rect,
                      GtkWidgetState* state,
                      GtkReliefStyle relief, GtkWidget* widget,
                      GtkTextDirection direction)
 {
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
-    GtkStyleContext* style = gtk_widget_get_style_context(widget);    
+    GtkStyleContext* style = gtk_widget_get_style_context(widget);
     gint x = rect->x, y=rect->y, width=rect->width, height=rect->height;
 
     gtk_widget_set_direction(widget, direction);
- 
+
     gtk_style_context_save(style);
     gtk_style_context_set_state(style, state_flags);
 
     if (state->isDefault && relief == GTK_RELIEF_NORMAL) {
         /* handle default borders both outside and inside the button */
         gint default_top, default_left, default_bottom, default_right;
         moz_gtk_button_get_default_overflow(&default_top, &default_left,
                                             &default_bottom, &default_right);
@@ -481,22 +481,22 @@ calculate_arrow_rect(GtkWidget* arrow, G
     gint extent;
     gint mxpad, mypad;
     gfloat mxalign, myalign;
     GtkMisc* misc = GTK_MISC(arrow);
 
     gtk_style_context_get_style(gtk_widget_get_style_context(arrow),
                                 "arrow_scaling", &arrow_scaling, NULL);
 
-    gtk_misc_get_padding(misc, &mxpad, &mypad); 
+    gtk_misc_get_padding(misc, &mxpad, &mypad);
     extent = MIN((rect->width - mxpad * 2),
                  (rect->height - mypad * 2)) * arrow_scaling;
 
     gtk_misc_get_alignment(misc, &mxalign, &myalign);
-    
+
     xalign = direction == GTK_TEXT_DIR_LTR ? mxalign : 1.0 - mxalign;
     xpad = mxpad + (rect->width - extent) * xalign;
 
     arrow_rect->x = direction == GTK_TEXT_DIR_LTR ?
                         floor(rect->x + xpad) : ceil(rect->x + xpad);
     arrow_rect->y = floor(rect->y + mypad +
                           ((rect->height - extent) * myalign));
 
@@ -600,23 +600,23 @@ moz_gtk_scrollbar_button_paint(cairo_t *
 
     GtkWidget *scrollbar =
         GetWidget(flags & MOZ_GTK_STEPPER_VERTICAL ?
                   MOZ_GTK_SCROLLBAR_VERTICAL : MOZ_GTK_SCROLLBAR_HORIZONTAL);
 
     gtk_widget_set_direction(scrollbar, direction);
 
     if (flags & MOZ_GTK_STEPPER_VERTICAL) {
-        arrow_angle = (flags & MOZ_GTK_STEPPER_DOWN) ? ARROW_DOWN : ARROW_UP;        
+        arrow_angle = (flags & MOZ_GTK_STEPPER_DOWN) ? ARROW_DOWN : ARROW_UP;
     } else {
-        arrow_angle = (flags & MOZ_GTK_STEPPER_DOWN) ? ARROW_RIGHT : ARROW_LEFT;        
+        arrow_angle = (flags & MOZ_GTK_STEPPER_DOWN) ? ARROW_RIGHT : ARROW_LEFT;
     }
 
     style = gtk_widget_get_style_context(scrollbar);
-  
+
     gtk_style_context_save(style);
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_BUTTON);
     gtk_style_context_set_state(style, state_flags);
     if (arrow_angle == ARROW_RIGHT) {
         gtk_style_context_add_class(style, GTK_STYLE_CLASS_RIGHT);
     } else if (arrow_angle == ARROW_DOWN) {
         gtk_style_context_add_class(style, GTK_STYLE_CLASS_BOTTOM);
     } else if (arrow_angle == ARROW_LEFT) {
@@ -649,39 +649,39 @@ moz_gtk_scrollbar_button_paint(cairo_t *
         }
     }
 
     gtk_render_background(style, cr, rect.x, rect.y, rect.width, rect.height);
     gtk_render_frame(style, cr, rect.x, rect.y, rect.width, rect.height);
 
     arrow_rect.width = rect.width / 2;
     arrow_rect.height = rect.height / 2;
-    
+
     gfloat arrow_scaling;
     gtk_style_context_get_style(style, "arrow-scaling", &arrow_scaling, NULL);
 
     gdouble arrow_size = MIN(rect.width, rect.height) * arrow_scaling;
     arrow_rect.x = rect.x + (rect.width - arrow_size) / 2;
     arrow_rect.y = rect.y + (rect.height - arrow_size) / 2;
 
     if (state_flags & GTK_STATE_FLAG_ACTIVE) {
         gtk_style_context_get_style(style,
                                     "arrow-displacement-x", &arrow_displacement_x,
                                     "arrow-displacement-y", &arrow_displacement_y,
                                     NULL);
 
         arrow_rect.x += arrow_displacement_x;
         arrow_rect.y += arrow_displacement_y;
     }
-  
+
     gtk_render_arrow(style, cr, arrow_angle,
                      arrow_rect.x,
-                     arrow_rect.y, 
+                     arrow_rect.y,
                      arrow_size);
-  
+
     gtk_style_context_restore(style);
 
     return MOZ_GTK_SUCCESS;
 }
 
 static void
 moz_gtk_update_scrollbar_style(GtkStyleContext* style,
                                WidgetNodeType widget,
@@ -855,17 +855,17 @@ moz_gtk_spin_updown_paint(cairo_t *cr, G
     /* hard code these values */
     GdkRectangle arrow_rect;
     arrow_rect.width = 6;
     arrow_rect.height = 6;
     arrow_rect.x = rect->x + (rect->width - arrow_rect.width) / 2;
     arrow_rect.y = rect->y + (rect->height - arrow_rect.height) / 2;
     arrow_rect.y += isDown ? -1 : 1;
 
-    gtk_render_arrow(style, cr, 
+    gtk_render_arrow(style, cr,
                     isDown ? ARROW_DOWN : ARROW_UP,
                     arrow_rect.x, arrow_rect.y,
                     arrow_rect.width);
 
     return MOZ_GTK_SUCCESS;
 }
 
 /* See gtk_range_draw() for reference.
@@ -901,32 +901,32 @@ moz_gtk_scale_paint(cairo_t *cr, GdkRect
     x = rect->x + (rect->width - width)/2;
     y = rect->y + margin.top;
   }
 
   gtk_render_background(style, cr, x, y, width, height);
   gtk_render_frame(style, cr, x, y, width, height);
 
   if (state->focused)
-    gtk_render_focus(style, cr, 
+    gtk_render_focus(style, cr,
                     rect->x, rect->y, rect->width, rect->height);
 
   return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_scale_thumb_paint(cairo_t *cr, GdkRectangle* rect,
                           GtkWidgetState* state,
                           GtkOrientation flags, GtkTextDirection direction)
 {
   GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
   GtkStyleContext* style;
   gint thumb_width, thumb_height, x, y;
 
-  /* determine the thumb size, and position the thumb in the center in the opposite axis 
+  /* determine the thumb size, and position the thumb in the center in the opposite axis
   */
   if (flags == GTK_ORIENTATION_HORIZONTAL) {
     moz_gtk_get_scalethumb_metrics(GTK_ORIENTATION_HORIZONTAL, &thumb_width, &thumb_height);
     x = rect->x;
     y = rect->y + (rect->height - thumb_height) / 2;
   }
   else {
     moz_gtk_get_scalethumb_metrics(GTK_ORIENTATION_VERTICAL, &thumb_height, &thumb_width);
@@ -973,17 +973,17 @@ static gint
 moz_gtk_vpaned_paint(cairo_t *cr, GdkRectangle* rect,
                      GtkWidgetState* state)
 {
     GtkStyleContext* style =
         GetStyleContext(MOZ_GTK_SPLITTER_SEPARATOR_VERTICAL,
                         GTK_TEXT_DIR_LTR,
                         GetStateFlagsFromGtkWidgetState(state));
     gtk_render_handle(style, cr,
-                      rect->x, rect->y, rect->width, rect->height);                     
+                      rect->x, rect->y, rect->width, rect->height);
     return MOZ_GTK_SUCCESS;
 }
 
 // See gtk_entry_draw() for reference.
 static gint
 moz_gtk_entry_paint(cairo_t *cr, GdkRectangle* rect,
                     GtkWidgetState* state,
                     GtkStyleContext* style)
@@ -1041,17 +1041,17 @@ moz_gtk_text_view_paint(cairo_t *cr, Gdk
     // for GTK 3.20, in which case the MOZ_GTK_TEXT_VIEW background is
     // visible.
     style = GetStyleContext(MOZ_GTK_TEXT_VIEW_TEXT, direction, state_flags);
     gtk_render_background(style, cr, rect.x, rect.y, rect.width, rect.height);
 
     return MOZ_GTK_SUCCESS;
 }
 
-static gint 
+static gint
 moz_gtk_treeview_paint(cairo_t *cr, GdkRectangle* rect,
                        GtkWidgetState* state,
                        GtkTextDirection direction)
 {
     gint xthickness, ythickness;
     GtkStyleContext *style;
     GtkStyleContext *style_tree;
     GtkStateFlags state_flags;
@@ -1059,27 +1059,27 @@ moz_gtk_treeview_paint(cairo_t *cr, GdkR
 
     /* only handle disabled and normal states, otherwise the whole background
      * area will be painted differently with other states */
     state_flags = state->disabled ? GTK_STATE_FLAG_INSENSITIVE : GTK_STATE_FLAG_NORMAL;
 
     style = GetStyleContext(MOZ_GTK_SCROLLED_WINDOW, direction);
     gtk_style_context_get_border(style, state_flags, &border);
     xthickness = border.left;
-    ythickness = border.top;    
+    ythickness = border.top;
 
     style_tree = GetStyleContext(MOZ_GTK_TREEVIEW_VIEW, direction);
     gtk_render_background(style_tree, cr,
                           rect->x + xthickness, rect->y + ythickness,
                           rect->width - 2 * xthickness,
                           rect->height - 2 * ythickness);
 
     style = GetStyleContext(MOZ_GTK_SCROLLED_WINDOW, direction);
-    gtk_render_frame(style, cr, 
-                     rect->x, rect->y, rect->width, rect->height); 
+    gtk_render_frame(style, cr,
+                     rect->x, rect->y, rect->width, rect->height);
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_tree_header_cell_paint(cairo_t *cr, GdkRectangle* rect,
                                GtkWidgetState* state,
                                gboolean isSorted, GtkTextDirection direction)
 {
@@ -1120,17 +1120,17 @@ moz_gtk_tree_header_sort_arrow_paint(cai
     }
     if (arrow_type != GTK_ARROW_NONE)
         gtk_render_arrow(style, cr, arrow_angle,
                          arrow_rect.x, arrow_rect.y,
                          arrow_rect.width);
     return MOZ_GTK_SUCCESS;
 }
 
-/* See gtk_expander_paint() for reference. 
+/* See gtk_expander_paint() for reference.
  */
 static gint
 moz_gtk_treeview_expander_paint(cairo_t *cr, GdkRectangle* rect,
                                 GtkWidgetState* state,
                                 GtkExpanderStyle expander_state,
                                 GtkTextDirection direction)
 {
     /* Because the frame we get is of the entire treeview, we can't get the precise
@@ -1205,30 +1205,30 @@ moz_gtk_combo_box_paint(cairo_t *cr, Gdk
                                 "separator-width", &separator_width,
                                 NULL);
 
     if (wide_separators) {
         if (direction == GTK_TEXT_DIR_LTR)
             arrow_rect.x -= separator_width;
         else
             arrow_rect.x += arrow_rect.width;
-        
+
         gtk_render_frame(style, cr, arrow_rect.x, arrow_rect.y, separator_width, arrow_rect.height);
     } else {
         if (direction == GTK_TEXT_DIR_LTR) {
             GtkBorder padding;
             GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
             gtk_style_context_get_padding(style, state_flags, &padding);
             arrow_rect.x -= padding.left;
         }
         else
             arrow_rect.x += arrow_rect.width;
-        
-        gtk_render_line(style, cr, 
-                        arrow_rect.x, arrow_rect.y, 
+
+        gtk_render_line(style, cr,
+                        arrow_rect.x, arrow_rect.y,
                         arrow_rect.x, arrow_rect.y + arrow_rect.height);
     }
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_arrow_paint(cairo_t *cr, GdkRectangle* rect,
                     GtkWidgetState* state,
@@ -1304,17 +1304,17 @@ moz_gtk_combo_box_entry_button_paint(cai
     gtk_render_arrow(style, cr, ARROW_DOWN,
                     real_arrow_rect.x, real_arrow_rect.y,
                     real_arrow_rect.width);
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_container_paint(cairo_t *cr, GdkRectangle* rect,
-                        GtkWidgetState* state, 
+                        GtkWidgetState* state,
                         WidgetNodeType  widget_type,
                         GtkTextDirection direction)
 {
     GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
     GtkStyleContext* style = GetStyleContext(widget_type, direction,
                                              state_flags);
     /* this is for drawing a prelight box */
     if (state_flags & GTK_STATE_FLAG_PRELIGHT) {
@@ -1322,17 +1322,17 @@ moz_gtk_container_paint(cairo_t *cr, Gdk
                               rect->x, rect->y, rect->width, rect->height);
     }
 
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_toggle_label_paint(cairo_t *cr, GdkRectangle* rect,
-                           GtkWidgetState* state, 
+                           GtkWidgetState* state,
                            gboolean isradio, GtkTextDirection direction)
 {
     if (!state->focused)
         return MOZ_GTK_SUCCESS;
 
     GtkStyleContext *style =
         GetStyleContext(isradio ? MOZ_GTK_RADIOBUTTON_CONTAINER :
                                   MOZ_GTK_CHECKBUTTON_CONTAINER,
@@ -1358,46 +1358,46 @@ moz_gtk_toolbar_paint(cairo_t *cr, GdkRe
 */
 static gint
 moz_gtk_toolbar_separator_paint(cairo_t *cr, GdkRectangle* rect,
                                 GtkTextDirection direction)
 {
     gint     separator_width;
     gint     paint_width;
     gboolean wide_separators;
-    
+
     /* Defined as constants in GTK+ 2.10.14 */
     const double start_fraction = 0.2;
     const double end_fraction = 0.8;
 
     GtkStyleContext* style = GetStyleContext(MOZ_GTK_TOOLBAR);
     gtk_style_context_get_style(style,
                                 "wide-separators", &wide_separators,
                                 "separator-width", &separator_width,
                                 NULL);
 
     style = GetStyleContext(MOZ_GTK_TOOLBAR_SEPARATOR, direction);
     if (wide_separators) {
         if (separator_width > rect->width)
             separator_width = rect->width;
-        
+
         gtk_render_frame(style, cr,
                           rect->x + (rect->width - separator_width) / 2,
                           rect->y + rect->height * start_fraction,
                           separator_width,
                           rect->height * (end_fraction - start_fraction));
     } else {
         GtkBorder padding;
         gtk_style_context_get_padding(style, GTK_STATE_FLAG_NORMAL, &padding);
-    
+
         paint_width = padding.left;
         if (paint_width > rect->width)
             paint_width = rect->width;
-        
-        gtk_render_line(style, cr, 
+
+        gtk_render_line(style, cr,
                         rect->x + (rect->width - paint_width) / 2,
                         rect->y + rect->height * start_fraction,
                         rect->x + (rect->width - paint_width) / 2,
                         rect->y + rect->height * end_fraction);
     }
     return MOZ_GTK_SUCCESS;
 }
 
@@ -1747,26 +1747,26 @@ moz_gtk_tab_paint(cairo_t *cr, GdkRectan
 }
 
 /* tab area*/
 static gint
 moz_gtk_tabpanels_paint(cairo_t *cr, GdkRectangle* rect,
                         GtkTextDirection direction)
 {
     GtkStyleContext* style = GetStyleContext(MOZ_GTK_TABPANELS, direction);
-    gtk_render_background(style, cr, rect->x, rect->y, 
+    gtk_render_background(style, cr, rect->x, rect->y,
                           rect->width, rect->height);
     /*
-     * The gap size is not needed in moz_gtk_tabpanels_paint because 
+     * The gap size is not needed in moz_gtk_tabpanels_paint because
      * the gap will be painted with the foreground tab in moz_gtk_tab_paint.
      *
-     * However, if moz_gtk_tabpanels_paint just uses gtk_render_frame(), 
-     * the theme will think that there are no tabs and may draw something 
-     * different.Hence the trick of using two clip regions, and drawing the 
-     * gap outside each clip region, to get the correct frame for 
+     * However, if moz_gtk_tabpanels_paint just uses gtk_render_frame(),
+     * the theme will think that there are no tabs and may draw something
+     * different.Hence the trick of using two clip regions, and drawing the
+     * gap outside each clip region, to get the correct frame for
      * a tabpanel with tabs.
      */
     /* left side */
     cairo_save(cr);
     cairo_rectangle(cr, rect->x, rect->y,
                     rect->x + rect->width / 2,
                     rect->y + rect->height);
     cairo_clip(cr);
@@ -1801,32 +1801,32 @@ moz_gtk_tab_scroll_arrow_paint(cairo_t *
     gdouble arrow_angle;
     gint arrow_size = MIN(rect->width, rect->height);
     gint x = rect->x + (rect->width - arrow_size) / 2;
     gint y = rect->y + (rect->height - arrow_size) / 2;
 
     if (direction == GTK_TEXT_DIR_RTL) {
         arrow_type = (arrow_type == GTK_ARROW_LEFT) ?
                          GTK_ARROW_RIGHT : GTK_ARROW_LEFT;
-    }    
+    }
     switch (arrow_type) {
     case GTK_ARROW_LEFT:
         arrow_angle = ARROW_LEFT;
         break;
     case GTK_ARROW_RIGHT:
         arrow_angle = ARROW_RIGHT;
         break;
     case GTK_ARROW_DOWN:
         arrow_angle = ARROW_DOWN;
         break;
     default:
         arrow_angle = ARROW_UP;
-        break;      
+        break;
     }
-    if (arrow_type != GTK_ARROW_NONE)  {        
+    if (arrow_type != GTK_ARROW_NONE)  {
         style = GetStyleContext(MOZ_GTK_TAB_SCROLLARROW, direction,
                                 GetStateFlagsFromGtkWidgetState(state));
         gtk_render_arrow(style, cr, arrow_angle,
                          x, y, arrow_size);
     }
     return MOZ_GTK_SUCCESS;
 }
 
@@ -1840,17 +1840,17 @@ moz_gtk_menu_bar_paint(cairo_t *cr, GdkR
     gtk_widget_set_direction(widget, direction);
 
     style = gtk_widget_get_style_context(widget);
     gtk_style_context_save(style);
     gtk_style_context_add_class(style, GTK_STYLE_CLASS_MENUBAR);
     gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
     gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
     gtk_style_context_restore(style);
-    
+
     return MOZ_GTK_SUCCESS;
 }
 
 static gint
 moz_gtk_menu_popup_paint(cairo_t *cr, GdkRectangle* rect,
                          GtkTextDirection direction)
 {
     GtkStyleContext* style;
@@ -2328,25 +2328,25 @@ moz_gtk_get_widget_border(WidgetNodeType
     case MOZ_GTK_TAB_SCROLLARROW:
         return MOZ_GTK_SUCCESS;
     default:
         g_warning("Unsupported widget type: %d", widget);
         return MOZ_GTK_UNKNOWN_WIDGET;
     }
     /* TODO - we're still missing some widget implementations */
     if (w) {
-      moz_gtk_add_style_border(gtk_widget_get_style_context(w), 
+      moz_gtk_add_style_border(gtk_widget_get_style_context(w),
                                left, top, right, bottom);
     }
     return MOZ_GTK_SUCCESS;
 }
 
 gint
-moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom, 
-                       GtkTextDirection direction, GtkTabFlags flags, 
+moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom,
+                       GtkTextDirection direction, GtkTabFlags flags,
                        WidgetNodeType widget)
 {
     GtkStyleContext* style = GetStyleContext(widget, direction,
                               GetStateFlagsFromGtkTabFlags(flags));
 
     *left = *top = *right = *bottom = 0;
     moz_gtk_add_style_padding(style, left, top, right, bottom);
 
@@ -2909,17 +2909,17 @@ moz_gtk_widget_paint(WidgetNodeType widg
         return moz_gtk_treeview_paint(cr, rect, state,
                                       direction);
         break;
     case MOZ_GTK_TREE_HEADER_CELL:
         return moz_gtk_tree_header_cell_paint(cr, rect, state,
                                               flags, direction);
         break;
     case MOZ_GTK_TREE_HEADER_SORTARROW:
-        return moz_gtk_tree_header_sort_arrow_paint(cr, rect, 
+        return moz_gtk_tree_header_sort_arrow_paint(cr, rect,
                                                     state,
                                                     (GtkArrowType) flags,
                                                     direction);
         break;
     case MOZ_GTK_TREEVIEW_EXPANDER:
         return moz_gtk_treeview_expander_paint(cr, rect, state,
                                                (GtkExpanderStyle) flags, direction);
         break;
--- a/widget/gtk/gtkdrawing.h
+++ b/widget/gtk/gtkdrawing.h
@@ -389,17 +389,17 @@ gint moz_gtk_get_widget_border(WidgetNod
  * top/bottom:  [OUT] the tab's top/bottom border
  * direction:   the text direction for the widget
  * flags:       tab-dependant flags; see the GtkTabFlags definition.
  * widget:      tab widget
  *
  * returns:    MOZ_GTK_SUCCESS if there was no error, an error code otherwise
  */
 gint
-moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom, 
+moz_gtk_get_tab_border(gint* left, gint* top, gint* right, gint* bottom,
                        GtkTextDirection direction, GtkTabFlags flags,
                        WidgetNodeType widget);
 
 /**
  * Get the desired size of a GtkCheckButton
  * indicator_size:     [OUT] the indicator size
  * indicator_spacing:  [OUT] the spacing between the indicator and its
  *                     container
@@ -424,17 +424,17 @@ GetToggleMetrics(bool isRadio);
  *                     container
  *
  * returns:    MOZ_GTK_SUCCESS if there was no error, an error code otherwise
  */
 gint
 moz_gtk_radio_get_metrics(gint* indicator_size, gint* indicator_spacing);
 
 /** Get the extra size for the focus ring for outline:auto.
- * widget:             [IN]  the widget to get the focus metrics for    
+ * widget:             [IN]  the widget to get the focus metrics for
  * focus_h_width:      [OUT] the horizontal width
  * focus_v_width:      [OUT] the vertical width
  *
  * returns:    MOZ_GTK_SUCCESS
  */
 gint
 moz_gtk_get_focus_outline_size(gint* focus_h_width, gint* focus_v_width);
 
--- a/widget/gtk/mozcontainer.cpp
+++ b/widget/gtk/mozcontainer.cpp
@@ -11,17 +11,17 @@
 #include <gdk/gdkx.h>
 #include <gdk/gdkwayland.h>
 #endif
 #include <stdio.h>
 
 #ifdef ACCESSIBILITY
 #include <atk/atk.h>
 #include "maiRedundantObjectFactory.h"
-#endif 
+#endif
 
 /* init methods */
 static void moz_container_class_init          (MozContainerClass *klass);
 static void moz_container_init                (MozContainer      *container);
 
 /* widget class methods */
 static void moz_container_map                 (GtkWidget         *widget);
 static void moz_container_unmap               (GtkWidget         *widget);
@@ -291,17 +291,17 @@ moz_container_map (GtkWidget *widget)
     g_return_if_fail (IS_MOZ_CONTAINER(widget));
     container = MOZ_CONTAINER (widget);
 
     gtk_widget_set_mapped(widget, TRUE);
 
     tmp_list = container->children;
     while (tmp_list) {
         tmp_child = ((MozContainerChild *)tmp_list->data)->widget;
-    
+
         if (gtk_widget_get_visible(tmp_child)) {
             if (!gtk_widget_get_mapped(tmp_child))
                 gtk_widget_map(tmp_child);
         }
         tmp_list = tmp_list->next;
     }
 
     if (gtk_widget_get_has_window (widget)) {
@@ -476,17 +476,17 @@ moz_container_remove (GtkContainer *cont
 }
 
 void
 moz_container_forall (GtkContainer *container, gboolean include_internals,
                       GtkCallback  callback, gpointer callback_data)
 {
     MozContainer *moz_container;
     GList *tmp_list;
-  
+
     g_return_if_fail (IS_MOZ_CONTAINER(container));
     g_return_if_fail (callback != NULL);
 
     moz_container = MOZ_CONTAINER(container);
 
     tmp_list = moz_container->children;
     while (tmp_list) {
         MozContainerChild *child;
@@ -512,28 +512,28 @@ moz_container_allocate_child (MozContain
 MozContainerChild *
 moz_container_get_child (MozContainer *container, GtkWidget *child_widget)
 {
     GList *tmp_list;
 
     tmp_list = container->children;
     while (tmp_list) {
         MozContainerChild *child;
-    
+
         child = static_cast<MozContainerChild*>(tmp_list->data);
         tmp_list = tmp_list->next;
 
         if (child->widget == child_widget)
             return child;
     }
 
     return NULL;
 }
 
-static void 
+static void
 moz_container_add(GtkContainer *container, GtkWidget *widget)
 {
     moz_container_put(MOZ_CONTAINER(container), widget, 0, 0);
 }
 
 #ifdef MOZ_WAYLAND
 struct wl_surface*
 moz_container_get_wl_surface(MozContainer *container)
--- a/widget/gtk/mozcontainer.h
+++ b/widget/gtk/mozcontainer.h
@@ -38,17 +38,17 @@
  * One consequence of this is that the MozContainer does not know which of its
  * GdkWindows should parent child GtkWidgets.  (Conventional GtkContainers
  * determine which GdkWindow to assign child GtkWidgets.)
  *
  * Therefore, when adding a child GtkWidget to a MozContainer,
  * gtk_widget_set_parent_window should be called on the child GtkWidget before
  * it is realized.
  */
- 
+
 #define MOZ_CONTAINER_TYPE            (moz_container_get_type())
 #define MOZ_CONTAINER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOZ_CONTAINER_TYPE, MozContainer))
 #define MOZ_CONTAINER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MOZ_CONTAINER_TYPE, MozContainerClass))
 #define IS_MOZ_CONTAINER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOZ_CONTAINER_TYPE))
 #define IS_MOZ_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOZ_CONTAINER_TYPE))
 #define MOZ_CONTAINER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), MOZ_CONTAINER_TYPE, MozContainerClass))
 
 typedef struct _MozContainer      MozContainer;
--- a/widget/gtk/nsAppShell.cpp
+++ b/widget/gtk/nsAppShell.cpp
@@ -112,17 +112,17 @@ WrapGdkFrameClockDispose(GObject* object
         g_signal_emit_by_name(object, "resume-events");
     }
 
     sRealGdkFrameClockDispose(object);
 }
 #endif
 
 /*static*/ gboolean
-nsAppShell::EventProcessorCallback(GIOChannel *source, 
+nsAppShell::EventProcessorCallback(GIOChannel *source,
                                    GIOCondition condition,
                                    gpointer data)
 {
     nsAppShell *self = static_cast<nsAppShell *>(data);
 
     unsigned char c;
     Unused << read(self->mPipeFDs[0], &c, 1);
     NS_ASSERTION(c == (unsigned char) NOTIFY_TOKEN, "wrong token");
--- a/widget/gtk/nsClipboard.cpp
+++ b/widget/gtk/nsClipboard.cpp
@@ -42,17 +42,17 @@ clipboard_get_cb(GtkClipboard *aGtkClipb
                  GtkSelectionData *aSelectionData,
                  guint info,
                  gpointer user_data);
 
 // Callback when someone asks us to clear a clipboard
 void
 clipboard_clear_cb(GtkClipboard *aGtkClipboard,
                    gpointer user_data);
-                   
+
 static void
 ConvertHTMLtoUCS2          (const char*         data,
                             int32_t             dataLength,
                             char16_t         **unicodeData,
                             int32_t            &outUnicodeLen);
 
 static void
 GetHTMLCharset             (const char* data, int32_t dataLength, nsCString& str);
@@ -188,50 +188,50 @@ nsClipboard::SetData(nsITransferable *aT
                 continue;
             }
 
             // Add this to our list of valid targets
             GdkAtom atom = gdk_atom_intern(flavorStr.get(), FALSE);
             gtk_target_list_add(list, atom, 0, 0);
         }
     }
-    
+
     // Get GTK clipboard (CLIPBOARD or PRIMARY)
     GtkClipboard *gtkClipboard = gtk_clipboard_get(GetSelectionAtom(aWhichClipboard));
-  
+
     gint numTargets;
     GtkTargetEntry *gtkTargets = gtk_target_table_new_from_list(list, &numTargets);
-          
+
     // Set getcallback and request to store data after an application exit
     if (gtkTargets &&
         gtk_clipboard_set_with_data(gtkClipboard, gtkTargets, numTargets,
                                     clipboard_get_cb, clipboard_clear_cb, this))
     {
         // We managed to set-up the clipboard so update internal state
         // We have to set it now because gtk_clipboard_set_with_data() calls clipboard_clear_cb()
-        // which reset our internal state 
+        // which reset our internal state
         if (aWhichClipboard == kSelectionClipboard) {
             mSelectionOwner = aOwner;
             mSelectionTransferable = aTransferable;
         }
         else {
             mGlobalOwner = aOwner;
             mGlobalTransferable = aTransferable;
             gtk_clipboard_set_can_store(gtkClipboard, gtkTargets, numTargets);
         }
 
         rv = NS_OK;
     }
-    else {  
+    else {
         rv = NS_ERROR_FAILURE;
     }
 
     gtk_target_table_free(gtkTargets, numTargets);
     gtk_target_list_unref(list);
-  
+
     return rv;
 }
 
 void
 nsClipboard::SetTransferableData(nsITransferable* aTransferable,
                                  nsCString&       aFlavor,
                                  const char*      aClipboardData,
                                  uint32_t         aClipboardDataLength)
@@ -450,17 +450,17 @@ nsITransferable *
 nsClipboard::GetTransferable(int32_t aWhichClipboard)
 {
     nsITransferable *retval;
 
     if (aWhichClipboard == kSelectionClipboard)
         retval = mSelectionTransferable.get();
     else
         retval = mGlobalTransferable.get();
-        
+
     return retval;
 }
 
 void
 nsClipboard::SelectionGetEvent(GtkClipboard     *aClipboard,
                                GtkSelectionData *aSelectionData)
 {
     // Someone has asked us to hand them something.  The first thing
@@ -503,28 +503,28 @@ nsClipboard::SelectionGetEvent(GtkClipbo
         selectionTarget == gdk_atom_intern ("UTF8_STRING", FALSE)) {
         // Try to convert our internal type into a text string.  Get
         // the transferable for this clipboard and try to get the
         // text/unicode type for it.
         rv = trans->GetTransferData("text/unicode", getter_AddRefs(item),
                                     &len);
         if (!item || NS_FAILED(rv))
             return;
-        
+
         nsCOMPtr<nsISupportsString> wideString;
         wideString = do_QueryInterface(item);
         if (!wideString)
             return;
 
         nsAutoString ucs2string;
         wideString->GetData(ucs2string);
         char *utf8string = ToNewUTF8String(ucs2string);
         if (!utf8string)
             return;
-        
+
         gtk_selection_data_set_text (aSelectionData, utf8string,
                                      strlen(utf8string));
 
         free(utf8string);
         return;
     }
 
     // Check to see if the selection data is an image type
@@ -589,25 +589,25 @@ nsClipboard::SelectionGetEvent(GtkClipbo
                 return;
             char16_t prefix = 0xFEFF;
             memcpy(buffer, &prefix, sizeof(prefix));
             memcpy(buffer + sizeof(prefix), primitive_data, len);
             g_free((guchar *)primitive_data);
             primitive_data = (guchar *)buffer;
             len += sizeof(prefix);
         }
-  
+
         gtk_selection_data_set(aSelectionData, selectionTarget,
                                8, /* 8 bits in a unit */
                                (const guchar *)primitive_data, len);
         g_free(primitive_data);
     }
 
     g_free(target_name);
-                           
+
 }
 
 void
 nsClipboard::SelectionClearEvent(GtkClipboard *aGtkClipboard)
 {
     int32_t whichClipboard;
 
     // which clipboard?
@@ -752,17 +752,17 @@ void GetHTMLCharset(const char* data, in
         htmlStr.EndReading(end);
 
         if (CaseInsensitiveFindInReadable(
             NS_LITERAL_CSTRING("charset="),
             start, end)) {
             valueStart = end;
             start = end;
             htmlStr.EndReading(end);
-          
+
             if (FindCharInReadable('"', start, end))
                 valueEnd = start;
         }
     }
     // find "charset" in HTML
     if (valueStart != valueEnd) {
         str = Substring(valueStart, valueEnd);
         ToUpperCase(str);
--- a/widget/gtk/nsClipboard.h
+++ b/widget/gtk/nsClipboard.h
@@ -34,17 +34,17 @@ protected:
     static const int kClipboardTimeout;
 };
 
 class nsClipboard : public nsIClipboard,
                     public nsIObserver
 {
 public:
     nsClipboard();
-    
+
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
     NS_DECL_NSICLIPBOARD
 
     // Make sure we are initialized, called from the factory
     // constructor
     nsresult  Init              (void);
 
--- a/widget/gtk/nsColorPicker.cpp
+++ b/widget/gtk/nsColorPicker.cpp
@@ -15,26 +15,26 @@
 NS_IMPL_ISUPPORTS(nsColorPicker, nsIColorPicker)
 
 #if defined(ACTIVATE_GTK3_COLOR_PICKER) && GTK_CHECK_VERSION(3,4,0)
 int nsColorPicker::convertGdkRgbaComponent(gdouble color_component) {
   // GdkRGBA value is in range [0.0..1.0]. We need something in range [0..255]
   return color_component * 255 + 0.5;
 }
 
-gdouble nsColorPicker::convertToGdkRgbaComponent(int color_component) { 
+gdouble nsColorPicker::convertToGdkRgbaComponent(int color_component) {
   return color_component / 255.0;
-}  
+}
 
 GdkRGBA nsColorPicker::convertToRgbaColor(nscolor color) {
   GdkRGBA result = { convertToGdkRgbaComponent(NS_GET_R(color)),
                      convertToGdkRgbaComponent(NS_GET_G(color)),
                      convertToGdkRgbaComponent(NS_GET_B(color)),
                      convertToGdkRgbaComponent(NS_GET_A(color)) };
-       
+
   return result;
 }
 #else
 int nsColorPicker::convertGdkColorComponent(guint16 color_component) {
   // GdkColor value is in range [0..65535]. We need something in range [0..255]
   return (color_component * 255 + 127) / 65535;
 }
 
@@ -90,50 +90,50 @@ NS_IMETHODIMP nsColorPicker::Open(nsICol
     NS_WARNING("mCallback is already set. Open called twice?");
     return NS_ERROR_FAILURE;
   }
   mCallback = aColorPickerShownCallback;
 
   nsCString title;
   title.Adopt(ToNewUTF8String(mTitle));
   GtkWindow *parent_window = GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
-  
+
 #if defined(ACTIVATE_GTK3_COLOR_PICKER) && GTK_CHECK_VERSION(3,4,0)
   GtkWidget* color_chooser = gtk_color_chooser_dialog_new(title, parent_window);
-    
+
   if (parent_window) {
       gtk_window_set_destroy_with_parent(GTK_WINDOW(color_chooser), TRUE);
   }
-  
+
   gtk_color_chooser_set_use_alpha(GTK_COLOR_CHOOSER(color_chooser), FALSE);
-  GdkRGBA color_rgba = convertToRgbaColor(color);    
+  GdkRGBA color_rgba = convertToRgbaColor(color);
   gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(color_chooser),
                              &color_rgba);
-  
+
   g_signal_connect(GTK_COLOR_CHOOSER(color_chooser), "color-activated",
                    G_CALLBACK(OnColorChanged), this);
 #else
   GtkWidget *color_chooser = gtk_color_selection_dialog_new(title.get());
-  
+
   if (parent_window) {
     GtkWindow *window = GTK_WINDOW(color_chooser);
     gtk_window_set_transient_for(window, parent_window);
     gtk_window_set_destroy_with_parent(window, TRUE);
   }
 
   GdkColor color_gdk = convertToGdkColor(color);
   gtk_color_selection_set_current_color(WidgetGetColorSelection(color_chooser),
                                         &color_gdk);
-  
+
   g_signal_connect(WidgetGetColorSelection(color_chooser), "color-changed",
                    G_CALLBACK(OnColorChanged), this);
 #endif
 
   NS_ADDREF_THIS();
-  
+
   g_signal_connect(color_chooser, "response", G_CALLBACK(OnResponse), this);
   g_signal_connect(color_chooser, "destroy", G_CALLBACK(OnDestroy), this);
   gtk_widget_show(color_chooser);
 
   return NS_OK;
 }
 
 #if defined(ACTIVATE_GTK3_COLOR_PICKER) && GTK_CHECK_VERSION(3,4,0)
--- a/widget/gtk/nsColorPicker.h
+++ b/widget/gtk/nsColorPicker.h
@@ -26,42 +26,42 @@ public:
   NS_DECL_NSICOLORPICKER
 
   nsColorPicker() {};
 
 private:
   ~nsColorPicker() {};
 
   static nsString ToHexString(int n);
-  
+
   static void OnResponse(GtkWidget* dialog, gint response_id,
                          gpointer user_data);
   static void OnDestroy(GtkWidget* dialog, gpointer user_data);
-  
+
 #if defined(ACTIVATE_GTK3_COLOR_PICKER) && GTK_CHECK_VERSION(3,4,0)
   static void OnColorChanged(GtkColorChooser* color_chooser, GdkRGBA* color,
                              gpointer user_data);
-                             
+
   static int convertGdkRgbaComponent(gdouble color_component);
   static gdouble convertToGdkRgbaComponent(int color_component);
   static GdkRGBA convertToRgbaColor(nscolor color);
-  
+
   void Update(GdkRGBA* color);
   void SetColor(const GdkRGBA* color);
 #else
   static void OnColorChanged(GtkColorSelection* colorselection,
                              gpointer user_data);
 
   // Conversion functions for color
   static int convertGdkColorComponent(guint16 color_component);
   static guint16 convertToGdkColorComponent(int color_component);
-  static GdkColor convertToGdkColor(nscolor color);  
+  static GdkColor convertToGdkColor(nscolor color);
 
   static GtkColorSelection* WidgetGetColorSelection(GtkWidget* widget);
-  
+
   void Update(GtkColorSelection* colorselection);
   void ReadValueFromColorSelection(GtkColorSelection* colorselection);
 #endif
 
   void Done(GtkWidget* dialog, gint response_id);
 
   nsCOMPtr<nsIWidget> mParentWidget;
   nsCOMPtr<nsIColorPickerShownCallback> mCallback;
--- a/widget/gtk/nsDeviceContextSpecG.cpp
+++ b/widget/gtk/nsDeviceContextSpecG.cpp
@@ -10,17 +10,17 @@
 #include "mozilla/Logging.h"
 
 #include "plstr.h"
 #include "prenv.h" /* for PR_GetEnv */
 
 #include "nsPrintfCString.h"
 #include "nsReadableUtils.h"
 #include "nsStringEnumerator.h"
-#include "nsIServiceManager.h" 
+#include "nsIServiceManager.h"
 #include "nsThreadUtils.h"
 
 #include "nsPSPrinters.h"
 
 #include "nsPrintSettingsGTK.h"
 
 #include "nsIFileStreams.h"
 #include "nsIFile.h"
@@ -365,29 +365,29 @@ nsPrinterEnumeratorGTK::nsPrinterEnumera
 }
 
 NS_IMPL_ISUPPORTS(nsPrinterEnumeratorGTK, nsIPrinterEnumerator)
 
 NS_IMETHODIMP nsPrinterEnumeratorGTK::GetPrinterNameList(nsIStringEnumerator **aPrinterNameList)
 {
   NS_ENSURE_ARG_POINTER(aPrinterNameList);
   *aPrinterNameList = nullptr;
-  
+
   nsresult rv = GlobalPrinters::GetInstance()->InitializeGlobalPrinters();
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   uint32_t numPrinters = GlobalPrinters::GetInstance()->GetNumPrinters();
   nsTArray<nsString> *printers = new nsTArray<nsString>(numPrinters);
   if (!printers) {
     GlobalPrinters::GetInstance()->FreeGlobalPrinters();
     return NS_ERROR_OUT_OF_MEMORY;
   }
-  
+
   uint32_t count = 0;
   while( count < numPrinters )
   {
     printers->AppendElement(*GlobalPrinters::GetInstance()->GetStringAt(count++));
   }
   GlobalPrinters::GetInstance()->FreeGlobalPrinters();
 
   return NS_NewAdoptingStringEnumerator(aPrinterNameList, printers);
@@ -429,17 +429,17 @@ nsPrinterEnumeratorGTK::InitPrintSetting
 
     DO_PR_DEBUG_LOG(("Setting default filename to '%s'\n",
                      NS_ConvertUTF16toUTF8(filename).get()));
     aPrintSettings->SetToFileName(filename);
   }
 
   aPrintSettings->SetIsInitializedFromPrinter(true);
 
-  return NS_OK;    
+  return NS_OK;
 }
 
 //----------------------------------------------------------------------
 nsresult GlobalPrinters::InitializeGlobalPrinters ()
 {
   if (PrintersAreAllocated()) {
     return NS_OK;
   }
@@ -473,36 +473,36 @@ nsresult GlobalPrinters::InitializeGloba
 }
 
 //----------------------------------------------------------------------
 void GlobalPrinters::FreeGlobalPrinters()
 {
   if (mGlobalPrinterList) {
     delete mGlobalPrinterList;
     mGlobalPrinterList = nullptr;
-  }  
+  }
 }
 
-void 
+void
 GlobalPrinters::GetDefaultPrinterName(nsAString& aDefaultPrinterName)
 {
   aDefaultPrinterName.Truncate();
-  
+
   bool allocate = !GlobalPrinters::GetInstance()->PrintersAreAllocated();
-  
+
   if (allocate) {
     nsresult rv = GlobalPrinters::GetInstance()->InitializeGlobalPrinters();
     if (NS_FAILED(rv)) {
       return;
     }
   }
   NS_ASSERTION(GlobalPrinters::GetInstance()->PrintersAreAllocated(), "no GlobalPrinters");
 
   if (GlobalPrinters::GetInstance()->GetNumPrinters() == 0)
     return;
-  
+
   aDefaultPrinterName = *GlobalPrinters::GetInstance()->GetStringAt(0);
 
-  if (allocate) {  
+  if (allocate) {
     GlobalPrinters::GetInstance()->FreeGlobalPrinters();
-  }  
+  }
 }
 
--- a/widget/gtk/nsDragService.cpp
+++ b/widget/gtk/nsDragService.cpp
@@ -262,17 +262,17 @@ OnSourceGrabEventAfter(GtkWidget *widget
     }
 
     // G_PRIORITY_DEFAULT_IDLE is lower priority than GDK's redraw idle source
     // and lower than GTK's idle source that sends drag position messages after
     // motion-notify signals.
     //
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#drag-and-drop-processing-model
     // recommends an interval of 350ms +/- 200ms.
-    sMotionEventTimerID = 
+    sMotionEventTimerID =
         g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, 350,
                            DispatchMotionEventCopy, nullptr, nullptr);
 }
 
 static GtkWindow*
 GetGtkWindow(nsIDOMDocument *aDocument)
 {
     nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDocument);
@@ -298,17 +298,17 @@ GetGtkWindow(nsIDOMDocument *aDocument)
         return nullptr;
 
     GtkWidget *toplevel = nullptr;
     toplevel = gtk_widget_get_toplevel(gtkWidget);
     if (!GTK_IS_WINDOW(toplevel))
         return nullptr;
 
     return GTK_WINDOW(toplevel);
-}   
+}
 
 // nsIDragService
 
 NS_IMETHODIMP
 nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
                                  nsIArray * aArrayTransferables,
                                  nsIScriptableRegion * aRegion,
                                  uint32_t aActionType,
@@ -522,17 +522,17 @@ nsDragService::SetAlphaPixmap(SourceSurf
 }
 
 NS_IMETHODIMP
 nsDragService::StartDragSession()
 {
     MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::StartDragSession"));
     return nsBaseDragService::StartDragSession();
 }
- 
+
 NS_IMETHODIMP
 nsDragService::EndDragSession(bool aDoneDrag, uint32_t aKeyModifiers)
 {
     MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::EndDragSession %d",
                                    aDoneDrag));
 
     if (sGrabWidget) {
         g_signal_handlers_disconnect_by_func(sGrabWidget,
@@ -547,17 +547,17 @@ nsDragService::EndDragSession(bool aDone
         if (sMotionEvent) {
             gdk_event_free(sMotionEvent);
             sMotionEvent = nullptr;
         }
     }
 
     // unset our drag action
     SetDragAction(DRAGDROP_ACTION_NONE);
-    
+
     // We're done with the drag context.
     mTargetDragContextForRemote = nullptr;
 
     return nsBaseDragService::EndDragSession(aDoneDrag, aKeyModifiers);
 }
 
 // nsIDragSession
 NS_IMETHODIMP
@@ -794,17 +794,17 @@ nsDragService::GetData(nsITransferable *
             }
             if (mTargetDragData) {
                 MOZ_LOG(sDragLm, LogLevel::Debug, ("dataFound = true\n"));
                 dataFound = true;
             }
             else {
                 MOZ_LOG(sDragLm, LogLevel::Debug, ("dataFound = false\n"));
 
-                // Dragging and dropping from the file manager would cause us 
+                // Dragging and dropping from the file manager would cause us
                 // to parse the source text as a nsIFile URL.
                 if (flavorStr.EqualsLiteral(kFileMime)) {
                     gdkFlavor = gdk_atom_intern(kTextMime, FALSE);
                     GetTargetDragData(gdkFlavor);
                     if (!mTargetDragData) {
                         gdkFlavor = gdk_atom_intern(gTextUriListType, FALSE);
                         GetTargetDragData(gdkFlavor);
                     }
@@ -822,17 +822,17 @@ nsDragService::GetData(nsITransferable *
                             rv = ioService->NewURI(NS_ConvertUTF16toUTF8(convertedText),
                                                    nullptr, nullptr, getter_AddRefs(fileURI));
                             if (NS_SUCCEEDED(rv)) {
                                 nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(fileURI, &rv);
                                 if (NS_SUCCEEDED(rv)) {
                                     nsCOMPtr<nsIFile> file;
                                     rv = fileURL->GetFile(getter_AddRefs(file));
                                     if (NS_SUCCEEDED(rv)) {
-                                        // The common wrapping code at the end of 
+                                        // The common wrapping code at the end of
                                         // this function assumes the data is text
                                         // and calls text-specific operations.
                                         // Make a secret hideout here for nsIFile
                                         // objects and return early.
                                         aTransferable->SetTransferData(flavorStr.get(), file,
                                                                        convertedTextLen);
                                         g_free(convertedText);
                                         return NS_OK;
@@ -974,34 +974,34 @@ nsDragService::GetData(nsITransferable *
                 if (!flavorStr.EqualsLiteral(kCustomTypesMime)) {
                   // the DOM only wants LF, so convert from MacOS line endings
                   // to DOM line endings.
                   nsLinebreakHelpers::ConvertPlatformToDOMLinebreaks(
                                flavorStr,
                                &mTargetDragData,
                                reinterpret_cast<int*>(&mTargetDragDataLen));
                 }
-        
+
                 // put it into the transferable.
                 nsCOMPtr<nsISupports> genericDataWrapper;
                 nsPrimitiveHelpers::CreatePrimitiveForData(flavorStr,
                                     mTargetDragData, mTargetDragDataLen,
                                     getter_AddRefs(genericDataWrapper));
                 aTransferable->SetTransferData(flavorStr.get(),
                                                genericDataWrapper,
                                                mTargetDragDataLen);
                 // we found one, get out of this loop!
                 MOZ_LOG(sDragLm, LogLevel::Debug, ("dataFound and converted!\n"));
                 break;
             }
         } // if (currentFlavor)
     } // foreach flavor
 
     return NS_OK;
-  
+
 }
 
 NS_IMETHODIMP
 nsDragService::IsDataFlavorSupported(const char *aDataFlavor,
                                      bool *_retval)
 {
     MOZ_LOG(sDragLm, LogLevel::Debug, ("nsDragService::IsDataFlavorSupported %s",
                                    aDataFlavor));
@@ -1062,51 +1062,51 @@ nsDragService::IsDataFlavorSupported(con
                 }
             }
         }
         return NS_OK;
     }
 
     // check the target context vs. this flavor, one at a time
     GList *tmp;
-    for (tmp = gdk_drag_context_list_targets(mTargetDragContext); 
+    for (tmp = gdk_drag_context_list_targets(mTargetDragContext);
          tmp; tmp = tmp->next) {
         /* Bug 331198 */
         GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
         gchar *name = nullptr;
         name = gdk_atom_name(atom);
         MOZ_LOG(sDragLm, LogLevel::Debug,
                ("checking %s against %s\n", name, aDataFlavor));
         if (name && (strcmp(name, aDataFlavor) == 0)) {
             MOZ_LOG(sDragLm, LogLevel::Debug, ("good!\n"));
             *_retval = true;
         }
         // check for automatic text/uri-list -> text/x-moz-url mapping
-        if (!*_retval && 
+        if (!*_retval &&
             name &&
             (strcmp(name, gTextUriListType) == 0) &&
             (strcmp(aDataFlavor, kURLMime) == 0 ||
              strcmp(aDataFlavor, kFileMime) == 0)) {
             MOZ_LOG(sDragLm, LogLevel::Debug,
                    ("good! ( it's text/uri-list and \
                    we're checking against text/x-moz-url )\n"));
             *_retval = true;
         }
         // check for automatic _NETSCAPE_URL -> text/x-moz-url mapping
-        if (!*_retval && 
+        if (!*_retval &&
             name &&
             (strcmp(name, gMozUrlType) == 0) &&
             (strcmp(aDataFlavor, kURLMime) == 0)) {
             MOZ_LOG(sDragLm, LogLevel::Debug,
                    ("good! ( it's _NETSCAPE_URL and \
                    we're checking against text/x-moz-url )\n"));
             *_retval = true;
         }
         // check for auto text/plain -> text/unicode mapping
-        if (!*_retval && 
+        if (!*_retval &&
             name &&
             (strcmp(name, kTextMime) == 0) &&
             ((strcmp(aDataFlavor, kUnicodeMime) == 0) ||
              (strcmp(aDataFlavor, kFileMime) == 0))) {
             MOZ_LOG(sDragLm, LogLevel::Debug,
                    ("good! ( it's text plain and we're checking \
                    against text/unicode or application/x-moz-file)\n"));
             *_retval = true;
@@ -1181,17 +1181,17 @@ nsDragService::IsTargetContextList(void)
     // drop will work or not.
     if (gtk_drag_get_source_widget(mTargetDragContext) == nullptr)
         return retval;
 
     GList *tmp;
 
     // walk the list of context targets and see if one of them is a list
     // of items.
-    for (tmp = gdk_drag_context_list_targets(mTargetDragContext); 
+    for (tmp = gdk_drag_context_list_targets(mTargetDragContext);
          tmp; tmp = tmp->next) {
         /* Bug 331198 */
         GdkAtom atom = GDK_POINTER_TO_ATOM(tmp->data);
         gchar *name = nullptr;
         name = gdk_atom_name(atom);
         if (name && strcmp(name, gMimeListType) == 0)
             retval = true;
         g_free(name);
@@ -1209,17 +1209,17 @@ nsDragService::GetTargetDragData(GdkAtom
 {
     MOZ_LOG(sDragLm, LogLevel::Debug, ("getting data flavor %p\n", aFlavor));
     MOZ_LOG(sDragLm, LogLevel::Debug, ("mLastWidget is %p and mLastContext is %p\n",
                                    mTargetWidget.get(),
                                    mTargetDragContext.get()));
     // reset our target data areas
     TargetResetData();
     gtk_drag_get_data(mTargetWidget, mTargetDragContext, aFlavor, mTargetTime);
-    
+
     MOZ_LOG(sDragLm, LogLevel::Debug, ("about to start inner iteration."));
     PRTime entryTime = PR_Now();
     while (!mTargetDragDataReceived && mDoingDrag) {
         // check the number of iterations
         MOZ_LOG(sDragLm, LogLevel::Debug, ("doing iteration...\n"));
         PR_Sleep(20*PR_TicksPerSecond()/1000);  /* sleep for 20 ms/iteration */
         if (PR_Now()-entryTime > NS_DND_TIMEOUT) break;
         gtk_main_iteration();
@@ -1438,17 +1438,17 @@ nsDragService::SourceEndDragSession(GdkD
 
     if (aResult == MOZ_GTK_DRAG_RESULT_SUCCESS) {
 
         // With GTK+ versions 2.10.x and prior the drag may have been
         // cancelled (but no drag-failed signal would have been sent).
         // aContext->dest_window will be non-nullptr only if the drop was
         // sent.
         GdkDragAction action =
-            gdk_drag_context_get_dest_window(aContext) ? 
+            gdk_drag_context_get_dest_window(aContext) ?
                 gdk_drag_context_get_actions(aContext) : (GdkDragAction)0;
 
         // Only one bit of action should be set, but, just in case someone
         // does something funny, erring away from MOVE, and not recording
         // unusual action combinations as NONE.
         if (!action)
             dropEffect = DRAGDROP_ACTION_NONE;
         else if (action & GDK_ACTION_COPY)
@@ -1781,17 +1781,17 @@ invisibleSourceDragEnd(GtkWidget        
 }
 
 // The following methods handle responding to GTK drag signals and
 // tracking state between these signals.
 //
 // In general, GTK does not expect us to run the event loop while handling its
 // drag signals, however our drag event handlers may run the
 // event loop, most often to fetch information about the drag data.
-// 
+//
 // GTK, for example, uses the return value from drag-motion signals to
 // determine whether drag-leave signals should be sent.  If an event loop is
 // run during drag-motion the XdndLeave message can get processed but when GTK
 // receives the message it does not yet know that it needs to send the
 // drag-leave signal to our widget.
 //
 // After a drag-drop signal, we need to reply with gtk_drag_finish().
 // However, gtk_drag_finish should happen after the drag-drop signal handler
@@ -1844,28 +1844,28 @@ nsDragService::ScheduleMotionEvent(nsWin
 void
 nsDragService::ScheduleLeaveEvent()
 {
     // We don't know at this stage whether a drop signal will immediately
     // follow.  If the drop signal gets sent it will happen before we return
     // to the main loop and the scheduled leave task will be replaced.
     if (!Schedule(eDragTaskLeave, nullptr, nullptr, LayoutDeviceIntPoint(), 0)) {
         NS_WARNING("Drag leave after drop");
-    }        
+    }
 }
 
 gboolean
 nsDragService::ScheduleDropEvent(nsWindow *aWindow,
                                  GdkDragContext *aDragContext,
                                  LayoutDeviceIntPoint aWindowPoint, guint aTime)
 {
     if (!Schedule(eDragTaskDrop, aWindow,
                   aDragContext, aWindowPoint, aTime)) {
         NS_WARNING("Additional drag drop ignored");
-        return FALSE;        
+        return FALSE;
     }
 
     SetDragEndPoint(aWindowPoint + aWindow->WidgetToScreenOffset());
 
     // We'll reply with gtk_drag_finish().
     return TRUE;
 }
 
@@ -1958,17 +1958,17 @@ nsDragService::RunScheduledTask()
     }
 
     // This may be the start of a destination drag session.
     StartDragSession();
 
     // mTargetWidget may be nullptr if the window has been destroyed.
     // (The leave event is not scheduled if a drop task is still scheduled.)
     // We still reply appropriately to indicate that the drop will or didn't
-    // succeeed. 
+    // succeeed.
     mTargetWidget = mTargetWindow->GetMozContainerWidget();
     mTargetDragContext.steal(mPendingDragContext);
     mTargetTime = mPendingTime;
 
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#drag-and-drop-processing-model
     // (as at 27 December 2010) indicates that a "drop" event should only be
     // fired (at the current target element) if the current drag operation is
     // not none.  The current drag operation will only be set to a non-none
--- a/widget/gtk/nsGTKToolkit.h
+++ b/widget/gtk/nsGTKToolkit.h
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim:expandtab:shiftwidth=4:tabstop=4:
  */
 /* 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 GTKTOOLKIT_H      
+#ifndef GTKTOOLKIT_H
 #define GTKTOOLKIT_H
 
 #include "nsString.h"
 #include <gtk/gtk.h>
 
 /**
  * Wrapper around the thread running the message pump.
  * The toolkit abstraction is necessary because the message pump must
  * execute within the same thread that created the widget under Win32.
- */ 
+ */
 
 class nsGTKToolkit
 {
 public:
     nsGTKToolkit();
 
     static nsGTKToolkit* GetToolkit();
 
@@ -28,17 +28,17 @@ public:
       delete gToolkit;
       gToolkit = nullptr;
     }
 
     /**
      * Get/set our value of DESKTOP_STARTUP_ID. When non-empty, this is applied
      * to the next toplevel window to be shown or focused (and then immediately
      * cleared).
-     */ 
+     */
     void SetDesktopStartupID(const nsACString& aID) { mDesktopStartupID = aID; }
     void GetDesktopStartupID(nsACString* aID) { *aID = mDesktopStartupID; }
 
     /**
      * Get/set the timestamp value to be used, if non-zero, to focus the
      * next top-level window to be shown or focused (upon which it is cleared).
      */
     void SetFocusTimestamp(uint32_t aTimestamp) { mFocusTimestamp = aTimestamp; }
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -1415,17 +1415,17 @@ KeymapWrapper::WillDispatchKeyboardEvent
                        aGdkKeyEvent->group);
     isLatin = isLatin && (altCharCodes.mShiftedCharCode <= 0xFF);
     if (altCharCodes.mUnshiftedCharCode || altCharCodes.mShiftedCharCode) {
         aKeyEvent.mAlternativeCharCodes.AppendElement(altCharCodes);
     }
 
     bool needLatinKeyCodes = !isLatin;
     if (!needLatinKeyCodes) {
-        needLatinKeyCodes = 
+        needLatinKeyCodes =
             (IS_ASCII_ALPHABETICAL(altCharCodes.mUnshiftedCharCode) !=
              IS_ASCII_ALPHABETICAL(altCharCodes.mShiftedCharCode));
     }
 
     // If current keyboard layout can input Latin characters, we don't need
     // more information.
     if (!needLatinKeyCodes) {
         MOZ_LOG(gKeymapWrapperLog, LogLevel::Info,
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -255,17 +255,17 @@ nsLookAndFeel::NativeGetColor(ColorID aI
     case eColorID_window:
     case eColorID_windowframe:
     case eColorID__moz_dialog:
     case eColorID__moz_combobox:
         aColor = mMozWindowBackground;
         break;
     case eColorID_WindowForeground:
     case eColorID_WidgetForeground:
-    case eColorID_TextForeground: 
+    case eColorID_TextForeground:
     case eColorID_captiontext: // text in active window caption, size box, and scrollbar arrow box (!)
     case eColorID_windowtext:
     case eColorID__moz_dialogtext:
         aColor = mMozWindowText;
         break;
     case eColorID_WidgetSelectBackground:
     case eColorID_TextSelectBackground:
     case eColorID_IMESelectedRawTextBackground:
@@ -438,34 +438,34 @@ static int32_t CheckWidgetStyle(GtkWidge
     gtk_widget_style_get(aWidget, aStyle, &value, nullptr);
     return value ? aResult : 0;
 }
 
 static int32_t ConvertGTKStepperStyleToMozillaScrollArrowStyle(GtkWidget* aWidget)
 {
     if (!aWidget)
         return mozilla::LookAndFeel::eScrollArrowStyle_Single;
-  
+
     return
         CheckWidgetStyle(aWidget, "has-backward-stepper",
                          mozilla::LookAndFeel::eScrollArrow_StartBackward) |
         CheckWidgetStyle(aWidget, "has-forward-stepper",
                          mozilla::LookAndFeel::eScrollArrow_EndForward) |
         CheckWidgetStyle(aWidget, "has-secondary-backward-stepper",
                          mozilla::LookAndFeel::eScrollArrow_EndBackward) |
         CheckWidgetStyle(aWidget, "has-secondary-forward-stepper",
                          mozilla::LookAndFeel::eScrollArrow_StartForward);
 }
 
 nsresult
 nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
 {
     nsresult res = NS_OK;
 
-    // Set these before they can get overrided in the nsXPLookAndFeel. 
+    // Set these before they can get overrided in the nsXPLookAndFeel.
     switch (aID) {
     case eIntID_ScrollButtonLeftMouseButtonAction:
         aResult = 0;
         return NS_OK;
     case eIntID_ScrollButtonMiddleMouseButtonAction:
         aResult = 1;
         return NS_OK;
     case eIntID_ScrollButtonRightMouseButtonAction:
@@ -492,17 +492,17 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
             gint blink_time;
             gboolean blink;
 
             settings = gtk_settings_get_default ();
             g_object_get (settings,
                           "gtk-cursor-blink-time", &blink_time,
                           "gtk-cursor-blink", &blink,
                           nullptr);
- 
+
             if (blink)
                 aResult = (int32_t) blink_time;
             else
                 aResult = 0;
             break;
         }
     case eIntID_CaretWidth:
         aResult = 1;
@@ -514,21 +514,21 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
         {
             GtkWidget *entry;
             GtkSettings *settings;
             gboolean select_on_focus;
 
             entry = gtk_entry_new();
             g_object_ref_sink(entry);
             settings = gtk_widget_get_settings(entry);
-            g_object_get(settings, 
+            g_object_get(settings,
                          "gtk-entry-select-on-focus",
                          &select_on_focus,
                          nullptr);
-            
+
             if(select_on_focus)
                 aResult = 1;
             else
                 aResult = 0;
 
             gtk_widget_destroy(entry);
             g_object_unref(entry);
         }
@@ -579,17 +579,17 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
     case eIntID_DragThresholdY:
         {
             GtkWidget* box = gtk_hbox_new(FALSE, 5);
             gint threshold = 0;
             g_object_get(gtk_widget_get_settings(box),
                          "gtk-dnd-drag-threshold", &threshold,
                          nullptr);
             g_object_ref_sink(box);
-            
+
             aResult = threshold;
         }
         break;
     case eIntID_ScrollArrowStyle: {
         GtkWidget* scrollbar = GetWidget(MOZ_GTK_SCROLLBAR_HORIZONTAL);
         aResult = ConvertGTKStepperStyleToMozillaScrollArrowStyle(scrollbar);
         break;
     }
@@ -927,17 +927,17 @@ nsLookAndFeel::EnsureInit()
 
     gtk_container_add(GTK_CONTAINER(parent), treeView);
     gtk_container_add(GTK_CONTAINER(parent), linkButton);
     gtk_container_add(GTK_CONTAINER(parent), menuBar);
     gtk_menu_shell_append(GTK_MENU_SHELL(menuBar), menuBarItem);
     gtk_container_add(GTK_CONTAINER(window), parent);
     gtk_container_add(GTK_CONTAINER(parent), entry);
     gtk_container_add(GTK_CONTAINER(parent), textView);
-    
+
     // Text colors
     GdkRGBA bgColor;
     // If the text window background is translucent, then the background of
     // the textview root node is visible.
     style = GetStyleContext(MOZ_GTK_TEXT_VIEW);
     gtk_style_context_get_background_color(style, GTK_STATE_FLAG_NORMAL,
                                            &bgColor);
 
@@ -978,17 +978,17 @@ nsLookAndFeel::EnsureInit()
         g_object_unref(labelStyle);
     }
 
     // Combobox text color
     style = GetStyleContext(MOZ_GTK_COMBOBOX_ENTRY_TEXTAREA);
     gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
     mComboBoxText = GDK_RGBA_TO_NS_RGBA(color);
 
-    // Menubar text and hover text colors    
+    // Menubar text and hover text colors
     style = GetStyleContext(MOZ_GTK_MENUBARITEM);
     gtk_style_context_get_color(style, GTK_STATE_FLAG_NORMAL, &color);
     mMenuBarText = GDK_RGBA_TO_NS_RGBA(color);
     gtk_style_context_get_color(style, GTK_STATE_FLAG_PRELIGHT, &color);
     mMenuBarHoverText = GDK_RGBA_TO_NS_RGBA(color);
 
     // GTK's guide to fancy odd row background colors:
     // 1) Check if a theme explicitly defines an odd row color
--- a/widget/gtk/nsNativeThemeGTK.cpp
+++ b/widget/gtk/nsNativeThemeGTK.cpp
@@ -94,17 +94,17 @@ nsNativeThemeGTK::RefreshWidgetWindow(ns
 {
   nsIPresShell *shell = GetPresShell(aFrame);
   if (!shell)
     return;
 
   nsViewManager* vm = shell->GetViewManager();
   if (!vm)
     return;
- 
+
   vm->InvalidateAllViews();
 }
 
 
 static bool IsFrameContentNodeInNamespace(nsIFrame *aFrame, uint32_t aNamespace)
 {
   nsIContent *content = aFrame ? aFrame->GetContent() : nullptr;
   if (!content)
@@ -664,17 +664,17 @@ nsNativeThemeGTK::GetGtkWidgetAndState(u
         if (IsFirstTab(aFrame))
           *aWidgetFlags |= MOZ_GTK_TAB_FIRST;
       }
     }
     break;
   case NS_THEME_SPLITTER:
     if (IsHorizontal(aFrame))
       aGtkWidgetType = MOZ_GTK_SPLITTER_VERTICAL;
-    else 
+    else
       aGtkWidgetType = MOZ_GTK_SPLITTER_HORIZONTAL;
     break;
   case NS_THEME_MENUBAR:
     aGtkWidgetType = MOZ_GTK_MENUBAR;
     break;
   case NS_THEME_MENUPOPUP:
     aGtkWidgetType = MOZ_GTK_MENUPOPUP;
     break;
@@ -1591,17 +1591,17 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n
     }
     break;
   case NS_THEME_MENUSEPARATOR:
     {
       gint separator_height;
 
       moz_gtk_get_menu_separator_height(&separator_height);
       aResult->height = separator_height;
-    
+
       *aIsOverridable = false;
     }
     break;
   case NS_THEME_CHECKBOX:
   case NS_THEME_RADIO:
     {
       const ToggleGTKMetrics* metrics = GetToggleMetrics(aWidgetType == NS_THEME_RADIO);
       aResult->width = metrics->minSizeWithBorder.width;
@@ -1654,19 +1654,19 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n
     {
       moz_gtk_get_entry_min_height(&aResult->height);
     }
     break;
 #endif
   case NS_THEME_SEPARATOR:
     {
       gint separator_width;
-    
+
       moz_gtk_get_toolbar_separator_width(&separator_width);
-    
+
       aResult->width = separator_width;
     }
     break;
   case NS_THEME_INNER_SPIN_BUTTON:
   case NS_THEME_SPINNER:
     // hard code these sizes
     aResult->width = 14;
     aResult->height = 26;
@@ -1696,17 +1696,17 @@ nsNativeThemeGTK::GetMinimumWidgetSize(n
   }
 
   *aResult = *aResult * ScreenHelperGTK::GetGTKMonitorScaleFactor();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType, 
+nsNativeThemeGTK::WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
                                      nsAtom* aAttribute, bool* aShouldRepaint,
                                      const nsAttrValue* aOldValue)
 {
   // Some widget types just never change state.
   if (aWidgetType == NS_THEME_TOOLBOX ||
       aWidgetType == NS_THEME_TOOLBAR ||
       aWidgetType == NS_THEME_STATUSBAR ||
       aWidgetType == NS_THEME_STATUSBARPANEL ||
@@ -1763,17 +1763,17 @@ nsNativeThemeGTK::WidgetStateChanged(nsI
   // XXXdwh Not sure what can really be done here.  Can at least guess for
   // specific widgets that they're highly unlikely to have certain states.
   // For example, a toolbar doesn't care about any states.
   if (!aAttribute) {
     // Hover/focus/active changed.  Always repaint.
     *aShouldRepaint = true;
   }
   else {
-    // Check the attribute to see if it's relevant.  
+    // Check the attribute to see if it's relevant.
     // disabled, checked, dlgtype, default, etc.
     *aShouldRepaint = false;
     if (aAttribute == nsGkAtoms::disabled ||
         aAttribute == nsGkAtoms::checked ||
         aAttribute == nsGkAtoms::selected ||
         aAttribute == nsGkAtoms::visuallyselected ||
         aAttribute == nsGkAtoms::focused ||
         aAttribute == nsGkAtoms::readonly ||
@@ -1945,20 +1945,20 @@ nsNativeThemeGTK::WidgetIsContainer(uint
     return false;
   return true;
 }
 
 bool
 nsNativeThemeGTK::ThemeDrawsFocusForWidget(uint8_t aWidgetType)
 {
    if (aWidgetType == NS_THEME_MENULIST ||
-      aWidgetType == NS_THEME_BUTTON || 
+      aWidgetType == NS_THEME_BUTTON ||
       aWidgetType == NS_THEME_TREEHEADERCELL)
     return true;
-  
+
   return false;
 }
 
 bool
 nsNativeThemeGTK::ThemeNeedsComboboxDropmarker()
 {
   return false;
 }
--- a/widget/gtk/nsNativeThemeGTK.h
+++ b/widget/gtk/nsNativeThemeGTK.h
@@ -44,29 +44,29 @@ public:
                                  uint8_t aWidgetType,
                                  nsRect* aOverflowRect) override;
 
   NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext,
                                   nsIFrame* aFrame, uint8_t aWidgetType,
                                   mozilla::LayoutDeviceIntSize* aResult,
                                   bool* aIsOverridable) override;
 
-  NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType, 
+  NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
                                 nsAtom* aAttribute,
                                 bool* aShouldRepaint,
                                 const nsAttrValue* aOldValue) override;
 
   NS_IMETHOD ThemeChanged() override;
 
   NS_IMETHOD_(bool) ThemeSupportsWidget(nsPresContext* aPresContext,
                                         nsIFrame* aFrame,
                                         uint8_t aWidgetType) override;
 
   NS_IMETHOD_(bool) WidgetIsContainer(uint8_t aWidgetType) override;
-  
+
   NS_IMETHOD_(bool) ThemeDrawsFocusForWidget(uint8_t aWidgetType) override;
 
   virtual bool ThemeNeedsComboboxDropmarker() override;
 
   virtual Transparency GetWidgetTransparency(nsIFrame* aFrame,
                                              uint8_t aWidgetType) override;
 
   nsNativeThemeGTK();
--- a/widget/gtk/nsPrintDialogGTK.cpp
+++ b/widget/gtk/nsPrintDialogGTK.cpp
@@ -89,17 +89,17 @@ ShowCustomDialog(GtkComboBox *changed_bo
   gtk_box_pack_start(GTK_BOX(custom_vbox), custom_label, FALSE, FALSE, 0);
   gtk_box_pack_start(GTK_BOX(custom_vbox), custom_entry, FALSE, FALSE, 5); // Make entry 5px underneath label
   GtkWidget* custom_hbox = gtk_hbox_new(FALSE, 2);
   gtk_box_pack_start(GTK_BOX(custom_hbox), question_icon, FALSE, FALSE, 0);
   gtk_box_pack_start(GTK_BOX(custom_hbox), custom_vbox, FALSE, FALSE, 10); // Make question icon 10px away from content
   gtk_container_set_border_width(GTK_CONTAINER(custom_hbox), 2);
   gtk_widget_show_all(custom_hbox);
 
-  gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(prompt_dialog))), 
+  gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(prompt_dialog))),
                      custom_hbox, FALSE, FALSE, 0);
   gint diag_response = gtk_dialog_run(GTK_DIALOG(prompt_dialog));
 
   if (diag_response == GTK_RESPONSE_ACCEPT) {
     const gchar* response_text = gtk_entry_get_text(GTK_ENTRY(custom_entry));
     g_object_set_data_full(G_OBJECT(changed_box), "custom-text", strdup(response_text), (GDestroyNotify) free);
     g_object_set_data(G_OBJECT(changed_box), "previous-active", GINT_TO_POINTER(CUSTOM_VALUE_INDEX));
   } else {
@@ -137,17 +137,17 @@ class nsPrintDialogWidgetGTK {
     nsCOMPtr<nsIStringBundle> printBundle;
 
     bool useNativeSelection;
 
     GtkWidget* ConstructHeaderFooterDropdown(const char16_t *currentString);
     const char* OptionWidgetToString(GtkWidget *dropdown);
 
     /* Code to copy between GTK and NS print settings structures.
-     * In the following, 
+     * In the following,
      *   "Import" means to copy from NS to GTK
      *   "Export" means to copy from GTK to NS
      */
     void ExportFramePrinting(nsIPrintSettings *aNS, GtkPrintSettings *aSettings);
     void ExportHeaderFooter(nsIPrintSettings *aNS);
 };
 
 nsPrintDialogWidgetGTK::nsPrintDialogWidgetGTK(nsPIDOMWindowOuter *aParent,
@@ -408,17 +408,17 @@ nsPrintDialogWidgetGTK::ImportSettings(n
   aNSSettings->GetPrintBGColors(&geckoBool);
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(print_bg_colors_toggle), geckoBool);
 
   aNSSettings->GetPrintBGImages(&geckoBool);
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(print_bg_images_toggle), geckoBool);
 
   gtk_print_unix_dialog_set_settings(GTK_PRINT_UNIX_DIALOG(dialog), settings);
   gtk_print_unix_dialog_set_page_setup(GTK_PRINT_UNIX_DIALOG(dialog), setup);
-  
+
   return NS_OK;
 }
 
 nsresult
 nsPrintDialogWidgetGTK::ExportSettings(nsIPrintSettings *aNSSettings)
 {
   NS_PRECONDITION(aNSSettings, "aSettings must not be null");
   NS_ENSURE_TRUE(aNSSettings, NS_ERROR_FAILURE);
--- a/widget/gtk/nsPrintOptionsGTK.h
+++ b/widget/gtk/nsPrintOptionsGTK.h
@@ -2,17 +2,17 @@
  *
  * 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 nsPrintOptionsGTK_h__
 #define nsPrintOptionsGTK_h__
 
-#include "nsPrintOptionsImpl.h"  
+#include "nsPrintOptionsImpl.h"
 
 namespace mozilla
 {
 namespace embedding
 {
   class PrintData;
 } // namespace embedding
 } // namespace mozilla
--- a/widget/gtk/nsPrintSettingsGTK.cpp
+++ b/widget/gtk/nsPrintSettingsGTK.cpp
@@ -31,18 +31,18 @@ GtkPaperSize* moz_gtk_paper_size_copy_to
   // We make a "custom-ified" copy of the paper size so it can be changed later.
   return gtk_paper_size_new_custom(gtk_paper_size_get_name(oldPaperSize),
                                    gtk_paper_size_get_display_name(oldPaperSize),
                                    gtk_paper_size_get_width(oldPaperSize, GTK_UNIT_INCH),
                                    gtk_paper_size_get_height(oldPaperSize, GTK_UNIT_INCH),
                                    GTK_UNIT_INCH);
 }
 
-NS_IMPL_ISUPPORTS_INHERITED(nsPrintSettingsGTK, 
-                            nsPrintSettings, 
+NS_IMPL_ISUPPORTS_INHERITED(nsPrintSettingsGTK,
+                            nsPrintSettings,
                             nsPrintSettingsGTK)
 
 /** ---------------------------------------------------
  */
 nsPrintSettingsGTK::nsPrintSettingsGTK() :
   mPageSetup(nullptr),
   mPrintSettings(nullptr),
   mGTKPrinter(nullptr),
@@ -89,17 +89,17 @@ nsPrintSettingsGTK::nsPrintSettingsGTK(c
 
 /** ---------------------------------------------------
  */
 nsPrintSettingsGTK& nsPrintSettingsGTK::operator=(const nsPrintSettingsGTK& rhs)
 {
   if (this == &rhs) {
     return *this;
   }
-  
+
   nsPrintSettings::operator=(rhs);
 
   if (mPageSetup)
     g_object_unref(mPageSetup);
   mPageSetup = gtk_page_setup_copy(rhs.mPageSetup);
   // NOTE: No need to re-initialize mUnwriteableMargin here (even
   // though mPageSetup is changing). It'll be copied correctly by
   // nsPrintSettings::operator=.
@@ -118,17 +118,17 @@ nsPrintSettingsGTK& nsPrintSettingsGTK::
 }
 
 /** -------------------------------------------
  */
 nsresult nsPrintSettingsGTK::_Clone(nsIPrintSettings **_retval)
 {
   NS_ENSURE_ARG_POINTER(_retval);
   *_retval = nullptr;
-  
+
   nsPrintSettingsGTK *newSettings = new nsPrintSettingsGTK(*this);
   if (!newSettings)
     return NS_ERROR_FAILURE;
   *_retval = newSettings;
   NS_ADDREF(*_retval);
   return NS_OK;
 }
 
@@ -147,17 +147,17 @@ nsPrintSettingsGTK::_Assign(nsIPrintSett
 
 /** ---------------------------------------------------
  */
 void
 nsPrintSettingsGTK::SetGtkPageSetup(GtkPageSetup *aPageSetup)
 {
   if (mPageSetup)
     g_object_unref(mPageSetup);
-  
+
   mPageSetup = (GtkPageSetup*) g_object_ref(aPageSetup);
   InitUnwriteableMargin();
 
   // If the paper size is not custom, then we make a custom copy of the
   // GtkPaperSize, so it can be mutable. If a GtkPaperSize wasn't made as
   // custom, its properties are immutable.
   GtkPaperSize* paperSize = gtk_page_setup_get_paper_size(aPageSetup);
   if (!gtk_paper_size_is_custom(paperSize)) {
@@ -171,17 +171,17 @@ nsPrintSettingsGTK::SetGtkPageSetup(GtkP
 
 /** ---------------------------------------------------
  */
 void
 nsPrintSettingsGTK::SetGtkPrintSettings(GtkPrintSettings *aPrintSettings)
 {
   if (mPrintSettings)
     g_object_unref(mPrintSettings);
-  
+
   mPrintSettings = (GtkPrintSettings*) g_object_ref(aPrintSettings);
 
   GtkPaperSize* paperSize = gtk_print_settings_get_paper_size(aPrintSettings);
   if (paperSize) {
     GtkPaperSize* customPaperSize =
       moz_gtk_paper_size_copy_to_new_custom(paperSize);
     gtk_paper_size_free(paperSize);
     gtk_page_setup_set_paper_size(mPageSetup, customPaperSize);
@@ -575,23 +575,23 @@ nsPrintSettingsGTK::InitUnwriteableMargi
 }
 
 /**
  * NOTE: Need a custom set of SetUnwriteableMargin functions, because
  * whenever we change mUnwriteableMargin, we must pass the change
  * down to our GTKPageSetup object.  (This is needed in order for us
  * to give the correct default values in nsPrintDialogGTK.)
  *
- * It's important that the following functions pass 
+ * It's important that the following functions pass
  * mUnwriteableMargin values rather than aUnwriteableMargin values
  * to gtk_page_setup_set_[blank]_margin, because the two may not be
  * the same.  (Specifically, negative values of aUnwriteableMargin
  * are ignored by the nsPrintSettings::SetUnwriteableMargin functions.)
  */
-NS_IMETHODIMP 
+NS_IMETHODIMP
 nsPrintSettingsGTK::SetUnwriteableMarginInTwips(nsIntMargin& aUnwriteableMargin)
 {
   nsPrintSettings::SetUnwriteableMarginInTwips(aUnwriteableMargin);
   gtk_page_setup_set_top_margin(mPageSetup,
            NS_TWIPS_TO_INCHES(mUnwriteableMargin.top), GTK_UNIT_INCH);
   gtk_page_setup_set_left_margin(mPageSetup,
            NS_TWIPS_TO_INCHES(mUnwriteableMargin.left), GTK_UNIT_INCH);
   gtk_page_setup_set_bottom_margin(mPageSetup,
--- a/widget/gtk/nsPrintSettingsGTK.h
+++ b/widget/gtk/nsPrintSettingsGTK.h
@@ -11,17 +11,17 @@
 
 extern "C" {
 #include <gtk/gtk.h>
 #include <gtk/gtkunixprint.h>
 }
 
 #define NS_PRINTSETTINGSGTK_IID \
 { 0x758df520, 0xc7c3, 0x11dc, { 0x95, 0xff, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
- 
+
 
 //*****************************************************************************
 //***    nsPrintSettingsGTK
 //*****************************************************************************
 
 class nsPrintSettingsGTK : public nsPrintSettings
 {
 public:
--- a/widget/gtk/nsSound.h
+++ b/widget/gtk/nsSound.h
@@ -8,21 +8,21 @@
 #ifndef __nsSound_h__
 #define __nsSound_h__
 
 #include "nsISound.h"
 #include "nsIStreamLoader.h"
 
 #include <gtk/gtk.h>
 
-class nsSound : public nsISound, 
+class nsSound : public nsISound,
                 public nsIStreamLoaderObserver
-{ 
-public: 
-    nsSound(); 
+{
+public:
+    nsSound();
 
     static void Shutdown();
     static already_AddRefed<nsISound> GetInstance();
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISOUND
     NS_DECL_NSISTREAMLOADEROBSERVER
 
--- a/widget/gtk/nsToolkit.cpp
+++ b/widget/gtk/nsToolkit.cpp
@@ -11,24 +11,24 @@
 nsGTKToolkit* nsGTKToolkit::gToolkit = nullptr;
 
 //-------------------------------------------------------------------------
 //
 // constructor
 //
 //-------------------------------------------------------------------------
 nsGTKToolkit::nsGTKToolkit()
-  : mFocusTimestamp(0)  
+  : mFocusTimestamp(0)
 {
 }
 
 //-------------------------------------------------------------------------------
 // Return the toolkit. If a toolkit does not yet exist, then one will be created.
 //-------------------------------------------------------------------------------
 // static
 nsGTKToolkit* nsGTKToolkit::GetToolkit()
 {
     if (!gToolkit) {
         gToolkit = new nsGTKToolkit();
     }
- 
+
     return gToolkit;
 }