mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
Bug 847598 - Paris binding for NotifyPaintEvent, r=peterv
--HG-- extra : rebase_source : dcd7cc75cfc42ab5cb636093b67da057019269cb
This commit is contained in:
parent
ea0064bedc
commit
f3649affbc
@ -25,6 +25,7 @@ nsDOMNotifyPaintEvent::nsDOMNotifyPaintEvent(mozilla::dom::EventTarget* aOwner,
|
||||
if (aInvalidateRequests) {
|
||||
mInvalidateRequests.MoveElementsFrom(aInvalidateRequests->mRequests);
|
||||
}
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
DOMCI_DATA(NotifyPaintEvent, nsDOMNotifyPaintEvent)
|
||||
@ -53,6 +54,13 @@ nsDOMNotifyPaintEvent::GetRegion()
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMNotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult)
|
||||
{
|
||||
*aResult = BoundingClientRect().get();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsClientRect>
|
||||
nsDOMNotifyPaintEvent::BoundingClientRect()
|
||||
{
|
||||
nsRefPtr<nsClientRect> rect = new nsClientRect(ToSupports(this));
|
||||
|
||||
@ -60,12 +68,18 @@ nsDOMNotifyPaintEvent::GetBoundingClientRect(nsIDOMClientRect** aResult)
|
||||
rect->SetLayoutRect(GetRegion().GetBounds());
|
||||
}
|
||||
|
||||
rect.forget(aResult);
|
||||
return NS_OK;
|
||||
return rect.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMNotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult)
|
||||
{
|
||||
*aResult = ClientRects().get();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsClientRectList>
|
||||
nsDOMNotifyPaintEvent::ClientRects()
|
||||
{
|
||||
nsISupports* parent = ToSupports(this);
|
||||
nsRefPtr<nsClientRectList> rectList = new nsClientRectList(parent);
|
||||
@ -79,8 +93,7 @@ nsDOMNotifyPaintEvent::GetClientRects(nsIDOMClientRectList** aResult)
|
||||
rectList->Append(rect);
|
||||
}
|
||||
|
||||
rectList.forget(aResult);
|
||||
return NS_OK;
|
||||
return rectList.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -9,8 +9,11 @@
|
||||
#include "nsIDOMNotifyPaintEvent.h"
|
||||
#include "nsDOMEvent.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "mozilla/dom/NotifyPaintEventBinding.h"
|
||||
|
||||
class nsPaintRequestList;
|
||||
class nsClientRectList;
|
||||
class nsClientRect;
|
||||
|
||||
class nsDOMNotifyPaintEvent : public nsDOMEvent,
|
||||
public nsIDOMNotifyPaintEvent
|
||||
@ -35,8 +38,16 @@ public:
|
||||
NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType);
|
||||
NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter);
|
||||
|
||||
already_AddRefed<nsPaintRequestList> PaintRequests();
|
||||
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope)
|
||||
{
|
||||
return mozilla::dom::NotifyPaintEventBinding::Wrap(aCx, aScope, this);
|
||||
}
|
||||
|
||||
already_AddRefed<nsClientRectList> ClientRects();
|
||||
|
||||
already_AddRefed<nsClientRect> BoundingClientRect();
|
||||
|
||||
already_AddRefed<nsPaintRequestList> PaintRequests();
|
||||
private:
|
||||
nsRegion GetRegion();
|
||||
|
||||
|
@ -634,6 +634,10 @@ DOMInterfaces = {
|
||||
'resultNotAddRefed': [ 'item' ]
|
||||
},
|
||||
|
||||
'NotifyPaintEvent': {
|
||||
'nativeType': 'nsDOMNotifyPaintEvent',
|
||||
},
|
||||
|
||||
'PaintRequest': {
|
||||
'nativeType': 'nsPaintRequest',
|
||||
},
|
||||
|
16
dom/webidl/NotifyPaintEvent.webidl
Normal file
16
dom/webidl/NotifyPaintEvent.webidl
Normal file
@ -0,0 +1,16 @@
|
||||
/* -*- 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/.
|
||||
*
|
||||
* For more information about this interface see nsIDOMNotifyPaintEvent.idl
|
||||
*/
|
||||
|
||||
interface NotifyPaintEvent : Event
|
||||
{
|
||||
readonly attribute ClientRectList clientRects;
|
||||
|
||||
readonly attribute ClientRect boundingClientRect;
|
||||
|
||||
readonly attribute PaintRequestList paintRequests;
|
||||
};
|
@ -164,6 +164,7 @@ webidl_files = \
|
||||
NodeIterator.webidl \
|
||||
NodeList.webidl \
|
||||
Notification.webidl \
|
||||
NotifyPaintEvent.webidl \
|
||||
PaintRequest.webidl \
|
||||
PaintRequestList.webidl \
|
||||
PannerNode.webidl \
|
||||
|
@ -64,7 +64,6 @@ members = [
|
||||
|
||||
'nsIDOMKeyEvent.*',
|
||||
'nsIDOMDragEvent.*',
|
||||
'nsIDOMNotifyPaintEvent.*',
|
||||
'nsIDOMMouseScrollEvent.*',
|
||||
'nsIDOMProgressEvent.lengthComputable',
|
||||
'nsIDOMProgressEvent.loaded',
|
||||
|
Loading…
x
Reference in New Issue
Block a user