зеркало из https://github.com/mozilla/gecko-dev.git
Backout changeset 13f6847dd840 (bug 616684) because it changes code semantics in a bad way, which results in problems like the crash in bug 652580, possibly among others
This commit is contained in:
Родитель
6207979552
Коммит
67e7a42892
|
@ -45,6 +45,8 @@
|
|||
#include "nsCoreUtils.h"
|
||||
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
|
|
@ -43,12 +43,15 @@
|
|||
#include "nsAccessNode.h"
|
||||
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOM3Node.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
#include "nsIDOMXULElement.h"
|
||||
#include "nsIDocShell.h"
|
||||
|
@ -422,12 +425,13 @@ nsCoreUtils::GetScreenCoordsForWindow(nsINode *aNode)
|
|||
nsCOMPtr<nsIDocShellTreeItem> rootTreeItem;
|
||||
treeItem->GetRootTreeItem(getter_AddRefs(rootTreeItem));
|
||||
nsCOMPtr<nsIDOMDocument> domDoc = do_GetInterface(rootTreeItem);
|
||||
if (!domDoc)
|
||||
nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(domDoc));
|
||||
if (!docView)
|
||||
return coords;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
domDoc->GetDefaultView(getter_AddRefs(window));
|
||||
nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(window));
|
||||
nsCOMPtr<nsIDOMAbstractView> abstractView;
|
||||
docView->GetDefaultView(getter_AddRefs(abstractView));
|
||||
nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(abstractView));
|
||||
if (!windowInter)
|
||||
return coords;
|
||||
|
||||
|
@ -593,14 +597,14 @@ nsCoreUtils::GetComputedStyleDeclaration(const nsAString& aPseudoElt,
|
|||
if (!document)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window = do_QueryInterface(document->GetWindow());
|
||||
if (!window)
|
||||
nsCOMPtr<nsIDOMViewCSS> viewCSS(do_QueryInterface(document->GetWindow()));
|
||||
if (!viewCSS)
|
||||
return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
|
||||
nsIDOMCSSStyleDeclaration* cssDecl = nsnull;
|
||||
nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(content));
|
||||
window->GetComputedStyle(domElement, aPseudoElt, getter_AddRefs(cssDecl));
|
||||
return cssDecl.forget();
|
||||
viewCSS->GetComputedStyle(domElement, aPseudoElt, &cssDecl);
|
||||
return cssDecl;
|
||||
}
|
||||
|
||||
already_AddRefed<nsIBoxObject>
|
||||
|
|
|
@ -47,9 +47,11 @@
|
|||
|
||||
#include "nsIClipboard.h"
|
||||
#include "nsContentCID.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMCharacterData.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMRange.h"
|
||||
#include "nsIDOMNSRange.h"
|
||||
#include "nsIDOMWindowInternal.h"
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsIDOMNSHTMLElement.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIPrefService.h"
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMNSEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
|
|
|
@ -168,6 +168,7 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID);
|
|||
#include "nsIChromeRegistry.h"
|
||||
#include "nsIMIMEHeaderParam.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsDOMDataTransfer.h"
|
||||
#include "nsHtml5Module.h"
|
||||
|
@ -5500,8 +5501,9 @@ nsContentUtils::DispatchXULCommand(nsIContent* aTarget,
|
|||
nsCOMPtr<nsIDOMXULCommandEvent> xulCommand = do_QueryInterface(event);
|
||||
nsCOMPtr<nsIPrivateDOMEvent> pEvent = do_QueryInterface(xulCommand);
|
||||
NS_ENSURE_STATE(pEvent);
|
||||
nsCOMPtr<nsIDOMAbstractView> view = do_QueryInterface(doc->GetWindow());
|
||||
nsresult rv = xulCommand->InitCommandEvent(NS_LITERAL_STRING("command"),
|
||||
PR_TRUE, PR_TRUE, doc->GetWindow(),
|
||||
PR_TRUE, PR_TRUE, view,
|
||||
0, aCtrl, aAlt, aShift, aMeta,
|
||||
aSourceEvent);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
|
|
@ -75,6 +75,8 @@
|
|||
#include "nsDOMAttribute.h"
|
||||
#include "nsIDOMDOMStringList.h"
|
||||
#include "nsIDOMDOMImplementation.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "mozilla/FunctionTimer.h"
|
||||
#include "nsGenericElement.h"
|
||||
|
@ -5067,14 +5069,16 @@ nsDocument::CreateTreeWalker(nsIDOMNode *aRoot,
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::GetDefaultView(nsIDOMWindow** aDefaultView)
|
||||
nsDocument::GetDefaultView(nsIDOMAbstractView** aDefaultView)
|
||||
{
|
||||
*aDefaultView = nsnull;
|
||||
nsPIDOMWindow* win = GetWindow();
|
||||
if (!win) {
|
||||
return NS_OK;
|
||||
if (win) {
|
||||
return CallQueryInterface(win, aDefaultView);
|
||||
}
|
||||
return CallQueryInterface(win, aDefaultView);
|
||||
|
||||
*aDefaultView = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include "nsTArray.h"
|
||||
#include "nsHashSets.h"
|
||||
#include "nsIDOMXMLDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMNSDocumentStyle.h"
|
||||
|
@ -497,6 +498,7 @@ class nsDocument : public nsIDocument,
|
|||
public nsIDOMDocumentEvent,
|
||||
public nsIDOM3DocumentEvent,
|
||||
public nsIDOMNSDocumentStyle,
|
||||
public nsIDOMDocumentView,
|
||||
public nsIDOMDocumentRange,
|
||||
public nsIDOMDocumentTraversal,
|
||||
public nsIDOMDocumentXBL,
|
||||
|
@ -812,6 +814,9 @@ public:
|
|||
// nsIDOMNSDocumentStyle
|
||||
NS_DECL_NSIDOMNSDOCUMENTSTYLE
|
||||
|
||||
// nsIDOMDocumentView
|
||||
NS_DECL_NSIDOMDOCUMENTVIEW
|
||||
|
||||
// nsIDOMDocumentRange
|
||||
NS_DECL_NSIDOMDOCUMENTRANGE
|
||||
|
||||
|
@ -1258,6 +1263,7 @@ protected:
|
|||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMNSDocument, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentEvent, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentView, nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMDocumentTraversal, \
|
||||
nsDocument) \
|
||||
NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, nsIDOMEventTarget, nsDocument) \
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
|
||||
#include "nsBindingManager.h"
|
||||
#include "nsXBLBinding.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIXBLService.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIBoxObject.h"
|
||||
|
|
|
@ -80,7 +80,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
|
|||
NS_IMETHODIMP
|
||||
nsDOMDragEvent::InitDragEvent(const nsAString & aType,
|
||||
PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMWindow* aView, PRInt32 aDetail,
|
||||
nsIDOMAbstractView* aView, PRInt32 aDetail,
|
||||
PRInt32 aScreenX, PRInt32 aScreenY,
|
||||
PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
|
@ -132,5 +132,7 @@ nsresult NS_NewDOMDragEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsDragEvent *aEvent)
|
||||
{
|
||||
nsDOMDragEvent* event = new nsDOMDragEvent(aPresContext, aEvent);
|
||||
NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
return CallQueryInterface(event, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ nsDOMKeyboardEvent::GetWhich(PRUint32* aWhich)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMKeyboardEvent::InitKeyEvent(const nsAString& aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMWindow* aView, PRBool aCtrlKey, PRBool aAltKey,
|
||||
nsIDOMAbstractView* aView, PRBool aCtrlKey, PRBool aAltKey,
|
||||
PRBool aShiftKey, PRBool aMetaKey,
|
||||
PRUint32 aKeyCode, PRUint32 aCharCode)
|
||||
{
|
||||
|
@ -198,5 +198,9 @@ nsresult NS_NewDOMKeyboardEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsKeyEvent *aEvent)
|
||||
{
|
||||
nsDOMKeyboardEvent* it = new nsDOMKeyboardEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMWindow* aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget)
|
||||
|
@ -147,7 +147,7 @@ nsDOMMouseEvent::InitMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBo
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMouseEvent::InitNSMouseEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
|
||||
|
@ -313,5 +313,9 @@ nsresult NS_NewDOMMouseEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsInputEvent *aEvent)
|
||||
{
|
||||
nsDOMMouseEvent* it = new nsDOMMouseEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMMouseScrollEvent::InitMouseScrollEvent(const nsAString & aType, PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMWindow *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
nsIDOMAbstractView *aView, PRInt32 aDetail, PRInt32 aScreenX,
|
||||
PRInt32 aScreenY, PRInt32 aClientX, PRInt32 aClientY,
|
||||
PRBool aCtrlKey, PRBool aAltKey, PRBool aShiftKey,
|
||||
PRBool aMetaKey, PRUint16 aButton, nsIDOMEventTarget *aRelatedTarget,
|
||||
|
@ -129,5 +129,9 @@ nsresult NS_NewDOMMouseScrollEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsInputEvent *aEvent)
|
||||
{
|
||||
nsDOMMouseScrollEvent* it = new nsDOMMouseScrollEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ NS_IMETHODIMP
|
|||
nsDOMMozTouchEvent::InitMozTouchEvent(const nsAString& aTypeArg,
|
||||
PRBool aCanBubbleArg,
|
||||
PRBool aCancelableArg,
|
||||
nsIDOMWindow* aViewArg,
|
||||
nsIDOMAbstractView* aViewArg,
|
||||
PRInt32 aDetailArg,
|
||||
PRInt32 aScreenX,
|
||||
PRInt32 aScreenY,
|
||||
|
@ -127,5 +127,8 @@ nsresult NS_NewDOMMozTouchEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsMozTouchEvent *aEvent)
|
||||
{
|
||||
nsDOMMozTouchEvent *it = new nsDOMMozTouchEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ NS_IMETHODIMP
|
|||
nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
|
||||
PRBool aCanBubble,
|
||||
PRBool aCancelable,
|
||||
nsIDOMWindow *aView,
|
||||
nsIDOMAbstractView *aView,
|
||||
PRInt32 aDetail,
|
||||
float aX, float aY,
|
||||
float aWidth, float aHeight)
|
||||
|
@ -155,6 +155,11 @@ NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
|
|||
nsPresContext *aPresContext,
|
||||
nsScrollAreaEvent *aEvent)
|
||||
{
|
||||
nsDOMScrollAreaEvent* it = new nsDOMScrollAreaEvent(aPresContext, aEvent);
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
nsDOMScrollAreaEvent *ev = new nsDOMScrollAreaEvent(aPresContext, aEvent);
|
||||
|
||||
if (!ev) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(ev, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ NS_IMETHODIMP
|
|||
nsDOMSimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
|
||||
PRBool aCanBubbleArg,
|
||||
PRBool aCancelableArg,
|
||||
nsIDOMWindow* aViewArg,
|
||||
nsIDOMAbstractView* aViewArg,
|
||||
PRInt32 aDetailArg,
|
||||
PRInt32 aScreenX,
|
||||
PRInt32 aScreenY,
|
||||
|
|
|
@ -176,7 +176,7 @@ nsDOMUIEvent::GetClientPoint()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMUIEvent::GetView(nsIDOMWindow** aView)
|
||||
nsDOMUIEvent::GetView(nsIDOMAbstractView** aView)
|
||||
{
|
||||
*aView = mView;
|
||||
NS_IF_ADDREF(*aView);
|
||||
|
@ -191,11 +191,7 @@ nsDOMUIEvent::GetDetail(PRInt32* aDetail)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMUIEvent::InitUIEvent(const nsAString& typeArg,
|
||||
PRBool canBubbleArg,
|
||||
PRBool cancelableArg,
|
||||
nsIDOMWindow* viewArg,
|
||||
PRInt32 detailArg)
|
||||
nsDOMUIEvent::InitUIEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg)
|
||||
{
|
||||
nsresult rv = nsDOMEvent::InitEvent(typeArg, canBubbleArg, cancelableArg);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -422,5 +418,9 @@ nsresult NS_NewDOMUIEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsGUIEvent *aEvent)
|
||||
{
|
||||
nsDOMUIEvent* it = new nsDOMUIEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -36,11 +36,12 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef nsDOMUIEvent_h
|
||||
#define nsDOMUIEvent_h
|
||||
#ifndef nsDOMUIEvent_h__
|
||||
#define nsDOMUIEvent_h__
|
||||
|
||||
#include "nsIDOMUIEvent.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsDOMEvent.h"
|
||||
|
||||
class nsDOMUIEvent : public nsDOMEvent,
|
||||
|
@ -77,7 +78,7 @@ protected:
|
|||
nsIntPoint GetPagePoint();
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIDOMWindow> mView;
|
||||
nsCOMPtr<nsIDOMAbstractView> mView;
|
||||
PRInt32 mDetail;
|
||||
nsIntPoint mClientPoint;
|
||||
// Screenpoint is mEvent->refPoint.
|
||||
|
@ -89,4 +90,4 @@ protected:
|
|||
NS_FORWARD_NSIDOMUIEVENT(nsDOMUIEvent::) \
|
||||
NS_FORWARD_TO_NSDOMEVENT
|
||||
|
||||
#endif // nsDOMUIEvent_h
|
||||
#endif // nsDOMUIEvent_h__
|
||||
|
|
|
@ -118,7 +118,7 @@ nsDOMXULCommandEvent::GetSourceEvent(nsIDOMEvent** aSourceEvent)
|
|||
NS_IMETHODIMP
|
||||
nsDOMXULCommandEvent::InitCommandEvent(const nsAString& aType,
|
||||
PRBool aCanBubble, PRBool aCancelable,
|
||||
nsIDOMWindow* aView,
|
||||
nsIDOMAbstractView *aView,
|
||||
PRInt32 aDetail,
|
||||
PRBool aCtrlKey, PRBool aAltKey,
|
||||
PRBool aShiftKey, PRBool aMetaKey,
|
||||
|
@ -144,5 +144,9 @@ nsresult NS_NewDOMXULCommandEvent(nsIDOMEvent** aInstancePtrResult,
|
|||
nsInputEvent *aEvent)
|
||||
{
|
||||
nsDOMXULCommandEvent* it = new nsDOMXULCommandEvent(aPresContext, aEvent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
return CallQueryInterface(it, aInstancePtrResult);
|
||||
}
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
#include "nsIDOMMouseScrollEvent.h"
|
||||
#include "nsIDOMDragEvent.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMNSUIEvent.h"
|
||||
#include "nsDOMDragEvent.h"
|
||||
#include "nsIDOMNSEditableElement.h"
|
||||
|
|
|
@ -1388,12 +1388,6 @@ nsHTMLDocument::NormalizeDocument()
|
|||
return nsDocument::NormalizeDocument();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::GetDefaultView(nsIDOMWindow** aWindow)
|
||||
{
|
||||
return nsDocument::GetDefaultView(aWindow);
|
||||
}
|
||||
|
||||
//
|
||||
// nsIDOMHTMLDocument interface implementation
|
||||
//
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "nsGUIEvent.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
|
||||
nsDOMTimeEvent::nsDOMTimeEvent(nsPresContext* aPresContext, nsEvent* aEvent)
|
||||
: nsDOMEvent(aPresContext, aEvent ? aEvent : new nsUIEvent(PR_FALSE, 0, 0)),
|
||||
|
@ -91,7 +92,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMTimeEvent)
|
|||
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMTimeEvent::GetView(nsIDOMWindow** aView)
|
||||
nsDOMTimeEvent::GetView(nsIDOMAbstractView** aView)
|
||||
{
|
||||
*aView = mView;
|
||||
NS_IF_ADDREF(*aView);
|
||||
|
@ -107,7 +108,7 @@ nsDOMTimeEvent::GetDetail(PRInt32* aDetail)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDOMTimeEvent::InitTimeEvent(const nsAString& aTypeArg,
|
||||
nsIDOMWindow* aViewArg,
|
||||
nsIDOMAbstractView* aViewArg,
|
||||
PRInt32 aDetailArg)
|
||||
{
|
||||
nsresult rv = nsDOMEvent::InitEvent(aTypeArg, PR_FALSE /*doesn't bubble*/,
|
||||
|
|
|
@ -58,8 +58,8 @@ public:
|
|||
NS_FORWARD_TO_NSDOMEVENT
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDOMWindow> mView;
|
||||
PRInt32 mDetail;
|
||||
nsCOMPtr<nsIDOMAbstractView> mView;
|
||||
PRInt32 mDetail;
|
||||
};
|
||||
|
||||
#endif // NS_DOMTIMEEVENT_H_
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
#include "nsStyleConsts.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIXBLService.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
|
|
@ -38,7 +38,10 @@
|
|||
|
||||
#include "nsXMLPrettyPrinter.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIXSLTProcessor.h"
|
||||
|
@ -92,13 +95,16 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument,
|
|||
nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle;
|
||||
nsCOMPtr<nsIDOMDocument> frameOwnerDoc;
|
||||
frameElem->GetOwnerDocument(getter_AddRefs(frameOwnerDoc));
|
||||
if (frameOwnerDoc) {
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
frameOwnerDoc->GetDefaultView(getter_AddRefs(window));
|
||||
if (window) {
|
||||
window->GetComputedStyle(frameElem,
|
||||
EmptyString(),
|
||||
getter_AddRefs(computedStyle));
|
||||
nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(frameOwnerDoc);
|
||||
if (docView) {
|
||||
nsCOMPtr<nsIDOMAbstractView> defaultView;
|
||||
docView->GetDefaultView(getter_AddRefs(defaultView));
|
||||
nsCOMPtr<nsIDOMViewCSS> defaultCSSView =
|
||||
do_QueryInterface(defaultView);
|
||||
if (defaultCSSView) {
|
||||
defaultCSSView->GetComputedStyle(frameElem,
|
||||
EmptyString(),
|
||||
getter_AddRefs(computedStyle));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* ***** 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
|
||||
|
@ -118,6 +119,7 @@
|
|||
#include "nsXULDocument.h"
|
||||
#include "nsXULPopupListener.h"
|
||||
#include "nsRuleWalker.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsCSSParser.h"
|
||||
#include "nsIListBoxObject.h"
|
||||
|
|
|
@ -50,6 +50,7 @@ DIRS = \
|
|||
interfaces/html \
|
||||
interfaces/events \
|
||||
interfaces/stylesheets \
|
||||
interfaces/views \
|
||||
interfaces/sidebar \
|
||||
interfaces/css \
|
||||
interfaces/traversal \
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
#include "nsBindingManager.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsStyleSet.h"
|
||||
|
@ -252,6 +253,7 @@
|
|||
#include "nsIDOMDocumentRange.h"
|
||||
#include "nsIDOMDocumentTraversal.h"
|
||||
#include "nsIDOMDocumentXBL.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMElementCSSInlineStyle.h"
|
||||
#include "nsIDOMLinkStyle.h"
|
||||
#include "nsIDOMHTMLDocument.h"
|
||||
|
@ -2271,6 +2273,7 @@ nsDOMClassInfo::RegisterExternalClasses()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentEvent) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentStyle) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocumentStyle) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentView) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentRange) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentTraversal) \
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentXBL) \
|
||||
|
@ -2347,6 +2350,8 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
|
||||
|
@ -2358,6 +2363,8 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow_2_0_BRANCH)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
@ -3064,6 +3071,8 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(RangeException, nsIDOMRangeException)
|
||||
|
@ -3946,6 +3955,8 @@ nsDOMClassInfo::Init()
|
|||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageIndexedDB)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow)
|
||||
|
|
|
@ -111,6 +111,7 @@
|
|||
#endif
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMDocumentEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
|
@ -1333,6 +1334,8 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsGlobalWindow)
|
|||
NS_INTERFACE_MAP_ENTRY(nsIDOM3EventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMNSEventTarget)
|
||||
NS_INTERFACE_MAP_ENTRY(nsPIDOMWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMViewCSS)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMAbstractView)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStorageWindow)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMStorageIndexedDB)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
|
@ -7936,6 +7939,10 @@ nsGlobalWindow::UpdateCanvasFocus(PRBool aFocusChanged, nsIContent* aNewContent)
|
|||
}
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsGlobalWindow::nsIDOMViewCSS
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt,
|
||||
const nsAString& aPseudoElt,
|
||||
|
@ -7972,6 +7979,27 @@ nsGlobalWindow::GetComputedStyle(nsIDOMElement* aElt,
|
|||
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
|
||||
//*****************************************************************************
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDOMClientInformation.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsIDOM3EventTarget.h"
|
||||
#include "nsIDOMNSEventTarget.h"
|
||||
|
@ -279,6 +280,7 @@ class nsGlobalWindow : public nsPIDOMWindow,
|
|||
public nsPIDOMEventTarget,
|
||||
public nsIDOM3EventTarget,
|
||||
public nsIDOMNSEventTarget,
|
||||
public nsIDOMViewCSS,
|
||||
public nsIDOMStorageWindow,
|
||||
public nsIDOMStorageIndexedDB,
|
||||
public nsSupportsWeakReference,
|
||||
|
@ -417,6 +419,12 @@ public:
|
|||
virtual NS_HIDDEN_(void) MaybeUpdateTouchState();
|
||||
virtual NS_HIDDEN_(void) UpdateTouchState();
|
||||
|
||||
// nsIDOMViewCSS
|
||||
NS_DECL_NSIDOMVIEWCSS
|
||||
|
||||
// nsIDOMAbstractView
|
||||
NS_DECL_NSIDOMABSTRACTVIEW
|
||||
|
||||
// nsIDOMStorageWindow
|
||||
NS_DECL_NSIDOMSTORAGEWINDOW
|
||||
|
||||
|
|
|
@ -77,6 +77,10 @@ interface nsIDOMLinkStyle;
|
|||
interface nsIDOMStyleSheet;
|
||||
interface nsIDOMMediaList;
|
||||
|
||||
// Views
|
||||
interface nsIDOMAbstractView;
|
||||
interface nsIDOMDocumentView;
|
||||
|
||||
// Base
|
||||
interface nsIDOMWindow;
|
||||
interface nsIDOMWindowInternal;
|
||||
|
@ -126,3 +130,4 @@ interface nsIDOMRange;
|
|||
interface nsIDOMCRMFObject;
|
||||
interface nsIDOMCrypto;
|
||||
interface nsIDOMPkcs11;
|
||||
|
||||
|
|
|
@ -47,10 +47,11 @@ interface nsISelection;
|
|||
* contain child windows if the document in the window contains a
|
||||
* HTML frameset document or if the document contains iframe elements.
|
||||
*
|
||||
* @see <http://www.whatwg.org/html/#window>
|
||||
* This interface is not officially defined by any standard bodies, it
|
||||
* originates from the defacto DOM Level 0 standard.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(ff7d278f-93db-4078-b89a-058c8e1270b4)]
|
||||
[scriptable, uuid(a6cf906b-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMWindow : nsISupports
|
||||
{
|
||||
/**
|
||||
|
@ -149,10 +150,4 @@ interface nsIDOMWindow : nsISupports
|
|||
* Method for sizing this window to the content in the window.
|
||||
*/
|
||||
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 nsIDOMBlob;
|
||||
|
||||
[scriptable, uuid(e2796e00-14de-4ce0-acfe-0374bc0e715d)]
|
||||
[scriptable, uuid(efff0d88-3b94-4375-bdeb-676a847ecd7d)]
|
||||
interface nsIDOMWindow2 : nsIDOMWindow
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -46,7 +46,7 @@ interface nsIVariant;
|
|||
interface nsIAnimationFrameListener;
|
||||
interface nsIDOMMediaQueryList;
|
||||
|
||||
[scriptable, uuid(4d95736f-8130-43cb-a276-5bc554eca80a)]
|
||||
[scriptable, uuid(04eafa93-efbe-4254-9d65-91c344fa7ff2)]
|
||||
interface nsIDOMWindowInternal : nsIDOMWindow2
|
||||
{
|
||||
readonly attribute nsIDOMWindowInternal window;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
* http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
|
||||
*/
|
||||
|
||||
[scriptable, uuid(d12f0ecf-434a-4b5c-81ad-354e3b9037b9)]
|
||||
[scriptable, uuid(2d305b95-a030-4d24-a12c-7fabf61a8c3c)]
|
||||
interface nsIDOMDocument : nsIDOMNode
|
||||
{
|
||||
readonly attribute nsIDOMDocumentType doctype;
|
||||
|
@ -108,11 +108,4 @@ interface nsIDOMDocument : nsIDOMNode
|
|||
raises(DOMException);
|
||||
// Introduced in DOM Level 3:
|
||||
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"
|
||||
|
||||
[scriptable, uuid(68e4448c-eb64-48ea-801a-0c83008d2607)]
|
||||
[scriptable, uuid(f493687c-ea80-471b-965b-11467ebea24b)]
|
||||
interface nsIDOMXMLDocument : nsIDOMDocument
|
||||
{
|
||||
// DOM Level 3 Load & Save, DocumentLS
|
||||
|
|
|
@ -71,6 +71,7 @@ XPIDLSRCS = \
|
|||
nsIDOMDocumentCSS.idl \
|
||||
nsIDOMRGBColor.idl \
|
||||
nsIDOMRect.idl \
|
||||
nsIDOMViewCSS.idl \
|
||||
nsIDOMNSRGBAColor.idl \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
/* -*- 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,9 +38,10 @@
|
|||
#include "domstubs.idl"
|
||||
#include "nsIDOMMouseEvent.idl"
|
||||
|
||||
interface nsIDOMAbstractView;
|
||||
interface nsIDOMDataTransfer;
|
||||
|
||||
[scriptable, uuid(0f4fef03-c0e9-406c-a754-c01148e431ae)]
|
||||
[scriptable, uuid(98351627-62d7-4b07-bbf3-78009b20764b)]
|
||||
interface nsIDOMDragEvent : nsIDOMMouseEvent
|
||||
{
|
||||
readonly attribute nsIDOMDataTransfer dataTransfer;
|
||||
|
@ -48,7 +49,7 @@ interface nsIDOMDragEvent : nsIDOMMouseEvent
|
|||
void initDragEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow aView,
|
||||
in nsIDOMAbstractView aView,
|
||||
in long aDetail,
|
||||
in long aScreenX,
|
||||
in long aScreenY,
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#include "nsIDOMUIEvent.idl"
|
||||
|
||||
[scriptable, uuid(e44d7977-20f2-442e-bc13-0f2f52992a4c)]
|
||||
[scriptable, uuid(028e0e6e-8b01-11d3-aae7-0010838a3123)]
|
||||
interface nsIDOMKeyEvent : nsIDOMUIEvent
|
||||
{
|
||||
const unsigned long DOM_VK_CANCEL = 0x03;
|
||||
|
@ -193,7 +193,7 @@ interface nsIDOMKeyEvent : nsIDOMUIEvent
|
|||
void initKeyEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in boolean ctrlKeyArg,
|
||||
in boolean altKeyArg,
|
||||
in boolean shiftKeyArg,
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(73558605-f479-493e-86d1-9794cd117fef)]
|
||||
[scriptable, uuid(ff751edc-8b02-aae7-0010-8301838a3123)]
|
||||
interface nsIDOMMouseEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute long screenX;
|
||||
|
@ -67,7 +67,7 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent
|
|||
void initMouseEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg,
|
||||
in long screenXArg,
|
||||
in long screenYArg,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include "nsIDOMMouseEvent.idl"
|
||||
|
||||
[scriptable, uuid(af08bce0-6821-4bac-8964-0fcee4be549a)]
|
||||
[scriptable, uuid(ba8d1a7e-b475-4542-8d32-01e7ea7b8091)]
|
||||
interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
|
||||
{
|
||||
const long HORIZONTAL_AXIS = 1;
|
||||
|
@ -49,7 +49,7 @@ interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
|
|||
void initMouseScrollEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg,
|
||||
in long screenXArg,
|
||||
in long screenYArg,
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include "nsIDOMMouseEvent.idl"
|
||||
|
||||
|
||||
[scriptable, uuid(e9ed248b-1995-482f-8407-33ae7744bb9c)]
|
||||
[scriptable, uuid(9b454391-0190-4313-a070-1e26e9bf6f31)]
|
||||
interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
|
||||
{
|
||||
readonly attribute unsigned long streamId;
|
||||
|
@ -48,7 +48,7 @@ interface nsIDOMMozTouchEvent : nsIDOMMouseEvent
|
|||
void initMozTouchEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg,
|
||||
in long screenXArg,
|
||||
in long screenYArg,
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
* by providing various information related to the mouse event.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(8418a402-3c9b-431a-80a7-a59b23ed57a0)]
|
||||
[scriptable, uuid(f5dd5fbb-f4ff-4277-819c-f31aa1dafc32)]
|
||||
interface nsIDOMNSMouseEvent : nsIDOMMouseEvent
|
||||
{
|
||||
// Finger or touch pressure event value
|
||||
|
@ -63,7 +63,7 @@ interface nsIDOMNSMouseEvent : nsIDOMMouseEvent
|
|||
void initNSMouseEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg,
|
||||
in long screenXArg,
|
||||
in long screenYArg,
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#include "nsIDOMUIEvent.idl"
|
||||
|
||||
[scriptable, uuid(911c3352-6690-421c-9bbe-6bd34f1600dc)]
|
||||
[scriptable, uuid(b2f49035-4a2f-4e62-8fb0-deb68b0de4d9)]
|
||||
interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
|
||||
{
|
||||
// Scroll area client rect
|
||||
|
@ -49,7 +49,7 @@ interface nsIDOMScrollAreaEvent : nsIDOMUIEvent
|
|||
void initScrollAreaEvent(in DOMString aEventType,
|
||||
in boolean aCanBubble,
|
||||
in boolean aCancelable,
|
||||
in nsIDOMWindow aView,
|
||||
in nsIDOMAbstractView aView,
|
||||
in long aDetail,
|
||||
in float x,
|
||||
in float y,
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
* consuming events.
|
||||
*/
|
||||
|
||||
[scriptable, uuid(fe6b7df3-be7c-4a0b-99a2-da84e956e2f5)]
|
||||
[scriptable, uuid(cb68e879-f710-415d-a871-9a550860df01)]
|
||||
interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
|
||||
{
|
||||
/* Swipe direction constants */
|
||||
|
@ -148,7 +148,7 @@ interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
|
|||
void initSimpleGestureEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg,
|
||||
in long screenXArg,
|
||||
in long screenYArg,
|
||||
|
|
|
@ -47,14 +47,14 @@
|
|||
* http://www.w3.org/TR/DOM-Level-2-Events/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(25f28689-3f78-47e8-8d76-15b936faf8c1)]
|
||||
[scriptable, uuid(a6cf90c3-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIDOMUIEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute nsIDOMWindow view;
|
||||
readonly attribute nsIDOMAbstractView view;
|
||||
readonly attribute long detail;
|
||||
void initUIEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg);
|
||||
};
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
* http://www.whatwg.org/specs/web-apps/current-work/
|
||||
*/
|
||||
|
||||
[scriptable, uuid(42bb545e-be46-4f4f-8c0a-6c948ea0c1d4)]
|
||||
[scriptable, uuid(2d7a0f2e-6b1c-4e93-bbea-122eb0a8a513)]
|
||||
interface nsIDOMHTMLDocument : nsIDOMDocument
|
||||
{
|
||||
attribute DOMString title;
|
||||
|
|
|
@ -45,13 +45,13 @@
|
|||
* http://www.w3.org/TR/SVG/animate.html#InterfaceTimeEvent
|
||||
*/
|
||||
|
||||
[scriptable, uuid(873785cc-d8be-48af-8b30-5c566e3f4e6e)]
|
||||
[scriptable, uuid(0d309c26-ddbb-44cb-9af1-3008972349e3)]
|
||||
interface nsIDOMTimeEvent : nsIDOMEvent
|
||||
{
|
||||
readonly attribute long detail;
|
||||
readonly attribute nsIDOMWindow view;
|
||||
readonly attribute nsIDOMAbstractView view;
|
||||
|
||||
void initTimeEvent(in DOMString typeArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg);
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
interface nsIDOMSVGSVGElement;
|
||||
|
||||
[scriptable, uuid(907f1ada-5ace-4789-8c25-0c79f251044d)]
|
||||
[scriptable, uuid(dcac0765-b258-4e0b-9862-6470eb9876ba)]
|
||||
interface nsIDOMSVGDocument : nsIDOMDocument
|
||||
/* , nsIDOMDocumentEvent */
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
interface nsIDOMSVGRect;
|
||||
interface nsIDOMSVGPoint;
|
||||
|
||||
[scriptable, uuid(7298880d-127d-470d-a8ac-e5a8e5969270)]
|
||||
[scriptable, uuid(339a8c7a-552e-4cbc-8d96-8370a3939358)]
|
||||
interface nsIDOMSVGZoomEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute nsIDOMSVGRect zoomRectScreen;
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
#
|
||||
# ***** 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
|
|
@ -0,0 +1,53 @@
|
|||
/* -*- 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;
|
||||
};
|
|
@ -0,0 +1,54 @@
|
|||
/* -*- 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"
|
||||
|
||||
[scriptable, uuid(1d78da1e-2177-4b8f-9b11-41e78d1e60f7)]
|
||||
[scriptable, uuid(f9fa8205-a988-4828-9228-f3332d5475ac)]
|
||||
interface nsIDOMXULCommandEvent : nsIDOMUIEvent
|
||||
{
|
||||
/**
|
||||
|
@ -68,7 +68,7 @@ interface nsIDOMXULCommandEvent : nsIDOMUIEvent
|
|||
void initCommandEvent(in DOMString typeArg,
|
||||
in boolean canBubbleArg,
|
||||
in boolean cancelableArg,
|
||||
in nsIDOMWindow viewArg,
|
||||
in nsIDOMAbstractView viewArg,
|
||||
in long detailArg,
|
||||
in boolean ctrlKeyArg,
|
||||
in boolean altKeyArg,
|
||||
|
|
|
@ -690,14 +690,13 @@ nsHTMLEditor::CheckPositionedElementBGandFG(nsIDOMElement * aElement,
|
|||
bgColorStr);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
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;
|
||||
res = window->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
|
||||
res = viewCSS->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
// from these declarations, get the one we want and that one only
|
||||
nsCOMPtr<nsIDOMCSSValue> colorCssValue;
|
||||
res = cssDecl->GetPropertyCSSValue(NS_LITERAL_STRING("color"), getter_AddRefs(colorCssValue));
|
||||
|
|
|
@ -430,13 +430,13 @@ nsHTMLEditor::GetPositionAndDimensions(nsIDOMElement * aElement,
|
|||
// Yes, it is absolutely positioned
|
||||
mResizedObjectIsAbsolutelyPositioned = PR_TRUE;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(window));
|
||||
NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDOMViewCSS> viewCSS;
|
||||
res = mHTMLCSSUtils->GetDefaultViewCSS(aElement, getter_AddRefs(viewCSS));
|
||||
NS_ENSURE_TRUE(viewCSS, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
|
||||
// Get the all the computed css styles attached to the element node
|
||||
res = window->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
|
||||
res = viewCSS->GetComputedStyle(aElement, EmptyString(), getter_AddRefs(cssDecl));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
aBorderLeft = GetCSSFloatValue(cssDecl, NS_LITERAL_STRING("border-left-width"));
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMElementCSSInlineStyle.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsTextEditUtils.h"
|
||||
|
@ -537,36 +538,35 @@ nsresult
|
|||
nsHTMLCSSUtils::GetComputedProperty(nsIDOMNode *aNode, nsIAtom *aProperty,
|
||||
nsAString & aValue)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
nsresult res = GetDefaultViewCSS(aNode, getter_AddRefs(window));
|
||||
nsCOMPtr<nsIDOMViewCSS> viewCSS = nsnull;
|
||||
nsresult res = GetDefaultViewCSS(aNode, getter_AddRefs(viewCSS));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
return GetCSSInlinePropertyBase(aNode, aProperty, aValue, window, COMPUTED_STYLE_TYPE);
|
||||
return GetCSSInlinePropertyBase(aNode, aProperty, aValue, viewCSS, COMPUTED_STYLE_TYPE);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
|
||||
nsAString& aValue,
|
||||
nsIDOMWindow* aWindow,
|
||||
PRUint8 aStyleType)
|
||||
nsAString &aValue,
|
||||
nsIDOMViewCSS *aViewCSS,
|
||||
PRUint8 aStyleType)
|
||||
{
|
||||
aValue.Truncate();
|
||||
NS_ENSURE_TRUE(aProperty, NS_ERROR_NULL_POINTER);
|
||||
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
nsCOMPtr<nsIDOMElement>element;
|
||||
nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
switch (aStyleType) {
|
||||
case COMPUTED_STYLE_TYPE:
|
||||
if (element && aWindow) {
|
||||
if (element && aViewCSS) {
|
||||
nsAutoString value, propString;
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl;
|
||||
aProperty->ToString(propString);
|
||||
// Get the all the computed css styles attached to the element node
|
||||
res = aWindow->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl));
|
||||
if (NS_FAILED(res) || !cssDecl)
|
||||
return res;
|
||||
res = aViewCSS->GetComputedStyle(element, EmptyString(), getter_AddRefs(cssDecl));
|
||||
if (NS_FAILED(res) || !cssDecl) return res;
|
||||
// from these declarations, get the one we want and that one only
|
||||
res = cssDecl->GetPropertyValue(propString, value);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
@ -591,28 +591,33 @@ nsHTMLCSSUtils::GetCSSInlinePropertyBase(nsIDOMNode *aNode, nsIAtom *aProperty,
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLCSSUtils::GetDefaultViewCSS(nsIDOMNode *aNode, nsIDOMWindow **aViewCSS)
|
||||
nsHTMLCSSUtils::GetDefaultViewCSS(nsIDOMNode *aNode, nsIDOMViewCSS **aViewCSS)
|
||||
{
|
||||
*aViewCSS = nsnull;
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
nsCOMPtr<nsIDOMElement>element;
|
||||
nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(element));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
|
||||
if (!element) {
|
||||
return NS_OK;
|
||||
// if we have an element node
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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);
|
||||
*aViewCSS = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1082,9 +1087,9 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
|
|||
if (theElement && IsCSSEditableProperty(theElement, aHTMLProperty, aAttribute)) {
|
||||
// Yes, the requested HTML style has a CSS equivalence in this implementation
|
||||
// Retrieve the default ViewCSS if we are asked for computed styles
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
nsCOMPtr<nsIDOMViewCSS> viewCSS = nsnull;
|
||||
if (COMPUTED_STYLE_TYPE == aStyleType) {
|
||||
res = GetDefaultViewCSS(theElement, getter_AddRefs(window));
|
||||
res = GetDefaultViewCSS(theElement, getter_AddRefs(viewCSS));
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
}
|
||||
nsTArray<nsIAtom*> cssPropertyArray;
|
||||
|
@ -1099,7 +1104,7 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
|
|||
nsAutoString valueString;
|
||||
// retrieve the specified/computed value of the property
|
||||
res = GetCSSInlinePropertyBase(theElement, cssPropertyArray[index],
|
||||
valueString, window, aStyleType);
|
||||
valueString, viewCSS, aStyleType);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
// append the value to aValueString (possibly with a leading whitespace)
|
||||
if (index) aValueString.Append(PRUnichar(' '));
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIHTMLEditor.h"
|
||||
|
@ -53,7 +54,6 @@
|
|||
#define COMPUTED_STYLE_TYPE 2
|
||||
|
||||
class nsHTMLEditor;
|
||||
class nsIDOMWindow;
|
||||
|
||||
typedef void (*nsProcessValueFunc)(const nsAString * aInputString, nsAString & aOutputString,
|
||||
const char * aDefaultValueString,
|
||||
|
@ -312,13 +312,12 @@ public:
|
|||
*/
|
||||
nsresult GetElementContainerOrSelf(nsIDOMNode * aNode, nsIDOMElement ** aElement);
|
||||
|
||||
/**
|
||||
* Gets the default Window for a given node.
|
||||
/** Gets the default DOMView for a given node
|
||||
*
|
||||
* @param aNode the node we want the default Window for
|
||||
* @param aWindow [OUT] the default Window
|
||||
* @param aNode the node we want the default DOMView for
|
||||
* @param aViewCSS [OUT] the default DOMViewCSS
|
||||
*/
|
||||
nsresult GetDefaultViewCSS(nsIDOMNode* aNode, nsIDOMWindow** aWindow);
|
||||
nsresult GetDefaultViewCSS(nsIDOMNode * aNode, nsIDOMViewCSS ** aViewCSS);
|
||||
|
||||
|
||||
private:
|
||||
|
@ -384,17 +383,17 @@ private:
|
|||
PRBool aRemoveProperty);
|
||||
|
||||
/** back-end for GetSpecifiedProperty and GetComputedProperty
|
||||
*
|
||||
* @param aNode [IN] a DOM node
|
||||
* @param aProperty [IN] a CSS property
|
||||
* @param aValue [OUT] the retrieved value for this property
|
||||
* @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
|
||||
* COMPUTED_STYLE_TYPE to query the computed style values
|
||||
*/
|
||||
*
|
||||
* @param aNode [IN] a DOM node
|
||||
* @param aProperty [IN] a CSS property
|
||||
* @param aValue [OUT] the retrieved value for this property
|
||||
* @param aViewCSS [IN] the ViewCSS we need in case we query computed styles
|
||||
* @param aStyleType [IN] SPECIFIED_STYLE_TYPE to query the specified style values
|
||||
COMPUTED_STYLE_TYPE to query the computed style values
|
||||
*/
|
||||
nsresult GetCSSInlinePropertyBase(nsIDOMNode * aNode, nsIAtom * aProperty,
|
||||
nsAString & aValue,
|
||||
nsIDOMWindow* aWindow,
|
||||
nsIDOMViewCSS * aViewCSS,
|
||||
PRUint8 aStyleType);
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
/* -*- Mode: C++; 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
|
||||
|
@ -50,7 +51,9 @@
|
|||
#include "nsIDOMHTMLImageElement.h"
|
||||
#include "nsIDOMHTMLAreaElement.h"
|
||||
#include "nsIDOMHTMLLinkElement.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMCSSValue.h"
|
||||
#include "nsIDOMCSSPrimitiveValue.h"
|
||||
|
@ -290,10 +293,13 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgIR
|
|||
|
||||
nsCOMPtr<nsIDOMDocument> document;
|
||||
domNode->GetOwnerDocument(getter_AddRefs(document));
|
||||
NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDOMDocumentView> docView(do_QueryInterface(document));
|
||||
NS_ENSURE_TRUE(docView, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
document->GetDefaultView(getter_AddRefs(window));
|
||||
nsCOMPtr<nsIDOMAbstractView> defaultView;
|
||||
docView->GetDefaultView(getter_AddRefs(defaultView));
|
||||
nsCOMPtr<nsIDOMViewCSS> defaultCSSView(do_QueryInterface(defaultView));
|
||||
NS_ENSURE_TRUE(defaultCSSView, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsIDOMCSSPrimitiveValue> primitiveValue;
|
||||
nsAutoString bgStringValue;
|
||||
|
@ -321,8 +327,8 @@ nsContextMenuInfo::GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, imgIR
|
|||
break;
|
||||
|
||||
nsCOMPtr<nsIDOMCSSStyleDeclaration> computedStyle;
|
||||
window->GetComputedStyle(domElement, EmptyString(),
|
||||
getter_AddRefs(computedStyle));
|
||||
defaultCSSView->GetComputedStyle(domElement, EmptyString(),
|
||||
getter_AddRefs(computedStyle));
|
||||
if (computedStyle) {
|
||||
nsCOMPtr<nsIDOMCSSValue> cssValue;
|
||||
computedStyle->GetPropertyCSSValue(NS_LITERAL_STRING("background-image"),
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "nsIAtom.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMNSRange.h"
|
||||
#include "nsIDOMRange.h"
|
||||
|
@ -102,10 +103,13 @@ mozInlineSpellWordUtil::Init(nsWeakPtr aWeakEditor)
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// view
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
rv = domDoc->GetDefaultView(getter_AddRefs(window));
|
||||
nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(domDoc, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIDOMAbstractView> abstractView;
|
||||
rv = docView->GetDefaultView(getter_AddRefs(abstractView));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mCSSView = do_QueryInterface(abstractView, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mCSSView = window;
|
||||
|
||||
// Find the root node for the editor. For contenteditable we'll need something
|
||||
// cleverer here.
|
||||
|
@ -494,7 +498,7 @@ ContainsDOMWordSeparator(nsIDOMNode* aNode, PRInt32 aBeforeOffset,
|
|||
}
|
||||
|
||||
static PRBool
|
||||
IsBreakElement(nsIDOMWindow* aDocView, nsIDOMNode* aNode)
|
||||
IsBreakElement(nsIDOMViewCSS* aDocView, nsIDOMNode* aNode)
|
||||
{
|
||||
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(aNode);
|
||||
if (!element)
|
||||
|
@ -533,8 +537,8 @@ IsBreakElement(nsIDOMWindow* aDocView, nsIDOMNode* aNode)
|
|||
}
|
||||
|
||||
struct CheckLeavingBreakElementClosure {
|
||||
nsIDOMWindow* mDocView;
|
||||
PRPackedBool mLeftBreakElement;
|
||||
nsIDOMViewCSS* mDocView;
|
||||
PRPackedBool mLeftBreakElement;
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nsCOMPtr.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentRange.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsString.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -125,7 +126,7 @@ private:
|
|||
// cached stuff for the editor, set by Init
|
||||
nsCOMPtr<nsIDOMDocumentRange> mDOMDocumentRange;
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
nsCOMPtr<nsIDOMWindow> mCSSView;
|
||||
nsCOMPtr<nsIDOMViewCSS> mCSSView;
|
||||
nsCOMPtr<nsIUGenCategory> mCategories;
|
||||
|
||||
// range to check, see SetRange
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMHTMLElement.h"
|
||||
#include "nsIDOMHTMLIFrameElement.h"
|
||||
#include "nsIDOMNSDocument.h"
|
||||
|
@ -66,6 +68,7 @@
|
|||
#include "nsIDOMEventTarget.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
//#include ".h"
|
||||
#include "nsIDOM3EventTarget.h"
|
||||
#include "nsIDOMKeyListener.h"
|
||||
#include "nsIDOMCompositionListener.h"
|
||||
|
@ -425,22 +428,28 @@ nsWidgetUtils::IsXULNode(nsIDOMNode *aNode, PRUint32 *aType)
|
|||
}
|
||||
|
||||
nsresult
|
||||
nsWidgetUtils::GetDOMWindowByNode(nsIDOMNode* aNode, nsIDOMWindow** aDOMWindow)
|
||||
nsWidgetUtils::GetDOMWindowByNode(nsIDOMNode *aNode, nsIDOMWindow * *aDOMWindow)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIDOMDocument> nodeDoc;
|
||||
nsresult rv = aNode->GetOwnerDocument(getter_AddRefs(nodeDoc));
|
||||
rv = aNode->GetOwnerDocument(getter_AddRefs(nodeDoc));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
rv = nodeDoc->GetDefaultView(getter_AddRefs(window));
|
||||
nsCOMPtr<nsIDOMDocumentView> docView = do_QueryInterface(nodeDoc, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
window.forget(aDOMWindow);
|
||||
nsCOMPtr<nsIDOMAbstractView> absView;
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
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;
|
||||
}
|
||||
|
||||
void
|
||||
nsWidgetUtils::GetChromeEventHandler(nsIDOMWindow *aDOMWin,
|
||||
nsIDOMEventTarget **aChromeTarget)
|
||||
nsIDOMEventTarget **aChromeTarget)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(aDOMWin));
|
||||
nsPIDOMEventTarget* chromeEventHandler = nsnull;
|
||||
|
|
|
@ -71,7 +71,6 @@ members = [
|
|||
#'nsIDOMWindow.document',
|
||||
'nsIDOMWindow.getSelection',
|
||||
'nsIDOMWindow.scrollByLines',
|
||||
'nsIDOMWindow.getComputedStyle',
|
||||
'nsIDOMJSWindow.dump',
|
||||
'nsIDOMScreen.top',
|
||||
'nsIDOMScreen.height',
|
||||
|
@ -109,7 +108,6 @@ members = [
|
|||
'nsIDOMDocument.createTextNode',
|
||||
'nsIDOMDocument.documentURI',
|
||||
'nsIDOMDocument.adoptNode',
|
||||
'nsIDOMDocument.defaultView',
|
||||
'nsIDOMElement.removeAttributeNS',
|
||||
'nsIDOMElement.removeAttribute',
|
||||
'nsIDOMElement.getAttribute',
|
||||
|
@ -175,6 +173,7 @@ members = [
|
|||
'nsIDOMElementCSSInlineStyle.*',
|
||||
'nsIDOMCSS2Properties.*',
|
||||
'nsIDOMRect.*',
|
||||
'nsIDOMViewCSS.getComputedStyle',
|
||||
'nsIDOMCSSStyleDeclaration.*',
|
||||
|
||||
# dom/interfaces/events
|
||||
|
@ -387,6 +386,9 @@ members = [
|
|||
'nsIDOMDocumentTraversal.createNodeIterator',
|
||||
'nsIDOMNodeIterator.nextNode',
|
||||
|
||||
# dom/interfaces/views
|
||||
'nsIDOMDocumentView.defaultView',
|
||||
|
||||
# dom/interfaces/xbl - None.
|
||||
|
||||
# dom/interfaces/xpath
|
||||
|
|
|
@ -37,6 +37,8 @@
|
|||
|
||||
#include "inLayoutUtils.h"
|
||||
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIContentViewer.h"
|
||||
|
@ -58,14 +60,15 @@ inLayoutUtils::GetWindowFor(nsIDOMNode* aNode)
|
|||
nsIDOMWindowInternal*
|
||||
inLayoutUtils::GetWindowFor(nsIDOMDocument* aDoc)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
aDoc->GetDefaultView(getter_AddRefs(window));
|
||||
if (!window) {
|
||||
return nsnull;
|
||||
}
|
||||
nsCOMPtr<nsIDOMDocumentView> doc = do_QueryInterface(aDoc);
|
||||
if (!doc) return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> windowInternal = do_QueryInterface(window);
|
||||
return windowInternal;
|
||||
nsCOMPtr<nsIDOMAbstractView> view;
|
||||
doc->GetDefaultView(getter_AddRefs(view));
|
||||
if (!view) return nsnull;
|
||||
|
||||
nsCOMPtr<nsIDOMWindowInternal> window = do_QueryInterface(view);
|
||||
return window;
|
||||
}
|
||||
|
||||
nsIPresShell*
|
||||
|
|
|
@ -70,6 +70,7 @@ MAKEFILES_dom="
|
|||
dom/interfaces/stylesheets/Makefile
|
||||
dom/interfaces/threads/Makefile
|
||||
dom/interfaces/traversal/Makefile
|
||||
dom/interfaces/views/Makefile
|
||||
dom/interfaces/xbl/Makefile
|
||||
dom/interfaces/xpath/Makefile
|
||||
dom/interfaces/xul/Makefile
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
#include "nsIDocument.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsWidgetAtoms.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsIDOMCSSValue.h"
|
||||
|
@ -199,27 +201,24 @@ nsMenuItemIconX::GetIconURI(nsIURI** aIconURI)
|
|||
if (!hasImageAttr) {
|
||||
// If the content node has no "image" attribute, get the
|
||||
// "list-style-image" property from CSS.
|
||||
nsCOMPtr<nsIDOMDocument> domDocument =
|
||||
do_QueryInterface(mContent->GetDocument());
|
||||
if (!domDocument)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIDOMDocumentView> domDocumentView =
|
||||
do_QueryInterface(mContent->GetDocument());
|
||||
if (!domDocumentView) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> window;
|
||||
rv = domDocument->GetDefaultView(getter_AddRefs(window));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
if (!window)
|
||||
return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIDOMAbstractView> domAbstractView;
|
||||
rv = domDocumentView->GetDefaultView(getter_AddRefs(domAbstractView));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMViewCSS> domViewCSS = do_QueryInterface(domAbstractView);
|
||||
if (!domViewCSS) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(mContent);
|
||||
if (!domElement)
|
||||
return NS_ERROR_FAILURE;
|
||||
if (!domElement) return NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
rv = window->GetComputedStyle(domElement, EmptyString(),
|
||||
getter_AddRefs(cssStyleDecl));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
rv = domViewCSS->GetComputedStyle(domElement, EmptyString(),
|
||||
getter_AddRefs(cssStyleDecl));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
NS_NAMED_LITERAL_STRING(listStyleImage, "list-style-image");
|
||||
rv = cssStyleDecl->GetPropertyCSSValue(listStyleImage,
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#include "nsIDOMXULCommandEvent.h"
|
||||
#include "nsIPrivateDOMEvent.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsIDOMAbstractView.h"
|
||||
|
||||
void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
|
||||
{
|
||||
|
@ -65,13 +66,13 @@ void nsMenuUtilsX::DispatchCommandTo(nsIContent* aTargetContent)
|
|||
getter_AddRefs(event));
|
||||
nsCOMPtr<nsIDOMXULCommandEvent> command = do_QueryInterface(event);
|
||||
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
|
||||
// pressed keys, but this is a big old edge case anyway. -dwh
|
||||
if (pEvent &&
|
||||
NS_SUCCEEDED(command->InitCommandEvent(NS_LITERAL_STRING("command"),
|
||||
PR_TRUE, PR_TRUE,
|
||||
doc->GetWindow(), 0,
|
||||
PR_TRUE, PR_TRUE, view, 0,
|
||||
PR_FALSE, PR_FALSE, PR_FALSE,
|
||||
PR_FALSE, nsnull))) {
|
||||
pEvent->SetTrusted(PR_TRUE);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* 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
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
|
@ -83,6 +84,8 @@
|
|||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsIDOMDocumentView.h"
|
||||
#include "nsIDOMViewCSS.h"
|
||||
#include "nsIDOMCSSStyleDeclaration.h"
|
||||
#include "nsITimelineService.h"
|
||||
#include "nsAppShellCID.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче