Bug 916520. Rename nsClientRect(List) to mozilla::dom::DOMRect(List). r=khuey
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 20 Sep 2013 22:21:03 +1200
changeset 151771 8b94cd262ef573496482bf4f15783f7861197840
parent 151770 42f245833598ff5eadd2a5846a735c5b751b129b
child 151772 f78208b337db6ee279176b0110056f16d5fc9a1b
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-esr52@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs916520
milestone27.0a1
Bug 916520. Rename nsClientRect(List) to mozilla::dom::DOMRect(List). r=khuey
content/base/public/Element.h
content/base/src/DOMRect.cpp
content/base/src/DOMRect.h
content/base/src/Element.cpp
content/base/src/FragmentOrElement.cpp
content/base/src/moz.build
content/base/src/nsDOMCaretPosition.cpp
content/base/src/nsDOMCaretPosition.h
content/base/src/nsINode.cpp
content/base/src/nsRange.cpp
content/base/src/nsRange.h
content/events/src/nsDOMNotifyPaintEvent.cpp
content/events/src/nsDOMNotifyPaintEvent.h
content/events/src/nsDOMScrollAreaEvent.cpp
content/events/src/nsDOMScrollAreaEvent.h
content/events/src/nsPaintRequest.cpp
content/events/src/nsPaintRequest.h
content/html/content/src/moz.build
content/html/content/src/nsClientRect.cpp
content/html/content/src/nsClientRect.h
content/html/content/src/nsGenericHTMLElement.h
content/mathml/content/src/nsMathMLElement.h
content/svg/content/src/nsSVGElement.h
content/xml/content/src/nsXMLElement.h
content/xul/content/src/nsXULElement.h
dom/base/nsDOMWindowUtils.cpp
dom/bindings/Bindings.conf
dom/tests/mochitest/general/test_clientRects.html
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/CaretPosition.webidl
dom/webidl/ClientRect.webidl
dom/webidl/ClientRectList.webidl
dom/webidl/DOMRect.webidl
dom/webidl/DOMRectList.webidl
dom/webidl/Element.webidl
dom/webidl/LegacyQueryInterface.webidl
dom/webidl/NotifyPaintEvent.webidl
dom/webidl/PaintRequest.webidl
dom/webidl/Range.webidl
dom/webidl/moz.build
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/xul/base/src/nsPopupBoxObject.cpp
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -27,17 +27,17 @@
 #include "nsIDOMXPathNSResolver.h"
 #include "nsPresContext.h"
 #include "nsDOMClassInfoID.h" // DOMCI_DATA
 #include "mozilla/CORSMode.h"
 #include "mozilla/Attributes.h"
 #include "nsIScrollableFrame.h"
 #include "mozilla/dom/Attr.h"
 #include "nsISMILAttr.h"
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 #include "nsAttrValue.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "Units.h"
 
 class nsIDOMEventListener;
 class nsIFrame;
 class nsIDOMMozNamedAttrMap;
@@ -45,18 +45,16 @@ class nsIDOMCSSStyleDeclaration;
 class nsIURI;
 class nsINodeInfo;
 class nsIControllers;
 class nsEventChainVisitor;
 class nsEventListenerManager;
 class nsIScrollableFrame;
 class nsAttrValueOrString;
 class ContentUnbinder;
-class nsClientRect;
-class nsClientRectList;
 class nsContentList;
 class nsDOMTokenList;
 struct nsRect;
 class nsEventStateManager;
 class nsFocusManager;
 class nsGlobalWindow;
 class nsICSSDeclaration;
 class nsISMILAttr;
@@ -105,16 +103,18 @@ enum {
 // Make sure we have space for our bits
 ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET);
 
 namespace mozilla {
 namespace dom {
 
 class Link;
 class UndoManager;
+class DOMRect;
+class DOMRectList;
 
 // IID for the dom::Element interface
 #define NS_ELEMENT_IID \
 { 0xec962aa7, 0x53ee, 0x46ff, \
   { 0x90, 0x34, 0x68, 0xea, 0x79, 0x9d, 0x7d, 0xf7 } }
 
 class Element : public FragmentOrElement
 {
@@ -642,18 +642,18 @@ public:
                                           ErrorResult& aError);
   already_AddRefed<Attr> RemoveAttributeNode(Attr& aOldAttr,
                                              ErrorResult& aError);
   Attr* GetAttributeNodeNS(const nsAString& aNamespaceURI,
                            const nsAString& aLocalName);
   already_AddRefed<Attr> SetAttributeNodeNS(Attr& aNewAttr,
                                             ErrorResult& aError);
 
-  already_AddRefed<nsClientRectList> GetClientRects();
-  already_AddRefed<nsClientRect> GetBoundingClientRect();
+  already_AddRefed<DOMRectList> GetClientRects();
+  already_AddRefed<DOMRect> GetBoundingClientRect();
   void ScrollIntoView(bool aTop);
   int32_t ScrollTop()
   {
     nsIScrollableFrame* sf = GetScrollFrame();
     return sf ? sf->GetScrollPositionCSSPixels().y : 0;
   }
   void SetScrollTop(int32_t aScrollTop)
   {
rename from content/html/content/src/nsClientRect.cpp
rename to content/base/src/DOMRect.cpp
--- a/content/html/content/src/nsClientRect.cpp
+++ b/content/base/src/DOMRect.cpp
@@ -1,95 +1,95 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsClientRect.h"
+#include "DOMRect.h"
 
 #include "nsPresContext.h"
-#include "mozilla/dom/ClientRectListBinding.h"
-#include "mozilla/dom/ClientRectBinding.h"
+#include "mozilla/dom/DOMRectListBinding.h"
+#include "mozilla/dom/DOMRectBinding.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsClientRect, mParent)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsClientRect)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsClientRect)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsClientRect)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMRect, mParent)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMRect)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMRect)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRect)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsIDOMClientRect)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 #define FORWARD_GETTER(_name)                                                   \
   NS_IMETHODIMP                                                                 \
-  nsClientRect::Get ## _name(float* aResult)                                    \
+  DOMRect::Get ## _name(float* aResult)                                         \
   {                                                                             \
     *aResult = _name();                                                         \
     return NS_OK;                                                               \
   }
 
 FORWARD_GETTER(Left)
 FORWARD_GETTER(Top)
 FORWARD_GETTER(Right)
 FORWARD_GETTER(Bottom)
 FORWARD_GETTER(Width)
 FORWARD_GETTER(Height)
 
 JSObject*
-nsClientRect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
+DOMRect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   MOZ_ASSERT(mParent);
-  return ClientRectBinding::Wrap(aCx, aScope, this);
+  return DOMRectBinding::Wrap(aCx, aScope, this);
 }
 
 // -----------------------------------------------------------------------------
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(nsClientRectList, mParent, mArray)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_2(DOMRectList, mParent, mArray)
 
-NS_INTERFACE_TABLE_HEAD(nsClientRectList)
+NS_INTERFACE_TABLE_HEAD(DOMRectList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
-  NS_INTERFACE_TABLE1(nsClientRectList, nsIDOMClientRectList)
-  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsClientRectList)
+  NS_INTERFACE_TABLE1(DOMRectList, nsIDOMClientRectList)
+  NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(DOMRectList)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsClientRectList)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsClientRectList)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMRectList)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMRectList)
 
 
 NS_IMETHODIMP    
