Bug 616684 - Remove support for DOM Views; r=sicking,ehsan

This commit is contained in:
Ms2ger 2011-04-24 08:54:25 +02:00
Родитель 620172a5cb
Коммит 31e3e8c5d1
71 изменённых файлов: 221 добавлений и 553 удалений

Просмотреть файл

@ -45,8 +45,6 @@
#include "nsCoreUtils.h" #include "nsCoreUtils.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowInternal.h"
#include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeItem.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"

Просмотреть файл

@ -43,15 +43,12 @@
#include "nsAccessNode.h" #include "nsAccessNode.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOM3Node.h" #include "nsIDOM3Node.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLDocument.h"
#include "nsIDOMHTMLElement.h" #include "nsIDOMHTMLElement.h"
#include "nsIDOMNodeList.h" #include "nsIDOMNodeList.h"
#include "nsIDOMRange.h" #include "nsIDOMRange.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowInternal.h"
#include "nsIDOMXULElement.h" #include "nsIDOMXULElement.h"
#include "nsIDocShell.h" #include "nsIDocShell.h"
@ -425,13 +422,12 @@ nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode)
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem; nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem)); treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
nsCOMPtr<nsIDOMDocument> domDoc = do_GetInterface(rootTreeItem); nsCOMPtr<nsIDOMDocument> domDoc = do_GetInterface(rootTreeItem);
nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(domDoc)); if (!domDoc)
if (!docView)
return coords; return coords;
nsCOMPtr<nsIDOMAbstractView> abstractView; nsCOMPtr<nsIDOMWindow> window;
docView->GetDefaultView(getter_AddRefs(abstractView)); domDoc->GetDefaultView(getter_AddRefs(window));
nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(abstractView)); nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(window));
if (!windowInter) if (!windowInter)
return coords; return coords;
@ -597,14 +593,14 @@ nsCoreUtils::GetComputedStyleDeclaration(const nsAString& aPseudoElt,
if (!document) if (!document)
return nsnull; return nsnull;
nsCOMPtr<nsIDOMViewCSS> viewCSS(do_QueryInterface(document->GetWindow())); nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(document->GetWindow());
if (!viewCSS) if (!window)
return nsnull; return nsnull;
nsIDOMCSSStyleDeclaration* cssDecl = nsnull; nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(content)); nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(content));
viewCSS->GetComputedStyle(domElement, aPseudoElt, &cssDecl); window->GetComputedStyle(domElement, aPseudoElt, getter_AddRefs(cssDecl));
return cssDecl; return cssDecl.forget();
} }
already_AddRefed<nsIBoxObject> already_AddRefed<nsIBoxObject>

Просмотреть файл

@ -47,11 +47,9 @@
#include "nsIClipboard.h" #include "nsIClipboard.h"
#include "nsContentCID.h" #include "nsContentCID.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMCharacterData.h" #include "nsIDOMCharacterData.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMRange.h" #include "nsIDOMRange.h"
#include "nsIDOMNSRange.h" #include "nsIDOMNSRange.h"
#include "nsIDOMWindowInternal.h" #include "nsIDOMWindowInternal.h"

Просмотреть файл

@ -52,7 +52,6 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIDOMNodeList.h" #include "nsIDOMNodeList.h"
#include "nsIDOMNSHTMLElement.h" #include "nsIDOMNSHTMLElement.h"
#include "nsIDOMViewCSS.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
#include "nsIPrefService.h" #include "nsIPrefService.h"

Просмотреть файл

@ -54,7 +54,6 @@
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
#include "nsIDOMNSEvent.h" #include "nsIDOMNSEvent.h"
#include "nsIDOMDragEvent.h" #include "nsIDOMDragEvent.h"
#include "nsIDOMAbstractView.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentRange.h" #include "nsIDOMDocumentRange.h"

Просмотреть файл

@ -168,7 +168,6 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
#include "nsIChromeRegistry.h" #include "nsIChromeRegistry.h"
#include "nsIMIMEHeaderParam.h" #include "nsIMIMEHeaderParam.h"
#include "nsIDOMXULCommandEvent.h" #include "nsIDOMXULCommandEvent.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMDragEvent.h" #include "nsIDOMDragEvent.h"
#include "nsDOMDataTransfer.h" #include "nsDOMDataTransfer.h"
#include "nsHtml5Module.h" #include "nsHtml5Module.h"
@ -5523,9 +5522,8 @@ nsContentUtils::DispatchXULCommand(nsIContent* aTarget,
nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event); nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event);
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand); nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand);
NS_ENSURE_STATE(pEvent); NS_ENSURE_STATE(pEvent);
nsCOMPtr<nsIDOMAbstractView> view = do_QueryInterface(doc->GetWindow());
nsresult rv = xulCommand->InitCommandEvent(NS_LITERAL_STRING("command"), nsresult rv = xulCommand->InitCommandEvent(NS_LITERAL_STRING("command"),
PR_TRUE, PR_TRUE, view, PR_TRUE, PR_TRUE, doc->GetWindow(),
0, aCtrl, aAlt, aShift, aMeta, 0, aCtrl, aAlt, aShift, aMeta,
aSourceEvent); aSourceEvent);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -75,8 +75,6 @@
#include "nsDOMAttribute.h" #include "nsDOMAttribute.h"
#include "nsIDOMDOMStringList.h" #include "nsIDOMDOMStringList.h"
#include "nsIDOMDOMImplementation.h" #include "nsIDOMDOMImplementation.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMDocumentXBL.h" #include "nsIDOMDocumentXBL.h"
#include "mozilla/FunctionTimer.h" #include "mozilla/FunctionTimer.h"
#include "nsGenericElement.h" #include "nsGenericElement.h"
@ -5077,16 +5075,14 @@ nsDocument::CreateTreeWalker(nsIDOMNode *aRoot,
NS_IMETHODIMP NS_IMETHODIMP
nsDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView) nsDocument::GetDefaultView(nsIDOMWindow** aDefaultView)
{ {
nsPIDOMWindow* win = GetWindow();
if (win) {
return CallQueryInterface(win, aDefaultView);
}
*aDefaultView = nsnull; *aDefaultView = nsnull;
nsPIDOMWindow* win = GetWindow();
return NS_OK; if (!win) {
return NS_OK;
}
return CallQueryInterface(win, aDefaultView);
} }
NS_IMETHODIMP NS_IMETHODIMP
@ -8331,7 +8327,7 @@ nsDocument::SetImagesNeedAnimating(PRBool aAnimating)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsDocument::CreateTouch(nsIDOMAbstractView* aView, nsDocument::CreateTouch(nsIDOMWindow* aView,
nsIDOMEventTarget* aTarget, nsIDOMEventTarget* aTarget,
PRInt32 aIdentifier, PRInt32 aIdentifier,
PRInt32 aPageX, PRInt32 aPageX,

Просмотреть файл

@ -52,7 +52,6 @@
#include "nsTArray.h" #include "nsTArray.h"
#include "nsHashSets.h" #include "nsHashSets.h"
#include "nsIDOMXMLDocument.h" #include "nsIDOMXMLDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMDocumentXBL.h" #include "nsIDOMDocumentXBL.h"
#include "nsIDOMNSDocument.h" #include "nsIDOMNSDocument.h"
#include "nsIDOMNSDocumentStyle.h" #include "nsIDOMNSDocumentStyle.h"
@ -499,7 +498,6 @@ class nsDocument : public nsIDocument,
public nsIDOMDocumentEvent, public nsIDOMDocumentEvent,
public nsIDOM3DocumentEvent, public nsIDOM3DocumentEvent,
public nsIDOMNSDocumentStyle, public nsIDOMNSDocumentStyle,
public nsIDOMDocumentView,
public nsIDOMDocumentRange, public nsIDOMDocumentRange,
public nsIDOMDocumentTraversal, public nsIDOMDocumentTraversal,
public nsIDOMDocumentXBL, public nsIDOMDocumentXBL,
@ -816,9 +814,6 @@ public:
// nsIDOMNSDocumentStyle // nsIDOMNSDocumentStyle
NS_DECL_NSIDOMNSDOCUMENTSTYLE NS_DECL_NSIDOMNSDOCUMENTSTYLE
// nsIDOMDocumentView
NS_DECL_NSIDOMDOCUMENTVIEW
// nsIDOMDocumentRange // nsIDOMDocumentRange
NS_DECL_NSIDOMDOCUMENTRANGE NS_DECL_NSIDOMDOCUMENTRANGE
@ -1268,7 +1263,6 @@ protected:
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \ NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \ NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \ NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentView, nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal, \ NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal, \
nsDocument) \ nsDocument) \
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \ NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \

Просмотреть файл

@ -92,7 +92,6 @@
#include "nsBindingManager.h" #include "nsBindingManager.h"
#include "nsXBLBinding.h" #include "nsXBLBinding.h"
#include "nsIDOMViewCSS.h"
#include "nsIXBLService.h" #include "nsIXBLService.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIBoxObject.h" #include "nsIBoxObject.h"

Просмотреть файл

