Bug 916520. Rename nsClientRect(List) to mozilla::dom::DOMRect(List). r=khuey

--HG--
rename : content/html/content/src/nsClientRect.cpp => content/base/src/DOMRect.cpp
rename : content/html/content/src/nsClientRect.h => content/base/src/DOMRect.h
rename : dom/webidl/ClientRect.webidl => dom/webidl/DOMRect.webidl
rename : dom/webidl/ClientRectList.webidl => dom/webidl/DOMRectList.webidl
extra : rebase_source : ebe27ef21b38f7df5065f37b971508b740c8cf3c
This commit is contained in:
Robert O'Callahan 2013-09-20 22:21:03 +12:00
parent 2a2b4a5f10
commit 20613a55bc
39 changed files with 160 additions and 127 deletions

View File

@ -32,7 +32,7 @@
#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"
@ -50,8 +50,6 @@ class nsEventListenerManager;
class nsIScrollableFrame;
class nsAttrValueOrString;
class ContentUnbinder;
class nsClientRect;
class nsClientRectList;
class nsContentList;
class nsDOMTokenList;
struct nsRect;
@ -110,6 +108,8 @@ namespace dom {
class Link;
class UndoManager;
class DOMRect;
class DOMRectList;
// IID for the dom::Element interface
#define NS_ELEMENT_IID \
@ -647,8 +647,8 @@ public:
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()
{

View File

@ -3,19 +3,19 @@
* 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)
@ -23,7 +23,7 @@ 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; \
@ -37,44 +37,44 @@ 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
@ -84,7 +84,7 @@ RoundFloat(double aValue)
}
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

View File

@ -3,8 +3,8 @@
* 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"
@ -17,17 +17,19 @@
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;
@ -36,7 +38,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsClientRect)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRect)
NS_DECL_NSIDOMCLIENTRECT
@ -84,17 +86,17 @@ protected:
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
@ -106,9 +108,9 @@ public:
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
{
@ -122,18 +124,18 @@ public:
}
#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) {
@ -143,10 +145,13 @@ public:
}
protected:
virtual ~nsClientRectList() {}
virtual ~DOMRectList() {}
nsTArray< nsRefPtr<nsClientRect> > mArray;
nsTArray< nsRefPtr<DOMRect> > mArray;
nsCOMPtr<nsISupports> mParent;
};
#endif /*NSCLIENTRECT_H_*/
}
}
#endif /*MOZILLA_DOMRECT_H_*/

View File

@ -70,7 +70,7 @@
#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"
@ -647,10 +647,10 @@ Element::GetClientAreaRect()
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) {
@ -665,10 +665,10 @@ Element::GetBoundingClientRect()
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) {

View File

@ -69,7 +69,6 @@
#include "nsXBLBinding.h"
#include "nsPIDOMWindow.h"
#include "nsPIBoxObject.h"
#include "nsClientRect.h"
#include "nsSVGUtils.h"
#include "nsLayoutUtils.h"
#include "nsGkAtoms.h"

View File

@ -56,6 +56,7 @@ EXPORTS.mozilla.dom += [
'Comment.h',
'DOMImplementation.h',
'DOMParser.h',
'DOMRect.h',
'DocumentFragment.h',
'DocumentType.h',
'EventSource.h',
@ -69,6 +70,7 @@ CPP_SOURCES += [
'Attr.cpp',
'Comment.cpp',
'DOMImplementation.cpp',
'DOMRect.cpp',
'DirectionalityUtils.cpp',
'DocumentFragment.cpp',
'DocumentType.cpp',

View File

@ -5,9 +5,11 @@
#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)
{
@ -23,14 +25,14 @@ 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;

View File

@ -10,7 +10,11 @@
#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
@ -23,6 +27,8 @@ class nsClientRect;
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)
@ -55,7 +61,7 @@ public:
* 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

View File

@ -23,7 +23,6 @@
#include "nsAttrValueOrString.h"
#include "nsBindingManager.h"
#include "nsCCUncollectableMarker.h"
#include "nsClientRect.h"
#include "nsContentCreatorFunctions.h"
#include "nsContentList.h"
#include "nsContentUtils.h"

View File

@ -23,13 +23,13 @@
#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"
@ -2874,10 +2874,10 @@ nsRange::GetBoundingClientRect(nsIDOMClientRect** aResult)
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();
}
@ -2899,15 +2899,15 @@ nsRange::GetClientRects(nsIDOMClientRectList** aResult)
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);

View File

@ -20,13 +20,12 @@
#include "nsWrapperCache.h"
#include "mozilla/Attributes.h"
class nsClientRect;
class nsClientRectList;
namespace mozilla {
class ErrorResult;
namespace dom {
class DocumentFragment;
class DOMRect;
class DOMRectList;
}
}
@ -35,6 +34,8 @@ class nsRange MOZ_FINAL : public nsIDOMRange,
public nsWrapperCache
{
typedef mozilla::ErrorResult ErrorResult;
typedef mozilla::dom::DOMRect DOMRect;
typedef mozilla::dom::DOMRectList DOMRectList;
public:
nsRange(nsINode* aNode)
@ -214,8 +215,8 @@ public:
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,

View File

@ -8,8 +8,10 @@
#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,
@ -54,10 +56,10 @@ nsDOMNotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult)
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());
@ -73,16 +75,16 @@ nsDOMNotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult)
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);