-nsClientRectList::GetLength(uint32_t* aLength)
+DOMRectList::GetLength(uint32_t* aLength)
 {
   *aLength = Length();
   return NS_OK;
 }
 
 NS_IMETHODIMP    
-nsClientRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn)
+DOMRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn)
 {
   NS_IF_ADDREF(*aReturn = Item(aIndex));
   return NS_OK;
 }
 
 JSObject*
-nsClientRectList::WrapObject(JSContext *cx, JS::Handle<JSObject*> scope)
+DOMRectList::WrapObject(JSContext *cx, JS::Handle<JSObject*> scope)
 {
-  return mozilla::dom::ClientRectListBinding::Wrap(cx, scope, this);
+  return mozilla::dom::DOMRectListBinding::Wrap(cx, scope, this);
 }
 
 static double
 RoundFloat(double aValue)
 {
   return floor(aValue + 0.5);
 }
 
 void
-nsClientRect::SetLayoutRect(const nsRect& aLayoutRect)
+DOMRect::SetLayoutRect(const nsRect& aLayoutRect)
 {
   double scale = 65536.0;
   // Round to the nearest 1/scale units. We choose scale so it can be represented
   // exactly by machine floating point.
   double scaleInv = 1/scale;
   double t2pScaled = scale/nsPresContext::AppUnitsPerCSSPixel();
   double x = RoundFloat(aLayoutRect.x*t2pScaled)*scaleInv;
   double y = RoundFloat(aLayoutRect.y*t2pScaled)*scaleInv;
rename from content/html/content/src/nsClientRect.h
rename to content/base/src/DOMRect.h
--- a/content/html/content/src/nsClientRect.h
+++ b/content/base/src/DOMRect.h
@@ -1,47 +1,49 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef NSCLIENTRECT_H_
-#define NSCLIENTRECT_H_
+#ifndef MOZILLA_DOMRECT_H_
+#define MOZILLA_DOMRECT_H_
 
 #include "nsIDOMClientRect.h"
 #include "nsIDOMClientRectList.h"
 #include "nsTArray.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsWrapperCache.h"
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 struct nsRect;
 
-class nsClientRect MOZ_FINAL : public nsIDOMClientRect
-                             , public nsWrapperCache
+namespace mozilla {
+namespace dom {
+
+class DOMRect MOZ_FINAL : public nsIDOMClientRect
+                        , public nsWrapperCache
 {
 public:
-  nsClientRect(nsISupports* aParent)
+  DOMRect(nsISupports* aParent)
     : mParent(aParent), mX(0.0), mY(0.0), mWidth(0.0), mHeight(0.0)
   {
     SetIsDOMBinding();
   }
-  virtual ~nsClientRect() {}
-
+  virtual ~DOMRect() {}
   
   void SetRect(float aX, float aY, float aWidth, float aHeight) {
     mX = aX; mY = aY; mWidth = aWidth; mHeight = aHeight;
   }
   void SetLayoutRect(const nsRect& aLayoutRect);
 
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsClientRect)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRect)
   NS_DECL_NSIDOMCLIENTRECT
 
 
   nsISupports* GetParentObject() const
   {
     MOZ_ASSERT(mParent);
     return mParent;
   }
@@ -79,74 +81,77 @@ public:
     return mHeight;
   }
 
 protected:
   nsCOMPtr<nsISupports> mParent;
   float mX, mY, mWidth, mHeight;
 };
 
-class nsClientRectList MOZ_FINAL : public nsIDOMClientRectList,
-                                   public nsWrapperCache
+class DOMRectList MOZ_FINAL : public nsIDOMClientRectList,
+                              public nsWrapperCache
 {
 public:
-  nsClientRectList(nsISupports *aParent) : mParent(aParent)
+  DOMRectList(nsISupports *aParent) : mParent(aParent)
   {
     SetIsDOMBinding();
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsClientRectList)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectList)
 
   NS_DECL_NSIDOMCLIENTRECTLIST
   
   virtual JSObject* WrapObject(JSContext *cx,
                                JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject()
   {
     return mParent;
   }
 
-  void Append(nsClientRect* aElement) { mArray.AppendElement(aElement); }
+  void Append(DOMRect* aElement) { mArray.AppendElement(aElement); }
 
-  static nsClientRectList* FromSupports(nsISupports* aSupports)
+  static DOMRectList* FromSupports(nsISupports* aSupports)
   {
 #ifdef DEBUG
     {
       nsCOMPtr<nsIDOMClientRectList> list_qi = do_QueryInterface(aSupports);
 
       // If this assertion fires the QI implementation for the object in
       // question doesn't use the nsIDOMClientRectList pointer as the nsISupports
       // pointer. That must be fixed, or we'll crash...
       NS_ASSERTION(list_qi == static_cast<nsIDOMClientRectList*>(aSupports),
                    "Uh, fix QI!");
     }
 #endif
 
-    return static_cast<nsClientRectList*>(aSupports);
+    return static_cast<DOMRectList*>(aSupports);
   }
 
   uint32_t Length()
   {
     return mArray.Length();
   }
-  nsClientRect* Item(uint32_t aIndex)
+  DOMRect* Item(uint32_t aIndex)
   {
     return mArray.SafeElementAt(aIndex);
   }
-  nsClientRect* IndexedGetter(uint32_t aIndex, bool& aFound)
+  DOMRect* IndexedGetter(uint32_t aIndex, bool& aFound)
   {
     aFound = aIndex < mArray.Length();
     if (!aFound) {
       return nullptr;
     }
     return mArray[aIndex];
   }
 
 protected:
-  virtual ~nsClientRectList() {}
+  virtual ~DOMRectList() {}
 
-  nsTArray< nsRefPtr<nsClientRect> > mArray;
+  nsTArray< nsRefPtr<DOMRect> > mArray;
   nsCOMPtr<nsISupports> mParent;
 };
 
-#endif /*NSCLIENTRECT_H_*/
+}
+}
+
+#endif /*MOZILLA_DOMRECT_H_*/
--- a/content/base/src/Element.cpp
+++ b/content/base/src/Element.cpp
@@ -65,17 +65,17 @@
 #ifdef DEBUG
 #include "nsRange.h"
 #endif
 
 #include "nsBindingManager.h"
 #include "nsXBLBinding.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIBoxObject.h"
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 #include "nsSVGUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 #include "ChildIterator.h"
 
 #include "nsIDOMEventListener.h"
 #include "nsIWebNavigation.h"
@@ -642,38 +642,38 @@ Element::GetClientAreaRect()
     // a scroll view, see bug 180552, bug 227567.
     return styledFrame->GetPaddingRect() - styledFrame->GetPositionIgnoringScrolling();
   }
 
   // SVG nodes reach here and just return 0
   return nsRect(0, 0, 0, 0);
 }
 
-already_AddRefed<nsClientRect>
+already_AddRefed<DOMRect>
 Element::GetBoundingClientRect()
 {
-  nsRefPtr<nsClientRect> rect = new nsClientRect(this);
+  nsRefPtr<DOMRect> rect = new DOMRect(this);
   
   nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
   if (!frame) {
     // display:none, perhaps? Return the empty rect
     return rect.forget();
   }
 
   nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(frame,
           nsLayoutUtils::GetContainingBlockForClientRect(frame),
           nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
   rect->SetLayoutRect(r);
   return rect.forget();
 }
 
-already_AddRefed<nsClientRectList>
+already_AddRefed<DOMRectList>
 Element::GetClientRects()
 {
-  nsRefPtr<nsClientRectList> rectList = new nsClientRectList(this);
+  nsRefPtr<DOMRectList> rectList = new DOMRectList(this);
 
   nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
   if (!frame) {
     // display:none, perhaps? Return an empty list
     return rectList.forget();
   }
 
   nsLayoutUtils::RectListBuilder builder(rectList);
--- a/content/base/src/FragmentOrElement.cpp
+++ b/content/base/src/FragmentOrElement.cpp
@@ -64,17 +64,16 @@
 #ifdef DEBUG
 #include "nsRange.h"
 #endif
 
 #include "nsBindingManager.h"
 #include "nsXBLBinding.h"
 #include "nsPIDOMWindow.h"
 #include "nsPIBoxObject.h"
-#include "nsClientRect.h"
 #include "nsSVGUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 
 #include "nsIDOMEventListener.h"
 #include "nsIWebNavigation.h"
 #include "nsIBaseWindow.h"
--- a/content/base/src/moz.build
+++ b/content/base/src/moz.build
@@ -51,29 +51,31 @@ if CONFIG['INTEL_ARCHITECTURE']:
         'nsTextFragmentSSE2.cpp',
     ]
 
 EXPORTS.mozilla.dom += [
     'Attr.h',
     'Comment.h',
     'DOMImplementation.h',
     'DOMParser.h',
+    'DOMRect.h',
     'DocumentFragment.h',
     'DocumentType.h',
     'EventSource.h',
     'Link.h',
     'NodeIterator.h',
     'Text.h',
     'TreeWalker.h',
 ]
 
 CPP_SOURCES += [
     'Attr.cpp',
     'Comment.cpp',
     'DOMImplementation.cpp',
+    'DOMRect.cpp',
     'DirectionalityUtils.cpp',
     'DocumentFragment.cpp',
     'DocumentType.cpp',
     'DOMParser.cpp',
     'Element.cpp',
     'EventSource.cpp',
     'FileIOObject.cpp',
     'FragmentOrElement.cpp',
--- a/content/base/src/nsDOMCaretPosition.cpp
+++ b/content/base/src/nsDOMCaretPosition.cpp
@@ -1,41 +1,43 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDOMCaretPosition.h"
 
 #include "mozilla/dom/CaretPositionBinding.h"
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 #include "nsRange.h"
 
+using namespace mozilla::dom;
+
 nsDOMCaretPosition::nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset)
   : mOffset(aOffset), mOffsetNode(aNode), mAnonymousContentNode(nullptr)
 {
   SetIsDOMBinding();
 }
 
 nsDOMCaretPosition::~nsDOMCaretPosition()
 {
 }
 
 nsINode* nsDOMCaretPosition::GetOffsetNode() const
 {
   return mOffsetNode;
 }
 
-already_AddRefed<nsClientRect>
+already_AddRefed<DOMRect>
 nsDOMCaretPosition::GetClientRect() const
 {
   if (!mOffsetNode) {
     return nullptr;
   }
 
-  nsRefPtr<nsClientRect> rect;
+  nsRefPtr<DOMRect> rect;
   nsRefPtr<nsRange> domRange;
   nsCOMPtr<nsINode> node;
 
   if (mAnonymousContentNode) {
     node = mAnonymousContentNode;
   } else {
     node = mOffsetNode;
   }
--- a/content/base/src/nsDOMCaretPosition.h
+++ b/content/base/src/nsDOMCaretPosition.h
@@ -5,29 +5,35 @@
 #ifndef nsDOMCaretPosition_h
 #define nsDOMCaretPosition_h
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsCOMPtr.h"
 #include "nsINode.h"
 #include "nsWrapperCache.h"
 
-class nsClientRect;
+namespace mozilla {
+namespace dom {
+class DOMRect;
+}
+}
 
 /**
  * Implementation of a DOM Caret Position, which is a node and offset within
  * that node, in the DOM tree.
  *
  * http://www.w3.org/TR/cssom-view/#dom-documentview-caretrangefrompoint
  *
  * @see Document::caretPositionFromPoint(float x, float y)
  */
 class nsDOMCaretPosition : public nsISupports,
                            public nsWrapperCache
 {
+  typedef mozilla::dom::DOMRect DOMRect;
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMCaretPosition)
 
   nsDOMCaretPosition(nsINode* aNode, uint32_t aOffset);
 
   /**
    * Retrieve the offset (character position within the DOM node) of the
@@ -50,17 +56,17 @@ public:
 
   /**
    * Retrieve the bounding rectangle of this CaretPosition object.
    *
    * @returns An nsClientRect representing the bounding rectangle of this
    *          CaretPosition, if one can be successfully determined, otherwise
    *          nullptr.
    */
-  already_AddRefed<nsClientRect> GetClientRect() const;
+  already_AddRefed<DOMRect> GetClientRect() const;
 
   /**
    * Set the anonymous content node that is the actual parent of this
    * CaretPosition object. In situations where the DOM node for a CaretPosition
    * actually lies within an anonymous content node (e.g. a textarea), the
    * actual parent is not set as the offset node. This is used to get the
    * correct bounding box of a CaretPosition object that lies within a textarea
    * or input element.
--- a/content/base/src/nsINode.cpp
+++ b/content/base/src/nsINode.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/MutationEvent.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Util.h"
 #include "nsAsyncDOMEvent.h"
 #include "nsAttrValueOrString.h"
 #include "nsBindingManager.h"
 #include "nsCCUncollectableMarker.h"
-#include "nsClientRect.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentList.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDocument.h"
 #include "mozilla/dom/Attr.h"
 #include "nsDOMAttributeMap.h"
 #include "nsDOMCID.h"
--- a/content/base/src/nsRange.cpp
+++ b/content/base/src/nsRange.cpp
@@ -18,23 +18,23 @@
 #include "nsIDocument.h"
 #include "nsIDOMText.h"
 #include "nsError.h"
 #include "nsIContentIterator.h"
 #include "nsIDOMNodeList.h"
 #include "nsGkAtoms.h"
 #include "nsContentUtils.h"
 #include "nsGenericDOMDataNode.h"
-#include "nsClientRect.h"
 #include "nsLayoutUtils.h"
 #include "nsTextFrame.h"
 #include "nsFontFaceList.h"
 #include "mozilla/dom/DocumentFragment.h"
 #include "mozilla/dom/DocumentType.h"
 #include "mozilla/dom/RangeBinding.h"
+#include "mozilla/dom/DOMRect.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Likely.h"
 #include "nsCSSFrameConstructor.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 JSObject*
@@ -2869,20 +2869,20 @@ static void CollectClientRects(nsLayoutU
 
 NS_IMETHODIMP
 nsRange::GetBoundingClientRect(nsIDOMClientRect** aResult)
 {
   *aResult = GetBoundingClientRect().get();
   return NS_OK;
 }
 
-already_AddRefed<nsClientRect>
+already_AddRefed<DOMRect>
 nsRange::GetBoundingClientRect()
 {
-  nsRefPtr<nsClientRect> rect = new nsClientRect(ToSupports(this));
+  nsRefPtr<DOMRect> rect = new DOMRect(ToSupports(this));
   if (!mStartParent) {
     return rect.forget();
   }
 
   nsLayoutUtils::RectAccumulator accumulator;
   CollectClientRects(&accumulator, this, mStartParent, mStartOffset, 
     mEndParent, mEndOffset);
 
@@ -2894,25 +2894,25 @@ nsRange::GetBoundingClientRect()
 
 NS_IMETHODIMP
 nsRange::GetClientRects(nsIDOMClientRectList** aResult)
 {
   *aResult = GetClientRects().get();
   return NS_OK;
 }
 
-already_AddRefed<nsClientRectList>
+already_AddRefed<DOMRectList>
 nsRange::GetClientRects()
 {
   if (!mStartParent) {
     return nullptr;
   }
 
-  nsRefPtr<nsClientRectList> rectList =
-    new nsClientRectList(static_cast<nsIDOMRange*>(this));
+  nsRefPtr<DOMRectList> rectList =
+    new DOMRectList(static_cast<nsIDOMRange*>(this));
 
   nsLayoutUtils::RectListBuilder builder(rectList);
 
   CollectClientRects(&builder, this, mStartParent, mStartOffset, 
     mEndParent, mEndOffset);
   return rectList.forget();
 }
 
--- a/content/base/src/nsRange.h
+++ b/content/base/src/nsRange.h
@@ -15,31 +15,32 @@
 #include "nsINode.h"
 #include "nsIDocument.h"
 #include "nsIDOMNode.h"
 #include "prmon.h"
 #include "nsStubMutationObserver.h"
 #include "nsWrapperCache.h"
 #include "mozilla/Attributes.h"
 
-class nsClientRect;
-class nsClientRectList;
-
 namespace mozilla {
 class ErrorResult;
 namespace dom {
 class DocumentFragment;
+class DOMRect;
+class DOMRectList;
 }
 }
 
 class nsRange MOZ_FINAL : public nsIDOMRange,
                           public nsStubMutationObserver,
                           public nsWrapperCache
 {
   typedef mozilla::ErrorResult ErrorResult;
+  typedef mozilla::dom::DOMRect DOMRect;
+  typedef mozilla::dom::DOMRectList DOMRectList;
 
 public:
   nsRange(nsINode* aNode)
     : mRoot(nullptr)
     , mStartOffset(0)
     , mEndOffset(0)
     , mIsPositioned(false)
     , mIsDetached(false)
@@ -209,18 +210,18 @@ public:
   void SelectNodeContents(nsINode& aNode, ErrorResult& aErr);
   void SetEnd(nsINode& aNode, uint32_t aOffset, ErrorResult& aErr);
   void SetEndAfter(nsINode& aNode, ErrorResult& aErr);
   void SetEndBefore(nsINode& aNode, ErrorResult& aErr);
   void SetStart(nsINode& aNode, uint32_t aOffset, ErrorResult& aErr);
   void SetStartAfter(nsINode& aNode, ErrorResult& aErr);
   void SetStartBefore(nsINode& aNode, ErrorResult& aErr);
   void SurroundContents(nsINode& aNode, ErrorResult& aErr);
-  already_AddRefed<nsClientRect> GetBoundingClientRect();
-  already_AddRefed<nsClientRectList> GetClientRects();
+  already_AddRefed<DOMRect> GetBoundingClientRect();
+  already_AddRefed<DOMRectList> GetClientRects();
 
   nsINode* GetParentObject() const { return mOwner; }
   virtual JSObject* WrapObject(JSContext* cx,
                                JS::Handle<JSObject*> scope) MOZ_OVERRIDE MOZ_FINAL;
 
 private:
   // no copy's or assigns
   nsRange(const nsRange&);
--- a/content/events/src/nsDOMNotifyPaintEvent.cpp
+++ b/content/events/src/nsDOMNotifyPaintEvent.cpp
@@ -3,18 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/basictypes.h"
 #include "ipc/IPCMessageUtils.h"
 #include "mozilla/GfxMessageUtils.h"
 #include "nsDOMNotifyPaintEvent.h"
 #include "nsContentUtils.h"
-#include "nsClientRect.h"
 #include "nsPaintRequest.h"
+#include "mozilla/dom/DOMRect.h"
+
+using namespace mozilla::dom;
 
 nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
                                              nsPresContext* aPresContext,
                                              nsEvent* aEvent,
                                              uint32_t aEventType,
                                              nsInvalidateRequestList* aInvalidateRequests)
 : nsDOMEvent(aOwner, aPresContext, aEvent)
 {
@@ -49,45 +51,45 @@ nsDOMNotifyPaintEvent::GetRegion()
 
 NS_IMETHODIMP
 nsDOMNotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult)
 {
   *aResult = BoundingClientRect().get();
   return NS_OK;
 }
 
-already_AddRefed<nsClientRect>
+already_AddRefed<DOMRect>
 nsDOMNotifyPaintEvent::BoundingClientRect()
 {
-  nsRefPtr<nsClientRect> rect = new nsClientRect(ToSupports(this));
+  nsRefPtr<DOMRect> rect = new DOMRect(ToSupports(this));
 
   if (mPresContext) {
     rect->SetLayoutRect(GetRegion().GetBounds());
   }
 
   return rect.forget();
 }
 
 NS_IMETHODIMP
 nsDOMNotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult)
 {
   *aResult = ClientRects().get();
   return NS_OK;
 }
 
-already_AddRefed<nsClientRectList>
+already_AddRefed<DOMRectList>
 nsDOMNotifyPaintEvent::ClientRects()
 {
   nsISupports* parent = ToSupports(this);
-  nsRefPtr<nsClientRectList> rectList = new nsClientRectList(parent);
+  nsRefPtr<DOMRectList> rectList = new DOMRectList(parent);
 
   nsRegion r = GetRegion();
   nsRegionRectIterator iter(r);
   for (const nsRect* rgnRect = iter.Next(); rgnRect; rgnRect = iter.Next()) {
-    nsRefPtr<nsClientRect> rect = new nsClientRect(parent);
+    nsRefPtr<DOMRect> rect = new DOMRect(parent);
     
     rect->SetLayoutRect(*rgnRect);
     rectList->Append(rect);
   }
 
   return rectList.forget();
 }
 
--- a/content/events/src/nsDOMNotifyPaintEvent.h
+++ b/content/events/src/nsDOMNotifyPaintEvent.h
@@ -8,22 +8,30 @@
 
 #include "mozilla/Attributes.h"
 #include "nsIDOMNotifyPaintEvent.h"
 #include "nsDOMEvent.h"
 #include "nsPresContext.h"
 #include "mozilla/dom/NotifyPaintEventBinding.h"
 
 class nsPaintRequestList;
-class nsClientRectList;
-class nsClientRect;
+
+namespace mozilla {
+namespace dom {
+class DOMRect;
+class DOMRectList;
+}
+}
 
 class nsDOMNotifyPaintEvent : public nsDOMEvent,
                               public nsIDOMNotifyPaintEvent
 {
+  typedef mozilla::dom::DOMRect DOMRect;
+  typedef mozilla::dom::DOMRectList DOMRectList;
+
 public:
   nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
                         nsPresContext*           aPresContext,
                         nsEvent*                 aEvent,
                         uint32_t                 aEventType,
                         nsInvalidateRequestList* aInvalidateRequests);
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -40,19 +48,19 @@ public:
   NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE;
 
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return mozilla::dom::NotifyPaintEventBinding::Wrap(aCx, aScope, this);
   }
 
-  already_AddRefed<nsClientRectList> ClientRects();
+  already_AddRefed<DOMRectList> ClientRects();
 
-  already_AddRefed<nsClientRect> BoundingClientRect();
+  already_AddRefed<DOMRect> BoundingClientRect();
 
   already_AddRefed<nsPaintRequestList> PaintRequests();
 private:
   nsRegion GetRegion();
 
   nsTArray<nsInvalidateRequestList::Request> mInvalidateRequests;
 };
 
--- a/content/events/src/nsDOMScrollAreaEvent.cpp
+++ b/content/events/src/nsDOMScrollAreaEvent.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/basictypes.h"
 #include "ipc/IPCMessageUtils.h"
 #include "mozilla/ContentEvents.h"
 
 #include "nsDOMScrollAreaEvent.h"
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 
 using namespace mozilla;
 
 nsDOMScrollAreaEvent::nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
                                            nsPresContext *aPresContext,
                                            InternalScrollAreaEvent* aEvent)
   : nsDOMUIEvent(aOwner, aPresContext, aEvent)
   , mClientArea(nullptr)
--- a/content/events/src/nsDOMScrollAreaEvent.h
+++ b/content/events/src/nsDOMScrollAreaEvent.h
@@ -6,22 +6,24 @@
 #ifndef nsDOMScrollAreaEvent_h__
 #define nsDOMScrollAreaEvent_h__
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "nsIDOMScrollAreaEvent.h"
 #include "nsDOMUIEvent.h"
 
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/ScrollAreaEventBinding.h"
 
 class nsDOMScrollAreaEvent : public nsDOMUIEvent,
                              public nsIDOMScrollAreaEvent
 {
+  typedef mozilla::dom::DOMRect DOMRect;
+
 public:
   nsDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
                        nsPresContext *aPresContext,
                        mozilla::InternalScrollAreaEvent* aEvent);
   virtual ~nsDOMScrollAreaEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
 
@@ -72,12 +74,12 @@ public:
                            float aWidth, float aHeight,
                            mozilla::ErrorResult& aRv)
   {
     aRv = InitScrollAreaEvent(aType, aCanBubble, aCancelable, aView,
                               aDetail, aX, aY, aWidth, aHeight);
   }
 
 protected:
-  nsClientRect mClientArea;
+  DOMRect mClientArea;
 };
 
 #endif // nsDOMScrollAreaEvent_h__
--- a/content/events/src/nsPaintRequest.cpp
+++ b/content/events/src/nsPaintRequest.cpp
@@ -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/. */
 
 #include "nsPaintRequest.h"
 
 #include "mozilla/dom/PaintRequestBinding.h"
 #include "mozilla/dom/PaintRequestListBinding.h"
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequest, mParent)
 
 NS_INTERFACE_TABLE_HEAD(nsPaintRequest)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -24,28 +24,28 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintR
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequest)
 
 /* virtual */ JSObject*
 nsPaintRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
 {
   return PaintRequestBinding::Wrap(aCx, aScope, this);
 }
 