@ -80,7 +80,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMDragEvent::InitDragEvent(const nsAString & aType, nsDOMDragEvent::InitDragEvent(const nsAString & aType,
PRBool aCanBubble, PRBool aCancelable, PRBool aCanBubble, PRBool aCancelable,
nsIDOMAbstractView* aView, PRInt32 aDetail, nsIDOMWindow* aView, PRInt32 aDetail,
PRInt32 aScreenX, PRInt32 aScreenY, PRInt32 aScreenX, PRInt32 aScreenY,
PRInt32 aClientX, PRInt32 aClientY, PRInt32 aClientX, PRInt32 aClientY,
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
@ -132,7 +132,5 @@ nsresult NS_NewDOMDragEvent(nsIDOMEvent** aInstancePtrResult,
nsDragEvent *aEvent) nsDragEvent *aEvent)
{ {
nsDOMDragEvent* event = new nsDOMDragEvent(aPresContext, aEvent); nsDOMDragEvent* event = new nsDOMDragEvent(aPresContext, aEvent);
NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
return CallQueryInterface(event, aInstancePtrResult); return CallQueryInterface(event, aInstancePtrResult);
} }

Просмотреть файл

@ -175,7 +175,7 @@ nsDOMKeyboardEvent::GetWhich(PRUint32* aWhich)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMKeyboardEvent::InitKeyEvent(const nsAString& aType, PRBool aCanBubble, PRBool aCancelable, nsDOMKeyboardEvent::InitKeyEvent(const nsAString& aType, PRBool aCanBubble, PRBool aCancelable,
nsIDOMAbstractView* aView, PRBool aCtrlKey, PRBool aAltKey, nsIDOMWindow* aView, PRBool aCtrlKey, PRBool aAltKey,
PRBool aShiftKey, PRBool aMetaKey, PRBool aShiftKey, PRBool aMetaKey,
PRUint32 aKeyCode, PRUint32 aCharCode) PRUint32 aKeyCode, PRUint32 aCharCode)
{ {
@ -198,9 +198,5 @@ nsresult NS_NewDOMKeyboardEvent(nsIDOMEvent** aInstancePtrResult,
nsKeyEvent *aEvent) nsKeyEvent *aEvent)
{ {
nsDOMKeyboardEvent* it = new nsDOMKeyboardEvent(aPresContext, aEvent); nsDOMKeyboardEvent* it = new nsDOMKeyboardEvent(aPresContext, aEvent);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(it, aInstancePtrResult); return CallQueryInterface(it, aInstancePtrResult);
} }

Просмотреть файл

@ -104,7 +104,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable, nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX, nsIDOMWindow* aView, PRInt32 aDetail, PRInt32 aScreenX,
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY, PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget) PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget)
@ -147,7 +147,7 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBo
NS_IMETHODIMP NS_IMETHODIMP
nsDOMMouseEvent::InitNSMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable, nsDOMMouseEvent::InitNSMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX, nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY, PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget, PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
@ -313,9 +313,5 @@ nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
nsInputEvent *aEvent) nsInputEvent *aEvent)
{ {
nsDOMMouseEvent* it = new nsDOMMouseEvent(aPresContext, aEvent); nsDOMMouseEvent* it = new nsDOMMouseEvent(aPresContext, aEvent);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(it, aInstancePtrResult); return CallQueryInterface(it, aInstancePtrResult);
} }

Просмотреть файл

@ -88,7 +88,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable, nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX, nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY, PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey, PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget, PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
@ -129,9 +129,5 @@ nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
nsInputEvent *aEvent) nsInputEvent *aEvent)
{ {
nsDOMMouseScrollEvent* it = new nsDOMMouseScrollEvent(aPresContext, aEvent); nsDOMMouseScrollEvent* it = new nsDOMMouseScrollEvent(aPresContext, aEvent);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(it, aInstancePtrResult); return CallQueryInterface(it, aInstancePtrResult);
} }

Просмотреть файл

@ -85,7 +85,7 @@ NS_IMETHODIMP
nsDOMMozTouchEvent::InitMozTouchEvent(const nsAString& aTypeArg, nsDOMMozTouchEvent::InitMozTouchEvent(const nsAString& aTypeArg,
PRBool aCanBubbleArg, PRBool aCanBubbleArg,
PRBool aCancelableArg, PRBool aCancelableArg,
nsIDOMAbstractView* aViewArg, nsIDOMWindow* aViewArg,
PRInt32 aDetailArg, PRInt32 aDetailArg,
PRInt32 aScreenX, PRInt32 aScreenX,
PRInt32 aScreenY, PRInt32 aScreenY,
@ -127,8 +127,5 @@ nsresult NS_NewDOMMozTouchEvent(nsIDOMEvent** aInstancePtrResult,
nsMozTouchEvent *aEvent) nsMozTouchEvent *aEvent)
{ {
nsDOMMozTouchEvent *it = new nsDOMMozTouchEvent(aPresContext, aEvent); nsDOMMozTouchEvent *it = new nsDOMMozTouchEvent(aPresContext, aEvent);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(it, aInstancePtrResult); return CallQueryInterface(it, aInstancePtrResult);
} }

Просмотреть файл

@ -101,7 +101,7 @@ NS_IMETHODIMP
nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType, nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
PRBool aCanBubble, PRBool aCanBubble,
PRBool aCancelable, PRBool aCancelable,
nsIDOMAbstractView *aView, nsIDOMWindow *aView,
PRInt32 aDetail, PRInt32 aDetail,
float aX, float aY, float aX, float aY,
float aWidth, float aHeight) float aWidth, float aHeight)
@ -156,10 +156,5 @@ NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
nsScrollAreaEvent *aEvent) nsScrollAreaEvent *aEvent)
{ {
nsDOMScrollAreaEvent *ev = new nsDOMScrollAreaEvent(aPresContext, aEvent); nsDOMScrollAreaEvent *ev = new nsDOMScrollAreaEvent(aPresContext, aEvent);
if (!ev) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(ev, aInstancePtrResult); return CallQueryInterface(ev, aInstancePtrResult);
} }

Просмотреть файл

@ -95,7 +95,7 @@ NS_IMETHODIMP
nsDOMSimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg, nsDOMSimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
PRBool aCanBubbleArg, PRBool aCanBubbleArg,
PRBool aCancelableArg, PRBool aCancelableArg,
nsIDOMAbstractView* aViewArg, nsIDOMWindow* aViewArg,
PRInt32 aDetailArg, PRInt32 aDetailArg,
PRInt32 aScreenX, PRInt32 aScreenX,
PRInt32 aScreenY, PRInt32 aScreenY,

Просмотреть файл

@ -1,4 +1,4 @@
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* ***** BEGIN LICENSE BLOCK ***** /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
@ -244,7 +244,7 @@ NS_IMETHODIMP
nsDOMTouchEvent::InitTouchEvent(const nsAString& aType, nsDOMTouchEvent::InitTouchEvent(const nsAString& aType,
PRBool aCanBubble, PRBool aCanBubble,
PRBool aCancelable, PRBool aCancelable,
nsIDOMAbstractView* aView, nsIDOMWindow* aView,
PRInt32 aDetail, PRInt32 aDetail,
PRBool aCtrlKey, PRBool aCtrlKey,
PRBool aAltKey, PRBool aAltKey,

Просмотреть файл

@ -176,7 +176,7 @@ nsDOMUIEvent::GetClientPoint()
} }
NS_IMETHODIMP NS_IMETHODIMP
nsDOMUIEvent::GetView(nsIDOMAbstractView** aView) nsDOMUIEvent::GetView(nsIDOMWindow** aView)
{ {
*aView = mView; *aView = mView;
NS_IF_ADDREF(*aView); NS_IF_ADDREF(*aView);
@ -191,7 +191,11 @@ nsDOMUIEvent::GetDetail(PRInt32* aDetail)
} }
NS_IMETHODIMP NS_IMETHODIMP
nsDOMUIEvent::InitUIEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg) nsDOMUIEvent::InitUIEvent(const nsAString& typeArg,
PRBool canBubbleArg,
PRBool cancelableArg,
nsIDOMWindow* viewArg,
PRInt32 detailArg)
{ {
nsresult rv = nsDOMEvent::InitEvent(typeArg, canBubbleArg, cancelableArg); nsresult rv = nsDOMEvent::InitEvent(typeArg, canBubbleArg, cancelableArg);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
@ -418,9 +422,5 @@ nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
nsGUIEvent *aEvent) nsGUIEvent *aEvent)
{ {
nsDOMUIEvent* it = new nsDOMUIEvent(aPresContext, aEvent); nsDOMUIEvent* it = new nsDOMUIEvent(aPresContext, aEvent);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(it, aInstancePtrResult); return CallQueryInterface(it, aInstancePtrResult);
} }

Просмотреть файл

@ -36,12 +36,11 @@
* *
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#ifndef nsDOMUIEvent_h__ #ifndef nsDOMUIEvent_h
#define nsDOMUIEvent_h__ #define nsDOMUIEvent_h
#include "nsIDOMUIEvent.h" #include "nsIDOMUIEvent.h"
#include "nsIDOMNSUIEvent.h" #include "nsIDOMNSUIEvent.h"
#include "nsIDOMAbstractView.h"
#include "nsDOMEvent.h" #include "nsDOMEvent.h"
class nsDOMUIEvent : public nsDOMEvent, class nsDOMUIEvent : public nsDOMEvent,
@ -78,7 +77,7 @@ protected:
nsIntPoint GetPagePoint(); nsIntPoint GetPagePoint();
protected: protected:
nsCOMPtr<nsIDOMAbstractView> mView; nsCOMPtr<nsIDOMWindow> mView;
PRInt32 mDetail; PRInt32 mDetail;
nsIntPoint mClientPoint; nsIntPoint mClientPoint;
// Screenpoint is mEvent->refPoint. // Screenpoint is mEvent->refPoint.
@ -90,4 +89,4 @@ protected:
NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::) \ NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::) \
NS_FORWARD_TO_NSDOMEVENT NS_FORWARD_TO_NSDOMEVENT
#endif // nsDOMUIEvent_h__ #endif // nsDOMUIEvent_h

Просмотреть файл

