Bug 1048246 - Fix more bad implicit constructors in layout; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 07 Aug 2014 19:48:38 -0400
changeset 198482 e4310d8289b99c2e781b01941c62100ac7e402e4
parent 198481 26218f791bbf849c0e8c2ae067d7352478d3e764
child 198483 adef7957b5ebd88c5752983c5df36a7b568b1173
push id8115
push userryanvm@gmail.com
push dateFri, 08 Aug 2014 20:35:49 +0000
treeherderfx-team@111597c92922 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1048246
milestone34.0a1
Bug 1048246 - Fix more bad implicit constructors in layout; r=roc
accessible/generic/HyperTextAccessible.cpp
layout/base/DisplayListClipState.h
layout/base/FrameLayerBuilder.h
layout/base/FramePropertyTable.h
layout/base/nsDisplayList.h
layout/base/nsDocumentViewer.cpp
layout/base/nsIPresShell.h
layout/base/nsLayoutUtils.h
layout/base/nsPresArena.h
layout/base/nsPresContext.h
layout/base/nsRefreshDriver.h
layout/generic/FrameChildList.h
layout/generic/Selection.h
layout/generic/WritingModes.h
layout/generic/nsContainerFrame.h
layout/generic/nsFrame.h
layout/generic/nsFrameList.h
layout/generic/nsHTMLReflowMetrics.h
layout/generic/nsIFrame.h
layout/generic/nsLeafFrame.h
layout/generic/nsQueryFrame.h
layout/generic/nsSplittableFrame.h
layout/generic/nsSubDocumentFrame.h
layout/printing/nsPrintData.h
layout/style/CSSStyleSheet.h
layout/style/CounterStyleManager.h
layout/style/Loader.h
layout/style/nsCSSScanner.h
layout/style/nsCSSValue.h
layout/style/nsStyleCoord.h
layout/style/nsStyleStruct.h
view/nsView.h
view/nsViewManager.h
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1541,17 +1541,19 @@ HyperTextAccessible::ScrollSubstringToPo
 
         // avoid divide by zero
         size.width = size.width ? size.width : 1;
         size.height = size.height ? size.height : 1;
 
         int16_t hPercent = offsetPointX * 100 / size.width;
         int16_t vPercent = offsetPointY * 100 / size.height;
 
