2012-12-22 00:16:55 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* 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/. */
|
2009-09-03 21:49:18 -07:00
|
|
|
|
|
|
|
#include "nsPaintRequest.h"
|
|
|
|
|
2012-12-22 00:16:55 -08:00
|
|
|
#include "mozilla/dom/PaintRequestBinding.h"
|
2012-06-13 08:18:30 -07:00
|
|
|
#include "mozilla/dom/PaintRequestListBinding.h"
|
2013-09-20 03:21:03 -07:00
|
|
|
#include "mozilla/dom/DOMRect.h"
|
2009-09-03 21:49:18 -07:00
|
|
|
|
2012-12-22 00:16:55 -08:00
|
|
|
using namespace mozilla;
|
|
|
|
using namespace mozilla::dom;
|
|
|
|
|
2012-12-22 00:04:33 -08:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequest, mParent)
|
|
|
|
|
2009-09-03 21:49:18 -07:00
|
|
|
NS_INTERFACE_TABLE_HEAD(nsPaintRequest)
|
2012-12-22 00:04:33 -08:00
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
2009-09-03 21:49:18 -07:00
|
|
|
NS_INTERFACE_TABLE1(nsPaintRequest, nsIDOMPaintRequest)
|
2012-12-22 00:04:33 -08:00
|
|
|
NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsPaintRequest)
|
2009-09-03 21:49:18 -07:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2012-12-22 00:04:33 -08:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequest)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequest)
|
|
|
|
|
|
|
|
/* virtual */ JSObject*
|
2013-04-25 09:29:54 -07:00
|
|
|
nsPaintRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
2012-12-22 00:04:33 -08:00
|
|
|
{
|
2013-03-11 16:03:47 -07:00
|
|
|
return PaintRequestBinding::Wrap(aCx, aScope, this);
|
2012-12-22 00:04:33 -08:00
|
|
|
}
|
2009-09-03 21:49:18 -07:00
|
|
|
|
2013-09-20 03:21:03 -07:00
|
|
|
already_AddRefed<DOMRect>
|
2012-12-22 00:16:55 -08:00
|
|
|
nsPaintRequest::ClientRect()
|
2009-09-03 21:49:18 -07:00
|
|
|
{
|
2013-09-20 03:21:03 -07:00
|
|
|
nsRefPtr<DOMRect> clientRect = new DOMRect(this);
|
2009-09-03 21:49:18 -07:00
|
|
|
clientRect->SetLayoutRect(mRequest.mRect);
|
2012-12-22 00:16:55 -08:00
|
|
|
return clientRect.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsPaintRequest::GetClientRect(nsIDOMClientRect** aResult)
|
|
|
|
{
|
2013-09-20 03:21:03 -07:00
|
|
|
nsRefPtr<DOMRect> clientRect = ClientRect();
|
2009-09-03 21:49:18 -07:00
|
|
|
clientRect.forget(aResult);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-12-22 00:16:55 -08:00
|
|
|
nsPaintRequest::GetXPCOMReason(nsAString& aResult)
|
2009-09-03 21:49:18 -07:00
|
|
|
{
|
2012-12-22 00:16:55 -08:00
|
|
|
GetReason(aResult);
|
2009-09-03 21:49:18 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-05-14 08:24:03 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(nsPaintRequestList, mParent)
|
2011-08-22 02:14:13 -07:00
|
|
|
|
2013-07-10 03:01:29 -07:00
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPaintRequestList)
|
2011-08-22 02:14:13 -07:00
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
2013-07-10 03:01:29 -07:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
2009-09-03 21:49:18 -07:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2011-08-22 02:14:13 -07:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPaintRequestList)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPaintRequestList)
|
2009-09-03 21:49:18 -07:00
|
|
|
|
2012-06-13 08:18:30 -07:00
|
|
|
JSObject*
|
2013-07-10 03:01:29 -07:00
|
|
|
nsPaintRequestList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
|
2012-06-13 08:18:30 -07:00
|
|
|
{
|
2013-07-10 03:01:29 -07:00
|
|
|
return PaintRequestListBinding::Wrap(aCx, aScope, this);
|
2009-09-03 21:49:18 -07:00
|
|
|
}
|