@ -118,7 +118,7 @@ nsDOMXULCommandEvent::GetSourceEvent(nsIDOMEvent** aSourceEvent)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType, nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
PRBool aCanBubble, PRBool aCancelable, PRBool aCanBubble, PRBool aCancelable,
nsIDOMAbstractView *aView, nsIDOMWindow* aView,
PRInt32 aDetail, PRInt32 aDetail,
PRBool aCtrlKey, PRBool aAltKey, PRBool aCtrlKey, PRBool aAltKey,
PRBool aShiftKey, PRBool aMetaKey, PRBool aShiftKey, PRBool aMetaKey,
@ -144,9 +144,5 @@ nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
nsInputEvent *aEvent) nsInputEvent *aEvent)
{ {
nsDOMXULCommandEvent* it = new nsDOMXULCommandEvent(aPresContext, aEvent); nsDOMXULCommandEvent* it = new nsDOMXULCommandEvent(aPresContext, aEvent);
if (nsnull == it) {
return NS_ERROR_OUT_OF_MEMORY;
}
return CallQueryInterface(it, aInstancePtrResult); return CallQueryInterface(it, aInstancePtrResult);
} }

Просмотреть файл

@ -118,7 +118,6 @@
#include "nsIDOMMouseScrollEvent.h" #include "nsIDOMMouseScrollEvent.h"
#include "nsIDOMDragEvent.h" #include "nsIDOMDragEvent.h"
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMNSUIEvent.h" #include "nsIDOMNSUIEvent.h"
#include "nsDOMDragEvent.h" #include "nsDOMDragEvent.h"
#include "nsIDOMNSEditableElement.h" #include "nsIDOMNSEditableElement.h"

Просмотреть файл

@ -1388,6 +1388,12 @@ nsHTMLDocument::NormalizeDocument()
return nsDocument::NormalizeDocument(); return nsDocument::NormalizeDocument();
} }
NS_IMETHODIMP
nsHTMLDocument::GetDefaultView(nsIDOMWindow** aWindow)
{
return nsDocument::GetDefaultView(aWindow);
}
// //
// nsIDOMHTMLDocument interface implementation // nsIDOMHTMLDocument interface implementation
// //

Просмотреть файл