-already_AddRefed<nsClientRect>
+already_AddRefed<DOMRect>
 nsPaintRequest::ClientRect()
 {
-  nsRefPtr<nsClientRect> clientRect = new nsClientRect(this);
+  nsRefPtr<DOMRect> clientRect = new DOMRect(this);
   clientRect->SetLayoutRect(mRequest.mRect);
   return clientRect.forget();
 }
 
 NS_IMETHODIMP
 nsPaintRequest::GetClientRect(nsIDOMClientRect** aResult)
 {
-  nsRefPtr<nsClientRect> clientRect = ClientRect();
+  nsRefPtr<DOMRect> clientRect = ClientRect();
   clientRect.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPaintRequest::GetXPCOMReason(nsAString& aResult)
 {
   GetReason(aResult);
--- a/content/events/src/nsPaintRequest.h
+++ b/content/events/src/nsPaintRequest.h
@@ -7,21 +7,27 @@
 #define NSPAINTREQUEST_H_
 
 #include "nsIDOMPaintRequest.h"
 #include "nsPresContext.h"
 #include "nsIDOMEvent.h"
 #include "mozilla/Attributes.h"
 #include "nsWrapperCache.h"
 
-class nsClientRect;
+namespace mozilla {
+namespace dom {
+class DOMRect;
+}
+}
 
 class nsPaintRequest MOZ_FINAL : public nsIDOMPaintRequest
                                , public nsWrapperCache
 {
+  typedef mozilla::dom::DOMRect DOMRect;
+
 public:
   nsPaintRequest(nsIDOMEvent* aParent)
     : mParent(aParent)
   {
     mRequest.mFlags = 0;
     SetIsDOMBinding();
   }
 
@@ -32,17 +38,17 @@ public:
   virtual JSObject* WrapObject(JSContext* aCx,
                                JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
 
   nsIDOMEvent* GetParentObject() const
   {
     return mParent;
   }
 
-  already_AddRefed<nsClientRect> ClientRect();
+  already_AddRefed<DOMRect> ClientRect();
   void GetReason(nsAString& aResult) const
   {
     aResult.AssignLiteral("repaint");
   }
 
   void SetRequest(const nsInvalidateRequestList::Request& aRequest)
   { mRequest = aRequest; }
 
--- a/content/html/content/src/moz.build
+++ b/content/html/content/src/moz.build
@@ -3,17 +3,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'content'
 
 EXPORTS += [
     'HTMLPropertiesCollection.h',
-    'nsClientRect.h',
     'nsGenericHTMLElement.h',
     'nsHTMLDNSPrefetch.h',
 ]
 
 EXPORTS.mozilla.dom += [
     'HTMLAnchorElement.h',
     'HTMLAreaElement.h',
     'HTMLBRElement.h',
@@ -137,17 +136,16 @@ CPP_SOURCES += [
     'HTMLTitleElement.cpp',
     'HTMLTrackElement.cpp',
     'HTMLUnknownElement.cpp',
     'HTMLVideoElement.cpp',
     'MediaError.cpp',
     'TimeRanges.cpp',
     'UndoManager.cpp',
     'ValidityState.cpp',
-    'nsClientRect.cpp',
     'nsDOMStringMap.cpp',
     'nsFormSubmission.cpp',
     'nsGenericHTMLElement.cpp',
     'nsGenericHTMLFrameElement.cpp',
     'nsHTMLDNSPrefetch.cpp',
     'HTMLFormElement.cpp',
     'nsIConstraintValidation.cpp',
     'nsRadioVisitor.cpp',
--- a/content/html/content/src/nsGenericHTMLElement.h
+++ b/content/html/content/src/nsGenericHTMLElement.h
@@ -10,16 +10,17 @@
 #include "nsMappedAttributeElement.h"
 #include "nsIDOMHTMLElement.h"
 #include "nsINameSpaceManager.h"  // for kNameSpaceID_None
 #include "nsIFormControl.h"
 #include "nsGkAtoms.h"
 #include "nsContentCreatorFunctions.h"
 #include "mozilla/ErrorResult.h"
 #include "nsIDOMHTMLMenuElement.h"
+#include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/ValidityState.h"
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIDOMNodeList;
 class nsIFrame;
 class nsIStyleRule;
 class nsChildContentList;
@@ -33,17 +34,17 @@ class nsILayoutHistoryState;
 class nsIEditor;
 struct nsRect;
 struct nsSize;
 class nsIDOMHTMLMenuElement;
 class nsIDOMHTMLCollection;
 class nsDOMSettableTokenList;
 
 namespace mozilla {
-namespace dom{
+namespace dom {
 class HTMLFormElement;
 class HTMLPropertiesCollection;
 class HTMLMenuElement;
 }
 }
 
 typedef nsMappedAttributeElement nsGenericHTMLElementBase;
 
--- a/content/mathml/content/src/nsMathMLElement.h
+++ b/content/mathml/content/src/nsMathMLElement.h
@@ -5,16 +5,17 @@
 
 #ifndef nsMathMLElement_h
 #define nsMathMLElement_h
 
 #include "mozilla/Attributes.h"
 #include "nsMappedAttributeElement.h"
 #include "nsIDOMElement.h"
 #include "Link.h"
+#include "mozilla/dom/DOMRect.h"
 
 class nsCSSValue;
 
 typedef nsMappedAttributeElement nsMathMLElementBase;
 
 /*
  * The base class for MathML elements.
  */
--- a/content/svg/content/src/nsSVGElement.h
+++ b/content/svg/content/src/nsSVGElement.h
@@ -13,16 +13,17 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/css/StyleRule.h"
 #include "nsAutoPtr.h"
 #include "nsChangeHint.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
+#include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/Element.h"
 #include "nsISupportsImpl.h"
 #include "nsStyledElement.h"
 #include "nsSVGClass.h"
 #include "nsIDOMSVGElement.h"
 
 class nsSVGAngle;
 class nsSVGBoolean;
--- a/content/xml/content/src/nsXMLElement.h
+++ b/content/xml/content/src/nsXMLElement.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsXMLElement_h___
 #define nsXMLElement_h___
 
 #include "mozilla/Attributes.h"
 #include "nsIDOMElement.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/dom/DOMRect.h"
 
 class nsXMLElement : public mozilla::dom::Element,
                      public nsIDOMElement
 {
 public:
   nsXMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
     : mozilla::dom::Element(aNodeInfo)
   {
--- a/content/xul/content/src/nsXULElement.h
+++ b/content/xul/content/src/nsXULElement.h
@@ -30,16 +30,17 @@
 #include "nsIBoxObject.h"
 #include "nsLayoutCID.h"
 #include "nsAttrAndChildArray.h"
 #include "nsGkAtoms.h"
 #include "nsAutoPtr.h"
 #include "nsStyledElement.h"
 #include "nsIFrameLoader.h"
 #include "nsFrameLoader.h"
+#include "mozilla/dom/DOMRect.h"
 
 class nsIDocument;
 class nsString;
 class nsIDocShell;
 class nsXULPrototypeDocument;
 
 class nsIObjectInputStream;
 class nsIObjectOutputStream;
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -47,17 +47,17 @@
 #include "nsIPresShell.h"
 #include "nsStyleAnimation.h"
 #include "nsCSSProps.h"
 #include "nsDOMFile.h"
 #include "nsTArrayHelpers.h"
 #include "nsIDocShell.h"
 #include "nsIContentViewer.h"
 #include "nsIMarkupDocumentViewer.h"
-#include "nsClientRect.h"
+#include "mozilla/dom/DOMRect.h"
 #include <algorithm>
 
 #if defined(MOZ_X11) && defined(MOZ_WIDGET_GTK)
 #include <gdk/gdk.h>
 #include <gdk/gdkx.h>
 #endif
 
 #include "Layers.h"
@@ -1574,17 +1574,17 @@ nsDOMWindowUtils::GetBoundsWithoutFlushi
 
   nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
   NS_ENSURE_STATE(window);
 
   nsresult rv;
   nsCOMPtr<nsIContent> content = do_QueryInterface(aElement, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsRefPtr<nsClientRect> rect = new nsClientRect(window);
+  nsRefPtr<DOMRect> rect = new DOMRect(window);
   nsIFrame* frame = content->GetPrimaryFrame();
 
   if (frame) {
     nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(frame,
                nsLayoutUtils::GetContainingBlockForClientRect(frame),
                nsLayoutUtils::RECTS_ACCOUNT_FOR_TRANSFORMS);
     rect->SetLayoutRect(r);
   }
@@ -1614,17 +1614,17 @@ nsDOMWindowUtils::GetRootBounds(nsIDOMCl
       bounds = sf->GetScrollRange();
       bounds.width += sf->GetScrollPortRect().width;
       bounds.height += sf->GetScrollPortRect().height;
     } else if (presShell->GetRootFrame()) {
       bounds = presShell->GetRootFrame()->GetRect();
     }
   }
 
-  nsRefPtr<nsClientRect> rect = new nsClientRect(window);
+  nsRefPtr<DOMRect> rect = new DOMRect(window);
   rect->SetRect(nsPresContext::AppUnitsToFloatCSSPixels(bounds.x),
                 nsPresContext::AppUnitsToFloatCSSPixels(bounds.y),
                 nsPresContext::AppUnitsToFloatCSSPixels(bounds.width),
                 nsPresContext::AppUnitsToFloatCSSPixels(bounds.height));
   rect.forget(aResult);
   return NS_OK;
 }
 
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -201,23 +201,18 @@ DOMInterfaces = {
     'nativeType': 'nsDOMCaretPosition',
 },
 
 'CharacterData': {
     'nativeType': 'nsGenericDOMDataNode',
     'concrete': False
 },
 
-'ClientRect': {
-    'nativeType': 'nsClientRect',
-},
-
-'ClientRectList': {
-    'nativeType': 'nsClientRectList',
-    'headerFile': 'nsClientRect.h',
+'DOMRectList': {
+    'headerFile': 'mozilla/dom/DOMRect.h',
     'resultNotAddRefed': [ 'item' ]
 },
 
 'ClipboardEvent': {
     'nativeType': 'nsDOMClipboardEvent',
 },
 
 'CommandEvent': {
--- a/dom/tests/mochitest/general/test_clientRects.html
+++ b/dom/tests/mochitest/general/test_clientRects.html
@@ -27,17 +27,17 @@ function doc(id) {
   return document.getElementById(id).contentDocument;
 }
 function checkElement(id, list, eps, doc) {
   var e = (doc || document).getElementById(id);
   var clientRects = e.getClientRects();
   ok(clientRects instanceof e.ownerDocument.defaultView.Array,
      "getClientRects retval should have Array.prototype on its proto chain");
   clientRects.map(function(rect) {
-    ok(rect instanceof ClientRect, "Should have a ClientRect here");
+    ok(rect instanceof DOMRect, "Should have a DOMRect here");
   });
   is(clientRects.length, list.length, "getClientRects().length for element '" + id + "'");
   var bounds = list.length > 0 ? list[0] : [0,0,0,0];
   for (var i = 0; i < clientRects.length && i < list.length; ++i) {
     var r = list[i];
     r[2] += r[0];
     r[3] += r[1];
     checkRect(clientRects[i], r, eps, "getClientRects()[" + i + "]", " for element '" + id + "'");
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -111,18 +111,16 @@ var interfaceNamesInGlobalScope =
     "CanvasRenderingContext2D",
     "CaretPosition",
     "CDATASection",
     {name: "CFStateChangeEvent", b2g: true},
     "ChannelMergerNode",
     "ChannelSplitterNode",
     "CharacterData",
     {name: "ChromeWindow", xbl: true},
-    "ClientRect",
-    "ClientRectList",
     "ClipboardEvent",
     "CloseEvent",
     "CommandEvent",
     "Comment",
     "CompositionEvent",
     "Controllers",
     "ConvolverNode",
     {name: "CRMFObject", desktop: true},
@@ -169,16 +167,18 @@ var interfaceNamesInGlobalScope =
     "DocumentType",
     {name: "DOMConstructor", xbl: true},
     "DOMCursor",
     "DOMError",
     "DOMException",
     "DOMImplementation",
     "DOMMMIError",
     "DOMParser",
+    "DOMRect",
+    "DOMRectList",
     "DOMRequest",
     "DOMSettableTokenList",
     "DOMStringList",
     "DOMStringMap",
     "DOMTokenList",
     "DOMTransactionEvent",
     "DragEvent",
     "DynamicsCompressorNode",
--- a/dom/webidl/CaretPosition.webidl
+++ b/dom/webidl/CaretPosition.webidl
@@ -11,10 +11,10 @@ interface CaretPosition {
   readonly attribute unsigned long offset;
 
 };
 
 /**
  * Gecko specific methods and properties for CaretPosition.
  */
 partial interface CaretPosition {
-  ClientRect? getClientRect();
+  DOMRect? getClientRect();
 };
rename from dom/webidl/ClientRect.webidl
rename to dom/webidl/DOMRect.webidl
--- a/dom/webidl/ClientRect.webidl
+++ b/dom/webidl/DOMRect.webidl
@@ -1,14 +1,14 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-interface ClientRect
+interface DOMRect
 {
   readonly attribute float left;
   readonly attribute float top;
   readonly attribute float right;
   readonly attribute float bottom;
   readonly attribute float width;
   readonly attribute float height;
 };
rename from dom/webidl/ClientRectList.webidl
rename to dom/webidl/DOMRectList.webidl
--- a/dom/webidl/ClientRectList.webidl
+++ b/dom/webidl/DOMRectList.webidl
@@ -1,11 +1,11 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 [ArrayClass]
-interface ClientRectList {
+interface DOMRectList {
   readonly attribute unsigned long length;
-  getter ClientRect? item(unsigned long index);
+  getter DOMRect? item(unsigned long index);
 };
--- a/dom/webidl/Element.webidl
+++ b/dom/webidl/Element.webidl
@@ -136,18 +136,18 @@ interface Element : Node {
    * Scrolls the element by (dx, dy) CSS pixels without doing any
    * layout flushing.
    */
   boolean scrollByNoFlush(long dx, long dy);
 };
 
 // http://dev.w3.org/csswg/cssom-view/#extensions-to-the-element-interface
 partial interface Element {
-  ClientRectList getClientRects();
-  ClientRect getBoundingClientRect();
+  DOMRectList getClientRects();
+  DOMRect getBoundingClientRect();
 
   // scrolling
   void scrollIntoView(optional boolean top = true);
   // None of the CSSOM attributes are [Pure], because they flush
            attribute long scrollTop;   // scroll on setting
            attribute long scrollLeft;  // scroll on setting
   readonly attribute long scrollWidth;
   readonly attribute long scrollHeight;
--- a/dom/webidl/LegacyQueryInterface.webidl
+++ b/dom/webidl/LegacyQueryInterface.webidl
@@ -12,25 +12,25 @@ interface LegacyQueryInterface {
   // Legacy QueryInterface, only exposed to chrome or XBL code on the
   // main thread.
   nsISupports queryInterface(IID iid);
 };
 
 Attr implements LegacyQueryInterface;
 BarProp implements LegacyQueryInterface;
 CaretPosition implements LegacyQueryInterface;
-ClientRect implements LegacyQueryInterface;
-ClientRectList implements LegacyQueryInterface;
 Comment implements LegacyQueryInterface;
 Crypto implements LegacyQueryInterface;
 CSSPrimitiveValue implements LegacyQueryInterface;
 CSSStyleDeclaration implements LegacyQueryInterface;
 CSSValueList implements LegacyQueryInterface;
 DOMImplementation implements LegacyQueryInterface;
 DOMParser implements LegacyQueryInterface;
+DOMRect implements LegacyQueryInterface;
+DOMRectList implements LegacyQueryInterface;
 DOMStringMap implements LegacyQueryInterface;
 DOMTokenList implements LegacyQueryInterface;
 Document implements LegacyQueryInterface;
 DocumentFragment implements LegacyQueryInterface;
 DocumentType implements LegacyQueryInterface;
 Element implements LegacyQueryInterface;
 Event implements LegacyQueryInterface;
 EventSource implements LegacyQueryInterface;
--- a/dom/webidl/NotifyPaintEvent.webidl
+++ b/dom/webidl/NotifyPaintEvent.webidl
@@ -3,14 +3,14 @@
  * 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/.
  *
  * For more information about this interface see nsIDOMNotifyPaintEvent.idl
  */
 
 interface NotifyPaintEvent : Event
 {
-  readonly attribute ClientRectList clientRects;
+  readonly attribute DOMRectList clientRects;
 
-  readonly attribute ClientRect boundingClientRect;
+  readonly attribute DOMRect boundingClientRect;
 
   readonly attribute PaintRequestList paintRequests;
 };
--- a/dom/webidl/PaintRequest.webidl
+++ b/dom/webidl/PaintRequest.webidl
@@ -6,17 +6,17 @@
 /**
  * These objects are exposed by the MozDOMAfterPaint event. Each one represents
  * a request to repaint a rectangle that was generated by the browser.
  */
 interface PaintRequest {
   /**
    * The client rect where invalidation was triggered.
    */
-  readonly attribute ClientRect clientRect;
+  readonly attribute DOMRect clientRect;
 
   /**
    * The reason for the request, as a string. If an empty string, then we don't know
    * the reason (this is common). Reasons include "scroll repaint", meaning that we
    * needed to repaint the rectangle due to scrolling, and "scroll copy", meaning
    * that we updated the rectangle due to scrolling but instead of painting
    * manually, we were able to do a copy from another area of the screen.
    */
--- a/dom/webidl/Range.webidl
+++ b/dom/webidl/Range.webidl
@@ -78,11 +78,11 @@ interface Range {
 // http://domparsing.spec.whatwg.org/#dom-range-createcontextualfragment
 partial interface Range {
   [Throws]
   DocumentFragment createContextualFragment(DOMString fragment);
 };
 
 // http://dvcs.w3.org/hg/csswg/raw-file/tip/cssom-view/Overview.html#extensions-to-the-range-interface
 partial interface Range {
-  ClientRectList? getClientRects();
-  ClientRect getBoundingClientRect();
+  DOMRectList? getClientRects();
+  DOMRect getBoundingClientRect();
 };
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -48,30 +48,30 @@ WEBIDL_FILES = [
     'CameraControl.webidl',
     'CameraManager.webidl',
     'CanvasRenderingContext2D.webidl',
     'CaretPosition.webidl',
     'ChannelMergerNode.webidl',
     'ChannelSplitterNode.webidl',
     'CharacterData.webidl',
     'ChildNode.webidl',
-    'ClientRect.webidl',
-    'ClientRectList.webidl',
     'ClipboardEvent.webidl',
     'CommandEvent.webidl',
     'Comment.webidl',
     'CompositionEvent.webidl',
     'ConvolverNode.webidl',
     'Coordinates.webidl',
     'DOMCursor.webidl',
     'DOMError.webidl',
     'DOMException.webidl',
     'DOMImplementation.webidl',
     'DOMMMIError.webidl',
     'DOMParser.webidl',
+    'DOMRect.webidl',
+    'DOMRectList.webidl',
     'DOMRequest.webidl',
     'DOMSettableTokenList.webidl',
     'DOMStringMap.webidl',
     'DOMTokenList.webidl',
     'DOMTransaction.webidl',
     'DataContainerEvent.webidl',
     'DelayNode.webidl',
     'DesktopNotification.webidl',
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -42,20 +42,20 @@
 #include "nsIWidget.h"
 #include "gfxMatrix.h"
 #include "gfxPoint3D.h"
 #include "gfxTypes.h"
 #include "nsTArray.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "nsICanvasRenderingContextInternal.h"
 #include "gfxPlatform.h"
-#include "nsClientRect.h"
 #include <algorithm>
 #include "mozilla/dom/HTMLVideoElement.h"
 #include "mozilla/dom/HTMLImageElement.h"
+#include "mozilla/dom/DOMRect.h"
 #include "imgIRequest.h"
 #include "nsIImageLoadingContent.h"
 #include "nsCOMPtr.h"
 #include "nsCSSProps.h"
 #include "nsListControlFrame.h"
 #include "mozilla/dom/Element.h"
 #include "nsCanvasFrame.h"
 #include "gfxDrawable.h"
@@ -2350,23 +2350,23 @@ nsLayoutUtils::RectAccumulator::RectAccu
 void nsLayoutUtils::RectAccumulator::AddRect(const nsRect& aRect) {
   mResultRect.UnionRect(mResultRect, aRect);
   if (!mSeenFirstRect) {
     mSeenFirstRect = true;
     mFirstRect = aRect;
   }
 }
 
-nsLayoutUtils::RectListBuilder::RectListBuilder(nsClientRectList* aList)
+nsLayoutUtils::RectListBuilder::RectListBuilder(DOMRectList* aList)
   : mRectList(aList)
 {
 }
 
 void nsLayoutUtils::RectListBuilder::AddRect(const nsRect& aRect) {
-  nsRefPtr<nsClientRect> rect = new nsClientRect(mRectList);
+  nsRefPtr<DOMRect> rect = new DOMRect(mRectList);
 
   rect->SetLayoutRect(aRect);
   mRectList->Append(rect);
 }
 
 nsIFrame* nsLayoutUtils::GetContainingBlockForClientRect(nsIFrame* aFrame)
 {
   return aFrame->PresContext()->PresShell()->GetRootFrame();
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -11,17 +11,16 @@ class nsPresContext;
 class nsIContent;
 class nsIAtom;
 class nsIScrollableFrame;
 class nsIDOMEvent;
 class nsRegion;
 class nsDisplayListBuilder;
 class nsDisplayItem;
 class nsFontMetrics;
-class nsClientRectList;
 class nsFontFaceList;
 class nsIImageLoadingContent;
 class nsStyleContext;
 class nsBlockFrame;
 class gfxASurface;
 class gfxDrawable;
 class nsView;
 class imgIContainer;
@@ -55,31 +54,33 @@ struct nsOverflowAreas;
 
 #include <limits>
 #include <algorithm>
 
 namespace mozilla {
 class SVGImageContext;
 struct IntrinsicSize;
 namespace dom {
+class DOMRectList;
 class Element;
 class HTMLImageElement;
 class HTMLCanvasElement;
 class HTMLVideoElement;
 } // namespace dom
 } // namespace mozilla
 
 /**
  * nsLayoutUtils is a namespace class used for various helper
  * functions that are useful in multiple places in layout.  The goal
  * is not to define multiple copies of the same static helper.
  */
 class nsLayoutUtils
 {
   typedef ::GraphicsFilter GraphicsFilter;
+  typedef mozilla::dom::DOMRectList DOMRectList;
 
 public:
   typedef mozilla::layers::FrameMetrics FrameMetrics;
   typedef FrameMetrics::ViewID ViewID;
 
   /**
    * Finds previously assigned ViewID for the given content element, if any.
    * Returns whether a ViewID was previously assigned.
@@ -812,19 +813,19 @@ public:
     bool mSeenFirstRect;
 
     RectAccumulator();
 
     virtual void AddRect(const nsRect& aRect);
   };
 
   struct RectListBuilder : public RectCallback {
-    nsClientRectList* mRectList;
+    DOMRectList* mRectList;
 
-    RectListBuilder(nsClientRectList* aList);
+    RectListBuilder(DOMRectList* aList);
     virtual void AddRect(const nsRect& aRect);
   };
 
   static nsIFrame* GetContainingBlockForClientRect(nsIFrame* aFrame);
 
   enum {
     RECTS_ACCOUNT_FOR_TRANSFORMS = 0x01
   };
--- a/layout/xul/base/src/nsPopupBoxObject.cpp
+++ b/layout/xul/base/src/nsPopupBoxObject.cpp
@@ -8,19 +8,21 @@
 #include "nsBoxObject.h"
 #include "nsIPresShell.h"
 #include "nsFrameManager.h"
 #include "nsIContent.h"
 #include "nsIDOMElement.h"
 #include "nsINameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsMenuPopupFrame.h"
-#include "nsClientRect.h"
 #include "nsView.h"
 #include "mozilla/AppUnits.h"
+#include "mozilla/dom/DOMRect.h"
+
+using namespace mozilla::dom;
 
 class nsPopupBoxObject : public nsBoxObject,
                          public nsIPopupBoxObject
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIPOPUPBOXOBJECT
 
@@ -274,17 +276,17 @@ nsPopupBoxObject::GetAnchorNode(nsIDOMEl
     CallQueryInterface(anchor, aAnchor);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPopupBoxObject::GetOuterScreenRect(nsIDOMClientRect** aRect)
 {
-  nsClientRect* rect = new nsClientRect(mContent);
+  DOMRect* rect = new DOMRect(mContent);
 
   NS_ADDREF(*aRect = rect);
 
   nsMenuPopupFrame *menuPopupFrame = do_QueryFrame(GetFrame(false));
   if (!menuPopupFrame)
     return NS_OK;
 
   // Return an empty rectangle if the popup is not open.