View File

@ -13,12 +13,20 @@
#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,
@ -45,9 +53,9 @@ public:
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:

View File

@ -8,7 +8,7 @@
#include "mozilla/ContentEvents.h"
#include "nsDOMScrollAreaEvent.h"
#include "nsClientRect.h"
#include "mozilla/dom/DOMRect.h"
using namespace mozilla;

View File

@ -11,12 +11,14 @@
#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,
@ -77,7 +79,7 @@ public:
}
protected:
nsClientRect mClientArea;
DOMRect mClientArea;
};
#endif // nsDOMScrollAreaEvent_h__

View File

@ -7,7 +7,7 @@
#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;
@ -29,10 +29,10 @@ 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();
}
@ -40,7 +40,7 @@ nsPaintRequest::ClientRect()
NS_IMETHODIMP
nsPaintRequest::GetClientRect(nsIDOMClientRect** aResult)
{
nsRefPtr<nsClientRect> clientRect = ClientRect();
nsRefPtr<DOMRect> clientRect = ClientRect();
clientRect.forget(aResult);
return NS_OK;
}

View File

@ -12,11 +12,17 @@
#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)
@ -37,7 +43,7 @@ public:
return mParent;
}
already_AddRefed<nsClientRect> ClientRect();
already_AddRefed<DOMRect> ClientRect();
void GetReason(nsAString& aResult) const
{
aResult.AssignLiteral("repaint");

View File

@ -8,7 +8,6 @@ MODULE = 'content'
EXPORTS += [
'HTMLPropertiesCollection.h',
'nsClientRect.h',
'nsGenericHTMLElement.h',
'nsHTMLDNSPrefetch.h',
]
@ -142,7 +141,6 @@ CPP_SOURCES += [
'TimeRanges.cpp',
'UndoManager.cpp',
'ValidityState.cpp',
'nsClientRect.cpp',
'nsDOMStringMap.cpp',
'nsFormSubmission.cpp',
'nsGenericHTMLElement.cpp',

View File

@ -15,6 +15,7 @@
#include "nsContentCreatorFunctions.h"
#include "mozilla/ErrorResult.h"
#include "nsIDOMHTMLMenuElement.h"
#include "mozilla/dom/DOMRect.h"
#include "mozilla/dom/ValidityState.h"
class nsIDOMAttr;
@ -38,7 +39,7 @@ class nsIDOMHTMLCollection;
class nsDOMSettableTokenList;
namespace mozilla {
namespace dom{
namespace dom {
class HTMLFormElement;
class HTMLPropertiesCollection;
class HTMLMenuElement;

View File

@ -10,6 +10,7 @@
#include "nsMappedAttributeElement.h"
#include "nsIDOMElement.h"
#include "Link.h"
#include "mozilla/dom/DOMRect.h"
class nsCSSValue;

View File

@ -18,6 +18,7 @@
#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"

View File

@ -9,6 +9,7 @@
#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

View File

@ -35,6 +35,7 @@
#include "nsStyledElement.h"
#include "nsIFrameLoader.h"
#include "nsFrameLoader.h"
#include "mozilla/dom/DOMRect.h"
class nsIDocument;
class nsString;

View File

@ -52,7 +52,7 @@
#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)
@ -1579,7 +1579,7 @@ nsDOMWindowUtils::GetBoundsWithoutFlushing(nsIDOMElement *aElement,
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) {
@ -1619,7 +1619,7 @@ nsDOMWindowUtils::GetRootBounds(nsIDOMClientRect** aResult)
}
}
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),

View File

@ -206,13 +206,8 @@ DOMInterfaces = {
'concrete': False
},
'ClientRect': {
'nativeType': 'nsClientRect',
},
'ClientRectList': {
'nativeType': 'nsClientRectList',
'headerFile': 'nsClientRect.h',
'DOMRectList': {
'headerFile': 'mozilla/dom/DOMRect.h',
'resultNotAddRefed': [ 'item' ]
},

View File

@ -32,7 +32,7 @@ function checkElement(id, list, eps, doc) {
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];

View File

@ -116,8 +116,6 @@ var interfaceNamesInGlobalScope =
"ChannelSplitterNode",
"CharacterData",
{name: "ChromeWindow", xbl: true},
"ClientRect",
"ClientRectList",
"ClipboardEvent",
"CloseEvent",
"CommandEvent",
@ -174,6 +172,8 @@ var interfaceNamesInGlobalScope =
"DOMImplementation",
"DOMMMIError",
"DOMParser",
"DOMRect",
"DOMRectList",
"DOMRequest",
"DOMSettableTokenList",
"DOMStringList",

View File

@ -16,5 +16,5 @@ interface CaretPosition {
* Gecko specific methods and properties for CaretPosition.
*/
partial interface CaretPosition {
ClientRect? getClientRect();
DOMRect? getClientRect();
};

View File

@ -3,7 +3,7 @@
* 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;

View File

@ -5,7 +5,7 @@
*/
[ArrayClass]
interface ClientRectList {
interface DOMRectList {
readonly attribute unsigned long length;
getter ClientRect? item(unsigned long index);
getter DOMRect? item(unsigned long index);
};

View File

@ -141,8 +141,8 @@ interface Element : Node {
// 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);

View File

@ -17,8 +17,6 @@ interface LegacyQueryInterface {
Attr implements LegacyQueryInterface;
BarProp implements LegacyQueryInterface;
CaretPosition implements LegacyQueryInterface;
ClientRect implements LegacyQueryInterface;
ClientRectList implements LegacyQueryInterface;
Comment implements LegacyQueryInterface;
Crypto implements LegacyQueryInterface;
CSSPrimitiveValue implements LegacyQueryInterface;
@ -26,6 +24,8 @@ 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;

View File

@ -8,9 +8,9 @@
interface NotifyPaintEvent : Event
{
readonly attribute ClientRectList clientRects;
readonly attribute DOMRectList clientRects;
readonly attribute ClientRect boundingClientRect;
readonly attribute DOMRect boundingClientRect;
readonly attribute PaintRequestList paintRequests;
};

View File

@ -11,7 +11,7 @@ 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

View File

@ -83,6 +83,6 @@ partial interface Range {
// 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();
};

View File

@ -53,8 +53,6 @@ WEBIDL_FILES = [
'ChannelSplitterNode.webidl',
'CharacterData.webidl',
'ChildNode.webidl',
'ClientRect.webidl',
'ClientRectList.webidl',
'ClipboardEvent.webidl',
'CommandEvent.webidl',
'Comment.webidl',
@ -67,6 +65,8 @@ WEBIDL_FILES = [
'DOMImplementation.webidl',
'DOMMMIError.webidl',
'DOMParser.webidl',
'DOMRect.webidl',
'DOMRectList.webidl',
'DOMRequest.webidl',
'DOMSettableTokenList.webidl',
'DOMStringMap.webidl',

View File

@ -47,10 +47,10 @@
#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"
@ -2355,13 +2355,13 @@ void nsLayoutUtils::RectAccumulator::AddRect(const nsRect& 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);

View File

@ -16,7 +16,6 @@ class nsRegion;
class nsDisplayListBuilder;
class nsDisplayItem;
class nsFontMetrics;
class nsClientRectList;
class nsFontFaceList;
class nsIImageLoadingContent;
class nsStyleContext;
@ -60,6 +59,7 @@ namespace mozilla {
class SVGImageContext;
struct IntrinsicSize;
namespace dom {
class DOMRectList;
class Element;
class HTMLImageElement;
class HTMLCanvasElement;
@ -75,6 +75,7 @@ class HTMLVideoElement;
class nsLayoutUtils
{
typedef ::GraphicsFilter GraphicsFilter;
typedef mozilla::dom::DOMRectList DOMRectList;
public:
typedef mozilla::layers::FrameMetrics FrameMetrics;
@ -817,9 +818,9 @@ public:
};
struct RectListBuilder : public RectCallback {
nsClientRectList* mRectList;
DOMRectList* mRectList;
RectListBuilder(nsClientRectList* aList);
RectListBuilder(DOMRectList* aList);
virtual void AddRect(const nsRect& aRect);
};

View File

@ -13,9 +13,11 @@
#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
@ -279,7 +281,7 @@ nsPopupBoxObject::GetAnchorNode(nsIDOMElement** aAnchor)
NS_IMETHODIMP
nsPopupBoxObject::GetOuterScreenRect(nsIDOMClientRect** aRect)
{
nsClientRect* rect = new nsClientRect(mContent);
DOMRect* rect = new DOMRect(mContent);
NS_ADDREF(*aRect = rect);