-        nsresult rv = nsCoreUtils::ScrollSubstringTo(frame, range, vPercent, hPercent);
+        nsresult rv = nsCoreUtils::ScrollSubstringTo(frame, range,
+                                                     nsIPresShell::ScrollAxis(vPercent),
+                                                     nsIPresShell::ScrollAxis(hPercent));
         if (NS_FAILED(rv))
           return;
 
         initialScrolled = true;
       } else {
         // Substring was scrolled to the given point already inside its closest
         // scrollable area. If there are nested scrollable areas then make
         // sure we scroll lower areas to the given point inside currently
--- a/layout/base/DisplayListClipState.h
+++ b/layout/base/DisplayListClipState.h
@@ -126,17 +126,17 @@ private:
  * A class to automatically save and restore the current clip state. Also
  * offers methods for modifying the clip state. Only one modification is allowed
  * to be in scope at a time using one of these objects; multiple modifications
  * require nested objects. The interface is written this way to prevent
  * dangling pointers to DisplayItemClips.
  */
 class DisplayListClipState::AutoSaveRestore {
 public:
-  AutoSaveRestore(nsDisplayListBuilder* aBuilder);
+  explicit AutoSaveRestore(nsDisplayListBuilder* aBuilder);
   void Restore()
   {
     mState = mSavedState;
     mRestored = true;
   }
   ~AutoSaveRestore()
   {
     mState = mSavedState;
@@ -222,17 +222,17 @@ public:
 
 /**
  * Do not use this outside of nsFrame::BuildDisplayListForChild, use
  * multiple AutoSaveRestores instead. We provide this class just to ensure
  * BuildDisplayListForChild is as efficient as possible.
  */
 class DisplayListClipState::AutoClipMultiple : public AutoSaveRestore {
 public:
-  AutoClipMultiple(nsDisplayListBuilder* aBuilder)
+  explicit AutoClipMultiple(nsDisplayListBuilder* aBuilder)
     : AutoSaveRestore(aBuilder)
     , mExtraClipUsed(false)
   {}
 
   /**
    * *aClip must survive longer than this object. Be careful!!!
    */
   void SetClipForContainingBlockDescendants(const DisplayItemClip* aClip)
--- a/layout/base/FrameLayerBuilder.h
+++ b/layout/base/FrameLayerBuilder.h
@@ -590,17 +590,17 @@ protected:
 
   /**
    * We accumulate ClippedDisplayItem elements in a hashtable during
    * the paint process. This is the hashentry for that hashtable.
    */
 public:
   class ThebesLayerItemsEntry : public nsPtrHashKey<ThebesLayer> {
   public:
-    ThebesLayerItemsEntry(const ThebesLayer *key)
+    explicit ThebesLayerItemsEntry(const ThebesLayer *key)
       : nsPtrHashKey<ThebesLayer>(key)
       , mContainerLayerFrame(nullptr)
       , mLastCommonClipCount(0)
       , mContainerLayerGeneration(0)
       , mHasExplicitLastPaintOffset(false)
       , mCommonClipCount(0)
     {}
     ThebesLayerItemsEntry(const ThebesLayerItemsEntry &toCopy) :
--- a/layout/base/FramePropertyTable.h
+++ b/layout/base/FramePropertyTable.h
@@ -187,17 +187,17 @@ protected:
 
   /**
    * Our hashtable entry. The key is an nsIFrame*, the value is a
    * PropertyValue representing one or more property/value pairs.
    */
   class Entry : public nsPtrHashKey<nsIFrame>
   {
   public:
-    Entry(KeyTypePointer aKey) : nsPtrHashKey<nsIFrame>(aKey) {}
+    explicit Entry(KeyTypePointer aKey) : nsPtrHashKey<nsIFrame>(aKey) {}
     Entry(const Entry &toCopy) :
       nsPtrHashKey<nsIFrame>(toCopy), mProp(toCopy.mProp) {}
 
     size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) {
       return mProp.SizeOfExcludingThis(aMallocSizeOf);
     }
 
     PropertyValue mProp;
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -619,17 +619,17 @@ public:
   void SetCurrentTableItem(nsDisplayTableItem* aTableItem) { mCurrentTableItem = aTableItem; }
 
   struct OutOfFlowDisplayData {
     OutOfFlowDisplayData(const DisplayItemClip& aContainingBlockClip,
                          const nsRect &aDirtyRect)
       : mContainingBlockClip(aContainingBlockClip)
       , mDirtyRect(aDirtyRect)
     {}
-    OutOfFlowDisplayData(const nsRect &aDirtyRect)
+    explicit OutOfFlowDisplayData(const nsRect &aDirtyRect)
       : mDirtyRect(aDirtyRect)
     {}
     DisplayItemClip mContainingBlockClip;
     nsRect mDirtyRect;
   };
   static void DestroyOutOfFlowDisplayData(void* aPropertyValue)
   {
     delete static_cast<OutOfFlowDisplayData*>(aPropertyValue);
@@ -803,17 +803,17 @@ public:
 
   // This is never instantiated directly (it has pure virtual methods), so no
   // need to count constructors and destructors.
   nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame);
   /**
    * This constructor is only used in rare cases when we need to construct
    * temporary items.
    */
-  nsDisplayItem(nsIFrame* aFrame)
+  explicit nsDisplayItem(nsIFrame* aFrame)
     : mFrame(aFrame)
     , mClip(nullptr)
     , mReferenceFrame(nullptr)
 #ifdef MOZ_DUMP_PAINTING
     , mPainted(false)
 #endif
   {
   }
@@ -825,17 +825,17 @@ public:
   }
 
 // Contains all the type integers for each display list item type
 #include "nsDisplayItemTypes.h"
 
   struct HitTestState {
     typedef nsTArray<ViewID> ShadowArray;
 
-    HitTestState(ShadowArray* aShadows = nullptr)
+    explicit HitTestState(ShadowArray* aShadows = nullptr)
       : mShadows(aShadows) {
     }
 
     ~HitTestState() {
       NS_ASSERTION(mItemBuffer.Length() == 0,
                    "mItemBuffer should have been cleared");
     }
 
@@ -1739,17 +1739,17 @@ protected:
 /**
  * A specialization of nsDisplayListSet where the lists are actually internal
  * to the object, and all distinct.
  */
 struct nsDisplayListCollection : public nsDisplayListSet {
   nsDisplayListCollection() :
     nsDisplayListSet(&mLists[0], &mLists[1], &mLists[2], &mLists[3], &mLists[4],
                      &mLists[5]) {}
-  nsDisplayListCollection(nsDisplayList* aBorderBackground) :
+  explicit nsDisplayListCollection(nsDisplayList* aBorderBackground) :
     nsDisplayListSet(aBorderBackground, &mLists[1], &mLists[2], &mLists[3], &mLists[4],
                      &mLists[5]) {}
 
   /**
    * Sort all lists by content order.
    */                     
   void SortAllByContentOrder(nsDisplayListBuilder* aBuilder, nsIContent* aCommonAncestor) {
     for (int32_t i = 0; i < 6; ++i) {
@@ -3407,17 +3407,17 @@ private:
  * The values must be non-negative.
  * The default value for both edges is zero, which means everything is painted.
  */
 class nsCharClipDisplayItem : public nsDisplayItem {
 public:
   nsCharClipDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
     : nsDisplayItem(aBuilder, aFrame), mLeftEdge(0), mRightEdge(0) {}
 
-  nsCharClipDisplayItem(nsIFrame* aFrame)
+  explicit nsCharClipDisplayItem(nsIFrame* aFrame)
     : nsDisplayItem(aFrame) {}
 
   struct ClipEdges {
     ClipEdges(const nsDisplayItem& aItem,
               nscoord aLeftEdge, nscoord aRightEdge) {
       nsRect r = aItem.Frame()->GetScrollableOverflowRect() +
                  aItem.ToReferenceFrame();
       mX = aLeftEdge > 0 ? r.x + aLeftEdge : nscoord_MIN;
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -422,32 +422,32 @@ protected:
   bool mCallerIsClosingWindow;
   bool mInitializedForPrintPreview;
   bool mHidden;
 };
 
 class nsPrintEventDispatcher
 {
 public:
-  nsPrintEventDispatcher(nsIDocument* aTop) : mTop(aTop)
+  explicit nsPrintEventDispatcher(nsIDocument* aTop) : mTop(aTop)
   {
     nsDocumentViewer::DispatchBeforePrint(mTop);
   }
   ~nsPrintEventDispatcher()
   {
     nsDocumentViewer::DispatchAfterPrint(mTop);
   }
 
   nsCOMPtr<nsIDocument> mTop;
 };
 
 class nsDocumentShownDispatcher : public nsRunnable
 {
 public:
-  nsDocumentShownDispatcher(nsCOMPtr<nsIDocument> aDocument)
+  explicit nsDocumentShownDispatcher(nsCOMPtr<nsIDocument> aDocument)
   : mDocument(aDocument) {}
 
   NS_IMETHOD Run() MOZ_OVERRIDE;
 
 private:
   nsCOMPtr<nsIDocument> mDocument;
 };
 
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -649,19 +649,19 @@ public:
    *                is visible.
    *                * SCROLL_ALWAYS: Move the frame regardless of its current
    *                visibility.
    * @param aOnlyIfPerceivedScrollableDirection:
    *                If the direction is not a perceived scrollable direction (i.e.
    *                no scrollbar showing and less than one device pixel of
    *                scrollable distance), don't scroll. Defaults to false.
    */
-    ScrollAxis(int16_t aWhere = SCROLL_MINIMUM,
-               WhenToScroll aWhen = SCROLL_IF_NOT_FULLY_VISIBLE,
-               bool aOnlyIfPerceivedScrollableDirection = false) :
+    explicit ScrollAxis(int16_t aWhere = SCROLL_MINIMUM,
+                        WhenToScroll aWhen = SCROLL_IF_NOT_FULLY_VISIBLE,
+                        bool aOnlyIfPerceivedScrollableDirection = false) :
       mWhereToScroll(aWhere), mWhenToScroll(aWhen),
       mOnlyIfPerceivedScrollableDirection(aOnlyIfPerceivedScrollableDirection)
     {}
   } ScrollAxis;
   /**
    * Scrolls the view of the document so that the primary frame of the content
    * is displayed in the window. Layout is flushed before scrolling.
    *
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -995,17 +995,17 @@ public:
     RectAccumulator();
 
     virtual void AddRect(const nsRect& aRect);
   };
 
   struct RectListBuilder : public RectCallback {
     DOMRectList* mRectList;
 
-    RectListBuilder(DOMRectList* aList);
+    explicit RectListBuilder(DOMRectList* aList);
     virtual void AddRect(const nsRect& aRect);
   };
 
   /**
    * SelectionCaret draws carets base on range. The carets are at begin
    * and end position of range's client rects. This class help us to
    * collect first and last rect for drawing carets.
    */
@@ -2341,17 +2341,17 @@ namespace mozilla {
     /**
      * An RAII class which will, for the duration of its lifetime,
      * **if** the frame given is a container for font size inflation,
      * set the current inflation container on the pres context to null
      * (and then, in its destructor, restore the old value).
      */
     class AutoMaybeDisableFontInflation {
     public:
-      AutoMaybeDisableFontInflation(nsIFrame *aFrame);
+      explicit AutoMaybeDisableFontInflation(nsIFrame *aFrame);
 
       ~AutoMaybeDisableFontInflation();
     private:
       nsPresContext *mPresContext;
       bool mOldValue;
     };
 
     void MaybeSetupTransactionIdAllocator(layers::LayerManager* aManager, nsView* aView);
--- a/layout/base/nsPresArena.h
+++ b/layout/base/nsPresArena.h
@@ -113,17 +113,17 @@ private:
     typedef uint32_t KeyType;
     nsTArray<void *> mEntries;
     size_t mEntrySize;
     size_t mEntriesEverAllocated;
 
     typedef const void* KeyTypePointer;
     KeyTypePointer mKey;
 
-    FreeList(KeyTypePointer aKey)
+    explicit FreeList(KeyTypePointer aKey)
     : mEntrySize(0), mEntriesEverAllocated(0), mKey(aKey) {}
     // Default copy constructor and destructor are ok.
 
     bool KeyEquals(KeyTypePointer const aKey) const
     { return mKey == aKey; }
 
     static KeyTypePointer KeyToPointer(KeyType aKey)
     { return NS_INT32_TO_PTR(aKey); }
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -932,17 +932,17 @@ public:
 
   /**
    * A class that can be used to temporarily disable reflow interruption.
    */
   class InterruptPreventer;
   friend class InterruptPreventer;
   class MOZ_STACK_CLASS InterruptPreventer {
   public:
-    InterruptPreventer(nsPresContext* aCtx) :
+    explicit InterruptPreventer(nsPresContext* aCtx) :
       mCtx(aCtx),
       mInterruptsEnabled(aCtx->mInterruptsEnabled),
       mHasPendingInterrupt(aCtx->mHasPendingInterrupt)
     {
       mCtx->mInterruptsEnabled = false;
       mCtx->mHasPendingInterrupt = false;
     }
     ~InterruptPreventer() {
@@ -1487,17 +1487,17 @@ protected:
   void InitApplyPluginGeometryTimer();
   /**
    * Cancel the timer that ensures we eventually run ApplyPluginGeometryUpdates.
    */
   void CancelApplyPluginGeometryTimer();
 
   class RunWillPaintObservers : public nsRunnable {
   public:
-    RunWillPaintObservers(nsRootPresContext* aPresContext) : mPresContext(aPresContext) {}
+    explicit RunWillPaintObservers(nsRootPresContext* aPresContext) : mPresContext(aPresContext) {}
     void Revoke() { mPresContext = nullptr; }
     NS_IMETHOD Run() MOZ_OVERRIDE
     {
       if (mPresContext) {
         mPresContext->FlushWillPaintObservers();
       }
       return NS_OK;
     }
--- a/layout/base/nsRefreshDriver.h
+++ b/layout/base/nsRefreshDriver.h
@@ -61,17 +61,17 @@ public:
 class nsAPostRefreshObserver {
 public:
   virtual void DidRefresh() = 0;
 };
 
 class nsRefreshDriver MOZ_FINAL : public mozilla::layers::TransactionIdAllocator,
                                   public nsARefreshObserver {
 public:
-  nsRefreshDriver(nsPresContext *aPresContext);
+  explicit nsRefreshDriver(nsPresContext *aPresContext);
   ~nsRefreshDriver();
 
   static void InitializeStatics();
   static void Shutdown();
 
   /**
    * Methods for testing, exposed via nsIDOMWindowUtils.  See
    * nsIDOMWindowUtils.advanceTimeAndRefresh for description.
--- a/layout/generic/FrameChildList.h
+++ b/layout/generic/FrameChildList.h
@@ -21,17 +21,17 @@ namespace layout {
 extern const char* ChildListName(FrameChildListID aListID);
 #endif
 
 class FrameChildListIDs {
 friend class FrameChildListIterator;
  public:
   FrameChildListIDs() : mIDs(0) {}
   FrameChildListIDs(const FrameChildListIDs& aOther) : mIDs(aOther.mIDs) {}
-  FrameChildListIDs(FrameChildListID aListID) : mIDs(aListID) {}
+  MOZ_IMPLICIT FrameChildListIDs(FrameChildListID aListID) : mIDs(aListID) {}
 
   FrameChildListIDs operator|(FrameChildListIDs aOther) const {
     return FrameChildListIDs(mIDs | aOther.mIDs);
   }
   FrameChildListIDs& operator|=(FrameChildListIDs aOther) {
     mIDs |= aOther.mIDs;
     return *this;
   }
@@ -41,34 +41,34 @@ friend class FrameChildListIterator;
   bool operator!=(FrameChildListIDs aOther) const {
     return !(*this == aOther);
   }
   bool Contains(FrameChildListIDs aOther) const {
     return (mIDs & aOther.mIDs) == aOther.mIDs;
   }
 
  protected:
-  FrameChildListIDs(uint32_t aIDs) : mIDs(aIDs) {}
+  explicit FrameChildListIDs(uint32_t aIDs) : mIDs(aIDs) {}
   uint32_t mIDs;
 };
 
 class FrameChildList {
  public:
   FrameChildList(const nsFrameList& aList, FrameChildListID aID)
     : mList(aList), mID(aID) {}
   nsFrameList mList;
   FrameChildListID mID;
 };
 
 /**
  * A class to iterate frame child lists.
  */
 class MOZ_STACK_CLASS FrameChildListArrayIterator {
  public:
-  FrameChildListArrayIterator(const nsTArray<FrameChildList>& aLists)
+  explicit FrameChildListArrayIterator(const nsTArray<FrameChildList>& aLists)
     : mLists(aLists), mCurrentIndex(0) {}
   bool IsDone() const { return mCurrentIndex >= mLists.Length(); }
   FrameChildListID CurrentID() const {
     NS_ASSERTION(!IsDone(), "CurrentID(): iterator at end");
     return mLists[mCurrentIndex].mID;
   }
   const nsFrameList& CurrentList() const {
     NS_ASSERTION(!IsDone(), "CurrentList(): iterator at end");
@@ -85,17 +85,17 @@ protected:
 };
 
 /**
  * A class for retrieving a frame's child lists and iterate them.
  */
 class MOZ_STACK_CLASS FrameChildListIterator
   : public FrameChildListArrayIterator {
  public:
-  FrameChildListIterator(const nsIFrame* aFrame);
+  explicit FrameChildListIterator(const nsIFrame* aFrame);
 
 protected:
   nsAutoTArray<FrameChildList,4> mLists;
 };
 
 inline mozilla::layout::FrameChildListIDs
 operator|(mozilla::layout::FrameChildListID aLeftOp,
           mozilla::layout::FrameChildListID aRightOp)
--- a/layout/generic/Selection.h
+++ b/layout/generic/Selection.h
@@ -25,17 +25,17 @@ class nsFrameSelection;
 struct SelectionDetails;
 
 namespace mozilla {
 class ErrorResult;
 }
 
 struct RangeData
 {
-  RangeData(nsRange* aRange)
+  explicit RangeData(nsRange* aRange)
     : mRange(aRange)
   {}
 
   nsRefPtr<nsRange> mRange;
   mozilla::TextRangeStyle mTextRangeStyle;
 };
 
 // Note, the ownership of mozilla::dom::Selection depends on which way the
@@ -50,17 +50,17 @@ class Selection : public nsISelectionPri
                   public nsWrapperCache,
                   public nsSupportsWeakReference
 {
 protected:
   virtual ~Selection();
 
 public:
   Selection();
-  Selection(nsFrameSelection *aList);
+  explicit Selection(nsFrameSelection *aList);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Selection, nsISelectionPrivate)
   NS_DECL_NSISELECTION
   NS_DECL_NSISELECTIONPRIVATE
 
   nsIDocument* GetParentObject() const;
 
--- a/layout/generic/WritingModes.h
+++ b/layout/generic/WritingModes.h
@@ -215,17 +215,17 @@ public:
    */
   WritingMode()
     : mWritingMode(0)
   { }
 
   /**
    * Construct writing mode based on a style context
    */
-  WritingMode(const nsStyleVisibility* aStyleVisibility)
+  explicit WritingMode(const nsStyleVisibility* aStyleVisibility)
   {
     NS_ASSERTION(aStyleVisibility, "we need an nsStyleVisibility here");
 
 #ifdef WRITING_MODE_VERTICAL_ENABLED
     switch (aStyleVisibility->mWritingMode) {
       case NS_STYLE_WRITING_MODE_HORIZONTAL_TB:
         mWritingMode = 0;
         break;
@@ -296,17 +296,17 @@ private:
   {
     return WritingMode(eUnknownWritingMode);
   }
 
   /**
    * Constructing a WritingMode with an arbitrary value is a private operation
    * currently only used by the Unknown() static method.
    */
-  WritingMode(uint8_t aValue)
+  explicit WritingMode(uint8_t aValue)
     : mWritingMode(aValue)
   { }
 
   uint8_t mWritingMode;
 
   enum Masks {
     // Masks for our bits; true chosen as opposite of commonest case
     eOrientationMask = 0x01, // true means vertical text
@@ -360,17 +360,17 @@ private:
  * by FlowRelativeToLineRelativeFactor() enough?
  */
 
 /**
  * Flow-relative point
  */
 class LogicalPoint {
 public:
-  LogicalPoint(WritingMode aWritingMode)
+  explicit LogicalPoint(WritingMode aWritingMode)
     :
 #ifdef DEBUG
       mWritingMode(aWritingMode),
 #endif
       mPoint(0, 0)
   { }
 
   // Construct from a writing mode and individual coordinates (which MUST be
@@ -564,17 +564,17 @@ private:
   nsPoint mPoint;
 };
 
 /**
  * Flow-relative size
  */
 class LogicalSize {
 public:
-  LogicalSize(WritingMode aWritingMode)
+  explicit LogicalSize(WritingMode aWritingMode)
     :
 #ifdef DEBUG
       mWritingMode(aWritingMode),
 #endif
       mSize(0, 0)
   { }
 
   LogicalSize(WritingMode aWritingMode, nscoord aISize, nscoord aBSize)
@@ -729,17 +729,17 @@ private:
   nsSize      mSize;
 };
 
 /**
  * Flow-relative margin
  */
 class LogicalMargin {
 public:
-  LogicalMargin(WritingMode aWritingMode)
+  explicit LogicalMargin(WritingMode aWritingMode)
     :
 #ifdef DEBUG
       mWritingMode(aWritingMode),
 #endif
       mMargin(0, 0, 0, 0)
   { }
 
   LogicalMargin(WritingMode aWritingMode,
@@ -1015,17 +1015,17 @@ private:
   nsMargin    mMargin;
 };
 
 /**
  * Flow-relative rectangle
  */
 class LogicalRect {
 public:
-  LogicalRect(WritingMode aWritingMode)
+  explicit LogicalRect(WritingMode aWritingMode)
     :
 #ifdef DEBUG
       mWritingMode(aWritingMode),
 #endif
       mRect(0, 0, 0, 0)
   { }
 
   LogicalRect(WritingMode aWritingMode,
--- a/layout/generic/nsContainerFrame.h
+++ b/layout/generic/nsContainerFrame.h
@@ -416,17 +416,17 @@ public:
 #define NS_DECLARE_FRAME_PROPERTY_FRAMELIST(prop)                     \
   NS_DECLARE_FRAME_PROPERTY(prop, nsContainerFrame::DestroyFrameList)
 
   NS_DECLARE_FRAME_PROPERTY_FRAMELIST(OverflowProperty)
   NS_DECLARE_FRAME_PROPERTY_FRAMELIST(OverflowContainersProperty)
   NS_DECLARE_FRAME_PROPERTY_FRAMELIST(ExcessOverflowContainersProperty)
 
 protected:
-  nsContainerFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
+  explicit nsContainerFrame(nsStyleContext* aContext) : nsSplittableFrame(aContext) {}
   ~nsContainerFrame();
 
   /**
    * Helper for DestroyFrom. DestroyAbsoluteFrames is called before
    * destroying frames on lists that can contain placeholders.
    * Derived classes must do that too, if they destroy such frame lists.
    * See nsBlockFrame::DestroyFrom for an example.
    */
--- a/layout/generic/nsFrame.h
+++ b/layout/generic/nsFrame.h
@@ -512,17 +512,17 @@ public:
    *                           Must not be null.
    * @param aChildPseudo the child's pseudo type, if any.
    */
   static nsIFrame*
   CorrectStyleParentFrame(nsIFrame* aProspectiveParent, nsIAtom* aChildPseudo);
 
 protected:
   // Protected constructor and destructor
-  nsFrame(nsStyleContext* aContext);
+  explicit nsFrame(nsStyleContext* aContext);
   virtual ~nsFrame();
 
   /**
    * To be called by |BuildDisplayLists| of this class or derived classes to add
    * a translucent overlay if this frame's content is selected.
    * @param aContentType an nsISelectionDisplay DISPLAY_ constant identifying
    * which kind of content this is for
    */
@@ -746,17 +746,17 @@ public:
     nsIFrame*                mFrame;
     const nsHTMLReflowState& mReflowState;
     nsHTMLReflowMetrics&     mMetrics;
     nsReflowStatus&          mStatus;    
     void*                    mValue;
   };
 
   struct DR_layout_cookie {
-    DR_layout_cookie(nsIFrame* aFrame);
+    explicit DR_layout_cookie(nsIFrame* aFrame);
     ~DR_layout_cookie();
 
     nsIFrame* mFrame;
     void* mValue;
   };
   
   struct DR_intrinsic_width_cookie {
     DR_intrinsic_width_cookie(nsIFrame* aFrame, const char* aType,
--- a/layout/generic/nsFrameList.h
+++ b/layout/generic/nsFrameList.h
@@ -294,17 +294,17 @@ public:
    * A class representing a slice of a frame list.
    */
   class Slice {
     friend class Enumerator;
 
   public:
     // Implicit on purpose, so that we can easily create enumerators from
     // nsFrameList via this impicit constructor.
-    Slice(const nsFrameList& aList) :
+    MOZ_IMPLICIT Slice(const nsFrameList& aList) :
 #ifdef DEBUG
       mList(aList),
 #endif
       mStart(aList.FirstChild()),
       mEnd(nullptr)
     {}
 
     Slice(const nsFrameList& aList, nsIFrame* aStart, nsIFrame* aEnd) :
@@ -329,17 +329,17 @@ public:
 #endif
     nsIFrame* const mStart; // our starting frame
     const nsIFrame* const mEnd; // The first frame that is NOT in the slice.
                                 // May be null.
   };
 
   class Enumerator {
   public:
-    Enumerator(const Slice& aSlice) :
+    explicit Enumerator(const Slice& aSlice) :
 #ifdef DEBUG
       mSlice(aSlice),
 #endif
       mFrame(aSlice.mStart),
       mEnd(aSlice.mEnd)
     {}
 
     Enumerator(const Enumerator& aOther) :
@@ -410,17 +410,17 @@ public:
    * the frames before and after the given link.  This means PrevFrame() is
    * null when the enumerator is at the beginning of the list and NextFrame()
    * is null when it's AtEnd().
    */
   class FrameLinkEnumerator : private Enumerator {
   public:
     friend class nsFrameList;
 
-    FrameLinkEnumerator(const nsFrameList& aList) :
+    explicit FrameLinkEnumerator(const nsFrameList& aList) :
       Enumerator(aList),
       mPrev(nullptr)
     {}
 
     FrameLinkEnumerator(const FrameLinkEnumerator& aOther) :
       Enumerator(aOther),
       mPrev(aOther.mPrev)
     {}
--- a/layout/generic/nsHTMLReflowMetrics.h
+++ b/layout/generic/nsHTMLReflowMetrics.h
@@ -199,25 +199,25 @@ struct nsCollapsingMargin {
 class nsHTMLReflowMetrics {
 public:
   // XXXldb Should |aFlags| generally be passed from parent to child?
   // Some places do it, and some don't.  |aFlags| should perhaps go away
   // entirely.
   // XXX width/height/ascent are OUT parameters and so they shouldn't
   // have to be initialized, but there are some bad frame classes that
   // aren't properly setting them when returning from Reflow()...
-  nsHTMLReflowMetrics(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0)
+  explicit nsHTMLReflowMetrics(mozilla::WritingMode aWritingMode, uint32_t aFlags = 0)
     : mISize(0)
     , mBSize(0)
     , mBlockStartAscent(ASK_FOR_BASELINE)
     , mFlags(aFlags)
     , mWritingMode(aWritingMode)
   {}
 
-  nsHTMLReflowMetrics(const nsHTMLReflowState& aState, uint32_t aFlags = 0);
+  explicit nsHTMLReflowMetrics(const nsHTMLReflowState& aState, uint32_t aFlags = 0);
 
   // ISize and BSize are logical-coordinate dimensions:
   // ISize is the size in the writing mode's inline direction (which equates to
   // width in horizontal writing modes, height in vertical ones), and BSize is
   // the size in the block-progression direction.
   nscoord ISize(mozilla::WritingMode aWritingMode) const {
     CHECK_WRITING_MODE(aWritingMode);
     return mISize;
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -3173,17 +3173,17 @@ class nsWeakFrame {
 public:
   nsWeakFrame() : mPrev(nullptr), mFrame(nullptr) { }
 
   nsWeakFrame(const nsWeakFrame& aOther) : mPrev(nullptr), mFrame(nullptr)
   {
     Init(aOther.GetFrame());
   }
 
-  nsWeakFrame(nsIFrame* aFrame) : mPrev(nullptr), mFrame(nullptr)
+  MOZ_IMPLICIT nsWeakFrame(nsIFrame* aFrame) : mPrev(nullptr), mFrame(nullptr)
   {
     Init(aFrame);
   }
 
   nsWeakFrame& operator=(nsWeakFrame& aOther) {
     Init(aOther.GetFrame());
     return *this;
   }
--- a/layout/generic/nsLeafFrame.h
+++ b/layout/generic/nsLeafFrame.h
@@ -67,17 +67,17 @@ public:
   virtual bool IsFrameOfType(uint32_t aFlags) const MOZ_OVERRIDE
   {
     // We don't actually contain a block, but we do always want a
     // computed width, so tell a little white lie here.
     return nsFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplacedContainsBlock));
   }
 
 protected:
-  nsLeafFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
+  explicit nsLeafFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
   virtual ~nsLeafFrame();
 
   /**
    * Return the intrinsic width of the frame's content area. Note that this
    * should not include borders or padding and should not depend on the applied
    * styles.
    */
   virtual nscoord GetIntrinsicISize() = 0;
--- a/layout/generic/nsQueryFrame.h
+++ b/layout/generic/nsQueryFrame.h
@@ -72,17 +72,23 @@ public:
   };
 
   virtual void* QueryFrame(FrameIID id) = 0;
 };
 
 class do_QueryFrame
 {
 public:
-  do_QueryFrame(nsQueryFrame *s) : mRawPtr(s) { }
+  explicit do_QueryFrame(nsQueryFrame *s) : mRawPtr(s) { }
+
+  // The return and argument types here are arbitrarily selected so no
+  // corresponding member function exists.
+  typedef void (do_QueryFrame::* MatchNullptr)(double, float);
+  // Implicit constructor for nullptr, trick borrowed from already_AddRefed.
+  MOZ_IMPLICIT do_QueryFrame(MatchNullptr aRawPtr) : mRawPtr(nullptr) {}
 
   template<class Dest>
   operator Dest*() {
     static_assert(mozilla::IsSame<Dest, typename Dest::Has_NS_DECL_QUERYFRAME_TARGET>::value,
                   "Dest must declare itself as a queryframe target");
     if (!mRawPtr)
       return nullptr;
 
--- a/layout/generic/nsSplittableFrame.h
+++ b/layout/generic/nsSplittableFrame.h
@@ -69,17 +69,17 @@ public:
   virtual nsIFrame* FirstInFlow() const MOZ_OVERRIDE;
   virtual nsIFrame* LastInFlow() const MOZ_OVERRIDE;
 
   // Remove the frame from the flow. Connects the frame's prev-in-flow
   // and its next-in-flow. This should only be called in frame Destroy() methods.
   static void RemoveFromFlow(nsIFrame* aFrame);
 
 protected:
-  nsSplittableFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
+  explicit nsSplittableFrame(nsStyleContext* aContext) : nsFrame(aContext) {}
 
   /**
    * Determine the height consumed by our previous-in-flows.
    *
    * @note (bz) This makes laying out a splittable frame with N in-flows
    *       O(N^2)! So, use this function with caution and minimize the number
    *       of calls to this method.
    */
--- a/layout/generic/nsSubDocumentFrame.h
+++ b/layout/generic/nsSubDocumentFrame.h
@@ -16,17 +16,17 @@
  *****************************************************************************/
 class nsSubDocumentFrame : public nsLeafFrame,
                            public nsIReflowCallback
 {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsSubDocumentFrame)
   NS_DECL_FRAMEARENA_HELPERS
 
-  nsSubDocumentFrame(nsStyleContext* aContext);
+  explicit nsSubDocumentFrame(nsStyleContext* aContext);
 
 #ifdef DEBUG_FRAME_DUMP
   void List(FILE* out = stderr, const char* aPrefix = "", uint32_t aFlags = 0) const MOZ_OVERRIDE;
   virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
 #endif
 
   NS_DECL_QUERYFRAME
 
--- a/layout/printing/nsPrintData.h
+++ b/layout/printing/nsPrintData.h
@@ -36,17 +36,17 @@ class nsIWebProgressListener;
 //   because the document is no longer stable.
 // 
 //------------------------------------------------------------------------
 class nsPrintData {
 public:
 
   typedef enum {eIsPrinting, eIsPrintPreview } ePrintDataType;
 
-  nsPrintData(ePrintDataType aType);
+  explicit nsPrintData(ePrintDataType aType);
   ~nsPrintData(); // non-virtual
 
   // Listener Helper Methods
   void OnEndPrinting();
   void OnStartPrinting();
   void DoOnProgressChange(int32_t      aProgress,
                           int32_t      aMaxProgress,
                           bool         aDoStartStop,
--- a/layout/style/CSSStyleSheet.h
+++ b/layout/style/CSSStyleSheet.h
@@ -110,17 +110,17 @@ private:
 
 
 class CSSStyleSheet MOZ_FINAL : public nsIStyleSheet,
                                 public nsIDOMCSSStyleSheet,
                                 public nsICSSLoaderObserver,
                                 public nsWrapperCache
 {
 public:
-  CSSStyleSheet(CORSMode aCORSMode);
+  explicit CSSStyleSheet(CORSMode aCORSMode);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(CSSStyleSheet,
                                                          nsIStyleSheet)
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_STYLE_SHEET_IMPL_CID)
 
   // nsIStyleSheet interface
--- a/layout/style/CounterStyleManager.h
+++ b/layout/style/CounterStyleManager.h
@@ -99,17 +99,17 @@ protected:
   int32_t mStyle;
 };
 
 class CounterStyleManager MOZ_FINAL
 {
 private:
   ~CounterStyleManager();
 public:
-  CounterStyleManager(nsPresContext* aPresContext);
+  explicit CounterStyleManager(nsPresContext* aPresContext);
 
   static void InitializeBuiltinCounterStyles();
 
   void Disconnect();
 
   bool IsInitial() const
   {
     // only 'none' and 'decimal'
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -41,17 +41,17 @@ class Element;
 namespace mozilla {
 
 class URIPrincipalAndCORSModeHashKey : public nsURIHashKey
 {
 public:
   typedef URIPrincipalAndCORSModeHashKey* KeyType;
   typedef const URIPrincipalAndCORSModeHashKey* KeyTypePointer;
 
-  URIPrincipalAndCORSModeHashKey(const URIPrincipalAndCORSModeHashKey* aKey)
+  explicit URIPrincipalAndCORSModeHashKey(const URIPrincipalAndCORSModeHashKey* aKey)
     : nsURIHashKey(aKey->mKey), mPrincipal(aKey->mPrincipal),
       mCORSMode(aKey->mCORSMode)
   {
     MOZ_COUNT_CTOR(URIPrincipalAndCORSModeHashKey);
   }
   URIPrincipalAndCORSModeHashKey(nsIURI* aURI, nsIPrincipal* aPrincipal,
                                  CORSMode aCORSMode)
     : nsURIHashKey(aURI), mPrincipal(aPrincipal), mCORSMode(aCORSMode)
@@ -125,17 +125,17 @@ enum StyleSheetState {
   eSheetPending,
   eSheetLoading,
   eSheetComplete
 };
 
 class Loader MOZ_FINAL {
 public:
   Loader();
-  Loader(nsIDocument*);
+  explicit Loader(nsIDocument*);
 
  private:
   // Private destructor, to discourage deletion outside of Release():
   ~Loader();
 
  public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Loader)
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(Loader)
--- a/layout/style/nsCSSScanner.h
+++ b/layout/style/nsCSSScanner.h
@@ -358,17 +358,17 @@ protected:
 struct MOZ_STACK_CLASS nsCSSGridTemplateAreaToken {
   nsAutoString mName;  // Empty for a null cell, non-empty for a named cell
   bool isTrash;  // True for a trash token, mName is ignored in this case.
 };
 
 // Scanner for the grid-template-areas micro-syntax
 class nsCSSGridTemplateAreaScanner {
 public:
-  nsCSSGridTemplateAreaScanner(const nsAString& aBuffer);
+  explicit nsCSSGridTemplateAreaScanner(const nsAString& aBuffer);
 
   // Get the next token.  Return false on EOF.
   // aTokenResult is filled in with the data for the token.
   bool Next(nsCSSGridTemplateAreaToken& aTokenResult);
 
 private:
   const char16_t *mBuffer;
   uint32_t mOffset;
--- a/layout/style/nsCSSValue.h
+++ b/layout/style/nsCSSValue.h
@@ -203,17 +203,17 @@ private:
 class FontFamilyListRefCnt MOZ_FINAL : public FontFamilyList {
 public:
     FontFamilyListRefCnt()
         : FontFamilyList()
     {
         MOZ_COUNT_CTOR(FontFamilyListRefCnt);
     }
 
-    FontFamilyListRefCnt(FontFamilyType aGenericType)
+    explicit FontFamilyListRefCnt(FontFamilyType aGenericType)
         : FontFamilyList(aGenericType)
     {
         MOZ_COUNT_CTOR(FontFamilyListRefCnt);
     }
 
     FontFamilyListRefCnt(const nsAString& aFamilyName,
                          QuotedName aQuoted)
         : FontFamilyList(aFamilyName, aQuoted)
@@ -818,17 +818,17 @@ private:
   nsCSSValue* First() { return mArray; }
 
   const nsCSSValue* First() const { return mArray; }
 
 #define CSSVALUE_LIST_FOR_EXTRA_VALUES(var)                                   \
   for (nsCSSValue *var = First() + 1, *var##_end = First() + mCount;          \
        var != var##_end; ++var)
 
-  Array(size_t aItemCount)
+  explicit Array(size_t aItemCount)
     : mRefCnt(0)
     , mCount(aItemCount)
   {
     MOZ_COUNT_CTOR(nsCSSValue::Array);
     CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
       new (val) nsCSSValue();
     }
   }
@@ -899,17 +899,17 @@ private:
 struct nsCSSValueSharedList MOZ_FINAL {
   nsCSSValueSharedList()
     : mHead(nullptr)
   {
     MOZ_COUNT_CTOR(nsCSSValueSharedList);
   }
 
   // Takes ownership of aList.
-  nsCSSValueSharedList(nsCSSValueList* aList)
+  explicit nsCSSValueSharedList(nsCSSValueList* aList)
     : mHead(aList)
   {
     MOZ_COUNT_CTOR(nsCSSValueSharedList);
   }
 
 private:
   // Private destructor, to discourage deletion outside of Release():
   ~nsCSSValueSharedList();
@@ -1039,17 +1039,17 @@ nsCSSValue::GetRectValue() const
   return *mValue.mRect;
 }
 
 struct nsCSSValuePair {
   nsCSSValuePair()
   {
     MOZ_COUNT_CTOR(nsCSSValuePair);
   }
-  nsCSSValuePair(nsCSSUnit aUnit)
+  explicit nsCSSValuePair(nsCSSUnit aUnit)
     : mXValue(aUnit), mYValue(aUnit)
   {
     MOZ_COUNT_CTOR(nsCSSValuePair);
   }
   nsCSSValuePair(const nsCSSValue& aXValue, const nsCSSValue& aYValue)
     : mXValue(aXValue), mYValue(aYValue)
   {
     MOZ_COUNT_CTOR(nsCSSValuePair);
@@ -1123,17 +1123,17 @@ private:
   }
 };
 
 struct nsCSSValueTriplet {
     nsCSSValueTriplet()
     {
         MOZ_COUNT_CTOR(nsCSSValueTriplet);
     }
-    nsCSSValueTriplet(nsCSSUnit aUnit)
+    explicit nsCSSValueTriplet(nsCSSUnit aUnit)
         : mXValue(aUnit), mYValue(aUnit), mZValue(aUnit)
     {
         MOZ_COUNT_CTOR(nsCSSValueTriplet);
     }
     nsCSSValueTriplet(const nsCSSValue& aXValue, 
                       const nsCSSValue& aYValue, 
                       const nsCSSValue& aZValue)
         : mXValue(aXValue), mYValue(aYValue), mZValue(aZValue)
--- a/layout/style/nsStyleCoord.h
+++ b/layout/style/nsStyleCoord.h
@@ -77,17 +77,17 @@ public:
     Calc() {}
 
   private:
     Calc(const Calc&) MOZ_DELETE;
     ~Calc() {}
     Calc& operator=(const Calc&) MOZ_DELETE;
   };
 
-  nsStyleCoord(nsStyleUnit aUnit = eStyleUnit_Null);
+  explicit nsStyleCoord(nsStyleUnit aUnit = eStyleUnit_Null);
   enum CoordConstructorType { CoordConstructor };
   inline nsStyleCoord(nscoord aValue, CoordConstructorType);
   nsStyleCoord(int32_t aValue, nsStyleUnit aUnit);
   nsStyleCoord(float aValue, nsStyleUnit aUnit);
   inline nsStyleCoord(const nsStyleCoord& aCopy);
   inline nsStyleCoord(const nsStyleUnion& aValue, nsStyleUnit aUnit);
   ~nsStyleCoord() { Reset(); }
 
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -60,17 +60,17 @@ class imgIContainer;
 #define NS_RULE_NODE_LEVEL_MASK             0xf0000000
 #define NS_RULE_NODE_LEVEL_SHIFT            28
 
 // The lifetime of these objects is managed by the presshell's arena.
 
 struct nsStyleFont {
   nsStyleFont(const nsFont& aFont, nsPresContext *aPresContext);
   nsStyleFont(const nsStyleFont& aStyleFont);
-  nsStyleFont(nsPresContext *aPresContext);
+  explicit nsStyleFont(nsPresContext *aPresContext);
 private:
   void Init(nsPresContext *aPresContext);
 public:
   ~nsStyleFont(void) {
     MOZ_COUNT_DTOR(nsStyleFont);
   }
 
   nsChangeHint CalcDifference(const nsStyleFont& aOther) const;
@@ -304,17 +304,17 @@ private:
   // This is _currently_ used only in conjunction with eStyleImageType_Image.
   nsAutoPtr<nsStyleSides> mCropRect;
 #ifdef DEBUG
   bool mImageTracked;
 #endif
 };
 
 struct nsStyleColor {
-  nsStyleColor(nsPresContext* aPresContext);
+  explicit nsStyleColor(nsPresContext* aPresContext);
   nsStyleColor(const nsStyleColor& aOther);
   ~nsStyleColor(void) {
     MOZ_COUNT_DTOR(nsStyleColor);
   }
 
   nsChangeHint CalcDifference(const nsStyleColor& aOther) const;
   static nsChangeHint MaxDifference() {
     return NS_STYLE_HINT_VISUAL;
@@ -652,17 +652,17 @@ protected:
   nsMargin      mCachedPadding;
 };
 
 struct nsBorderColors {
   nsBorderColors* mNext;
   nscolor mColor;
 
   nsBorderColors() : mNext(nullptr), mColor(NS_RGB(0,0,0)) {}
-  nsBorderColors(const nscolor& aColor) : mNext(nullptr), mColor(aColor) {}
+  explicit nsBorderColors(const nscolor& aColor) : mNext(nullptr), mColor(aColor) {}
   ~nsBorderColors();
 
   nsBorderColors* Clone() const { return Clone(true); }
 
   static bool Equal(const nsBorderColors* c1,
                       const nsBorderColors* c2) {
     if (c1 == c2)
       return true;
@@ -719,17 +719,17 @@ class nsCSSShadowArray MOZ_FINAL {
       // actual array in one allocation. The amount of memory to
       // allocate is equal to the class's size + the number of bytes for all
       // but the first array item (because aBaseSize includes one
       // item, see the private declarations)
       return ::operator new(aBaseSize +
                             (aArrayLen - 1) * sizeof(nsCSSShadowItem));
     }
 
-    nsCSSShadowArray(uint32_t aArrayLen) :
+    explicit nsCSSShadowArray(uint32_t aArrayLen) :
       mLength(aArrayLen)
     {
       MOZ_COUNT_CTOR(nsCSSShadowArray);
       for (uint32_t i = 1; i < mLength; ++i) {
         // Make sure we call the constructors of each nsCSSShadowItem
         // (the first one is called for us because we declared it under private)
         new (&mArray[i]) nsCSSShadowItem();
       }
@@ -798,17 +798,17 @@ public:
 // Returns if the given border style type is visible or not
 static bool IsVisibleBorderStyle(uint8_t aStyle)
 {
   return (aStyle != NS_STYLE_BORDER_STYLE_NONE &&
           aStyle != NS_STYLE_BORDER_STYLE_HIDDEN);
 }
 
 struct nsStyleBorder {
-  nsStyleBorder(nsPresContext* aContext);
+  explicit nsStyleBorder(nsPresContext* aContext);
   nsStyleBorder(const nsStyleBorder& aBorder);
   ~nsStyleBorder();
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleBorder_id, sz);
   }
   void Destroy(nsPresContext* aContext);
@@ -1024,17 +1024,17 @@ protected:
 private:
   nscoord       mTwipsPerPixel;
 
   nsStyleBorder& operator=(const nsStyleBorder& aOther) MOZ_DELETE;
 };
 
 
 struct nsStyleOutline {
-  nsStyleOutline(nsPresContext* aPresContext);
+  explicit nsStyleOutline(nsPresContext* aPresContext);
   nsStyleOutline(const nsStyleOutline& aOutline);
   ~nsStyleOutline(void) {
     MOZ_COUNT_DTOR(nsStyleOutline);
   }
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleOutline_id, sz);
@@ -1121,17 +1121,17 @@ protected:
   bool          mHasCachedOutline;
   uint8_t       mOutlineStyle;    // [reset] See nsStyleConsts.h
 
   nscoord       mTwipsPerPixel;
 };
 
 
 struct nsStyleList {
-  nsStyleList(nsPresContext* aPresContext);
+  explicit nsStyleList(nsPresContext* aPresContext);
   nsStyleList(const nsStyleList& aStyleList);
   ~nsStyleList(void);
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleList_id, sz);
   }
   void Destroy(nsPresContext* aContext) {
@@ -1719,17 +1719,17 @@ protected:
   explicit nsStyleImageOrientation(uint8_t aOrientation)
     : mOrientation(aOrientation)
   { }
 
   uint8_t mOrientation;
 };
 
 struct nsStyleVisibility {
-  nsStyleVisibility(nsPresContext* aPresContext);
+  explicit nsStyleVisibility(nsPresContext* aPresContext);
   nsStyleVisibility(const nsStyleVisibility& aVisibility);
   ~nsStyleVisibility() {
     MOZ_COUNT_DTOR(nsStyleVisibility);
   }
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleVisibility_id, sz);
@@ -2191,17 +2191,17 @@ struct nsStyleTable {
                           nsChangeHint_ClearAncestorIntrinsics);
   }
 
   uint8_t       mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_*
   int32_t       mSpan;          // [reset] the number of columns spanned by a colgroup or col
 };
 
 struct nsStyleTableBorder {
-  nsStyleTableBorder(nsPresContext* aContext);
+  explicit nsStyleTableBorder(nsPresContext* aContext);
   nsStyleTableBorder(const nsStyleTableBorder& aOther);
   ~nsStyleTableBorder(void);
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleTableBorder_id, sz);
   }
   void Destroy(nsPresContext* aContext) {
@@ -2614,17 +2614,17 @@ struct nsStyleXUL {
   uint8_t       mBoxAlign;              // [reset] see nsStyleConsts.h
   uint8_t       mBoxDirection;          // [reset] see nsStyleConsts.h
   uint8_t       mBoxOrient;             // [reset] see nsStyleConsts.h
   uint8_t       mBoxPack;               // [reset] see nsStyleConsts.h
   bool          mStretchStack;          // [reset] see nsStyleConsts.h
 };
 
 struct nsStyleColumn {
-  nsStyleColumn(nsPresContext* aPresContext);
+  explicit nsStyleColumn(nsPresContext* aPresContext);
   nsStyleColumn(const nsStyleColumn& aSource);
   ~nsStyleColumn();
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(nsPresArena::nsStyleColumn_id, sz);
   }
   void Destroy(nsPresContext* aContext) {
--- a/view/nsView.h
+++ b/view/nsView.h
@@ -376,18 +376,18 @@ public:
                                     bool aUseAttachedEvents) MOZ_OVERRIDE;
 
   virtual ~nsView();
 
   nsPoint GetOffsetTo(const nsView* aOther, const int32_t aAPD) const;
   nsIWidget* GetNearestWidget(nsPoint* aOffset, const int32_t aAPD) const;
 
 private:
-  nsView(nsViewManager* aViewManager = nullptr,
-          nsViewVisibility aVisibility = nsViewVisibility_kShow);
+  explicit nsView(nsViewManager* aViewManager = nullptr,
+                  nsViewVisibility aVisibility = nsViewVisibility_kShow);
 
   bool ForcedRepaint() { return mForcedRepaint; }
 
   // Do the actual work of ResetWidgetBounds, unconditionally.  Don't
   // call this method if we have no widget.
   void DoResetWidgetBounds(bool aMoveOnly, bool aInvalidateChangedSize);
   void InitializeWindow(bool aEnableDragDrop, bool aResetVisibility);
 
--- a/view/nsViewManager.h
+++ b/view/nsViewManager.h
@@ -245,17 +245,17 @@ public:
    * event.
    * We don't want to defer widget geometry changes all the time. Resizing a
    * popup from script doesn't need to be deferred, for example, especially
    * since popup widget geometry is observable from script and expected to
    * update synchronously.
    */
   class MOZ_STACK_CLASS AutoDisableRefresh {
   public:
-    AutoDisableRefresh(nsViewManager* aVM) {
+    explicit AutoDisableRefresh(nsViewManager* aVM) {
       if (aVM) {
         mRootVM = aVM->IncrementDisableRefreshCount();
       }
     }
     ~AutoDisableRefresh() {
       if (mRootVM) {
         mRootVM->DecrementDisableRefreshCount();
       }