@ -39,7 +39,6 @@
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsPresContext.h" #include "nsPresContext.h"
#include "nsIInterfaceRequestorUtils.h" #include "nsIInterfaceRequestorUtils.h"
#include "nsIDOMAbstractView.h"
nsDOMTimeEvent::nsDOMTimeEvent(nsPresContext* aPresContext, nsEvent* aEvent) nsDOMTimeEvent::nsDOMTimeEvent(nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aPresContext, aEvent ? aEvent : new nsUIEvent(PR_FALSE, 0, 0)), : nsDOMEvent(aPresContext, aEvent ? aEvent : new nsUIEvent(PR_FALSE, 0, 0)),
@ -92,7 +91,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTimeEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMTimeEvent::GetView(nsIDOMAbstractView** aView) nsDOMTimeEvent::GetView(nsIDOMWindow** aView)
{ {
*aView = mView; *aView = mView;
NS_IF_ADDREF(*aView); NS_IF_ADDREF(*aView);
@ -108,7 +107,7 @@ nsDOMTimeEvent::GetDetail(PRInt32* aDetail)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg, nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg,
nsIDOMAbstractView* aViewArg, nsIDOMWindow* aViewArg,
PRInt32 aDetailArg) PRInt32 aDetailArg)
{ {
nsresult rv = nsDOMEvent::InitEvent(aTypeArg, PR_FALSE /*doesn't bubble*/, nsresult rv = nsDOMEvent::InitEvent(aTypeArg, PR_FALSE /*doesn't bubble*/,

Просмотреть файл

@ -58,8 +58,8 @@ public:
NS_FORWARD_TO_NSDOMEVENT NS_FORWARD_TO_NSDOMEVENT
private: private:
nsCOMPtr<nsIDOMAbstractView> mView; nsCOMPtr<nsIDOMWindow> mView;
PRInt32 mDetail; PRInt32 mDetail;
}; };
#endif // NS_DOMTIMEEVENT_H_ #endif // NS_DOMTIMEEVENT_H_

Просмотреть файл

@ -51,8 +51,6 @@
#include "nsStyleConsts.h" #include "nsStyleConsts.h"
#include "nsDOMError.h" #include "nsDOMError.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMCSSStyleDeclaration.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIXBLService.h" #include "nsIXBLService.h"
#include "nsGkAtoms.h" #include "nsGkAtoms.h"

Просмотреть файл

@ -38,10 +38,7 @@
#include "nsXMLPrettyPrinter.h" #include "nsXMLPrettyPrinter.h"
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMDocumentXBL.h" #include "nsIDOMDocumentXBL.h"
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsIXSLTProcessor.h" #include "nsIXSLTProcessor.h"
@ -95,16 +92,13 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument,
nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle; nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle;
nsCOMPtr<nsIDOMDocument> frameOwnerDoc; nsCOMPtr<nsIDOMDocument> frameOwnerDoc;
frameElem->GetOwnerDocument(getter_AddRefs(frameOwnerDoc)); frameElem->GetOwnerDocument(getter_AddRefs(frameOwnerDoc));
nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(frameOwnerDoc); if (frameOwnerDoc) {
if (docView) { nsCOMPtr<nsIDOMWindow> window;
nsCOMPtr<nsIDOMAbstractView> defaultView; frameOwnerDoc->GetDefaultView(getter_AddRefs(window));
docView->GetDefaultView(getter_AddRefs(defaultView)); if (window) {
nsCOMPtr<nsIDOMViewCSS> defaultCSSView = window->GetComputedStyle(frameElem,
do_QueryInterface(defaultView); EmptyString(),
if (defaultCSSView) { getter_AddRefs(computedStyle));
defaultCSSView->GetComputedStyle(frameElem,
EmptyString(),
getter_AddRefs(computedStyle));
} }
} }

Просмотреть файл

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
* /* ***** BEGIN LICENSE BLOCK *****
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -119,7 +118,6 @@
#include "nsXULDocument.h" #include "nsXULDocument.h"
#include "nsXULPopupListener.h" #include "nsXULPopupListener.h"
#include "nsRuleWalker.h" #include "nsRuleWalker.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsCSSParser.h" #include "nsCSSParser.h"
#include "nsIListBoxObject.h" #include "nsIListBoxObject.h"

Просмотреть файл

@ -50,7 +50,6 @@ DIRS = \
interfaces/html \ interfaces/html \
interfaces/events \ interfaces/events \
interfaces/stylesheets \ interfaces/stylesheets \
interfaces/views \
interfaces/sidebar \ interfaces/sidebar \
interfaces/css \ interfaces/css \
interfaces/traversal \ interfaces/traversal \

Просмотреть файл

@ -192,7 +192,6 @@
#include "nsBindingManager.h" #include "nsBindingManager.h"
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsStyleSet.h" #include "nsStyleSet.h"
@ -253,7 +252,6 @@
#include "nsIDOMDocumentRange.h" #include "nsIDOMDocumentRange.h"
#include "nsIDOMDocumentTraversal.h" #include "nsIDOMDocumentTraversal.h"
#include "nsIDOMDocumentXBL.h" #include "nsIDOMDocumentXBL.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMElementCSSInlineStyle.h" #include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMLinkStyle.h" #include "nsIDOMLinkStyle.h"
#include "nsIDOMHTMLDocument.h" #include "nsIDOMHTMLDocument.h"
@ -2303,7 +2301,6 @@ nsDOMClassInfo::RegisterExternalClasses()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentView) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentRange) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentRange) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentTraversal) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentTraversal) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \ DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \
@ -2380,8 +2377,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
@ -2393,8 +2388,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH) DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
@ -3128,8 +3121,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(RangeException, nsIDOMRangeException) DOM_CLASSINFO_MAP_BEGIN(RangeException, nsIDOMRangeException)
@ -4023,8 +4014,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal) DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB) DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow) DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow)

Просмотреть файл

@ -111,7 +111,6 @@
#endif #endif
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMNSDocument.h" #include "nsIDOMNSDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMDocumentEvent.h" #include "nsIDOMDocumentEvent.h"
#include "nsIDOMEvent.h" #include "nsIDOMEvent.h"
@ -1334,8 +1333,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow)
NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget) NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget) NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow) NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
NS_INTERFACE_MAP_ENTRY(nsIDOMViewCSS)
NS_INTERFACE_MAP_ENTRY(nsIDOMAbstractView)
NS_INTERFACE_MAP_ENTRY(nsIDOMStorageWindow) NS_INTERFACE_MAP_ENTRY(nsIDOMStorageWindow)
NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB) NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
@ -7888,10 +7885,6 @@ nsGlobalWindow::UpdateCanvasFocus(PRBool aFocusChanged, nsIContent* aNewContent)
} }
} }
//*****************************************************************************
// nsGlobalWindow::nsIDOMViewCSS
//*****************************************************************************
NS_IMETHODIMP NS_IMETHODIMP
nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt, nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt,
const nsAString& aPseudoElt, const nsAString& aPseudoElt,
@ -7928,27 +7921,6 @@ nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt,
return NS_OK; return NS_OK;
} }
//*****************************************************************************
// nsGlobalWindow::nsIDOMAbstractView
//*****************************************************************************
NS_IMETHODIMP
nsGlobalWindow::GetDocument(nsIDOMDocumentView ** aDocumentView)
{
NS_ENSURE_ARG_POINTER(aDocumentView);
nsresult rv = NS_OK;
if (mDocument) {
rv = CallQueryInterface(mDocument, aDocumentView);
}
else {
*aDocumentView = nsnull;
}
return rv;
}
//***************************************************************************** //*****************************************************************************
// nsGlobalWindow::nsIDOMStorageWindow // nsGlobalWindow::nsIDOMStorageWindow
//***************************************************************************** //*****************************************************************************

Просмотреть файл

@ -62,7 +62,6 @@
#include "nsIDocShellTreeOwner.h" #include "nsIDocShellTreeOwner.h"
#include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeItem.h"
#include "nsIDOMClientInformation.h" #include "nsIDOMClientInformation.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsIDOM3EventTarget.h" #include "nsIDOM3EventTarget.h"
#include "nsIDOMNSEventTarget.h" #include "nsIDOMNSEventTarget.h"
@ -280,7 +279,6 @@ class nsGlobalWindow : public nsPIDOMWindow,
public nsPIDOMEventTarget, public nsPIDOMEventTarget,
public nsIDOM3EventTarget, public nsIDOM3EventTarget,
public nsIDOMNSEventTarget, public nsIDOMNSEventTarget,
public nsIDOMViewCSS,
public nsIDOMStorageWindow, public nsIDOMStorageWindow,
public nsIDOMStorageIndexedDB, public nsIDOMStorageIndexedDB,
public nsSupportsWeakReference, public nsSupportsWeakReference,
@ -419,12 +417,6 @@ public:
virtual NS_HIDDEN_(void) MaybeUpdateTouchState(); virtual NS_HIDDEN_(void) MaybeUpdateTouchState();
virtual NS_HIDDEN_(void) UpdateTouchState(); virtual NS_HIDDEN_(void) UpdateTouchState();
// nsIDOMViewCSS
NS_DECL_NSIDOMVIEWCSS
// nsIDOMAbstractView
NS_DECL_NSIDOMABSTRACTVIEW
// nsIDOMStorageWindow // nsIDOMStorageWindow
NS_DECL_NSIDOMSTORAGEWINDOW NS_DECL_NSIDOMSTORAGEWINDOW

Просмотреть файл

@ -77,10 +77,6 @@ interface nsIDOMLinkStyle;
interface nsIDOMStyleSheet; interface nsIDOMStyleSheet;
interface nsIDOMMediaList; interface nsIDOMMediaList;
// Views
interface nsIDOMAbstractView;
interface nsIDOMDocumentView;
// Base // Base
interface nsIDOMWindow; interface nsIDOMWindow;
interface nsIDOMWindowInternal; interface nsIDOMWindowInternal;
@ -130,4 +126,3 @@ interface nsIDOMRange;
interface nsIDOMCRMFObject; interface nsIDOMCRMFObject;
interface nsIDOMCrypto; interface nsIDOMCrypto;
interface nsIDOMPkcs11; interface nsIDOMPkcs11;

Просмотреть файл

@ -47,11 +47,10 @@ interface nsISelection;
* contain child windows if the document in the window contains a * contain child windows if the document in the window contains a
* HTML frameset document or if the document contains iframe elements. * HTML frameset document or if the document contains iframe elements.
* *
* This interface is not officially defined by any standard bodies, it * @see <http://www.whatwg.org/html/#window>
* originates from the defacto DOM Level 0 standard.
*/ */
[scriptable, uuid(a6cf906b-15b3-11d2-932e-00805f8add32)] [scriptable, uuid(ff7d278f-93db-4078-b89a-058c8e1270b4)]
interface nsIDOMWindow : nsISupports interface nsIDOMWindow : nsISupports
{ {
/** /**
@ -150,4 +149,10 @@ interface nsIDOMWindow : nsISupports
* Method for sizing this window to the content in the window. * Method for sizing this window to the content in the window.
*/ */
void sizeToContent(); void sizeToContent();
/**
* @see <http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle>
*/
nsIDOMCSSStyleDeclaration getComputedStyle(in nsIDOMElement elt,
[optional] in DOMString pseudoElt);
}; };

Просмотреть файл

@ -40,7 +40,7 @@
interface nsIDOMOfflineResourceList; interface nsIDOMOfflineResourceList;
interface nsIDOMBlob; interface nsIDOMBlob;
[scriptable, uuid(efff0d88-3b94-4375-bdeb-676a847ecd7d)] [scriptable, uuid(e2796e00-14de-4ce0-acfe-0374bc0e715d)]
interface nsIDOMWindow2 : nsIDOMWindow interface nsIDOMWindow2 : nsIDOMWindow
{ {
/** /**

Просмотреть файл

@ -46,7 +46,7 @@ interface nsIVariant;
interface nsIAnimationFrameListener; interface nsIAnimationFrameListener;
interface nsIDOMMediaQueryList; interface nsIDOMMediaQueryList;
[scriptable, uuid(04eafa93-efbe-4254-9d65-91c344fa7ff2)] [scriptable, uuid(4d95736f-8130-43cb-a276-5bc554eca80a)]
interface nsIDOMWindowInternal : nsIDOMWindow2 interface nsIDOMWindowInternal : nsIDOMWindow2
{ {
readonly attribute nsIDOMWindowInternal window; readonly attribute nsIDOMWindowInternal window;

Просмотреть файл

@ -52,7 +52,7 @@
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
*/ */
[scriptable, uuid(2d305b95-a030-4d24-a12c-7fabf61a8c3c)] [scriptable, uuid(d12f0ecf-434a-4b5c-81ad-354e3b9037b9)]
interface nsIDOMDocument : nsIDOMNode interface nsIDOMDocument : nsIDOMNode
{ {
readonly attribute nsIDOMDocumentType doctype; readonly attribute nsIDOMDocumentType doctype;
@ -108,4 +108,11 @@ interface nsIDOMDocument : nsIDOMNode
raises(DOMException); raises(DOMException);
// Introduced in DOM Level 3: // Introduced in DOM Level 3:
void normalizeDocument(); void normalizeDocument();
/**
* The window associated with this document.
*
* @see http://www.whatwg.org/html/#dom-document-defaultview
*/
readonly attribute nsIDOMWindow defaultView;
}; };

Просмотреть файл

@ -38,7 +38,7 @@
#include "nsIDOMDocument.idl" #include "nsIDOMDocument.idl"
[scriptable, uuid(f493687c-ea80-471b-965b-11467ebea24b)] [scriptable, uuid(68e4448c-eb64-48ea-801a-0c83008d2607)]
interface nsIDOMXMLDocument : nsIDOMDocument interface nsIDOMXMLDocument : nsIDOMDocument
{ {
// DOM Level 3 Load & Save, DocumentLS // DOM Level 3 Load & Save, DocumentLS

Просмотреть файл

@ -71,7 +71,6 @@ XPIDLSRCS = \
nsIDOMDocumentCSS.idl \ nsIDOMDocumentCSS.idl \
nsIDOMRGBColor.idl \ nsIDOMRGBColor.idl \
nsIDOMRect.idl \ nsIDOMRect.idl \
nsIDOMViewCSS.idl \
nsIDOMNSRGBAColor.idl \ nsIDOMNSRGBAColor.idl \
$(NULL) $(NULL)

Просмотреть файл

@ -1,49 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Johnny Stenback <jst@netscape.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMAbstractView.idl"
[scriptable, uuid(0b9341f3-95d4-4fa4-adcd-e119e0db2889)]
interface nsIDOMViewCSS : nsIDOMAbstractView
{
/**
* @see <http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle>
*/
nsIDOMCSSStyleDeclaration getComputedStyle(in nsIDOMElement elt,
[optional] in DOMString pseudoElt);
};

Просмотреть файл

@ -38,10 +38,9 @@
#include "domstubs.idl" #include "domstubs.idl"
#include "nsIDOMMouseEvent.idl" #include "nsIDOMMouseEvent.idl"
interface nsIDOMAbstractView;
interface nsIDOMDataTransfer; interface nsIDOMDataTransfer;
[scriptable, uuid(98351627-62d7-4b07-bbf3-78009b20764b)] [scriptable, uuid(0f4fef03-c0e9-406c-a754-c01148e431ae)]
interface nsIDOMDragEvent : nsIDOMMouseEvent interface nsIDOMDragEvent : nsIDOMMouseEvent
{ {
readonly attribute nsIDOMDataTransfer dataTransfer; readonly attribute nsIDOMDataTransfer dataTransfer;
@ -49,7 +48,7 @@ interface nsIDOMDragEvent : nsIDOMMouseEvent
void initDragEvent(in DOMString typeArg, void initDragEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView aView, in nsIDOMWindow aView,
in long aDetail, in long aDetail,
in long aScreenX, in long aScreenX,
in long aScreenY, in long aScreenY,

Просмотреть файл

@ -39,7 +39,7 @@
#include "nsIDOMUIEvent.idl" #include "nsIDOMUIEvent.idl"
[scriptable, uuid(028e0e6e-8b01-11d3-aae7-0010838a3123)] [scriptable, uuid(e44d7977-20f2-442e-bc13-0f2f52992a4c)]
interface nsIDOMKeyEvent : nsIDOMUIEvent interface nsIDOMKeyEvent : nsIDOMUIEvent
{ {
const unsigned long DOM_VK_CANCEL = 0x03; const unsigned long DOM_VK_CANCEL = 0x03;
@ -193,7 +193,7 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
void initKeyEvent(in DOMString typeArg, void initKeyEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in boolean ctrlKeyArg, in boolean ctrlKeyArg,
in boolean altKeyArg, in boolean altKeyArg,
in boolean shiftKeyArg, in boolean shiftKeyArg,

Просмотреть файл

@ -47,7 +47,7 @@
* http://www.w3.org/TR/DOM-Level-2-Events/ * http://www.w3.org/TR/DOM-Level-2-Events/
*/ */
[scriptable, uuid(ff751edc-8b02-aae7-0010-8301838a3123)] [scriptable, uuid(73558605-f479-493e-86d1-9794cd117fef)]
interface nsIDOMMouseEvent : nsIDOMUIEvent interface nsIDOMMouseEvent : nsIDOMUIEvent
{ {
readonly attribute long screenX; readonly attribute long screenX;
@ -67,7 +67,7 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent
void initMouseEvent(in DOMString typeArg, void initMouseEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg, in long detailArg,
in long screenXArg, in long screenXArg,
in long screenYArg, in long screenYArg,

Просмотреть файл

@ -38,7 +38,7 @@
#include "nsIDOMMouseEvent.idl" #include "nsIDOMMouseEvent.idl"
[scriptable, uuid(ba8d1a7e-b475-4542-8d32-01e7ea7b8091)] [scriptable, uuid(af08bce0-6821-4bac-8964-0fcee4be549a)]
interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
{ {
const long HORIZONTAL_AXIS = 1; const long HORIZONTAL_AXIS = 1;
@ -49,7 +49,7 @@ interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
void initMouseScrollEvent(in DOMString typeArg, void initMouseScrollEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg, in long detailArg,
in long screenXArg, in long screenXArg,
in long screenYArg, in long screenYArg,

Просмотреть файл

@ -40,7 +40,7 @@
#include "nsIDOMMouseEvent.idl" #include "nsIDOMMouseEvent.idl"
[scriptable, uuid(9b454391-0190-4313-a070-1e26e9bf6f31)] [scriptable, uuid(e9ed248b-1995-482f-8407-33ae7744bb9c)]
interface nsIDOMMozTouchEvent : nsIDOMMouseEvent interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
{ {
readonly attribute unsigned long streamId; readonly attribute unsigned long streamId;
@ -48,7 +48,7 @@ interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
void initMozTouchEvent(in DOMString typeArg, void initMozTouchEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg, in long detailArg,
in long screenXArg, in long screenXArg,
in long screenYArg, in long screenYArg,

Просмотреть файл

@ -43,7 +43,7 @@
* by providing various information related to the mouse event. * by providing various information related to the mouse event.
*/ */
[scriptable, uuid(f5dd5fbb-f4ff-4277-819c-f31aa1dafc32)] [scriptable, uuid(8418a402-3c9b-431a-80a7-a59b23ed57a0)]
interface nsIDOMNSMouseEvent : nsIDOMMouseEvent interface nsIDOMNSMouseEvent : nsIDOMMouseEvent
{ {
// Finger or touch pressure event value // Finger or touch pressure event value
@ -63,7 +63,7 @@ interface nsIDOMNSMouseEvent : nsIDOMMouseEvent
void initNSMouseEvent(in DOMString typeArg, void initNSMouseEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg, in long detailArg,
in long screenXArg, in long screenXArg,
in long screenYArg, in long screenYArg,

Просмотреть файл

@ -37,7 +37,7 @@
#include "nsIDOMUIEvent.idl" #include "nsIDOMUIEvent.idl"
[scriptable, uuid(b2f49035-4a2f-4e62-8fb0-deb68b0de4d9)] [scriptable, uuid(911c3352-6690-421c-9bbe-6bd34f1600dc)]
interface nsIDOMScrollAreaEvent : nsIDOMUIEvent interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
{ {
// Scroll area client rect // Scroll area client rect
@ -49,7 +49,7 @@ interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
void initScrollAreaEvent(in DOMString aEventType, void initScrollAreaEvent(in DOMString aEventType,
in boolean aCanBubble, in boolean aCanBubble,
in boolean aCancelable, in boolean aCancelable,
in nsIDOMAbstractView aView, in nsIDOMWindow aView,
in long aDetail, in long aDetail,
in float x, in float x,
in float y, in float y,

Просмотреть файл

@ -97,7 +97,7 @@
* consuming events. * consuming events.
*/ */
[scriptable, uuid(cb68e879-f710-415d-a871-9a550860df01)] [scriptable, uuid(fe6b7df3-be7c-4a0b-99a2-da84e956e2f5)]
interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
{ {
/* Swipe direction constants */ /* Swipe direction constants */
@ -148,7 +148,7 @@ interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
void initSimpleGestureEvent(in DOMString typeArg, void initSimpleGestureEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg, in long detailArg,
in long screenXArg, in long screenXArg,
in long screenYArg, in long screenYArg,

Просмотреть файл

@ -77,7 +77,7 @@ interface nsIDOMTouchEvent : nsIDOMUIEvent {
void initTouchEvent(in DOMString type, void initTouchEvent(in DOMString type,
in boolean canBubble, in boolean canBubble,
in boolean cancelable, in boolean cancelable,
in nsIDOMAbstractView view, in nsIDOMWindow view,
in long detail, in long detail,
in boolean ctrlKey, in boolean ctrlKey,
in boolean altKey, in boolean altKey,
@ -88,9 +88,9 @@ interface nsIDOMTouchEvent : nsIDOMUIEvent {
in nsIDOMTouchList changedTouches); in nsIDOMTouchList changedTouches);
}; };
[scriptable, uuid(922e0f11-28b9-4560-9fb8-869fe143845f)] [scriptable, uuid(804a3851-ea2e-4e5f-bedd-315f37f31ab1)]
interface nsIDOMDocumentTouch : nsISupports { interface nsIDOMDocumentTouch : nsISupports {
nsIDOMTouch createTouch([optional] in nsIDOMAbstractView view, nsIDOMTouch createTouch([optional] in nsIDOMWindow view,
[optional] in nsIDOMEventTarget target, [optional] in nsIDOMEventTarget target,
[optional] in long identifier, [optional] in long identifier,
[optional] in long pageX, [optional] in long pageX,

Просмотреть файл

@ -47,14 +47,14 @@
* http://www.w3.org/TR/DOM-Level-2-Events/ * http://www.w3.org/TR/DOM-Level-2-Events/
*/ */
[scriptable, uuid(a6cf90c3-15b3-11d2-932e-00805f8add32)] [scriptable, uuid(25f28689-3f78-47e8-8d76-15b936faf8c1)]
interface nsIDOMUIEvent : nsIDOMEvent interface nsIDOMUIEvent : nsIDOMEvent
{ {
readonly attribute nsIDOMAbstractView view; readonly attribute nsIDOMWindow view;
readonly attribute long detail; readonly attribute long detail;
void initUIEvent(in DOMString typeArg, void initUIEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg); in long detailArg);
}; };

Просмотреть файл

@ -50,7 +50,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/ * http://www.whatwg.org/specs/web-apps/current-work/
*/ */
[scriptable, uuid(2d7a0f2e-6b1c-4e93-bbea-122eb0a8a513)] [scriptable, uuid(42bb545e-be46-4f4f-8c0a-6c948ea0c1d4)]
interface nsIDOMHTMLDocument : nsIDOMDocument interface nsIDOMHTMLDocument : nsIDOMDocument
{ {
attribute DOMString title; attribute DOMString title;

Просмотреть файл

@ -45,13 +45,13 @@
* http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent * http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent
*/ */
[scriptable, uuid(0d309c26-ddbb-44cb-9af1-3008972349e3)] [scriptable, uuid(873785cc-d8be-48af-8b30-5c566e3f4e6e)]
interface nsIDOMTimeEvent : nsIDOMEvent interface nsIDOMTimeEvent : nsIDOMEvent
{ {
readonly attribute long detail; readonly attribute long detail;
readonly attribute nsIDOMAbstractView view; readonly attribute nsIDOMWindow view;
void initTimeEvent(in DOMString typeArg, void initTimeEvent(in DOMString typeArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg); in long detailArg);
}; };

Просмотреть файл

@ -39,7 +39,7 @@
interface nsIDOMSVGSVGElement; interface nsIDOMSVGSVGElement;
[scriptable, uuid(dcac0765-b258-4e0b-9862-6470eb9876ba)] [scriptable, uuid(907f1ada-5ace-4789-8c25-0c79f251044d)]
interface nsIDOMSVGDocument : nsIDOMDocument interface nsIDOMSVGDocument : nsIDOMDocument
/* , nsIDOMDocumentEvent */ /* , nsIDOMDocumentEvent */
{ {

Просмотреть файл

@ -45,7 +45,7 @@
interface nsIDOMSVGRect; interface nsIDOMSVGRect;
interface nsIDOMSVGPoint; interface nsIDOMSVGPoint;
[scriptable, uuid(339a8c7a-552e-4cbc-8d96-8370a3939358)] [scriptable, uuid(7298880d-127d-470d-a8ac-e5a8e5969270)]
interface nsIDOMSVGZoomEvent : nsIDOMUIEvent interface nsIDOMSVGZoomEvent : nsIDOMUIEvent
{ {
readonly attribute nsIDOMSVGRect zoomRectScreen; readonly attribute nsIDOMSVGRect zoomRectScreen;

Просмотреть файл

@ -1,54 +0,0 @@
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = dom
XPIDL_MODULE = dom_views
GRE_MODULE = 1
SDK_XPIDLSRCS = \
nsIDOMDocumentView.idl \
nsIDOMAbstractView.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -1,53 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Johnny Stenback <jst@netscape.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "domstubs.idl"
/**
* The nsIDOMAbstractView interface is a datatype for a view in the
* Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Views
*/
[scriptable, uuid(F51EBADE-8B1A-11D3-AAE7-0010830123B4)]
interface nsIDOMAbstractView : nsISupports
{
readonly attribute nsIDOMDocumentView document;
};

Просмотреть файл

@ -1,54 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Johnny Stenback <jst@netscape.com> (original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "domstubs.idl"
/**
* The nsIDOMDocumentView interface is a datatype for a document that
* supports views in the Document Object Model.
*
* For more information on this interface please see
* http://www.w3.org/TR/DOM-Level-2-Views
*/
[scriptable, uuid(1ACDB2BA-1DD2-11B2-95BC-9542495D2569)]
interface nsIDOMDocumentView : nsISupports
{
readonly attribute nsIDOMAbstractView defaultView;
};

Просмотреть файл

@ -43,7 +43,7 @@
#include "nsIDOMUIEvent.idl" #include "nsIDOMUIEvent.idl"
[scriptable, uuid(f9fa8205-a988-4828-9228-f3332d5475ac)] [scriptable, uuid(1d78da1e-2177-4b8f-9b11-41e78d1e60f7)]
interface nsIDOMXULCommandEvent : nsIDOMUIEvent interface nsIDOMXULCommandEvent : nsIDOMUIEvent
{ {
/** /**
@ -68,7 +68,7 @@ interface nsIDOMXULCommandEvent : nsIDOMUIEvent
void initCommandEvent(in DOMString typeArg, void initCommandEvent(in DOMString typeArg,
in boolean canBubbleArg, in boolean canBubbleArg,
in boolean cancelableArg, in boolean cancelableArg,
in nsIDOMAbstractView viewArg, in nsIDOMWindow viewArg,
in long detailArg, in long detailArg,
in boolean ctrlKeyArg, in boolean ctrlKeyArg,
in boolean altKeyArg, in boolean altKeyArg,

Просмотреть файл

@ -690,13 +690,14 @@ nsHTMLEditor::CheckPositionedElementBGandFG(nsIDOMElement * aElement,
bgColorStr); bgColorStr);
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
if (bgColorStr.EqualsLiteral("transparent")) { if (bgColorStr.EqualsLiteral("transparent")) {
nsCOMPtr<nsIDOMWindow> window;
res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(window));
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsIDOMViewCSS> viewCSS;
res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(viewCSS));
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl; nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
res = viewCSS->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl)); res = window->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
// from these declarations, get the one we want and that one only // from these declarations, get the one we want and that one only
nsCOMPtr<nsIDOMCSSValue> colorCssValue; nsCOMPtr<nsIDOMCSSValue> colorCssValue;
res = cssDecl->GetPropertyCSSValue(NS_LITERAL_STRING("color"), getter_AddRefs(colorCssValue)); res = cssDecl->GetPropertyCSSValue(NS_LITERAL_STRING("color"), getter_AddRefs(colorCssValue));

Просмотреть файл

@ -430,13 +430,13 @@ nsHTMLEditor::GetPositionAndDimensions(nsIDOMElement * aElement,
// Yes, it is absolutely positioned // Yes, it is absolutely positioned
mResizedObjectIsAbsolutelyPositioned = PR_TRUE; mResizedObjectIsAbsolutelyPositioned = PR_TRUE;
nsCOMPtr<nsIDOMViewCSS> viewCSS; nsCOMPtr<nsIDOMWindow> window;
res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(viewCSS)); res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(window));
NS_ENSURE_TRUE(viewCSS, NS_ERROR_FAILURE); NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl; nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
// Get the all the computed css styles attached to the element node // Get the all the computed css styles attached to the element node
res = viewCSS->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl)); res = window->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
aBorderLeft = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("border-left-width")); aBorderLeft = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("border-left-width"));

Просмотреть файл

@ -47,7 +47,6 @@
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMElementCSSInlineStyle.h" #include "nsIDOMElementCSSInlineStyle.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIAtom.h" #include "nsIAtom.h"
#include "nsTextEditUtils.h" #include "nsTextEditUtils.h"
@ -538,35 +537,36 @@ nsresult
nsHTMLCSSUtils::GetComputedProperty(nsIDOMNode *aNode, nsIAtom *aProperty, nsHTMLCSSUtils::GetComputedProperty(nsIDOMNode *aNode, nsIAtom *aProperty,
nsAString & aValue) nsAString & aValue)
{ {
nsCOMPtr<nsIDOMViewCSS> viewCSS = nsnull; nsCOMPtr<nsIDOMWindow> window;
nsresult res = GetDefaultViewCSS(aNode, getter_AddRefs(viewCSS)); nsresult res = GetDefaultViewCSS(aNode, getter_AddRefs(window));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
return GetCSSInlinePropertyBase(aNode, aProperty, aValue, viewCSS, COMPUTED_STYLE_TYPE); return GetCSSInlinePropertyBase(aNode, aProperty, aValue, window, COMPUTED_STYLE_TYPE);
} }
nsresult nsresult
nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty, nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
nsAString &aValue, nsAString& aValue,
nsIDOMViewCSS *aViewCSS, nsIDOMWindow* aWindow,
PRUint8 aStyleType) PRUint8 aStyleType)
{ {
aValue.Truncate(); aValue.Truncate();
NS_ENSURE_TRUE(aProperty, NS_ERROR_NULL_POINTER); NS_ENSURE_TRUE(aProperty, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIDOMElement>element; nsCOMPtr<nsIDOMElement> element;
nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element)); nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
switch (aStyleType) { switch (aStyleType) {
case COMPUTED_STYLE_TYPE: case COMPUTED_STYLE_TYPE:
if (element && aViewCSS) { if (element && aWindow) {
nsAutoString value, propString; nsAutoString value, propString;
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl; nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
aProperty->ToString(propString); aProperty->ToString(propString);
// Get the all the computed css styles attached to the element node // Get the all the computed css styles attached to the element node
res = aViewCSS->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl)); res = aWindow->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl));
if (NS_FAILED(res) || !cssDecl) return res; if (NS_FAILED(res) || !cssDecl)
return res;
// from these declarations, get the one we want and that one only // from these declarations, get the one we want and that one only
res = cssDecl->GetPropertyValue(propString, value); res = cssDecl->GetPropertyValue(propString, value);
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
@ -591,33 +591,29 @@ nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
} }
nsresult nsresult
nsHTMLCSSUtils::GetDefaultViewCSS(nsIDOMNode *aNode, nsIDOMViewCSS **aViewCSS) nsHTMLCSSUtils::GetDefaultViewCSS(nsIDOMNode *aNode, nsIDOMWindow **aViewCSS)
{ {
nsCOMPtr<nsIDOMElement>element; nsCOMPtr<nsIDOMElement> element;
nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element)); nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
// if we have an element node // TODO: move this initialization to the top of the function
if (element) {
// find the owner document
nsCOMPtr<nsIDOMDocument> doc;
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(element);
res = node->GetOwnerDocument(getter_AddRefs(doc));
NS_ENSURE_SUCCESS(res, res);
if (doc) {
nsCOMPtr<nsIDOMDocumentView> documentView = do_QueryInterface(doc);
nsCOMPtr<nsIDOMAbstractView> abstractView;
// from the document, get the abtractView
res = documentView->GetDefaultView(getter_AddRefs(abstractView));
NS_ENSURE_SUCCESS(res, res);
if (abstractView) {
// from the abstractView, get the CSS view
CallQueryInterface(abstractView, aViewCSS);
return NS_OK;
}
}
}
*aViewCSS = nsnull; *aViewCSS = nsnull;
if (!element) {
return NS_OK;
}
// find the owner document
nsCOMPtr<nsIDOMDocument> doc;
nsCOMPtr<nsIDOMNode> node = do_QueryInterface(element);
res = node->GetOwnerDocument(getter_AddRefs(doc));
NS_ENSURE_SUCCESS(res, res);
if (!doc) {
return NS_OK;
}
nsCOMPtr<nsIDOMWindow> window;
res = doc->GetDefaultView(getter_AddRefs(window));
NS_ENSURE_SUCCESS(res, res);
window.forget(aViewCSS);
return NS_OK; return NS_OK;
} }
@ -1087,9 +1083,9 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
if (theElement && IsCSSEditableProperty(theElement, aHTMLProperty, aAttribute)) { if (theElement && IsCSSEditableProperty(theElement, aHTMLProperty, aAttribute)) {
// Yes, the requested HTML style has a CSS equivalence in this implementation // Yes, the requested HTML style has a CSS equivalence in this implementation
// Retrieve the default ViewCSS if we are asked for computed styles // Retrieve the default ViewCSS if we are asked for computed styles
nsCOMPtr<nsIDOMViewCSS> viewCSS = nsnull; nsCOMPtr<nsIDOMWindow> window;
if (COMPUTED_STYLE_TYPE == aStyleType) { if (COMPUTED_STYLE_TYPE == aStyleType) {
res = GetDefaultViewCSS(theElement, getter_AddRefs(viewCSS)); res = GetDefaultViewCSS(theElement, getter_AddRefs(window));
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
} }
nsTArray<nsIAtom*> cssPropertyArray; nsTArray<nsIAtom*> cssPropertyArray;
@ -1104,7 +1100,7 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
nsAutoString valueString; nsAutoString valueString;
// retrieve the specified/computed value of the property // retrieve the specified/computed value of the property
res = GetCSSInlinePropertyBase(theElement, cssPropertyArray[index], res = GetCSSInlinePropertyBase(theElement, cssPropertyArray[index],
valueString, viewCSS, aStyleType); valueString, window, aStyleType);
NS_ENSURE_SUCCESS(res, res); NS_ENSURE_SUCCESS(res, res);
// append the value to aValueString (possibly with a leading whitespace) // append the value to aValueString (possibly with a leading whitespace)
if (index) aValueString.Append(PRUnichar(' ')); if (index) aValueString.Append(PRUnichar(' '));

Просмотреть файл

@ -42,7 +42,6 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsString.h" #include "nsString.h"
#include "nsTArray.h" #include "nsTArray.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMNode.h" #include "nsIDOMNode.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIHTMLEditor.h" #include "nsIHTMLEditor.h"
@ -54,6 +53,7 @@
#define COMPUTED_STYLE_TYPE 2 #define COMPUTED_STYLE_TYPE 2
class nsHTMLEditor; class nsHTMLEditor;
class nsIDOMWindow;
typedef void (*nsProcessValueFunc)(const nsAString * aInputString, nsAString & aOutputString, typedef void (*nsProcessValueFunc)(const nsAString * aInputString, nsAString & aOutputString,
const char * aDefaultValueString, const char * aDefaultValueString,
@ -312,12 +312,13 @@ public:
*/ */
nsresult GetElementContainerOrSelf(nsIDOMNode * aNode, nsIDOMElement ** aElement); nsresult GetElementContainerOrSelf(nsIDOMNode * aNode, nsIDOMElement ** aElement);
/** Gets the default DOMView for a given node /**
* Gets the default Window for a given node.
* *
* @param aNode the node we want the default DOMView for * @param aNode the node we want the default Window for
* @param aViewCSS [OUT] the default DOMViewCSS * @param aWindow [OUT] the default Window
*/ */
nsresult GetDefaultViewCSS(nsIDOMNode * aNode, nsIDOMViewCSS ** aViewCSS); nsresult GetDefaultViewCSS(nsIDOMNode* aNode, nsIDOMWindow** aWindow);
private: private:
@ -383,17 +384,17 @@ private:
PRBool aRemoveProperty); PRBool aRemoveProperty);
/** back-end for GetSpecifiedProperty and GetComputedProperty /** back-end for GetSpecifiedProperty and GetComputedProperty
* *
* @param aNode [IN] a DOM node * @param aNode [IN] a DOM node
* @param aProperty [IN] a CSS property * @param aProperty [IN] a CSS property
* @param aValue [OUT] the retrieved value for this property * @param aValue [OUT] the retrieved value for this property
* @param aViewCSS [IN] the ViewCSS we need in case we query computed styles * @param aWindow [IN] the window we need in case we query computed styles
* @param aStyleType [IN] SPECIFIED_STYLE_TYPE to query the specified style values * @param aStyleType [IN] SPECIFIED_STYLE_TYPE to query the specified style values
COMPUTED_STYLE_TYPE to query the computed style values * COMPUTED_STYLE_TYPE to query the computed style values
*/ */
nsresult GetCSSInlinePropertyBase(nsIDOMNode * aNode, nsIAtom * aProperty, nsresult GetCSSInlinePropertyBase(nsIDOMNode * aNode, nsIAtom * aProperty,
nsAString & aValue, nsAString & aValue,
nsIDOMViewCSS * aViewCSS, nsIDOMWindow* aWindow,
PRUint8 aStyleType); PRUint8 aStyleType);

Просмотреть файл

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
* /* ***** BEGIN LICENSE BLOCK *****
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -24,6 +23,7 @@
* Chris Saari <saari@netscape.com> * Chris Saari <saari@netscape.com>
* Conrad Carlen <ccarlen@netscape.com> * Conrad Carlen <ccarlen@netscape.com>
* Pierre Chanial <p_ch@verizon.net> * Pierre Chanial <p_ch@verizon.net>
* Ms2ger <ms2ger@gmail.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -51,9 +51,7 @@
#include "nsIDOMHTMLImageElement.h" #include "nsIDOMHTMLImageElement.h"
#include "nsIDOMHTMLAreaElement.h" #include "nsIDOMHTMLAreaElement.h"
#include "nsIDOMHTMLLinkElement.h" #include "nsIDOMHTMLLinkElement.h"
#include "nsIDOMDocumentView.h" #include "nsIDOMWindow.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMCSSValue.h" #include "nsIDOMCSSValue.h"
#include "nsIDOMCSSPrimitiveValue.h" #include "nsIDOMCSSPrimitiveValue.h"
@ -293,13 +291,11 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgIR
nsCOMPtr<nsIDOMDocument> document; nsCOMPtr<nsIDOMDocument> document;
domNode->GetOwnerDocument(getter_AddRefs(document)); domNode->GetOwnerDocument(getter_AddRefs(document));
nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(document)); NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(docView, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMAbstractView> defaultView; nsCOMPtr<nsIDOMWindow> window;
docView->GetDefaultView(getter_AddRefs(defaultView)); document->GetDefaultView(getter_AddRefs(window));
nsCOMPtr<nsIDOMViewCSS> defaultCSSView(do_QueryInterface(defaultView)); NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
NS_ENSURE_TRUE(defaultCSSView, NS_ERROR_FAILURE);
nsCOMPtr<nsIDOMCSSPrimitiveValue> primitiveValue; nsCOMPtr<nsIDOMCSSPrimitiveValue> primitiveValue;
nsAutoString bgStringValue; nsAutoString bgStringValue;
@ -327,8 +323,8 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgIR
break; break;
nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle; nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle;
defaultCSSView->GetComputedStyle(domElement, EmptyString(), window->GetComputedStyle(domElement, EmptyString(),
getter_AddRefs(computedStyle)); getter_AddRefs(computedStyle));
if (computedStyle) { if (computedStyle) {
nsCOMPtr<nsIDOMCSSValue> cssValue; nsCOMPtr<nsIDOMCSSValue> cssValue;
computedStyle->GetPropertyCSSValue(NS_LITERAL_STRING("background-image"), computedStyle->GetPropertyCSSValue(NS_LITERAL_STRING("background-image"),

Просмотреть файл

@ -21,6 +21,7 @@
* Contributor(s): * Contributor(s):
* Brett Wilson <brettw@gmail.com> (original author) * Brett Wilson <brettw@gmail.com> (original author)
* Robert O'Callahan <rocallahan@novell.com> * Robert O'Callahan <rocallahan@novell.com>
* Ms2ger <ms2ger@gmail.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -41,7 +42,6 @@
#include "nsIAtom.h" #include "nsIAtom.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMNSRange.h" #include "nsIDOMNSRange.h"
#include "nsIDOMRange.h" #include "nsIDOMRange.h"
@ -102,15 +102,14 @@ mozInlineSpellWordUtil::Init(nsWeakPtr aWeakEditor)
mDOMDocumentRange = do_QueryInterface(domDoc, &rv); mDOMDocumentRange = do_QueryInterface(domDoc, &rv);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
// view // Window
nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(domDoc, &rv); nsCOMPtr<nsIDOMWindow> window;
NS_ENSURE_SUCCESS(rv, rv); rv = domDoc->GetDefaultView(getter_AddRefs(window));
nsCOMPtr<nsIDOMAbstractView> abstractView;
rv = docView->GetDefaultView(getter_AddRefs(abstractView));
NS_ENSURE_SUCCESS(rv, rv);
mCSSView = do_QueryInterface(abstractView, &rv);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
mCSSView = window;
NS_ENSURE_TRUE(window, NS_ERROR_NULL_POINTER);
// Find the root node for the editor. For contenteditable we'll need something // Find the root node for the editor. For contenteditable we'll need something
// cleverer here. // cleverer here.
nsCOMPtr<nsIDOMElement> rootElt; nsCOMPtr<nsIDOMElement> rootElt;
@ -498,7 +497,7 @@ ContainsDOMWordSeparator(nsIDOMNode* aNode, PRInt32 aBeforeOffset,
} }
static PRBool static PRBool
IsBreakElement(nsIDOMViewCSS* aDocView, nsIDOMNode* aNode) IsBreakElement(nsIDOMWindow* aDocView, nsIDOMNode* aNode)
{ {
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode); nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
if (!element) if (!element)
@ -537,8 +536,8 @@ IsBreakElement(nsIDOMViewCSS* aDocView, nsIDOMNode* aNode)
} }
struct CheckLeavingBreakElementClosure { struct CheckLeavingBreakElementClosure {
nsIDOMViewCSS* mDocView; nsIDOMWindow* mDocView;
PRPackedBool mLeftBreakElement; PRPackedBool mLeftBreakElement;
}; };
static void static void

Просмотреть файл

@ -38,7 +38,6 @@
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentRange.h" #include "nsIDOMDocumentRange.h"
#include "nsIDOMViewCSS.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsString.h" #include "nsString.h"
#include "nsTArray.h" #include "nsTArray.h"
@ -126,7 +125,7 @@ private:
// cached stuff for the editor, set by Init // cached stuff for the editor, set by Init
nsCOMPtr<nsIDOMDocumentRange> mDOMDocumentRange; nsCOMPtr<nsIDOMDocumentRange> mDOMDocumentRange;
nsCOMPtr<nsIDocument> mDocument; nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIDOMViewCSS> mCSSView; nsCOMPtr<nsIDOMWindow> mCSSView;
nsCOMPtr<nsIUGenCategory> mCategories; nsCOMPtr<nsIUGenCategory> mCategories;
// range to check, see SetRange // range to check, see SetRange

Просмотреть файл

@ -22,6 +22,7 @@
* Contributor(s): * Contributor(s):
* Oleg Romashin <romaxa@gmail.com> (original author) * Oleg Romashin <romaxa@gmail.com> (original author)
* Brad Lassey <blassey@mozilla.com> * Brad Lassey <blassey@mozilla.com>
* Ms2ger <ms2ger@gmail.com>
* *
* Alternatively, the contents of this file may be used under the terms of * Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or * either the GNU General Public License Version 2 or later (the "GPL"), or
@ -39,9 +40,7 @@
#include "nsCURILoader.h" #include "nsCURILoader.h"
#include "nsICategoryManager.h" #include "nsICategoryManager.h"
#include "nsIDOMAbstractView.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMHTMLElement.h" #include "nsIDOMHTMLElement.h"
#include "nsIDOMHTMLIFrameElement.h" #include "nsIDOMHTMLIFrameElement.h"
#include "nsIDOMNSDocument.h" #include "nsIDOMNSDocument.h"
@ -68,7 +67,6 @@
#include "nsIDOMEventTarget.h" #include "nsIDOMEventTarget.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIDOMWindow.h" #include "nsIDOMWindow.h"
//#include ".h"
#include "nsIDOM3EventTarget.h" #include "nsIDOM3EventTarget.h"
#include "nsIDOMKeyListener.h" #include "nsIDOMKeyListener.h"
#include "nsIDOMCompositionListener.h" #include "nsIDOMCompositionListener.h"
@ -428,28 +426,24 @@ nsWidgetUtils::IsXULNode(nsIDOMNode *aNode, PRUint32 *aType)
} }
nsresult nsresult
nsWidgetUtils::GetDOMWindowByNode(nsIDOMNode *aNode, nsIDOMWindow * *aDOMWindow) nsWidgetUtils::GetDOMWindowByNode(nsIDOMNode* aNode, nsIDOMWindow** aDOMWindow)
{ {
nsresult rv;
nsCOMPtr<nsIDOMDocument> nodeDoc; nsCOMPtr<nsIDOMDocument> nodeDoc;
rv = aNode->GetOwnerDocument(getter_AddRefs(nodeDoc)); nsresult rv = aNode->GetOwnerDocument(getter_AddRefs(nodeDoc));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(nodeDoc, &rv); NS_ENSURE_TRUE(nodeDoc, NS_ERROR_NULL_POINTER);
nsCOMPtr<nsIDOMWindow> window;
rv = nodeDoc->GetDefaultView(getter_AddRefs(window));
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMAbstractView> absView; NS_ENSURE_TRUE(window, NS_ERROR_NULL_POINTER);
NS_ENSURE_SUCCESS(rv, rv); window.forget(aDOMWindow);
rv = docView->GetDefaultView(getter_AddRefs(absView));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(absView, &rv);
NS_ENSURE_SUCCESS(rv, rv);
*aDOMWindow = window;
NS_IF_ADDREF(*aDOMWindow);
return rv; return rv;
} }
void void
nsWidgetUtils::GetChromeEventHandler(nsIDOMWindow *aDOMWin, nsWidgetUtils::GetChromeEventHandler(nsIDOMWindow *aDOMWin,
nsIDOMEventTarget **aChromeTarget) nsIDOMEventTarget **aChromeTarget)
{ {
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin)); nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin));
nsPIDOMEventTarget* chromeEventHandler = nsnull; nsPIDOMEventTarget* chromeEventHandler = nsnull;

Просмотреть файл

@ -71,6 +71,7 @@ members = [
#'nsIDOMWindow.document', #'nsIDOMWindow.document',
'nsIDOMWindow.getSelection', 'nsIDOMWindow.getSelection',
'nsIDOMWindow.scrollByLines', 'nsIDOMWindow.scrollByLines',
'nsIDOMWindow.getComputedStyle',
'nsIDOMJSWindow.dump', 'nsIDOMJSWindow.dump',
'nsIDOMScreen.top', 'nsIDOMScreen.top',
'nsIDOMScreen.height', 'nsIDOMScreen.height',
@ -108,6 +109,7 @@ members = [
'nsIDOMDocument.createTextNode', 'nsIDOMDocument.createTextNode',
'nsIDOMDocument.documentURI', 'nsIDOMDocument.documentURI',
'nsIDOMDocument.adoptNode', 'nsIDOMDocument.adoptNode',
'nsIDOMDocument.defaultView',
'nsIDOMElement.removeAttributeNS', 'nsIDOMElement.removeAttributeNS',
'nsIDOMElement.removeAttribute', 'nsIDOMElement.removeAttribute',
'nsIDOMElement.getAttribute', 'nsIDOMElement.getAttribute',
@ -173,7 +175,6 @@ members = [
'nsIDOMElementCSSInlineStyle.*', 'nsIDOMElementCSSInlineStyle.*',
'nsIDOMCSS2Properties.*', 'nsIDOMCSS2Properties.*',
'nsIDOMRect.*', 'nsIDOMRect.*',
'nsIDOMViewCSS.getComputedStyle',
'nsIDOMCSSStyleDeclaration.*', 'nsIDOMCSSStyleDeclaration.*',
# dom/interfaces/events # dom/interfaces/events
@ -390,9 +391,6 @@ members = [
'nsIDOMDocumentTraversal.createNodeIterator', 'nsIDOMDocumentTraversal.createNodeIterator',
'nsIDOMNodeIterator.nextNode', 'nsIDOMNodeIterator.nextNode',
# dom/interfaces/views
'nsIDOMDocumentView.defaultView',
# dom/interfaces/xbl - None. # dom/interfaces/xbl - None.
# dom/interfaces/xpath # dom/interfaces/xpath

Просмотреть файл

@ -37,8 +37,6 @@
#include "inLayoutUtils.h" #include "inLayoutUtils.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMAbstractView.h"
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsIContentViewer.h" #include "nsIContentViewer.h"
@ -60,15 +58,14 @@ inLayoutUtils::GetWindowFor(nsIDOMNode* aNode)
nsIDOMWindowInternal* nsIDOMWindowInternal*
inLayoutUtils::GetWindowFor(nsIDOMDocument* aDoc) inLayoutUtils::GetWindowFor(nsIDOMDocument* aDoc)
{ {
nsCOMPtr<nsIDOMDocumentView> doc = do_QueryInterface(aDoc); nsCOMPtr<nsIDOMWindow> window;
if (!doc) return nsnull; aDoc->GetDefaultView(getter_AddRefs(window));
if (!window) {
return nsnull;
}
nsCOMPtr<nsIDOMAbstractView> view; nsCOMPtr<nsIDOMWindowInternal> windowInternal = do_QueryInterface(window);
doc->GetDefaultView(getter_AddRefs(view)); return windowInternal;
if (!view) return nsnull;
nsCOMPtr<nsIDOMWindowInternal> window = do_QueryInterface(view);
return window;
} }
nsIPresShell* nsIPresShell*

Просмотреть файл

@ -70,7 +70,6 @@ MAKEFILES_dom="
dom/interfaces/stylesheets/Makefile dom/interfaces/stylesheets/Makefile
dom/interfaces/threads/Makefile dom/interfaces/threads/Makefile
dom/interfaces/traversal/Makefile dom/interfaces/traversal/Makefile
dom/interfaces/views/Makefile
dom/interfaces/xbl/Makefile dom/interfaces/xbl/Makefile
dom/interfaces/xpath/Makefile dom/interfaces/xpath/Makefile
dom/interfaces/xul/Makefile dom/interfaces/xul/Makefile

Просмотреть файл

@ -49,8 +49,6 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsINameSpaceManager.h" #include "nsINameSpaceManager.h"
#include "nsWidgetAtoms.h" #include "nsWidgetAtoms.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMElement.h" #include "nsIDOMElement.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsIDOMCSSValue.h" #include "nsIDOMCSSValue.h"
@ -201,24 +199,27 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIconURI)
if (!hasImageAttr) { if (!hasImageAttr) {
// If the content node has no "image" attribute, get the // If the content node has no "image" attribute, get the
// "list-style-image" property from CSS. // "list-style-image" property from CSS.
nsCOMPtr<nsIDOMDocumentView> domDocumentView = nsCOMPtr<nsIDOMDocument> domDocument =
do_QueryInterface(mContent->GetDocument()); do_QueryInterface(mContent->GetDocument());
if (!domDocumentView) return NS_ERROR_FAILURE; if (!domDocument)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMAbstractView> domAbstractView; nsCOMPtr<nsIDOMWindow> window;
rv = domDocumentView->GetDefaultView(getter_AddRefs(domAbstractView)); rv = domDocument->GetDefaultView(getter_AddRefs(window));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIDOMViewCSS> domViewCSS = do_QueryInterface(domAbstractView); if (!window)
if (!domViewCSS) return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mContent); nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mContent);
if (!domElement) return NS_ERROR_FAILURE; if (!domElement)
return NS_ERROR_FAILURE;
rv = domViewCSS->GetComputedStyle(domElement, EmptyString(), rv = window->GetComputedStyle(domElement, EmptyString(),
getter_AddRefs(cssStyleDecl)); getter_AddRefs(cssStyleDecl));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv))
return rv;
NS_NAMED_LITERAL_STRING(listStyleImage, "list-style-image"); NS_NAMED_LITERAL_STRING(listStyleImage, "list-style-image");
rv = cssStyleDecl->GetPropertyCSSValue(listStyleImage, rv = cssStyleDecl->GetPropertyCSSValue(listStyleImage,

Просмотреть файл

@ -51,7 +51,6 @@
#include "nsIDOMXULCommandEvent.h" #include "nsIDOMXULCommandEvent.h"
#include "nsIPrivateDOMEvent.h" #include "nsIPrivateDOMEvent.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsIDOMAbstractView.h"
void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent) void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
{ {
@ -66,13 +65,13 @@ void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
getter_AddRefs(event)); getter_AddRefs(event));
nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryInterface(event); nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryInterface(event);
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(command); nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(command);
nsCOMPtr<nsIDOMAbstractView> view = do_QueryInterface(doc->GetWindow());
// FIXME: Should probably figure out how to init this with the actual // FIXME: Should probably figure out how to init this with the actual
// pressed keys, but this is a big old edge case anyway. -dwh // pressed keys, but this is a big old edge case anyway. -dwh
if (pEvent && if (pEvent &&
NS_SUCCEEDED(command->InitCommandEvent(NS_LITERAL_STRING("command"), NS_SUCCEEDED(command->InitCommandEvent(NS_LITERAL_STRING("command"),
PR_TRUE, PR_TRUE, view, 0, PR_TRUE, PR_TRUE,
doc->GetWindow(), 0,
PR_FALSE, PR_FALSE, PR_FALSE, PR_FALSE, PR_FALSE, PR_FALSE,
PR_FALSE, nsnull))) { PR_FALSE, nsnull))) {
pEvent->SetTrusted(PR_TRUE); pEvent->SetTrusted(PR_TRUE);

Просмотреть файл

@ -1,7 +1,6 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 ci et: */ /* vim:set ts=2 sw=2 sts=2 ci et: */
/* /* ***** BEGIN LICENSE BLOCK *****
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
* *
* The contents of this file are subject to the Mozilla Public License Version * The contents of this file are subject to the Mozilla Public License Version
@ -84,8 +83,6 @@
#include "nsIScriptSecurityManager.h" #include "nsIScriptSecurityManager.h"
#include "nsIWindowWatcher.h" #include "nsIWindowWatcher.h"
#include "nsIURI.h" #include "nsIURI.h"
#include "nsIDOMDocumentView.h"
#include "nsIDOMViewCSS.h"
#include "nsIDOMCSSStyleDeclaration.h" #include "nsIDOMCSSStyleDeclaration.h"
#include "nsITimelineService.h" #include "nsITimelineService.h"
#include "nsAppShellCID.h" #include "nsAppShellCID.h"