Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2005-12-09 22:08:45 +03:00
|
|
|
/* vim: set ts=2 sw=2 et tw=78: */
|
2001-09-26 02:43:09 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-18 01:52:36 +04:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2001-04-01 05:10:59 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* 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/
|
2001-09-26 02:43:09 +04:00
|
|
|
*
|
|
|
|
* 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.
|
2001-04-01 05:10:59 +04:00
|
|
|
*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
* The Original Code is mozilla.org code.
|
2001-04-01 05:10:59 +04:00
|
|
|
*
|
2004-04-18 01:52:36 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-09-26 02:43:09 +04:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2000
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-04-01 05:10:59 +04:00
|
|
|
*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
* Contributor(s):
|
|
|
|
* Johnny Stenback <jst@netscape.com> (original author)
|
2001-09-26 02:43:09 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-18 01:52:36 +04:00
|
|
|
* 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"),
|
2001-09-26 02:43:09 +04:00
|
|
|
* 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
|
2004-04-18 01:52:36 +04:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-09-26 02:43:09 +04:00
|
|
|
* 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
|
2004-04-18 01:52:36 +04:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-09-26 02:43:09 +04:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-09-01 07:30:51 +04:00
|
|
|
#include "nscore.h"
|
2001-04-01 05:10:59 +04:00
|
|
|
#include "nsDOMClassInfo.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsCRT.h"
|
2006-11-12 18:15:37 +03:00
|
|
|
#include "nsCRTGlue.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIServiceManager.h"
|
2002-03-04 05:25:08 +03:00
|
|
|
#include "nsICategoryManager.h"
|
2002-04-16 15:57:17 +04:00
|
|
|
#include "nsIComponentRegistrar.h"
|
2002-09-04 03:36:13 +04:00
|
|
|
#include "nsXPCOM.h"
|
2002-03-04 05:25:08 +03:00
|
|
|
#include "nsISupportsPrimitives.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIXPConnect.h"
|
|
|
|
#include "nsIJSContextStack.h"
|
|
|
|
#include "nsIXPCSecurityManager.h"
|
2004-07-23 04:26:02 +04:00
|
|
|
#include "nsIStringBundle.h"
|
|
|
|
#include "nsIConsoleService.h"
|
2004-08-19 02:19:45 +04:00
|
|
|
#include "nsIScriptError.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsXPIDLString.h"
|
|
|
|
#include "nsReadableUtils.h"
|
2004-05-22 03:31:37 +04:00
|
|
|
#include "nsUnicharUtils.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "xptcall.h"
|
2003-09-19 12:43:14 +04:00
|
|
|
#include "prprf.h"
|
2006-05-19 09:57:36 +04:00
|
|
|
#include "nsTArray.h"
|
2007-07-19 01:56:57 +04:00
|
|
|
#include "nsCSSValue.h"
|
2008-03-15 02:08:57 +03:00
|
|
|
#include "nsIRunnable.h"
|
|
|
|
#include "nsThreadUtils.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-10-03 03:09:08 +04:00
|
|
|
// JavaScript includes
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "jsprvtd.h" // we are using private JS typedefs...
|
|
|
|
#include "jscntxt.h"
|
|
|
|
#include "jsdbgapi.h"
|
|
|
|
#include "jsnum.h"
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// General helper includes
|
2005-07-31 00:57:07 +04:00
|
|
|
#include "nsGlobalWindow.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIContent.h"
|
2006-06-06 19:42:41 +04:00
|
|
|
#include "nsIAttribute.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDocument.h"
|
|
|
|
#include "nsIDOMDocument.h"
|
2003-07-12 02:32:25 +04:00
|
|
|
#include "nsIDOM3Document.h"
|
2001-09-21 05:07:53 +04:00
|
|
|
#include "nsIDOMXMLDocument.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMNSDocument.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsIDOMEvent.h"
|
2001-12-06 09:57:03 +03:00
|
|
|
#include "nsIDOMNSEvent.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsIDOMKeyEvent.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMEventListener.h"
|
2004-07-23 04:26:02 +04:00
|
|
|
#include "nsContentUtils.h"
|
2005-10-22 02:30:36 +04:00
|
|
|
#include "nsDOMWindowUtils.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// Window scriptable helper includes
|
|
|
|
#include "nsIDocShell.h"
|
|
|
|
#include "nsIDocShellTreeItem.h"
|
|
|
|
#include "nsIDocShellTreeNode.h"
|
|
|
|
#include "nsIScriptExternalNameSet.h"
|
|
|
|
#include "nsJSUtils.h"
|
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-06 01:28:38 +04:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsScriptNameSpaceManager.h"
|
|
|
|
#include "nsIScriptObjectOwner.h"
|
|
|
|
#include "nsIJSNativeInitializer.h"
|
2007-11-13 13:35:49 +03:00
|
|
|
#include "nsJSEnvironment.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// DOM base includes
|
|
|
|
#include "nsIDOMPluginArray.h"
|
|
|
|
#include "nsIDOMPlugin.h"
|
|
|
|
#include "nsIDOMMimeTypeArray.h"
|
|
|
|
#include "nsIDOMMimeType.h"
|
|
|
|
#include "nsIDOMLocation.h"
|
|
|
|
#include "nsIDOMWindowInternal.h"
|
2004-08-26 07:49:17 +04:00
|
|
|
#include "nsPIDOMWindow.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMJSWindow.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMWindowCollection.h"
|
|
|
|
#include "nsIDOMHistory.h"
|
|
|
|
#include "nsIDOMMediaList.h"
|
2002-02-09 06:36:55 +03:00
|
|
|
#include "nsIDOMChromeWindow.h"
|
2005-12-09 22:08:45 +03:00
|
|
|
#include "nsIDOMConstructor.h"
|
2008-10-22 18:31:14 +04:00
|
|
|
#include "nsClientRect.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// DOM core includes
|
|
|
|
#include "nsDOMError.h"
|
2002-04-10 17:38:30 +04:00
|
|
|
#include "nsIDOMDOMException.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMNode.h"
|
2003-06-16 15:17:18 +04:00
|
|
|
#include "nsIDOM3Node.h"
|
2006-01-27 07:10:30 +03:00
|
|
|
#include "nsIDOM3Attr.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMNodeList.h"
|
|
|
|
#include "nsIDOMNamedNodeMap.h"
|
2003-10-16 04:44:20 +04:00
|
|
|
#include "nsIDOMDOMStringList.h"
|
2009-08-12 12:55:14 +04:00
|
|
|
#include "nsIDOMDOMTokenList.h"
|
2003-10-16 04:44:20 +04:00
|
|
|
#include "nsIDOMNameList.h"
|
2007-02-01 18:14:00 +03:00
|
|
|
#include "nsIDOMNSElement.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// HTMLFormElement helper includes
|
|
|
|
#include "nsIForm.h"
|
2001-05-12 09:26:07 +04:00
|
|
|
#include "nsIFormControl.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMHTMLFormElement.h"
|
|
|
|
#include "nsIDOMNSHTMLFormControlList.h"
|
|
|
|
#include "nsIDOMHTMLCollection.h"
|
2008-10-22 18:31:14 +04:00
|
|
|
#include "nsIHTMLCollection.h"
|
2007-12-21 16:44:58 +03:00
|
|
|
#include "nsHTMLDocument.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-05-12 09:26:07 +04:00
|
|
|
// HTMLSelectElement helper includes
|
|
|
|
#include "nsIDOMHTMLSelectElement.h"
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// HTMLEmbed/ObjectElement helper includes
|
|
|
|
#include "nsIPluginInstance.h"
|
|
|
|
#include "nsIObjectFrame.h"
|
2005-12-03 14:27:42 +03:00
|
|
|
#include "nsIObjectLoadingContent.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIPluginHost.h"
|
|
|
|
|
|
|
|
// Oh, did I mention that I hate Microsoft for doing this to me?
|
2008-11-04 21:08:21 +03:00
|
|
|
#ifdef XP_WIN
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#undef GetClassName
|
2005-04-29 17:33:49 +04:00
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2003-03-19 02:23:49 +03:00
|
|
|
// HTMLOptionsCollection includes
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMHTMLOptionElement.h"
|
2003-03-14 10:00:53 +03:00
|
|
|
#include "nsIDOMNSHTMLOptionElement.h"
|
|
|
|
#include "nsIDOMHTMLOptionsCollection.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIDOMNSHTMLOptionCollectn.h"
|
|
|
|
|
2002-07-09 04:44:20 +04:00
|
|
|
// ContentList includes
|
2005-02-03 02:38:28 +03:00
|
|
|
#include "nsContentList.h"
|
2008-11-13 19:54:52 +03:00
|
|
|
#include "nsGenericElement.h"
|
2002-07-09 04:44:20 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// Event related includes
|
|
|
|
#include "nsIEventListenerManager.h"
|
2007-05-14 13:11:38 +04:00
|
|
|
#include "nsIDOMEventTarget.h"
|
2005-04-29 03:48:28 +04:00
|
|
|
#include "nsIDOMNSEventTarget.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// CSS related includes
|
|
|
|
#include "nsIDOMStyleSheet.h"
|
|
|
|
#include "nsIDOMStyleSheetList.h"
|
|
|
|
#include "nsIDOMCSSStyleDeclaration.h"
|
2001-05-14 02:16:45 +04:00
|
|
|
#include "nsIDOMCSSRule.h"
|
2008-10-22 18:31:14 +04:00
|
|
|
#include "nsICSSRule.h"
|
|
|
|
#include "nsICSSRuleList.h"
|
2002-01-11 03:15:55 +03:00
|
|
|
#include "nsIDOMRect.h"
|
2002-03-22 23:18:42 +03:00
|
|
|
#include "nsIDOMRGBColor.h"
|
2007-01-25 05:03:02 +03:00
|
|
|
#include "nsIDOMNSRGBAColor.h"
|
2009-07-13 15:14:57 +04:00
|
|
|
#include "nsDOMCSSAttrDeclaration.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// XBL related includes.
|
|
|
|
#include "nsIXBLService.h"
|
2005-02-26 01:07:01 +03:00
|
|
|
#include "nsXBLBinding.h"
|
2007-02-17 02:02:08 +03:00
|
|
|
#include "nsBindingManager.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsIPresShell.h"
|
|
|
|
#include "nsIDOMViewCSS.h"
|
|
|
|
#include "nsIDOMElement.h"
|
|
|
|
#include "nsIDOMCSSStyleDeclaration.h"
|
2004-07-27 01:49:49 +04:00
|
|
|
#include "nsStyleSet.h"
|
|
|
|
#include "nsStyleContext.h"
|
|
|
|
#include "nsAutoPtr.h"
|
2005-11-18 16:39:43 +03:00
|
|
|
#include "nsMemory.h"
|
|
|
|
|
|
|
|
// Tranformiix
|
|
|
|
#include "nsIDOMXPathEvaluator.h"
|
|
|
|
#include "nsIXSLTProcessor.h"
|
|
|
|
#include "nsIXSLTProcessorObsolete.h"
|
2006-07-06 04:33:24 +04:00
|
|
|
#include "nsIXSLTProcessorPrivate.h"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2006-04-26 13:19:48 +04:00
|
|
|
#include "nsIDOMLSProgressEvent.h"
|
|
|
|
#include "nsIDOMParser.h"
|
|
|
|
#include "nsIDOMSerializer.h"
|
2008-11-13 19:54:52 +03:00
|
|
|
#include "nsXMLHttpRequest.h"
|
2006-04-26 13:19:48 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
// includes needed for the prototype chain interfaces
|
|
|
|
#include "nsIDOMNavigator.h"
|
|
|
|
#include "nsIDOMBarProp.h"
|
|
|
|
#include "nsIDOMScreen.h"
|
|
|
|
#include "nsIDOMDocumentType.h"
|
|
|
|
#include "nsIDOMDOMImplementation.h"
|
|
|
|
#include "nsIDOMDocumentFragment.h"
|
|
|
|
#include "nsIDOMDocumentEvent.h"
|
|
|
|
#include "nsIDOMAttr.h"
|
|
|
|
#include "nsIDOMText.h"
|
2008-06-04 21:53:34 +04:00
|
|
|
#include "nsIDOM3Text.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMComment.h"
|
|
|
|
#include "nsIDOMCDATASection.h"
|
|
|
|
#include "nsIDOMProcessingInstruction.h"
|
|
|
|
#include "nsIDOMNotation.h"
|
2004-08-20 22:09:19 +04:00
|
|
|
#include "nsIDOMNSEvent.h"
|
2007-12-11 11:18:04 +03:00
|
|
|
#include "nsIDOMDataContainerEvent.h"
|
2004-08-20 22:09:19 +04:00
|
|
|
#include "nsIDOMKeyEvent.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMMouseEvent.h"
|
2008-08-13 07:08:59 +04:00
|
|
|
#include "nsIDOMMouseScrollEvent.h"
|
2008-08-27 16:07:27 +04:00
|
|
|
#include "nsIDOMDragEvent.h"
|
2006-12-01 14:09:53 +03:00
|
|
|
#include "nsIDOMCommandEvent.h"
|
2003-04-16 04:00:46 +04:00
|
|
|
#include "nsIDOMPopupBlockedEvent.h"
|
2005-03-18 18:33:51 +03:00
|
|
|
#include "nsIDOMBeforeUnloadEvent.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMMutationEvent.h"
|
2005-06-02 05:17:35 +04:00
|
|
|
#include "nsIDOMSmartCardEvent.h"
|
2006-05-23 00:37:32 +04:00
|
|
|
#include "nsIDOMXULCommandEvent.h"
|
2005-06-16 03:52:46 +04:00
|
|
|
#include "nsIDOMPageTransitionEvent.h"
|
2008-01-30 04:31:29 +03:00
|
|
|
#include "nsIDOMMessageEvent.h"
|
2009-09-04 08:49:18 +04:00
|
|
|
#include "nsPaintRequest.h"
|
2008-09-18 13:47:21 +04:00
|
|
|
#include "nsIDOMNotifyPaintEvent.h"
|
2009-09-12 03:13:56 +04:00
|
|
|
#include "nsIDOMScrollAreaEvent.h"
|
2009-12-23 22:10:31 +03:00
|
|
|
#include "nsIDOMTransitionEvent.h"
|
2004-08-05 15:38:42 +04:00
|
|
|
#include "nsIDOMNSDocumentStyle.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMDocumentRange.h"
|
2001-09-07 13:30:03 +04:00
|
|
|
#include "nsIDOMDocumentTraversal.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMDocumentXBL.h"
|
|
|
|
#include "nsIDOMDocumentView.h"
|
|
|
|
#include "nsIDOMElementCSSInlineStyle.h"
|
|
|
|
#include "nsIDOMLinkStyle.h"
|
|
|
|
#include "nsIDOMHTMLDocument.h"
|
|
|
|
#include "nsIDOMNSHTMLDocument.h"
|
|
|
|
#include "nsIDOMNSHTMLElement.h"
|
|
|
|
#include "nsIDOMHTMLAnchorElement.h"
|
2006-01-25 18:16:57 +03:00
|
|
|
#include "nsIDOMNSHTMLAnchorElement2.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMHTMLAppletElement.h"
|
|
|
|
#include "nsIDOMHTMLAreaElement.h"
|
2006-01-25 18:16:57 +03:00
|
|
|
#include "nsIDOMNSHTMLAreaElement2.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMHTMLBRElement.h"
|
|
|
|
#include "nsIDOMHTMLBaseElement.h"
|
|
|
|
#include "nsIDOMHTMLBaseFontElement.h"
|
|
|
|
#include "nsIDOMHTMLBodyElement.h"
|
|
|
|
#include "nsIDOMHTMLButtonElement.h"
|
|
|
|
#include "nsIDOMNSHTMLButtonElement.h"
|
2005-04-18 10:33:23 +04:00
|
|
|
#include "nsIDOMHTMLCanvasElement.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMHTMLDListElement.h"
|
|
|
|
#include "nsIDOMHTMLDirectoryElement.h"
|
|
|
|
#include "nsIDOMHTMLDivElement.h"
|
|
|
|
#include "nsIDOMHTMLEmbedElement.h"
|
|
|
|
#include "nsIDOMHTMLFieldSetElement.h"
|
|
|
|
#include "nsIDOMHTMLFontElement.h"
|
|
|
|
#include "nsIDOMNSHTMLFormElement.h"
|
|
|
|
#include "nsIDOMHTMLFrameElement.h"
|
|
|
|
#include "nsIDOMHTMLFrameSetElement.h"
|
2001-09-20 11:58:49 +04:00
|
|
|
#include "nsIDOMNSHTMLFrameElement.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMHTMLHRElement.h"
|
2003-07-30 12:13:07 +04:00
|
|
|
#include "nsIDOMNSHTMLHRElement.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMHTMLHeadElement.h"
|
|
|
|
#include "nsIDOMHTMLHeadingElement.h"
|
|
|
|
#include "nsIDOMHTMLHtmlElement.h"
|
|
|
|
#include "nsIDOMHTMLIFrameElement.h"
|
|
|
|
#include "nsIDOMHTMLImageElement.h"
|
|
|
|
#include "nsIDOMNSHTMLImageElement.h"
|
|
|
|
#include "nsIDOMHTMLInputElement.h"
|
|
|
|
#include "nsIDOMNSHTMLInputElement.h"
|
|
|
|
#include "nsIDOMHTMLIsIndexElement.h"
|
|
|
|
#include "nsIDOMHTMLLIElement.h"
|
|
|
|
#include "nsIDOMHTMLLabelElement.h"
|
|
|
|
#include "nsIDOMHTMLLegendElement.h"
|
|
|
|
#include "nsIDOMHTMLLinkElement.h"
|
|
|
|
#include "nsIDOMHTMLMapElement.h"
|
|
|
|
#include "nsIDOMHTMLMenuElement.h"
|
|
|
|
#include "nsIDOMHTMLMetaElement.h"
|
|
|
|
#include "nsIDOMHTMLModElement.h"
|
|
|
|
#include "nsIDOMHTMLOListElement.h"
|
|
|
|
#include "nsIDOMHTMLObjectElement.h"
|
|
|
|
#include "nsIDOMHTMLOptGroupElement.h"
|
|
|
|
#include "nsIDOMHTMLParagraphElement.h"
|
|
|
|
#include "nsIDOMHTMLParamElement.h"
|
|
|
|
#include "nsIDOMHTMLPreElement.h"
|
|
|
|
#include "nsIDOMHTMLQuoteElement.h"
|
|
|
|
#include "nsIDOMHTMLScriptElement.h"
|
2009-11-10 04:04:24 +03:00
|
|
|
#include "nsIDOMNSHTMLScriptElement.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMNSHTMLSelectElement.h"
|
|
|
|
#include "nsIDOMHTMLStyleElement.h"
|
|
|
|
#include "nsIDOMHTMLTableCaptionElem.h"
|
|
|
|
#include "nsIDOMHTMLTableCellElement.h"
|
|
|
|
#include "nsIDOMHTMLTableColElement.h"
|
|
|
|
#include "nsIDOMHTMLTableElement.h"
|
|
|
|
#include "nsIDOMHTMLTableRowElement.h"
|
|
|
|
#include "nsIDOMHTMLTableSectionElem.h"
|
|
|
|
#include "nsIDOMHTMLTextAreaElement.h"
|
|
|
|
#include "nsIDOMNSHTMLTextAreaElement.h"
|
|
|
|
#include "nsIDOMHTMLTitleElement.h"
|
|
|
|
#include "nsIDOMHTMLUListElement.h"
|
2008-07-09 12:22:20 +04:00
|
|
|
#include "nsIDOMHTMLMediaError.h"
|
|
|
|
#include "nsIDOMHTMLSourceElement.h"
|
|
|
|
#include "nsIDOMHTMLVideoElement.h"
|
|
|
|
#include "nsIDOMHTMLAudioElement.h"
|
2008-08-14 15:07:46 +04:00
|
|
|
#include "nsIDOMProgressEvent.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMNSUIEvent.h"
|
2009-01-17 00:32:09 +03:00
|
|
|
#include "nsIDOMNSCSS2Properties.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMCSSCharsetRule.h"
|
|
|
|
#include "nsIDOMCSSImportRule.h"
|
|
|
|
#include "nsIDOMCSSMediaRule.h"
|
2008-08-11 01:13:49 +04:00
|
|
|
#include "nsIDOMCSSFontFaceRule.h"
|
2004-08-05 22:26:14 +04:00
|
|
|
#include "nsIDOMCSSMozDocumentRule.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMCSSPrimitiveValue.h"
|
|
|
|
#include "nsIDOMCSSStyleRule.h"
|
|
|
|
#include "nsIDOMCSSStyleSheet.h"
|
2008-10-22 18:31:14 +04:00
|
|
|
#include "nsDOMCSSValueList.h"
|
2009-08-21 18:42:37 +04:00
|
|
|
#include "nsIDOMOrientationEvent.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMRange.h"
|
|
|
|
#include "nsIDOMNSRange.h"
|
2002-04-10 17:38:30 +04:00
|
|
|
#include "nsIDOMRangeException.h"
|
2008-07-22 04:35:38 +04:00
|
|
|
#include "nsIDOMNodeIterator.h"
|
2001-09-07 13:30:03 +04:00
|
|
|
#include "nsIDOMTreeWalker.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
#include "nsIDOMXULDocument.h"
|
|
|
|
#include "nsIDOMXULElement.h"
|
|
|
|
#include "nsIDOMXULCommandDispatcher.h"
|
|
|
|
#include "nsIDOMCrypto.h"
|
|
|
|
#include "nsIDOMCRMFObject.h"
|
|
|
|
#include "nsIControllers.h"
|
|
|
|
#include "nsISelection.h"
|
|
|
|
#include "nsIBoxObject.h"
|
2003-04-11 04:56:27 +04:00
|
|
|
#ifdef MOZ_XUL
|
2002-03-29 05:46:01 +03:00
|
|
|
#include "nsITreeSelection.h"
|
|
|
|
#include "nsITreeContentView.h"
|
|
|
|
#include "nsITreeView.h"
|
2003-07-09 01:10:52 +04:00
|
|
|
#include "nsIXULTemplateBuilder.h"
|
2008-10-22 18:31:14 +04:00
|
|
|
#include "nsTreeColumns.h"
|
2003-04-11 04:56:27 +04:00
|
|
|
#endif
|
2005-11-18 16:39:43 +03:00
|
|
|
#include "nsIDOMXPathException.h"
|
|
|
|
#include "nsIDOMXPathExpression.h"
|
|
|
|
#include "nsIDOMNSXPathExpression.h"
|
|
|
|
#include "nsIDOMXPathNSResolver.h"
|
|
|
|
#include "nsIDOMXPathResult.h"
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
#ifdef MOZ_SVG
|
2005-03-23 04:42:22 +03:00
|
|
|
#include "nsIDOMGetSVGDocument.h"
|
2007-01-27 02:45:15 +03:00
|
|
|
#include "nsIDOMSVGAElement.h"
|
2004-12-09 06:16:15 +03:00
|
|
|
#include "nsIDOMSVGAngle.h"
|
|
|
|
#include "nsIDOMSVGAnimatedAngle.h"
|
2007-06-27 23:02:58 +04:00
|
|
|
#include "nsIDOMSVGAnimatedBoolean.h"
|
2004-10-15 03:02:53 +04:00
|
|
|
#include "nsIDOMSVGAnimatedEnum.h"
|
2005-09-07 02:30:40 +04:00
|
|
|
#include "nsIDOMSVGAnimatedInteger.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGAnimatedLength.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#include "nsIDOMSVGAnimatedLengthList.h"
|
2004-10-15 03:02:53 +04:00
|
|
|
#include "nsIDOMSVGAnimatedNumber.h"
|
|
|
|
#include "nsIDOMSVGAnimatedNumberList.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGAnimatedPathData.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGAnimatedPoints.h"
|
2004-07-01 12:10:34 +04:00
|
|
|
#include "nsIDOMSVGAnimPresAspRatio.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGAnimatedRect.h"
|
|
|
|
#include "nsIDOMSVGAnimatedString.h"
|
2009-01-15 07:38:07 +03:00
|
|
|
#ifdef MOZ_SMIL
|
|
|
|
#include "nsIDOMSVGAnimateElement.h"
|
2009-01-19 12:14:16 +03:00
|
|
|
#include "nsIDOMSVGAnimateTransformElement.h"
|
2009-01-15 07:38:07 +03:00
|
|
|
#include "nsIDOMSVGSetElement.h"
|
|
|
|
#include "nsIDOMSVGAnimationElement.h"
|
|
|
|
#include "nsIDOMElementTimeControl.h"
|
|
|
|
#endif // MOZ_SMIL
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGAnimTransformList.h"
|
|
|
|
#include "nsIDOMSVGCircleElement.h"
|
2005-01-25 06:55:03 +03:00
|
|
|
#include "nsIDOMSVGClipPathElement.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGDefsElement.h"
|
2005-01-24 20:42:23 +03:00
|
|
|
#include "nsIDOMSVGDescElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGDocument.h"
|
|
|
|
#include "nsIDOMSVGElement.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGEllipseElement.h"
|
2005-08-26 01:31:09 +04:00
|
|
|
#include "nsIDOMSVGEvent.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGException.h"
|
2005-09-07 02:30:40 +04:00
|
|
|
#include "nsIDOMSVGFilterElement.h"
|
|
|
|
#include "nsIDOMSVGFilters.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGFitToViewBox.h"
|
|
|
|
#include "nsIDOMSVGForeignObjectElem.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGGElement.h"
|
2004-10-15 03:02:53 +04:00
|
|
|
#include "nsIDOMSVGGradientElement.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGImageElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGLength.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#include "nsIDOMSVGLengthList.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGLineElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGLocatable.h"
|
2004-12-09 06:16:15 +03:00
|
|
|
#include "nsIDOMSVGMarkerElement.h"
|
2006-01-20 20:00:43 +03:00
|
|
|
#include "nsIDOMSVGMaskElement.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGMatrix.h"
|
2005-01-24 20:42:23 +03:00
|
|
|
#include "nsIDOMSVGMetadataElement.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGNumber.h"
|
2004-10-15 03:02:53 +04:00
|
|
|
#include "nsIDOMSVGNumberList.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGPathElement.h"
|
|
|
|
#include "nsIDOMSVGPathSeg.h"
|
|
|
|
#include "nsIDOMSVGPathSegList.h"
|
2005-09-14 02:38:36 +04:00
|
|
|
#include "nsIDOMSVGPatternElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGPoint.h"
|
|
|
|
#include "nsIDOMSVGPointList.h"
|
|
|
|
#include "nsIDOMSVGPolygonElement.h"
|
|
|
|
#include "nsIDOMSVGPolylineElement.h"
|
2004-07-01 12:10:34 +04:00
|
|
|
#include "nsIDOMSVGPresAspectRatio.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGRect.h"
|
|
|
|
#include "nsIDOMSVGRectElement.h"
|
|
|
|
#include "nsIDOMSVGScriptElement.h"
|
2004-10-15 03:02:53 +04:00
|
|
|
#include "nsIDOMSVGStopElement.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGStylable.h"
|
|
|
|
#include "nsIDOMSVGStyleElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGSVGElement.h"
|
2007-02-05 19:26:23 +03:00
|
|
|
#include "nsIDOMSVGSwitchElement.h"
|
2004-11-23 16:51:57 +03:00
|
|
|
#include "nsIDOMSVGSymbolElement.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#include "nsIDOMSVGTextElement.h"
|
2005-08-26 06:49:52 +04:00
|
|
|
#include "nsIDOMSVGTextPathElement.h"
|
2005-01-24 20:42:23 +03:00
|
|
|
#include "nsIDOMSVGTitleElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGTransform.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#include "nsIDOMSVGTransformable.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
#include "nsIDOMSVGTransformList.h"
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
#include "nsIDOMSVGTSpanElement.h"
|
|
|
|
#include "nsIDOMSVGURIReference.h"
|
2004-11-23 16:51:57 +03:00
|
|
|
#include "nsIDOMSVGUseElement.h"
|
2007-08-28 03:11:14 +04:00
|
|
|
#include "nsIDOMSVGUnitTypes.h"
|
2004-12-03 02:13:13 +03:00
|
|
|
#include "nsIDOMSVGZoomAndPan.h"
|
2005-08-26 01:31:09 +04:00
|
|
|
#include "nsIDOMSVGZoomEvent.h"
|
2004-07-26 00:03:55 +04:00
|
|
|
#endif // MOZ_SVG
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2005-04-18 10:33:23 +04:00
|
|
|
#include "nsIDOMCanvasRenderingContext2D.h"
|
2009-09-03 04:47:49 +04:00
|
|
|
#include "nsICanvasRenderingContextWebGL.h"
|
2005-04-18 10:33:23 +04:00
|
|
|
|
2003-01-18 20:55:27 +03:00
|
|
|
#include "nsIImageDocument.h"
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
// Storage includes
|
2008-11-01 00:40:35 +03:00
|
|
|
#include "nsDOMStorage.h"
|
2006-05-19 09:57:36 +04:00
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
// Drag and drop
|
|
|
|
#include "nsIDOMDataTransfer.h"
|
|
|
|
|
2008-07-16 03:37:48 +04:00
|
|
|
// Geolocation
|
2008-08-14 20:35:49 +04:00
|
|
|
#include "nsIDOMGeoGeolocation.h"
|
|
|
|
#include "nsIDOMGeoPosition.h"
|
2009-02-26 07:33:24 +03:00
|
|
|
#include "nsIDOMGeoPositionCoords.h"
|
2008-08-14 20:35:49 +04:00
|
|
|
#include "nsIDOMGeoPositionError.h"
|
2008-07-16 03:37:48 +04:00
|
|
|
|
2008-11-06 09:41:52 +03:00
|
|
|
// Workers
|
|
|
|
#include "nsDOMWorker.h"
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
#include "nsDOMFile.h"
|
2009-11-09 23:05:16 +03:00
|
|
|
#include "nsDOMFileReader.h"
|
2007-07-25 08:29:47 +04:00
|
|
|
#include "nsIDOMFileException.h"
|
2009-10-07 12:30:26 +04:00
|
|
|
#include "nsIDOMFileError.h"
|
2007-07-25 08:29:47 +04:00
|
|
|
|
2008-10-24 00:15:20 +04:00
|
|
|
// Simple gestures include
|
|
|
|
#include "nsIDOMSimpleGestureEvent.h"
|
|
|
|
|
2008-12-12 02:55:15 +03:00
|
|
|
#include "nsIDOMNSMouseEvent.h"
|
|
|
|
|
2009-10-16 12:57:32 +04:00
|
|
|
#include "nsIEventListenerService.h"
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
static const char kDOMStringBundleURL[] =
|
2005-02-23 19:53:28 +03:00
|
|
|
"chrome://global/locale/dom/dom.properties";
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
// NOTE: DEFAULT_SCRIPTABLE_FLAGS and DOM_DEFAULT_SCRIPTABLE_FLAGS
|
|
|
|
// are defined in nsIDOMClassInfo.h.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
#define WINDOW_SCRIPTABLE_FLAGS \
|
|
|
|
(nsIXPCScriptable::WANT_GETPROPERTY | \
|
|
|
|
nsIXPCScriptable::WANT_SETPROPERTY | \
|
|
|
|
nsIXPCScriptable::WANT_PRECREATE | \
|
|
|
|
nsIXPCScriptable::WANT_ADDPROPERTY | \
|
|
|
|
nsIXPCScriptable::WANT_DELPROPERTY | \
|
2005-09-30 05:18:43 +04:00
|
|
|
nsIXPCScriptable::WANT_NEWENUMERATE | \
|
2007-02-24 09:57:20 +03:00
|
|
|
nsIXPCScriptable::WANT_FINALIZE | \
|
2005-08-12 08:11:00 +04:00
|
|
|
nsIXPCScriptable::WANT_EQUALITY | \
|
|
|
|
nsIXPCScriptable::WANT_OUTER_OBJECT | \
|
2005-10-08 04:28:45 +04:00
|
|
|
nsIXPCScriptable::WANT_INNER_OBJECT | \
|
2005-08-12 08:11:00 +04:00
|
|
|
nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE)
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#define NODE_SCRIPTABLE_FLAGS \
|
2007-01-05 01:31:26 +03:00
|
|
|
((DOM_DEFAULT_SCRIPTABLE_FLAGS | \
|
2006-11-23 02:18:16 +03:00
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY | \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsIXPCScriptable::WANT_ADDPROPERTY | \
|
2009-03-24 14:02:23 +03:00
|
|
|
nsIXPCScriptable::WANT_SETPROPERTY) & \
|
2001-07-11 13:09:30 +04:00
|
|
|
~nsIXPCScriptable::USE_JSSTUB_FOR_ADDPROPERTY)
|
|
|
|
|
|
|
|
// We need to let JavaScript QI elements to interfaces that are not in
|
|
|
|
// the classinfo since XBL can be used to dynamically implement new
|
|
|
|
// unknown interfaces on elements, accessibility relies on this being
|
|
|
|
// possible.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
#define ELEMENT_SCRIPTABLE_FLAGS \
|
2007-09-28 17:45:01 +04:00
|
|
|
((NODE_SCRIPTABLE_FLAGS & ~nsIXPCScriptable::CLASSINFO_INTERFACES_ONLY) | \
|
2009-06-03 19:30:18 +04:00
|
|
|
nsIXPCScriptable::WANT_POSTCREATE | \
|
2007-09-28 17:45:01 +04:00
|
|
|
nsIXPCScriptable::WANT_ENUMERATE)
|
2007-03-23 02:01:14 +03:00
|
|
|
|
2004-04-02 09:11:44 +04:00
|
|
|
#define EXTERNAL_OBJ_SCRIPTABLE_FLAGS \
|
2008-10-23 06:41:37 +04:00
|
|
|
((ELEMENT_SCRIPTABLE_FLAGS & \
|
|
|
|
~nsIXPCScriptable::USE_JSSTUB_FOR_SETPROPERTY) | \
|
2009-06-03 19:30:18 +04:00
|
|
|
nsIXPCScriptable::WANT_POSTCREATE | \
|
2004-10-28 05:54:21 +04:00
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY | \
|
2004-08-30 08:31:16 +04:00
|
|
|
nsIXPCScriptable::WANT_SETPROPERTY | \
|
|
|
|
nsIXPCScriptable::WANT_CALL)
|
2004-04-02 09:11:44 +04:00
|
|
|
|
2002-05-22 04:34:01 +04:00
|
|
|
#define DOCUMENT_SCRIPTABLE_FLAGS \
|
|
|
|
(NODE_SCRIPTABLE_FLAGS | \
|
2009-06-03 19:30:18 +04:00
|
|
|
nsIXPCScriptable::WANT_POSTCREATE | \
|
2002-05-22 04:34:01 +04:00
|
|
|
nsIXPCScriptable::WANT_ADDPROPERTY | \
|
2005-07-28 20:15:00 +04:00
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY | \
|
2008-11-13 19:54:52 +03:00
|
|
|
nsIXPCScriptable::WANT_ENUMERATE)
|
2002-05-22 04:34:01 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
#define ARRAY_SCRIPTABLE_FLAGS \
|
2005-10-04 09:50:42 +04:00
|
|
|
(DOM_DEFAULT_SCRIPTABLE_FLAGS | \
|
2003-09-19 12:43:14 +04:00
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY | \
|
|
|
|
nsIXPCScriptable::WANT_ENUMERATE)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-11-13 19:54:52 +03:00
|
|
|
#define EVENTTARGET_SCRIPTABLE_FLAGS \
|
|
|
|
(DOM_DEFAULT_SCRIPTABLE_FLAGS | \
|
2009-03-24 14:02:23 +03:00
|
|
|
nsIXPCScriptable::WANT_ADDPROPERTY)
|
2008-11-13 19:54:52 +03:00
|
|
|
|
2002-08-29 08:05:39 +04:00
|
|
|
#define DOMCLASSINFO_STANDARD_FLAGS \
|
|
|
|
(nsIClassInfo::MAIN_THREAD_ONLY | nsIClassInfo::DOM_OBJECT)
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
#ifdef NS_DEBUG
|
|
|
|
#define NS_DEFINE_CLASSINFO_DATA_DEBUG(_class) \
|
|
|
|
eDOMClassInfo_##_class##_id,
|
|
|
|
#else
|
|
|
|
#define NS_DEFINE_CLASSINFO_DATA_DEBUG(_class) \
|
|
|
|
// nothing
|
|
|
|
#endif
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
#define NS_DEFINE_CLASSINFO_DATA_WITH_NAME(_class, _name, _helper, \
|
|
|
|
_flags) \
|
|
|
|
{ #_name, \
|
2009-06-03 19:30:18 +04:00
|
|
|
nsnull, \
|
2002-03-04 06:42:57 +03:00
|
|
|
{ _helper::doCreate }, \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsnull, \
|
2001-07-11 13:09:30 +04:00
|
|
|
nsnull, \
|
|
|
|
nsnull, \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
_flags, \
|
2001-11-02 07:49:07 +03:00
|
|
|
PR_TRUE, \
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA_DEBUG(_class) \
|
|
|
|
},
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
#define NS_DEFINE_CLASSINFO_DATA(_class, _helper, _flags) \
|
|
|
|
NS_DEFINE_CLASSINFO_DATA_WITH_NAME(_class, _class, _helper, _flags)
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// This list of NS_DEFINE_CLASSINFO_DATA macros is what gives the DOM
|
|
|
|
// classes their correct behavior when used through XPConnect. The
|
|
|
|
// arguments that are passed to NS_DEFINE_CLASSINFO_DATA are
|
|
|
|
//
|
|
|
|
// 1. Class name as it should appear in JavaScript, this name is also
|
|
|
|
// used to find the id of the class in nsDOMClassInfo
|
|
|
|
// (i.e. e<classname>_id)
|
2001-05-10 13:45:46 +04:00
|
|
|
// 2. Scriptable helper class
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// 3. nsIClassInfo/nsIXPCScriptable flags (i.e. for GetScriptableFlags)
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
static nsDOMClassInfoData sClassInfoData[] = {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// Base classes
|
2001-07-25 02:39:11 +04:00
|
|
|
|
|
|
|
// The Window class lets you QI into interfaces that are not in the
|
|
|
|
// flattened set (i.e. nsIXPCScriptable::CLASSINFO_INTERFACES_ONLY
|
|
|
|
// is not set), because of this make sure all scriptable interfaces
|
2004-12-10 22:48:22 +03:00
|
|
|
// that are implemented by nsGlobalWindow can securely be exposed
|
2001-07-25 02:39:11 +04:00
|
|
|
// to JS.
|
|
|
|
|
|
|
|
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Window, nsWindowSH,
|
2001-07-25 02:39:11 +04:00
|
|
|
DEFAULT_SCRIPTABLE_FLAGS |
|
2005-08-12 08:11:00 +04:00
|
|
|
WINDOW_SCRIPTABLE_FLAGS)
|
2002-05-22 04:34:01 +04:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(Location, nsLocationSH,
|
2009-12-14 03:57:08 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Navigator, nsNavigatorSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
|
|
|
nsIXPCScriptable::WANT_PRECREATE)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Plugin, nsPluginSH,
|
2001-05-12 09:26:07 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(PluginArray, nsPluginArraySH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(MimeType, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(MimeTypeArray, nsMimeTypeArraySH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(BarProp, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(History, nsHistorySH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Screen, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2007-11-12 09:43:14 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMPrototype, nsDOMConstructorSH,
|
2007-05-09 16:04:59 +04:00
|
|
|
DOM_BASE_SCRIPTABLE_FLAGS |
|
2007-06-14 14:03:44 +04:00
|
|
|
nsIXPCScriptable::WANT_HASINSTANCE |
|
|
|
|
nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE)
|
2007-11-12 09:43:14 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMConstructor, nsDOMConstructorSH,
|
2007-05-09 16:04:59 +04:00
|
|
|
DOM_BASE_SCRIPTABLE_FLAGS |
|
|
|
|
nsIXPCScriptable::WANT_HASINSTANCE |
|
|
|
|
nsIXPCScriptable::WANT_CALL |
|
2007-06-14 14:03:44 +04:00
|
|
|
nsIXPCScriptable::WANT_CONSTRUCT |
|
|
|
|
nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// Core classes
|
2001-09-21 07:23:33 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XMLDocument, nsDocumentSH,
|
2008-03-06 23:20:42 +03:00
|
|
|
DOCUMENT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DocumentType, nsNodeSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NODE_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMImplementation, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-11-01 18:52:53 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMException, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-08-12 12:55:14 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMTokenList, nsDOMTokenListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2009-03-24 14:02:23 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DocumentFragment, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Element, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2006-06-06 19:42:41 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Attr, nsAttributeSH,
|
2008-10-13 20:33:27 +04:00
|
|
|
NODE_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Text, nsNodeSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NODE_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Comment, nsNodeSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NODE_SCRIPTABLE_FLAGS)
|
2001-07-11 13:09:30 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CDATASection, nsNodeSH, NODE_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ProcessingInstruction, nsNodeSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NODE_SCRIPTABLE_FLAGS)
|
2001-07-11 13:09:30 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Notation, nsNodeSH, NODE_SCRIPTABLE_FLAGS)
|
2009-03-24 14:02:23 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(NodeList, nsNodeListSH, ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(NamedNodeMap, nsNamedNodeMapSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
// Misc Core related classes
|
|
|
|
|
|
|
|
// Event
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Event, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(MutationEvent, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-08-20 22:09:19 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(UIEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(MouseEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-08-13 07:08:59 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(MouseScrollEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-08-27 16:07:27 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DragEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-08-20 22:09:19 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(KeyboardEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(PopupBlockedEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-08-21 18:42:37 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(OrientationEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// Misc HTML classes
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLDocument, nsHTMLDocumentSH,
|
2008-03-06 23:20:42 +03:00
|
|
|
DOCUMENT_SCRIPTABLE_FLAGS)
|
2003-03-14 10:00:53 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLOptionsCollection,
|
|
|
|
nsHTMLOptionsCollectionSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS |
|
|
|
|
nsIXPCScriptable::WANT_SETPROPERTY)
|
2001-07-11 13:09:30 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA_WITH_NAME(HTMLFormControlCollection, HTMLCollection,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsHTMLCollectionSH,
|
2001-07-11 13:09:30 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA_WITH_NAME(HTMLGenericCollection, HTMLCollection,
|
|
|
|
nsHTMLCollectionSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// HTML element classes
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLAnchorElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-08-29 04:28:32 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLAppletElement, nsHTMLPluginObjElementSH,
|
2004-04-02 09:11:44 +04:00
|
|
|
EXTERNAL_OBJ_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLAreaElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLBRElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLBaseElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLBaseFontElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-07-16 02:46:14 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLBodyElement, nsHTMLBodyElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLButtonElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLDListElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLDelElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLDirectoryElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLDivElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLEmbedElement, nsHTMLPluginObjElementSH,
|
2004-04-02 09:11:44 +04:00
|
|
|
EXTERNAL_OBJ_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLFieldSetElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLFontElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLFormElement, nsHTMLFormElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS |
|
2003-01-31 15:10:13 +03:00
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY |
|
2002-03-13 05:56:40 +03:00
|
|
|
nsIXPCScriptable::WANT_NEWENUMERATE)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLFrameElement, nsElementSH,
|
2007-07-26 23:18:06 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLFrameSetElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLHRElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLHeadElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLHeadingElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLHtmlElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLIFrameElement, nsElementSH,
|
2007-07-26 23:18:06 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLImageElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLInputElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLInsElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLIsIndexElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLLIElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLLabelElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLLegendElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLLinkElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLMapElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLMenuElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLMetaElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLOListElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLObjectElement, nsHTMLPluginObjElementSH,
|
2004-04-02 09:11:44 +04:00
|
|
|
EXTERNAL_OBJ_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLOptGroupElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLOptionElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLParagraphElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLParamElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLPreElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLQuoteElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLScriptElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-05-12 09:26:07 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLSelectElement, nsHTMLSelectElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS |
|
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLSpacerElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLSpanElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLStyleElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTableCaptionElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTableCellElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTableColElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTableElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTableRowElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTableSectionElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTextAreaElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLTitleElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLUListElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLUnknownElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLWBRElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
// CSS classes
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSStyleRule, nsDOMGenericSH,
|
2001-05-15 12:26:13 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSCharsetRule, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSImportRule, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSMediaRule, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSNameSpaceRule, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-14 02:16:45 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSRuleList, nsCSSRuleListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-09-05 04:00:18 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSGroupRuleRuleList, nsCSSRuleListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(MediaList, nsMediaListSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-06-23 14:09:13 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(StyleSheetList, nsStyleSheetListSH,
|
2001-05-11 08:45:15 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSStyleSheet, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSStyleDeclaration, nsCSSStyleDeclSH,
|
2001-09-05 08:35:21 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-11-07 10:52:41 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ComputedCSSStyleDeclaration, nsCSSStyleDeclSH,
|
2008-08-11 01:13:49 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ROCSSPrimitiveValue, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
// Range classes
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Range, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Selection, nsDOMGenericSH,
|
2001-05-12 09:16:57 +04:00
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// XUL classes
|
2003-04-11 04:56:27 +04:00
|
|
|
#ifdef MOZ_XUL
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULDocument, nsDocumentSH,
|
2008-03-06 23:20:42 +03:00
|
|
|
DOCUMENT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULElement, nsElementSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULCommandDispatcher, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2003-04-11 04:56:27 +04:00
|
|
|
#endif
|
2006-02-23 06:17:11 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULControllers, nsNonDOMObjectSH,
|
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(BoxObject, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
2008-01-16 04:27:53 +03:00
|
|
|
#ifdef MOZ_XUL
|
2002-03-29 05:46:01 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(TreeSelection, nsDOMGenericSH,
|
2001-05-16 12:13:12 +04:00
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
2002-03-29 05:46:01 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(TreeContentView, nsDOMGenericSH,
|
2002-01-05 10:17:10 +03:00
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
2003-04-11 04:56:27 +04:00
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// Crypto classes
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Crypto, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-05-09 05:39:02 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CRMFObject, nsDOMGenericSH,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
// DOM Traversal classes
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(TreeWalker, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
|
|
|
// We are now trying to preserve binary compat in classinfo. No
|
|
|
|
// more putting things in those categories up there. New entries
|
|
|
|
// are to be added to the end of the list
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSRect, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
// DOM Chrome Window class.
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(ChromeWindow, nsWindowSH,
|
|
|
|
DEFAULT_SCRIPTABLE_FLAGS |
|
2005-08-12 08:11:00 +04:00
|
|
|
WINDOW_SCRIPTABLE_FLAGS)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSRGBColor, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(RangeException, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSValueList, nsCSSValueListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA_WITH_NAME(ContentList, HTMLCollection,
|
2009-03-24 14:02:23 +03:00
|
|
|
nsContentListSH, ARRAY_SCRIPTABLE_FLAGS)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XMLStylesheetProcessingInstruction, nsNodeSH,
|
|
|
|
NODE_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(ImageDocument, nsHTMLDocumentSH,
|
2008-03-06 23:20:42 +03:00
|
|
|
DOCUMENT_SCRIPTABLE_FLAGS)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
|
|
|
#ifdef MOZ_XUL
|
2005-01-17 12:24:56 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULTemplateBuilder, nsDOMGenericSH,
|
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULTreeBuilder, nsDOMGenericSH,
|
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMStringList, nsStringListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(NameList, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2004-04-17 09:53:38 +04:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(TreeColumn, nsDOMGenericSH,
|
|
|
|
DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(TreeColumns, nsTreeColumnsSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
#endif
|
|
|
|
|
2004-08-05 22:26:14 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSMozDocumentRule, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2005-03-18 18:33:51 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(BeforeUnloadEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
#ifdef MOZ_SVG
|
|
|
|
// SVG document
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGDocument, nsDocumentSH,
|
2002-05-22 04:34:01 +04:00
|
|
|
DOCUMENT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
|
|
|
|
// SVG element classes
|
2007-01-27 02:45:15 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-01-15 07:38:07 +03:00
|
|
|
#ifdef MOZ_SMIL
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimateElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-01-19 12:14:16 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimateTransformElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-01-15 07:38:07 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGSetElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
#endif // MOZ_SMIL
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGCircleElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-01-25 06:55:03 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGClipPathElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGDefsElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-01-24 20:42:23 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGDescElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGEllipseElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2006-12-11 19:33:08 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEBlendElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-02-20 14:03:00 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEColorMatrixElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-09-07 02:30:40 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEComponentTransferElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2006-12-11 19:33:08 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFECompositeElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-06-27 23:02:58 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEConvolveMatrixElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2008-01-04 00:37:57 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEDiffuseLightingElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEDisplacementMapElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEDistantLightElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-01-08 19:48:56 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEFloodElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-09-07 02:30:40 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEFuncAElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEFuncBElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEFuncGElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEFuncRElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEGaussianBlurElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2008-01-02 23:49:13 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEImageElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-09-07 02:30:40 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEMergeElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEMergeNodeElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2006-11-02 19:30:20 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEMorphologyElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-09-07 02:30:40 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEOffsetElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-07-26 10:57:42 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFEPointLightElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFESpecularLightingElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFESpotLightElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-07-27 04:50:45 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFETileElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-01-08 19:48:56 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFETurbulenceElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-09-07 02:30:40 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGFilterElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGGElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGImageElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-10-15 03:02:53 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGLinearGradientElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGLineElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-12-09 06:16:15 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGMarkerElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2006-01-20 20:00:43 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGMaskElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-01-24 20:42:23 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGMetadataElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-09-14 02:38:36 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPatternElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPolygonElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPolylineElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-10-15 03:02:53 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGRadialGradientElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGRectElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGScriptElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-10-15 03:02:53 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGStopElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGStyleElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGSVGElement, nsElementSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2007-02-05 19:26:23 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGSwitchElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-11-23 16:51:57 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGSymbolElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGTextElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-08-26 06:49:52 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGTextPathElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-01-24 20:42:23 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGTitleElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGTSpanElement, nsElementSH,
|
2004-06-23 22:14:04 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2004-11-23 16:51:57 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGUseElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
|
|
|
|
// other SVG classes
|
2004-12-09 06:16:15 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAngle, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedAngle, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2007-06-27 23:02:58 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedBoolean, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-10-15 03:02:53 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedEnumeration, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2005-09-07 02:30:40 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedInteger, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedLength, nsDOMGenericSH,
|
2003-01-31 15:10:13 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedLengthList, nsDOMGenericSH,
|
2003-01-31 15:10:13 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-10-15 03:02:53 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedNumber, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedNumberList, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedPreserveAspectRatio, nsDOMGenericSH,
|
2003-01-31 15:10:13 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedRect, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedString, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGAnimatedTransformList, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2005-08-26 01:31:09 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGException, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGLength, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGLengthList, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGMatrix, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGNumber, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-10-15 03:02:53 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGNumberList, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegArcAbs, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegArcRel, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegClosePath, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicAbs, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicSmoothAbs, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoCubicSmoothRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticAbs, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticSmoothAbs, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegCurvetoQuadraticSmoothRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoAbs, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoHorizontalAbs, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoHorizontalRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2001-12-12 10:59:31 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoVerticalAbs, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegLinetoVerticalRel, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegList, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegMovetoAbs, nsDOMGenericSH,
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPathSegMovetoRel, nsDOMGenericSH,
|
2003-01-31 15:10:13 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPoint, nsDOMGenericSH,
|
2003-01-31 15:10:13 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPointList, nsDOMGenericSH,
|
2002-01-11 03:15:55 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGPreserveAspectRatio, nsDOMGenericSH,
|
2003-10-16 04:44:20 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGRect, nsDOMGenericSH,
|
2004-07-01 12:10:34 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGTransform, nsDOMGenericSH,
|
2004-07-01 12:10:34 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGTransformList, nsDOMGenericSH,
|
2004-07-22 22:34:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2005-08-26 01:31:09 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGZoomEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2004-07-26 00:03:55 +04:00
|
|
|
#endif // MOZ_SVG
|
2005-04-18 10:33:23 +04:00
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLCanvasElement, nsElementSH,
|
2005-04-19 01:03:13 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2005-04-18 10:33:23 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CanvasRenderingContext2D, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2005-04-20 04:00:23 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CanvasGradient, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CanvasPattern, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-06-11 03:16:59 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(TextMetrics, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2005-06-02 05:17:35 +04:00
|
|
|
|
2005-10-22 02:30:36 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SmartCardEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(PageTransitionEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WindowUtils, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2005-06-29 07:51:44 +04:00
|
|
|
|
2005-11-18 16:39:43 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XSLTProcessor, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XPathEvaluator, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XPathException, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XPathExpression, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XPathNSResolver, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XPathResult, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
// WhatWG Storage
|
|
|
|
|
|
|
|
// mrbkap says we don't need WANT_ADDPROPERTY on Storage objects
|
|
|
|
// since a call to addProperty() is always followed by a call to
|
|
|
|
// setProperty(), except in the case when a getter or setter is set
|
|
|
|
// for a property. But we don't care about getters or setters here.
|
2009-05-16 17:59:30 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(StorageObsolete, nsStorageSH,
|
2006-05-19 09:57:36 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
|
|
|
nsIXPCScriptable::WANT_NEWRESOLVE |
|
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY |
|
|
|
|
nsIXPCScriptable::WANT_SETPROPERTY |
|
|
|
|
nsIXPCScriptable::WANT_DELPROPERTY |
|
|
|
|
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |
|
|
|
|
nsIXPCScriptable::WANT_NEWENUMERATE)
|
2009-03-19 02:43:45 +03:00
|
|
|
|
2009-05-16 17:59:30 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(Storage, nsStorage2SH,
|
2009-03-19 02:43:45 +03:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
|
|
|
nsIXPCScriptable::WANT_NEWRESOLVE |
|
|
|
|
nsIXPCScriptable::WANT_GETPROPERTY |
|
|
|
|
nsIXPCScriptable::WANT_SETPROPERTY |
|
|
|
|
nsIXPCScriptable::WANT_DELPROPERTY |
|
|
|
|
nsIXPCScriptable::DONT_ENUM_STATIC_PROPS |
|
|
|
|
nsIXPCScriptable::WANT_NEWENUMERATE)
|
2006-05-19 09:57:36 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(StorageList, nsStorageListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(StorageItem, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(StorageEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2010-01-28 17:53:53 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(StorageEventObsolete, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2006-05-19 09:57:36 +04:00
|
|
|
|
2006-04-26 13:19:48 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(DOMParser, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XMLSerializer, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XMLHttpProgressEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-08-14 15:04:43 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(XMLHttpRequest, nsEventTargetSH,
|
2008-11-13 19:54:52 +03:00
|
|
|
EVENTTARGET_SCRIPTABLE_FLAGS)
|
2006-04-26 13:19:48 +04:00
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ClientRect, nsDOMGenericSH,
|
2007-05-31 02:32:54 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-03-12 03:59:15 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ClientRectList, nsClientRectListSH,
|
2007-05-31 02:32:54 +04:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
|
2008-08-17 15:18:21 +04:00
|
|
|
#ifdef MOZ_SVG
|
2005-06-29 07:51:44 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(SVGForeignObjectElement, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
#endif
|
2006-05-23 00:37:32 +04:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XULCommandEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2006-12-01 14:09:53 +03:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CommandEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2007-05-29 13:45:30 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(OfflineResourceList, nsOfflineResourceListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2007-07-09 10:19:27 +04:00
|
|
|
|
2007-07-25 08:29:47 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(FileList, nsFileListSH,
|
2007-12-18 00:20:40 +03:00
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2007-07-25 08:29:47 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(File, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(FileException, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-10-07 12:30:26 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(FileError, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-11-09 23:05:16 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(FileReader, nsEventTargetSH,
|
2009-10-07 12:30:26 +04:00
|
|
|
EVENTTARGET_SCRIPTABLE_FLAGS)
|
2007-07-25 08:29:47 +04:00
|
|
|
|
2007-07-26 21:52:26 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ModalContentWindow, nsWindowSH,
|
|
|
|
DEFAULT_SCRIPTABLE_FLAGS |
|
|
|
|
WINDOW_SCRIPTABLE_FLAGS)
|
2007-12-11 11:18:04 +03:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(DataContainerEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-01-30 04:31:29 +03:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(MessageEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-07-09 12:22:20 +04:00
|
|
|
|
2008-08-14 20:35:49 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(GeoGeolocation, nsDOMGenericSH,
|
2008-07-16 03:37:48 +04:00
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-08-14 20:35:49 +04:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(GeoPosition, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2009-02-26 07:33:24 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(GeoPositionCoords, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2008-08-14 20:35:49 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(GeoPositionError, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2008-08-11 01:13:49 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceStyleDecl, nsCSSStyleDeclSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLVideoElement, nsElementSH,
|
2008-07-09 12:22:20 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLSourceElement, nsElementSH,
|
2008-07-09 12:22:20 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLMediaError, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-08-10 18:41:12 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(HTMLAudioElement, nsElementSH,
|
2008-07-09 12:22:20 +04:00
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
2008-07-22 04:35:38 +04:00
|
|
|
|
2008-08-14 15:07:46 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(ProgressEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(XMLHttpRequestUpload, nsEventTargetSH,
|
2008-11-13 19:54:52 +03:00
|
|
|
EVENTTARGET_SCRIPTABLE_FLAGS)
|
2008-08-14 15:07:46 +04:00
|
|
|
|
2008-07-22 04:35:38 +04:00
|
|
|
// DOM Traversal NodeIterator class
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(NodeIterator, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-08-27 16:07:27 +04:00
|
|
|
|
|
|
|
// data transfer for drag and drop
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(DataTransfer, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
|
2008-09-18 13:47:21 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(NotifyPaintEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-10-24 00:15:20 +04:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(SimpleGestureEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2008-11-04 20:21:38 +03:00
|
|
|
|
|
|
|
#ifdef MOZ_MATHML
|
|
|
|
NS_DEFINE_CLASSINFO_DATA_WITH_NAME(MathMLElement, Element, nsElementSH,
|
|
|
|
ELEMENT_SCRIPTABLE_FLAGS)
|
|
|
|
#endif
|
2008-11-06 09:41:52 +03:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(Worker, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-06-28 03:44:35 +04:00
|
|
|
|
2009-09-03 04:47:49 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(CanvasRenderingContextWebGL, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WebGLBuffer, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WebGLTexture, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WebGLProgram, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WebGLShader, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WebGLFramebuffer, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(WebGLRenderbuffer, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-09-04 08:49:18 +04:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(PaintRequest, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(PaintRequestList, nsPaintRequestListSH,
|
|
|
|
ARRAY_SCRIPTABLE_FLAGS)
|
2009-09-12 03:13:56 +04:00
|
|
|
|
|
|
|
NS_DEFINE_CLASSINFO_DATA(ScrollAreaEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-10-16 12:57:32 +04:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(EventListenerInfo, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
2009-12-23 22:10:31 +03:00
|
|
|
NS_DEFINE_CLASSINFO_DATA(TransitionEvent, nsDOMGenericSH,
|
|
|
|
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
};
|
|
|
|
|
2010-01-30 05:50:46 +03:00
|
|
|
// Objects that shuld be constructable through |new Name();|
|
2005-11-18 16:39:43 +03:00
|
|
|
struct nsContractIDMapData
|
|
|
|
{
|
|
|
|
PRInt32 mDOMClassInfoID;
|
2005-11-18 17:45:37 +03:00
|
|
|
const char *mContractID;
|
2005-11-18 16:39:43 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_DEFINE_CONSTRUCTOR_DATA(_class, _contract_id) \
|
|
|
|
{ eDOMClassInfo_##_class##_id, _contract_id },
|
|
|
|
|
2005-11-18 18:53:43 +03:00
|
|
|
static const nsContractIDMapData kConstructorMap[] =
|
2005-11-18 16:39:43 +03:00
|
|
|
{
|
2006-04-26 13:19:48 +04:00
|
|
|
NS_DEFINE_CONSTRUCTOR_DATA(DOMParser, NS_DOMPARSER_CONTRACTID)
|
2009-11-09 23:05:16 +03:00
|
|
|
NS_DEFINE_CONSTRUCTOR_DATA(FileReader, NS_FILEREADER_CONTRACTID)
|
2006-04-26 13:19:48 +04:00
|
|
|
NS_DEFINE_CONSTRUCTOR_DATA(XMLSerializer, NS_XMLSERIALIZER_CONTRACTID)
|
|
|
|
NS_DEFINE_CONSTRUCTOR_DATA(XMLHttpRequest, NS_XMLHTTPREQUEST_CONTRACTID)
|
|
|
|
NS_DEFINE_CONSTRUCTOR_DATA(XPathEvaluator, NS_XPATH_EVALUATOR_CONTRACTID)
|
2005-11-18 16:39:43 +03:00
|
|
|
NS_DEFINE_CONSTRUCTOR_DATA(XSLTProcessor,
|
|
|
|
"@mozilla.org/document-transformer;1?type=xslt")
|
|
|
|
};
|
|
|
|
|
2008-11-06 09:41:52 +03:00
|
|
|
struct nsConstructorFuncMapData
|
|
|
|
{
|
|
|
|
PRInt32 mDOMClassInfoID;
|
|
|
|
nsDOMConstructorFunc mConstructorFunc;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_DEFINE_CONSTRUCTOR_FUNC_DATA(_class, _func) \
|
|
|
|
{ eDOMClassInfo_##_class##_id, _func },
|
|
|
|
|
|
|
|
static const nsConstructorFuncMapData kConstructorFuncMap[] =
|
|
|
|
{
|
|
|
|
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(Worker, nsDOMWorker::NewWorker)
|
|
|
|
};
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsIXPConnect *nsDOMClassInfo::sXPConnect = nsnull;
|
|
|
|
nsIScriptSecurityManager *nsDOMClassInfo::sSecMan = nsnull;
|
|
|
|
PRBool nsDOMClassInfo::sIsInitialized = PR_FALSE;
|
2004-07-23 04:26:02 +04:00
|
|
|
PRBool nsDOMClassInfo::sDisableDocumentAllSupport = PR_FALSE;
|
2004-08-26 07:49:17 +04:00
|
|
|
PRBool nsDOMClassInfo::sDisableGlobalScopePollutionSupport = PR_FALSE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sTop_id = JSVAL_VOID;
|
2003-04-26 07:27:21 +04:00
|
|
|
jsval nsDOMClassInfo::sParent_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sScrollbars_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sLocation_id = JSVAL_VOID;
|
2003-01-22 06:22:35 +03:00
|
|
|
jsval nsDOMClassInfo::sConstructor_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::s_content_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sContent_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sMenubar_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sToolbar_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sLocationbar_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sPersonalbar_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sStatusbar_id = JSVAL_VOID;
|
2009-10-07 04:09:16 +04:00
|
|
|
jsval nsDOMClassInfo::sDialogArguments_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sDirectories_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sControllers_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sLength_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sInnerHeight_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sInnerWidth_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOuterHeight_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOuterWidth_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sScreenX_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sScreenY_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sStatus_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sName_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnmousedown_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnmouseup_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnclick_id = JSVAL_VOID;
|
2003-06-10 22:33:58 +04:00
|
|
|
jsval nsDOMClassInfo::sOndblclick_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sOncontextmenu_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnmouseover_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnmouseout_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnkeydown_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnkeyup_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnkeypress_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnmousemove_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnfocus_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnblur_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnsubmit_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnreset_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnchange_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnselect_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnload_id = JSVAL_VOID;
|
2004-03-03 03:20:31 +03:00
|
|
|
jsval nsDOMClassInfo::sOnbeforeunload_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sOnunload_id = JSVAL_VOID;
|
2009-06-26 21:16:50 +04:00
|
|
|
jsval nsDOMClassInfo::sOnhashchange_id = JSVAL_VOID;
|
2005-07-26 02:09:39 +04:00
|
|
|
jsval nsDOMClassInfo::sOnpageshow_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnpagehide_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sOnabort_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnerror_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnpaint_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnresize_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnscroll_id = JSVAL_VOID;
|
2009-02-18 16:31:31 +03:00
|
|
|
jsval nsDOMClassInfo::sOndrag_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOndragend_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOndragenter_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOndragleave_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOndragover_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOndragstart_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOndrop_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sScrollX_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sScrollY_id = JSVAL_VOID;
|
2003-04-15 17:40:46 +04:00
|
|
|
jsval nsDOMClassInfo::sScrollMaxX_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sScrollMaxY_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sOpen_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sItem_id = JSVAL_VOID;
|
2004-08-24 05:31:19 +04:00
|
|
|
jsval nsDOMClassInfo::sNamedItem_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
jsval nsDOMClassInfo::sEnumerate_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sNavigator_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sDocument_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sWindow_id = JSVAL_VOID;
|
2003-02-14 04:59:52 +03:00
|
|
|
jsval nsDOMClassInfo::sFrames_id = JSVAL_VOID;
|
2003-02-27 03:54:49 +03:00
|
|
|
jsval nsDOMClassInfo::sSelf_id = JSVAL_VOID;
|
2003-07-09 04:48:25 +04:00
|
|
|
jsval nsDOMClassInfo::sOpener_id = JSVAL_VOID;
|
2004-07-23 04:26:02 +04:00
|
|
|
jsval nsDOMClassInfo::sAll_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sTags_id = JSVAL_VOID;
|
2005-04-29 03:48:28 +04:00
|
|
|
jsval nsDOMClassInfo::sAddEventListener_id= JSVAL_VOID;
|
2006-06-23 20:43:29 +04:00
|
|
|
jsval nsDOMClassInfo::sBaseURIObject_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sNodePrincipal_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sDocumentURIObject_id=JSVAL_VOID;
|
2007-07-26 08:14:33 +04:00
|
|
|
jsval nsDOMClassInfo::sOncopy_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOncut_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sOnpaste_id = JSVAL_VOID;
|
2007-10-10 05:24:28 +04:00
|
|
|
jsval nsDOMClassInfo::sJava_id = JSVAL_VOID;
|
|
|
|
jsval nsDOMClassInfo::sPackages_id = JSVAL_VOID;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
static const JSClass *sObjectClass = nsnull;
|
2005-07-29 19:11:08 +04:00
|
|
|
const JSClass *nsDOMClassInfo::sXPCNativeWrapperClass = nsnull;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-07-01 23:12:32 +04:00
|
|
|
/**
|
|
|
|
* Set our JSClass pointer for the Object class
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
FindObjectClass(JSObject* aGlobalObject)
|
2005-07-29 19:11:08 +04:00
|
|
|
{
|
2009-07-01 23:12:32 +04:00
|
|
|
NS_ASSERTION(!sObjectClass,
|
|
|
|
"Double set of sObjectClass");
|
|
|
|
JSObject *obj, *proto = aGlobalObject;
|
|
|
|
do {
|
|
|
|
obj = proto;
|
|
|
|
proto = STOBJ_GET_PROTO(obj);
|
|
|
|
} while (proto);
|
2005-07-29 19:11:08 +04:00
|
|
|
|
2009-07-01 23:12:32 +04:00
|
|
|
sObjectClass = STOBJ_GET_CLASS(obj);
|
2005-07-29 19:11:08 +04:00
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
static void
|
|
|
|
PrintWarningOnConsole(JSContext *cx, const char *stringBundleProperty)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIStringBundleService>
|
|
|
|
stringService(do_GetService(NS_STRINGBUNDLE_CONTRACTID));
|
|
|
|
if (!stringService) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIStringBundle> bundle;
|
|
|
|
stringService->CreateBundle(kDOMStringBundleURL, getter_AddRefs(bundle));
|
|
|
|
if (!bundle) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsXPIDLString msg;
|
|
|
|
bundle->GetStringFromName(NS_ConvertASCIItoUTF16(stringBundleProperty).get(),
|
|
|
|
getter_Copies(msg));
|
|
|
|
|
|
|
|
if (msg.IsEmpty()) {
|
|
|
|
NS_ERROR("Failed to get strings from dom.properties!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIConsoleService> consoleService
|
|
|
|
(do_GetService("@mozilla.org/consoleservice;1"));
|
|
|
|
if (!consoleService) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptError> scriptError =
|
|
|
|
do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
|
|
|
|
if (!scriptError) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSStackFrame *fp, *iterator = nsnull;
|
|
|
|
fp = ::JS_FrameIterator(cx, &iterator);
|
|
|
|
PRUint32 lineno = 0;
|
|
|
|
nsAutoString sourcefile;
|
|
|
|
if (fp) {
|
|
|
|
JSScript* script = ::JS_GetFrameScript(cx, fp);
|
|
|
|
if (script) {
|
|
|
|
const char* filename = ::JS_GetScriptFilename(cx, script);
|
|
|
|
if (filename) {
|
|
|
|
CopyUTF8toUTF16(nsDependentCString(filename), sourcefile);
|
|
|
|
}
|
|
|
|
jsbytecode* pc = ::JS_GetFramePC(cx, fp);
|
|
|
|
if (pc) {
|
|
|
|
lineno = ::JS_PCToLineNumber(cx, script, pc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
nsresult rv = scriptError->Init(msg.get(),
|
|
|
|
sourcefile.get(),
|
|
|
|
EmptyString().get(),
|
|
|
|
lineno,
|
|
|
|
0, // column for error is not available
|
|
|
|
nsIScriptError::warningFlag,
|
|
|
|
"DOM:HTML");
|
|
|
|
if (NS_SUCCEEDED(rv)){
|
|
|
|
consoleService->LogMessage(scriptError);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
static jsval
|
|
|
|
GetInternedJSVal(JSContext *cx, const char *str)
|
|
|
|
{
|
|
|
|
JSString *s = ::JS_InternString(cx, str);
|
|
|
|
|
|
|
|
if (!s) {
|
|
|
|
return JSVAL_VOID;
|
|
|
|
}
|
|
|
|
|
|
|
|
return STRING_TO_JSVAL(s);
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// static
|
|
|
|
nsresult
|
2002-08-16 01:18:20 +04:00
|
|
|
nsDOMClassInfo::DefineStaticJSVals(JSContext *cx)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2002-08-16 01:18:20 +04:00
|
|
|
#define SET_JSVAL_TO_STRING(_val, _cx, _str) \
|
|
|
|
_val = GetInternedJSVal(_cx, _str); \
|
|
|
|
if (!JSVAL_IS_STRING(_val)) { \
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
}
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sTop_id, cx, "top");
|
2003-04-26 07:27:21 +04:00
|
|
|
SET_JSVAL_TO_STRING(sParent_id, cx, "parent");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sScrollbars_id, cx, "scrollbars");
|
|
|
|
SET_JSVAL_TO_STRING(sLocation_id, cx, "location");
|
2003-01-22 06:22:35 +03:00
|
|
|
SET_JSVAL_TO_STRING(sConstructor_id, cx, "constructor");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(s_content_id, cx, "_content");
|
|
|
|
SET_JSVAL_TO_STRING(sContent_id, cx, "content");
|
|
|
|
SET_JSVAL_TO_STRING(sMenubar_id, cx, "menubar");
|
|
|
|
SET_JSVAL_TO_STRING(sToolbar_id, cx, "toolbar");
|
|
|
|
SET_JSVAL_TO_STRING(sLocationbar_id, cx, "locationbar");
|
|
|
|
SET_JSVAL_TO_STRING(sPersonalbar_id, cx, "personalbar");
|
|
|
|
SET_JSVAL_TO_STRING(sStatusbar_id, cx, "statusbar");
|
2009-10-07 04:09:16 +04:00
|
|
|
SET_JSVAL_TO_STRING(sDialogArguments_id, cx, "dialogArguments");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sDirectories_id, cx, "directories");
|
|
|
|
SET_JSVAL_TO_STRING(sControllers_id, cx, "controllers");
|
|
|
|
SET_JSVAL_TO_STRING(sLength_id, cx, "length");
|
|
|
|
SET_JSVAL_TO_STRING(sInnerHeight_id, cx, "innerHeight");
|
|
|
|
SET_JSVAL_TO_STRING(sInnerWidth_id, cx, "innerWidth");
|
2004-09-01 08:26:43 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOuterHeight_id, cx, "outerHeight");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOuterWidth_id, cx, "outerWidth");
|
|
|
|
SET_JSVAL_TO_STRING(sScreenX_id, cx, "screenX");
|
|
|
|
SET_JSVAL_TO_STRING(sScreenY_id, cx, "screenY");
|
|
|
|
SET_JSVAL_TO_STRING(sStatus_id, cx, "status");
|
|
|
|
SET_JSVAL_TO_STRING(sName_id, cx, "name");
|
|
|
|
SET_JSVAL_TO_STRING(sOnmousedown_id, cx, "onmousedown");
|
|
|
|
SET_JSVAL_TO_STRING(sOnmouseup_id, cx, "onmouseup");
|
|
|
|
SET_JSVAL_TO_STRING(sOnclick_id, cx, "onclick");
|
2003-06-10 22:33:58 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOndblclick_id, cx, "ondblclick");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOncontextmenu_id, cx, "oncontextmenu");
|
|
|
|
SET_JSVAL_TO_STRING(sOnmouseover_id, cx, "onmouseover");
|
|
|
|
SET_JSVAL_TO_STRING(sOnmouseout_id, cx, "onmouseout");
|
|
|
|
SET_JSVAL_TO_STRING(sOnkeydown_id, cx, "onkeydown");
|
|
|
|
SET_JSVAL_TO_STRING(sOnkeyup_id, cx, "onkeyup");
|
|
|
|
SET_JSVAL_TO_STRING(sOnkeypress_id, cx, "onkeypress");
|
|
|
|
SET_JSVAL_TO_STRING(sOnmousemove_id, cx, "onmousemove");
|
|
|
|
SET_JSVAL_TO_STRING(sOnfocus_id, cx, "onfocus");
|
|
|
|
SET_JSVAL_TO_STRING(sOnblur_id, cx, "onblur");
|
|
|
|
SET_JSVAL_TO_STRING(sOnsubmit_id, cx, "onsubmit");
|
|
|
|
SET_JSVAL_TO_STRING(sOnreset_id, cx, "onreset");
|
|
|
|
SET_JSVAL_TO_STRING(sOnchange_id, cx, "onchange");
|
|
|
|
SET_JSVAL_TO_STRING(sOnselect_id, cx, "onselect");
|
|
|
|
SET_JSVAL_TO_STRING(sOnload_id, cx, "onload");
|
2004-03-03 03:20:31 +03:00
|
|
|
SET_JSVAL_TO_STRING(sOnbeforeunload_id, cx, "onbeforeunload");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOnunload_id, cx, "onunload");
|
2009-06-26 21:16:50 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOnhashchange_id, cx, "onhashchange");
|
2005-07-26 02:09:39 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOnpageshow_id, cx, "onpageshow");
|
|
|
|
SET_JSVAL_TO_STRING(sOnpagehide_id, cx, "onpagehide");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOnabort_id, cx, "onabort");
|
|
|
|
SET_JSVAL_TO_STRING(sOnerror_id, cx, "onerror");
|
|
|
|
SET_JSVAL_TO_STRING(sOnpaint_id, cx, "onpaint");
|
|
|
|
SET_JSVAL_TO_STRING(sOnresize_id, cx, "onresize");
|
|
|
|
SET_JSVAL_TO_STRING(sOnscroll_id, cx, "onscroll");
|
2009-02-18 16:31:31 +03:00
|
|
|
SET_JSVAL_TO_STRING(sOndrag_id, cx, "ondrag");
|
|
|
|
SET_JSVAL_TO_STRING(sOndragend_id, cx, "ondragend");
|
|
|
|
SET_JSVAL_TO_STRING(sOndragenter_id, cx, "ondragenter");
|
|
|
|
SET_JSVAL_TO_STRING(sOndragleave_id, cx, "ondragleave");
|
|
|
|
SET_JSVAL_TO_STRING(sOndragover_id, cx, "ondragover");
|
|
|
|
SET_JSVAL_TO_STRING(sOndragstart_id, cx, "ondragstart");
|
|
|
|
SET_JSVAL_TO_STRING(sOndrop_id, cx, "ondrop");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sScrollX_id, cx, "scrollX");
|
|
|
|
SET_JSVAL_TO_STRING(sScrollY_id, cx, "scrollY");
|
2003-04-15 17:40:46 +04:00
|
|
|
SET_JSVAL_TO_STRING(sScrollMaxX_id, cx, "scrollMaxX");
|
|
|
|
SET_JSVAL_TO_STRING(sScrollMaxY_id, cx, "scrollMaxY");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOpen_id, cx, "open");
|
|
|
|
SET_JSVAL_TO_STRING(sItem_id, cx, "item");
|
2004-08-24 05:31:19 +04:00
|
|
|
SET_JSVAL_TO_STRING(sNamedItem_id, cx, "namedItem");
|
2002-08-16 01:18:20 +04:00
|
|
|
SET_JSVAL_TO_STRING(sEnumerate_id, cx, "enumerateProperties");
|
|
|
|
SET_JSVAL_TO_STRING(sNavigator_id, cx, "navigator");
|
|
|
|
SET_JSVAL_TO_STRING(sDocument_id, cx, "document");
|
|
|
|
SET_JSVAL_TO_STRING(sWindow_id, cx, "window");
|
2003-02-14 04:59:52 +03:00
|
|
|
SET_JSVAL_TO_STRING(sFrames_id, cx, "frames");
|
2003-02-27 03:54:49 +03:00
|
|
|
SET_JSVAL_TO_STRING(sSelf_id, cx, "self");
|
2003-07-09 04:48:25 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOpener_id, cx, "opener");
|
2004-07-23 04:26:02 +04:00
|
|
|
SET_JSVAL_TO_STRING(sAll_id, cx, "all");
|
|
|
|
SET_JSVAL_TO_STRING(sTags_id, cx, "tags");
|
2005-04-29 03:48:28 +04:00
|
|
|
SET_JSVAL_TO_STRING(sAddEventListener_id,cx, "addEventListener");
|
2006-06-23 20:43:29 +04:00
|
|
|
SET_JSVAL_TO_STRING(sBaseURIObject_id, cx, "baseURIObject");
|
|
|
|
SET_JSVAL_TO_STRING(sNodePrincipal_id, cx, "nodePrincipal");
|
|
|
|
SET_JSVAL_TO_STRING(sDocumentURIObject_id,cx,"documentURIObject");
|
2007-07-26 08:14:33 +04:00
|
|
|
SET_JSVAL_TO_STRING(sOncopy_id, cx, "oncopy");
|
|
|
|
SET_JSVAL_TO_STRING(sOncut_id, cx, "oncut");
|
|
|
|
SET_JSVAL_TO_STRING(sOnpaste_id, cx, "onpaste");
|
2007-10-10 05:24:28 +04:00
|
|
|
SET_JSVAL_TO_STRING(sJava_id, cx, "java");
|
|
|
|
SET_JSVAL_TO_STRING(sPackages_id, cx, "Packages");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
static nsresult
|
|
|
|
CreateExceptionFromResult(JSContext *cx, nsresult aResult)
|
2009-05-21 12:17:51 +04:00
|
|
|
{
|
2009-05-21 12:17:51 +04:00
|
|
|
nsCOMPtr<nsIExceptionService> xs =
|
|
|
|
do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID);
|
|
|
|
if (!xs) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2002-02-07 13:50:42 +03:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
nsCOMPtr<nsIExceptionManager> xm;
|
|
|
|
nsresult rv = xs->GetCurrentExceptionManager(getter_AddRefs(xm));
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2009-05-21 14:54:41 +04:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
nsCOMPtr<nsIException> exception;
|
|
|
|
rv = xm->GetExceptionFromProvider(aResult, 0, getter_AddRefs(exception));
|
|
|
|
if (NS_FAILED(rv) || !exception) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2009-05-21 14:54:41 +04:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
jsval jv;
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
|
|
|
rv = nsDOMClassInfo::WrapNative(cx, ::JS_GetGlobalObject(cx), exception,
|
|
|
|
&NS_GET_IID(nsIException), PR_FALSE, &jv,
|
|
|
|
getter_AddRefs(holder));
|
|
|
|
if (NS_FAILED(rv) || JSVAL_IS_NULL(jv)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2009-05-21 14:54:41 +04:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
JS_SetPendingException(cx, jv);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2009-05-21 14:54:41 +04:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsDOMClassInfo::ThrowJSException(JSContext *cx, nsresult aResult)
|
|
|
|
{
|
|
|
|
JSAutoRequest ar(cx);
|
2009-05-21 14:54:41 +04:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
if (NS_SUCCEEDED(CreateExceptionFromResult(cx, aResult))) {
|
2006-04-15 04:37:51 +04:00
|
|
|
return NS_OK;
|
2009-05-21 12:17:51 +04:00
|
|
|
}
|
2006-04-15 04:37:51 +04:00
|
|
|
|
|
|
|
// XXX This probably wants to be localized, but that can fail in ways that
|
|
|
|
// are hard to report correctly.
|
|
|
|
JSString *str =
|
|
|
|
JS_NewStringCopyZ(cx, "An error occured throwing an exception");
|
|
|
|
if (!str) {
|
|
|
|
// JS_NewStringCopyZ reported the error for us.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
JS_SetPendingException(cx, STRING_TO_JSVAL(str));
|
2002-02-07 13:50:42 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
nsDOMClassInfo::nsDOMClassInfo(nsDOMClassInfoData* aData) : mData(aData)
|
2001-04-01 05:10:59 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
nsDOMClassInfo::~nsDOMClassInfo()
|
|
|
|
{
|
2002-03-04 05:25:08 +03:00
|
|
|
if (IS_EXTERNAL(mData->mCachedClassInfo)) {
|
|
|
|
// Some compilers don't like delete'ing a const nsDOMClassInfo*
|
2007-07-08 11:08:04 +04:00
|
|
|
nsDOMClassInfoData* data = const_cast<nsDOMClassInfoData*>(mData);
|
|
|
|
delete static_cast<nsExternalDOMClassInfoData*>(data);
|
2002-03-04 05:25:08 +03:00
|
|
|
}
|
2001-04-01 05:10:59 +04:00
|
|
|
}
|
|
|
|
|
2009-11-29 11:32:39 +03:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsDOMClassInfo, NS_DOMCLASSINFO_IID)
|
|
|
|
|
2003-09-08 02:05:34 +04:00
|
|
|
NS_IMPL_ADDREF(nsDOMClassInfo)
|
|
|
|
NS_IMPL_RELEASE(nsDOMClassInfo)
|
2001-04-01 05:10:59 +04:00
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsDOMClassInfo)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIXPCScriptable)
|
2001-04-01 05:10:59 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIClassInfo)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIXPCScriptable)
|
2009-11-29 11:32:39 +03:00
|
|
|
if (aIID.Equals(NS_GET_IID(nsDOMClassInfo))) {
|
|
|
|
*aInstancePtr = static_cast<nsIXPCScriptable*>(this);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
else
|
2001-04-01 05:10:59 +04:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
static JSClass sDOMConstructorProtoClass = {
|
2001-07-11 13:09:30 +04:00
|
|
|
"DOM Constructor.prototype", 0,
|
|
|
|
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
|
2009-07-22 20:23:21 +04:00
|
|
|
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nsnull
|
2001-07-11 13:09:30 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const char *
|
|
|
|
CutPrefix(const char *aName) {
|
|
|
|
static const char prefix_nsIDOM[] = "nsIDOM";
|
|
|
|
static const char prefix_nsI[] = "nsI";
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
if (strncmp(aName, prefix_nsIDOM, sizeof(prefix_nsIDOM) - 1) == 0) {
|
2001-07-11 13:09:30 +04:00
|
|
|
return aName + sizeof(prefix_nsIDOM) - 1;
|
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
if (strncmp(aName, prefix_nsI, sizeof(prefix_nsI) - 1) == 0) {
|
2001-07-11 13:09:30 +04:00
|
|
|
return aName + sizeof(prefix_nsI) - 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return aName;
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsDOMClassInfo::RegisterClassName(PRInt32 aClassInfoID)
|
|
|
|
{
|
2007-11-13 13:35:49 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
nameSpaceManager->RegisterClassName(sClassInfoData[aClassInfoID].mName,
|
2009-06-03 19:30:18 +04:00
|
|
|
aClassInfoID,
|
|
|
|
&sClassInfoData[aClassInfoID].mNameUTF16);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsDOMClassInfo::RegisterClassProtos(PRInt32 aClassInfoID)
|
|
|
|
{
|
2007-11-13 13:35:49 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
|
2001-07-11 13:09:30 +04:00
|
|
|
PRBool found_old;
|
|
|
|
|
|
|
|
const nsIID *primary_iid = sClassInfoData[aClassInfoID].mProtoChainInterface;
|
|
|
|
|
|
|
|
if (!primary_iid || primary_iid == &NS_GET_IID(nsISupports)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-11-10 19:19:44 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfoManager>
|
|
|
|
iim(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
|
2001-07-11 13:09:30 +04:00
|
|
|
NS_ENSURE_TRUE(iim, NS_ERROR_NOT_AVAILABLE);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIInterfaceInfo> if_info;
|
|
|
|
PRBool first = PR_TRUE;
|
|
|
|
|
|
|
|
iim->GetInfoForIID(primary_iid, getter_AddRefs(if_info));
|
|
|
|
|
|
|
|
while (if_info) {
|
2008-01-12 07:30:42 +03:00
|
|
|
const nsIID *iid = nsnull;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2008-01-12 07:30:42 +03:00
|
|
|
if_info->GetIIDShared(&iid);
|
2001-07-11 13:09:30 +04:00
|
|
|
NS_ENSURE_TRUE(iid, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
if (iid->Equals(NS_GET_IID(nsISupports))) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-01-12 07:30:42 +03:00
|
|
|
const char *name = nsnull;
|
|
|
|
if_info->GetNameShared(&name);
|
|
|
|
NS_ENSURE_TRUE(name, NS_ERROR_UNEXPECTED);
|
2007-03-23 02:01:14 +03:00
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
nameSpaceManager->RegisterClassProto(CutPrefix(name), iid, &found_old);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
if (first) {
|
|
|
|
first = PR_FALSE;
|
|
|
|
} else if (found_old) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2002-01-11 02:45:06 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfo> tmp(if_info);
|
2001-07-11 13:09:30 +04:00
|
|
|
tmp->GetParent(getter_AddRefs(if_info));
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsDOMClassInfo::RegisterExternalClasses()
|
|
|
|
{
|
2007-11-13 13:35:49 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2004-11-01 21:50:36 +03:00
|
|
|
nsCOMPtr<nsIComponentRegistrar> registrar;
|
2007-11-13 13:35:49 +03:00
|
|
|
nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(registrar));
|
2004-11-01 21:50:36 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
nsCOMPtr<nsICategoryManager> cm =
|
|
|
|
do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
nsCOMPtr<nsISimpleEnumerator> e;
|
|
|
|
rv = cm->EnumerateCategory(JAVASCRIPT_DOM_CLASS, getter_AddRefs(e));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2002-08-27 01:20:34 +04:00
|
|
|
nsXPIDLCString contractId;
|
|
|
|
nsCAutoString categoryEntry;
|
2002-03-04 05:25:08 +03:00
|
|
|
nsCOMPtr<nsISupports> entry;
|
|
|
|
|
|
|
|
while (NS_SUCCEEDED(e->GetNext(getter_AddRefs(entry)))) {
|
2002-08-06 04:53:19 +04:00
|
|
|
nsCOMPtr<nsISupportsCString> category(do_QueryInterface(entry));
|
2002-03-04 05:25:08 +03:00
|
|
|
|
|
|
|
if (!category) {
|
2002-08-06 04:53:19 +04:00
|
|
|
NS_WARNING("Category entry not an nsISupportsCString!");
|
2002-03-04 05:25:08 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2002-08-27 01:20:34 +04:00
|
|
|
rv = category->GetData(categoryEntry);
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2002-08-27 01:20:34 +04:00
|
|
|
cm->GetCategoryEntry(JAVASCRIPT_DOM_CLASS, categoryEntry.get(),
|
2002-03-04 05:25:08 +03:00
|
|
|
getter_Copies(contractId));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2004-11-01 21:50:36 +03:00
|
|
|
nsCID *cid;
|
|
|
|
rv = registrar->ContractIDToCID(contractId, &cid);
|
2002-03-04 05:25:08 +03:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_WARNING("Bad contract id registered with the script namespace manager");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
rv = nameSpaceManager->RegisterExternalClassName(categoryEntry.get(), *cid);
|
2004-11-01 21:50:36 +03:00
|
|
|
nsMemory::Free(cid);
|
2002-03-04 05:25:08 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
return nameSpaceManager->RegisterExternalInterfaces(PR_TRUE);
|
2002-03-04 05:25:08 +03:00
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-10-01 02:56:06 +04:00
|
|
|
// static
|
|
|
|
inline nsresult
|
|
|
|
nsDOMClassInfo::WrapNativeParent(JSContext *cx, JSObject *scope,
|
2009-10-06 03:16:22 +04:00
|
|
|
nsISupports *native,
|
|
|
|
nsWrapperCache *nativeWrapperCache,
|
|
|
|
JSObject **parentObj)
|
2009-10-01 02:56:06 +04:00
|
|
|
{
|
|
|
|
// In the common case, |native| is a wrapper cache with an existing wrapper
|
2009-10-06 03:16:22 +04:00
|
|
|
#ifdef DEBUG
|
2009-10-01 02:56:06 +04:00
|
|
|
nsWrapperCache* cache = nsnull;
|
|
|
|
CallQueryInterface(native, &cache);
|
2009-10-06 03:16:22 +04:00
|
|
|
NS_PRECONDITION(nativeWrapperCache &&
|
|
|
|
cache == nativeWrapperCache, "What happened here?");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
JSObject* obj = nativeWrapperCache->GetWrapper();
|
|
|
|
if (obj) {
|
2009-10-01 02:56:06 +04:00
|
|
|
#ifdef DEBUG
|
2009-10-06 03:16:22 +04:00
|
|
|
jsval debugVal;
|
|
|
|
nsresult rv = WrapNative(cx, scope, native, PR_FALSE, &debugVal);
|
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv) && JSVAL_TO_OBJECT(debugVal) == obj,
|
|
|
|
"Unexpected object in nsWrapperCache");
|
2009-10-01 02:56:06 +04:00
|
|
|
#endif
|
2009-10-06 03:16:22 +04:00
|
|
|
*parentObj = obj;
|
|
|
|
return NS_OK;
|
2009-10-01 02:56:06 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
jsval v;
|
|
|
|
nsresult rv = WrapNative(cx, scope, native, PR_FALSE, &v);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
*parentObj = JSVAL_TO_OBJECT(v);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
#define _DOM_CLASSINFO_MAP_BEGIN(_class, _ifptr, _has_class_if) \
|
2001-07-11 13:09:30 +04:00
|
|
|
{ \
|
|
|
|
nsDOMClassInfoData &d = sClassInfoData[eDOMClassInfo_##_class##_id]; \
|
|
|
|
d.mProtoChainInterface = _ifptr; \
|
2001-11-02 07:49:07 +03:00
|
|
|
d.mHasClassInterface = _has_class_if; \
|
2001-07-11 13:09:30 +04:00
|
|
|
static const nsIID *interface_list[] = {
|
|
|
|
|
|
|
|
#define DOM_CLASSINFO_MAP_BEGIN(_class, _interface) \
|
2001-11-02 07:49:07 +03:00
|
|
|
_DOM_CLASSINFO_MAP_BEGIN(_class, &NS_GET_IID(_interface), PR_TRUE)
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
#define DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(_class, _interface) \
|
|
|
|
_DOM_CLASSINFO_MAP_BEGIN(_class, &NS_GET_IID(_interface), PR_FALSE)
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
#define DOM_CLASSINFO_MAP_ENTRY(_if) \
|
|
|
|
&NS_GET_IID(_if),
|
|
|
|
|
|
|
|
#define DOM_CLASSINFO_MAP_END \
|
|
|
|
nsnull \
|
|
|
|
}; \
|
|
|
|
\
|
|
|
|
d.mInterfaces = interface_list; \
|
|
|
|
}
|
|
|
|
|
2005-03-29 23:21:21 +04:00
|
|
|
#define DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDocument) \
|
|
|
|
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) \
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) \
|
2005-03-29 23:21:21 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Document) \
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node) \
|
2008-07-22 04:55:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathEvaluator) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
|
|
|
|
2005-03-29 23:21:21 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
#define DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLElement) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementCSSInlineStyle) \
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) \
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) \
|
2007-02-01 18:14:00 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node) \
|
2008-07-22 04:55:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSElement) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2004-08-20 22:09:19 +04:00
|
|
|
#define DOM_CLASSINFO_EVENT_MAP_ENTRIES \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEvent) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEvent) \
|
|
|
|
|
|
|
|
#define DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMUIEvent) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSUIEvent) \
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsresult
|
|
|
|
nsDOMClassInfo::Init()
|
|
|
|
{
|
2003-01-22 06:18:41 +03:00
|
|
|
/* Errors that can trigger early returns are done first,
|
|
|
|
otherwise nsDOMClassInfo is left in a half inited state. */
|
2002-03-04 05:25:08 +03:00
|
|
|
NS_ASSERTION(sizeof(PtrBits) == sizeof(void*),
|
|
|
|
"BAD! You'll need to adjust the size of PtrBits to the size "
|
|
|
|
"of a pointer on your platform.");
|
|
|
|
|
2003-01-22 06:18:41 +03:00
|
|
|
NS_ENSURE_TRUE(!sIsInitialized, NS_ERROR_ALREADY_INITIALIZED);
|
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
|
2003-01-22 06:18:41 +03:00
|
|
|
|
2003-01-31 15:10:13 +03:00
|
|
|
nsresult rv = CallGetService(nsIXPConnect::GetCID(), &sXPConnect);
|
2003-01-22 06:18:41 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXPCFunctionThisTranslator> old;
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXPCFunctionThisTranslator> elt = new nsEventListenerThisTranslator();
|
|
|
|
NS_ENSURE_TRUE(elt, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
sXPConnect->SetFunctionThisTranslator(NS_GET_IID(nsIDOMEventListener),
|
|
|
|
elt, getter_AddRefs(old));
|
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptSecurityManager> sm =
|
|
|
|
do_GetService("@mozilla.org/scriptsecuritymanager;1", &rv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
sSecMan = sm;
|
|
|
|
NS_ADDREF(sSecMan);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIThreadJSContextStack> stack =
|
|
|
|
do_GetService("@mozilla.org/js/xpc/ContextStack;1", &rv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
JSContext *cx = nsnull;
|
|
|
|
|
|
|
|
rv = stack->GetSafeJSContext(&cx);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Window, nsIDOMWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
2006-05-19 09:57:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-10-22 02:30:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WindowUtils, nsIDOMWindowUtils)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowUtils)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Location, nsIDOMLocation)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLocation)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Navigator, nsIDOMNavigator)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNavigator)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSNavigator)
|
2008-08-14 20:35:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNavigatorGeolocation)
|
2006-06-29 04:56:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMClientInformation)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Plugin, nsIDOMPlugin)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPlugin)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(PluginArray, nsIDOMPluginArray)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPluginArray)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MimeType, nsIDOMMimeType)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMimeType)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MimeTypeArray, nsIDOMMimeTypeArray)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMimeTypeArray)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(BarProp, nsIDOMBarProp)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMBarProp)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(History, nsIDOMHistory)
|
2003-02-25 04:40:18 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHistory)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Screen, nsIDOMScreen)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMScreen)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(DOMPrototype, nsIDOMDOMConstructor)
|
2007-11-12 09:43:14 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
|
2007-05-09 16:04:59 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-11-12 09:43:14 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DOMConstructor, nsIDOMDOMConstructor)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMConstructor)
|
2005-12-09 22:08:45 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-10-26 06:23:56 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XMLDocument, nsIDOMXMLDocument)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocument)
|
2001-09-21 05:07:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXMLDocument)
|
2005-03-29 23:21:21 +04:00
|
|
|
DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DocumentType, nsIDOMDocumentType)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentType)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2006-02-17 16:12:50 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DOMImplementation, nsIDOMDOMImplementation)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMImplementation)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-01 18:52:53 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DOMException, nsIDOMDOMException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIException)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-08-12 12:55:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DOMTokenList, nsIDOMDOMTokenList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMTokenList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DocumentFragment, nsIDOMDocumentFragment)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocumentFragment)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2008-07-22 04:55:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2009-05-07 17:59:51 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Element, nsIDOMElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElement)
|
2007-02-01 18:14:00 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSElement)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2008-07-22 04:55:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Attr, nsIDOMAttr)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAttr)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2006-01-27 07:10:30 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Attr)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2009-05-07 17:59:51 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Text, nsIDOMText)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMText)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2008-06-04 21:53:34 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Text)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Comment, nsIDOMComment)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMComment)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CDATASection, nsIDOMCDATASection)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCDATASection)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2002-12-04 08:18:39 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2008-06-04 21:53:34 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Text)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(ProcessingInstruction, nsIDOMProcessingInstruction)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMProcessingInstruction)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2002-12-04 08:18:39 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Notation, nsIDOMNotation)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNotation)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(NodeList, nsIDOMNodeList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(NamedNodeMap, nsIDOMNamedNodeMap)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNamedNodeMap)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Event, nsIDOMEvent)
|
2004-08-20 22:09:19 +04:00
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(PopupBlockedEvent, nsIDOMPopupBlockedEvent)
|
2003-04-16 04:00:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPopupBlockedEvent)
|
2004-08-20 22:09:19 +04:00
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-08-21 18:42:37 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(OrientationEvent, nsIDOMOrientationEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMOrientationEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-06-02 05:17:35 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SmartCardEvent, nsIDOMSmartCardEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSmartCardEvent)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-06-16 03:52:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(PageTransitionEvent, nsIDOMPageTransitionEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPageTransitionEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MutationEvent, nsIDOMMutationEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMutationEvent)
|
2004-08-20 22:09:19 +04:00
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(UIEvent, nsIDOMUIEvent)
|
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-08-25 18:15:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(KeyboardEvent, nsIDOMKeyEvent)
|
2004-08-20 22:09:19 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMKeyEvent)
|
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MouseEvent, nsIDOMMouseEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
|
2008-12-12 02:55:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent)
|
2004-08-20 22:09:19 +04:00
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-08-13 07:08:59 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MouseScrollEvent, nsIDOMMouseScrollEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseScrollEvent)
|
2008-09-11 12:53:43 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
|
2008-12-12 02:55:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent)
|
2008-08-13 07:08:59 +04:00
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DragEvent, nsIDOMDragEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDragEvent)
|
2009-02-17 14:49:03 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
|
2008-12-12 02:55:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent)
|
2008-08-27 16:07:27 +04:00
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLDocument, nsIDOMHTMLDocument)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLDocument)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLDocument)
|
2005-03-29 23:21:21 +04:00
|
|
|
DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2003-03-14 10:00:53 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLOptionsCollection, nsIDOMHTMLOptionsCollection)
|
2008-09-15 18:15:51 +04:00
|
|
|
// Order is significant. nsIDOMHTMLOptionsCollection.length shadows
|
|
|
|
// nsIDOMHTMLCollection.length, which is readonly.
|
2003-03-14 10:00:53 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLOptionsCollection)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLOptionCollection)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCollection)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-07 10:52:41 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLFormControlCollection,
|
|
|
|
nsIDOMHTMLCollection)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCollection)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLFormControlList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-07 10:52:41 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLGenericCollection,
|
|
|
|
nsIDOMHTMLCollection)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCollection)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLAnchorElement, nsIDOMHTMLAnchorElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLAnchorElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLAnchorElement)
|
2006-01-25 18:16:57 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLAnchorElement2)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLAppletElement, nsIDOMHTMLAppletElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLAppletElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLAreaElement, nsIDOMHTMLAreaElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLAreaElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLAreaElement)
|
2006-01-25 18:16:57 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLAreaElement2)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLBRElement, nsIDOMHTMLBRElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLBRElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLBaseElement, nsIDOMHTMLBaseElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLBaseElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLBaseFontElement, nsIDOMHTMLBaseFontElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLBaseFontElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLBodyElement, nsIDOMHTMLBodyElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLBodyElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLButtonElement, nsIDOMHTMLButtonElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLButtonElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLButtonElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLDListElement, nsIDOMHTMLDListElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLDListElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLDelElement, nsIDOMHTMLElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLModElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLDirectoryElement, nsIDOMHTMLDirectoryElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLDirectoryElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLDivElement, nsIDOMHTMLDivElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLDivElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLEmbedElement, nsIDOMHTMLEmbedElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLEmbedElement)
|
2005-03-23 04:42:22 +03:00
|
|
|
#ifdef MOZ_SVG
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGetSVGDocument)
|
|
|
|
#endif
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLFieldSetElement, nsIDOMHTMLFieldSetElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFieldSetElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLFontElement, nsIDOMHTMLFontElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFontElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLFormElement, nsIDOMHTMLFormElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFormElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLFormElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLFrameElement, nsIDOMHTMLFrameElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFrameElement)
|
2001-09-20 11:58:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLFrameElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLFrameSetElement, nsIDOMHTMLFrameSetElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLFrameSetElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLHRElement, nsIDOMHTMLHRElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLHRElement)
|
2003-07-30 12:13:07 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLHRElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLHeadElement, nsIDOMHTMLHeadElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLHeadElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLHeadingElement, nsIDOMHTMLHeadingElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLHeadingElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLHtmlElement, nsIDOMHTMLHtmlElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLHtmlElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLIFrameElement, nsIDOMHTMLIFrameElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLIFrameElement)
|
2001-09-20 11:58:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLFrameElement)
|
2008-06-17 01:53:12 +04:00
|
|
|
#ifdef MOZ_SVG
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGetSVGDocument)
|
|
|
|
#endif
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLImageElement, nsIDOMHTMLImageElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLImageElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLImageElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLInputElement, nsIDOMHTMLInputElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLInputElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLInputElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLInsElement, nsIDOMHTMLElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLModElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLIsIndexElement, nsIDOMHTMLIsIndexElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLIsIndexElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLLIElement, nsIDOMHTMLLIElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLLIElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLLabelElement, nsIDOMHTMLLabelElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLLabelElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLLegendElement, nsIDOMHTMLLegendElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLLegendElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLLinkElement, nsIDOMHTMLLinkElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLLinkElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLinkStyle)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLMapElement, nsIDOMHTMLMapElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLMapElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLMenuElement, nsIDOMHTMLMenuElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLMenuElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLMetaElement, nsIDOMHTMLMetaElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLMetaElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLOListElement, nsIDOMHTMLOListElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLOListElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLObjectElement, nsIDOMHTMLObjectElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLObjectElement)
|
2008-06-17 01:53:12 +04:00
|
|
|
#ifdef MOZ_SVG
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGetSVGDocument)
|
|
|
|
#endif
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLOptGroupElement, nsIDOMHTMLOptGroupElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLOptGroupElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLOptionElement, nsIDOMHTMLOptionElement)
|
2008-09-15 18:15:51 +04:00
|
|
|
// Order is significant. nsIDOMNSHTMLOptionElement.text shdaows
|
|
|
|
// nsIDOMHTMLOptionElement.text, which is readonly.
|
2003-03-14 10:00:53 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLOptionElement)
|
2003-03-22 00:27:17 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLOptionElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLParagraphElement, nsIDOMHTMLParagraphElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLParagraphElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLParamElement, nsIDOMHTMLParamElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLParamElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLPreElement, nsIDOMHTMLPreElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLPreElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLQuoteElement, nsIDOMHTMLQuoteElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLQuoteElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLScriptElement, nsIDOMHTMLScriptElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLScriptElement)
|
2009-11-10 04:04:24 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLScriptElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLSelectElement, nsIDOMHTMLSelectElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLSelectElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLSelectElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLSpacerElement, nsIDOMHTMLElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLSpanElement, nsIDOMHTMLElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLStyleElement, nsIDOMHTMLStyleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLStyleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLinkStyle)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTableCaptionElement,
|
|
|
|
nsIDOMHTMLTableCaptionElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTableCaptionElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTableCellElement, nsIDOMHTMLTableCellElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTableCellElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTableColElement, nsIDOMHTMLTableColElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTableColElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTableElement, nsIDOMHTMLTableElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTableElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTableRowElement, nsIDOMHTMLTableRowElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTableRowElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTableSectionElement,
|
|
|
|
nsIDOMHTMLTableSectionElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTableSectionElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTextAreaElement, nsIDOMHTMLTextAreaElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTextAreaElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLTextAreaElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLTitleElement, nsIDOMHTMLTitleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLTitleElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLUListElement, nsIDOMHTMLUListElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLUListElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLUnknownElement, nsIDOMHTMLElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-02 07:49:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(HTMLWBRElement, nsIDOMHTMLElement)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSStyleRule, nsIDOMCSSStyleRule)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleRule)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSCharsetRule, nsIDOMCSSCharsetRule)
|
2002-08-06 09:26:41 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSCharsetRule)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSImportRule, nsIDOMCSSImportRule)
|
2001-08-05 01:19:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSImportRule)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSMediaRule, nsIDOMCSSMediaRule)
|
2001-09-05 04:00:18 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMediaRule)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-07 10:52:41 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSNameSpaceRule, nsIDOMCSSRule)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRule)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSRuleList, nsIDOMCSSRuleList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRuleList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-07 10:52:41 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSGroupRuleRuleList, nsIDOMCSSRuleList)
|
2001-09-05 04:00:18 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSRuleList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MediaList, nsIDOMMediaList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMediaList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(StyleSheetList, nsIDOMStyleSheetList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStyleSheetList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSStyleSheet, nsIDOMCSSStyleSheet)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleSheet)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSStyleDeclaration, nsIDOMCSSStyleDeclaration)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSS2Properties)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSCSS2Properties)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-07 10:52:41 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ComputedCSSStyleDeclaration,
|
|
|
|
nsIDOMCSSStyleDeclaration)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
|
2002-09-26 07:46:50 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSS2Properties)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSCSS2Properties)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-11-07 10:52:41 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ROCSSPrimitiveValue,
|
|
|
|
nsIDOMCSSPrimitiveValue)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSPrimitiveValue)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2002-07-08 11:11:59 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSValueList, nsIDOMCSSValueList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSValueList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-08-25 18:15:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSRect, nsIDOMRect)
|
2002-01-11 03:15:55 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMRect)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-08-25 18:15:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSRGBColor, nsIDOMRGBColor)
|
2002-03-22 23:18:42 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMRGBColor)
|
2007-01-25 05:03:02 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSRGBAColor)
|
2002-03-22 23:18:42 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Range, nsIDOMRange)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMRange)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSRange)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-07-22 04:35:38 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(NodeIterator, nsIDOMNodeIterator)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeIterator)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-09-07 13:30:03 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TreeWalker, nsIDOMTreeWalker)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTreeWalker)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Selection, nsISelection)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsISelection)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2003-04-11 04:56:27 +04:00
|
|
|
#ifdef MOZ_XUL
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XULDocument, nsIDOMXULDocument)
|
2003-03-26 10:41:30 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocument)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULDocument)
|
2005-03-29 23:21:21 +04:00
|
|
|
DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XULElement, nsIDOMXULElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULElement)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2004-03-19 03:37:50 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2007-02-01 18:14:00 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSElement)
|
2006-09-21 07:35:50 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementCSSInlineStyle)
|
2008-07-22 04:55:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XULCommandDispatcher, nsIDOMXULCommandDispatcher)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandDispatcher)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2003-04-11 04:56:27 +04:00
|
|
|
#endif
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2006-02-23 06:17:11 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XULControllers, nsIControllers)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIControllers)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(BoxObject, nsIBoxObject)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIBoxObject)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-01-16 04:27:53 +03:00
|
|
|
#ifdef MOZ_XUL
|
2002-03-29 05:46:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TreeSelection, nsITreeSelection)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsITreeSelection)
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2002-03-29 05:46:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TreeContentView, nsITreeContentView)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsITreeContentView)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
|
2002-01-05 10:17:10 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2003-04-11 04:56:27 +04:00
|
|
|
#endif
|
2002-01-05 10:17:10 +03:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Crypto, nsIDOMCrypto)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCrypto)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CRMFObject, nsIDOMCRMFObject)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCRMFObject)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2002-09-04 10:57:25 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XMLStylesheetProcessingInstruction, nsIDOMProcessingInstruction)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMProcessingInstruction)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLinkStyle)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2002-09-04 10:57:25 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2002-12-04 08:18:39 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
2002-09-04 10:57:25 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ChromeWindow, nsIDOMWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMChromeWindow)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2007-04-26 16:56:03 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(RangeException, nsIDOMRangeException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMRangeException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIException)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-08-25 18:15:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentList, nsIDOMHTMLCollection)
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCollection)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(ImageDocument, nsIImageDocument)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLDocument)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIImageDocument)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSHTMLDocument)
|
2005-03-29 23:21:21 +04:00
|
|
|
DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
|
|
|
|
#ifdef MOZ_XUL
|
2005-01-17 12:24:56 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XULTemplateBuilder, nsIXULTemplateBuilder)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXULTemplateBuilder)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).
Not part of default build; code is #ifdef'ed out.
r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 15:39:26 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XULTreeBuilder, nsIXULTreeBuilder)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXULTreeBuilder)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsITreeView)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
#endif
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DOMStringList, nsIDOMDOMStringList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDOMStringList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(NameList, nsIDOMNameList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNameList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-04-17 09:53:38 +04:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TreeColumn, nsITreeColumn)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsITreeColumn)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TreeColumns, nsITreeColumns)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsITreeColumns)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
#endif
|
|
|
|
|
2004-08-05 22:26:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSMozDocumentRule, nsIDOMCSSMozDocumentRule)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSMozDocumentRule)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-03-18 18:33:51 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(BeforeUnloadEvent, nsIDOMBeforeUnloadEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMBeforeUnloadEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
#ifdef MOZ_SVG
|
2010-01-13 16:50:01 +03:00
|
|
|
#define DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGElement) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSElement) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node) \
|
2008-07-22 04:55:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
2001-12-12 10:59:31 +03:00
|
|
|
|
|
|
|
#define DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable) \
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransformable) \
|
2004-04-13 03:48:42 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable) \
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
|
|
|
|
// XXX - the proto chain stuff is sort of hackish, because of the MI in
|
|
|
|
// the SVG interfaces. I doubt that extending the proto on one interface
|
|
|
|
// works properly on an element which inherits off multiple interfaces.
|
|
|
|
// Tough luck. - bbaetz
|
2004-07-26 00:03:55 +04:00
|
|
|
|
|
|
|
// The SVG document
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGDocument, nsIDOMSVGDocument)
|
2008-09-15 18:15:51 +04:00
|
|
|
// Order is significant. nsIDOMDocument.title shadows
|
|
|
|
// nsIDOMSVGDocument.title, which is readonly.
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDocument)
|
2008-09-15 18:15:51 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGDocument)
|
2005-03-29 23:21:21 +04:00
|
|
|
DOM_CLASSINFO_DOCUMENT_MAP_ENTRIES
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
// SVG element classes
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2007-01-27 02:45:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAElement, nsIDOMSVGAElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAElement)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-01-15 07:38:07 +03:00
|
|
|
#ifdef MOZ_SMIL
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimateElement, nsIDOMSVGAnimateElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-01-19 12:14:16 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimateTransformElement,
|
|
|
|
nsIDOMSVGAnimateTransformElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimateTransformElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-01-15 07:38:07 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGSetElement,
|
|
|
|
nsIDOMSVGSetElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimationElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSetElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElementTimeControl)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
#endif // MOZ_SMIL
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGCircleElement, nsIDOMSVGCircleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGCircleElement)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
2005-01-25 06:55:03 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGClipPathElement, nsIDOMSVGClipPathElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGClipPathElement)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransformable)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2007-08-28 03:11:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGDefsElement, nsIDOMSVGDefsElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGDefsElement)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-01-24 20:42:23 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGDescElement, nsIDOMSVGDescElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGDescElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGEllipseElement, nsIDOMSVGEllipseElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGEllipseElement)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2006-12-11 19:33:08 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEBlendElement, nsIDOMSVGFEBlendElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEBlendElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-02-20 14:03:00 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEColorMatrixElement, nsIDOMSVGFEColorMatrixElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEColorMatrixElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEComponentTransferElement, nsIDOMSVGFEComponentTransferElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEComponentTransferElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2006-12-11 19:33:08 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFECompositeElement, nsIDOMSVGFECompositeElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFECompositeElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2007-01-08 19:48:56 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-06-27 23:02:58 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEConvolveMatrixElement, nsIDOMSVGFEConvolveMatrixElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEConvolveMatrixElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-01-04 00:37:57 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEDiffuseLightingElement, nsIDOMSVGFEDiffuseLightingElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEDiffuseLightingElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEDisplacementMapElement, nsIDOMSVGFEDisplacementMapElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEDisplacementMapElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEDistantLightElement, nsIDOMSVGFEDistantLightElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEDistantLightElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-01-08 19:48:56 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEFloodElement, nsIDOMSVGFEFloodElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEFloodElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2006-12-11 19:33:08 +03:00
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEFuncAElement, nsIDOMSVGFEFuncAElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEFuncAElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEFuncBElement, nsIDOMSVGFEFuncBElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEFuncBElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEFuncGElement, nsIDOMSVGFEFuncGElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEFuncGElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEFuncRElement, nsIDOMSVGFEFuncRElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEFuncRElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEGaussianBlurElement, nsIDOMSVGFEGaussianBlurElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEGaussianBlurElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-01-02 23:49:13 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEImageElement, nsIDOMSVGFEImageElement)
|
2008-01-03 11:04:58 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEImageElement)
|
2008-01-02 23:49:13 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEMergeElement, nsIDOMSVGFEMergeElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEMergeElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
2006-11-02 19:30:20 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEMorphologyElement, nsIDOMSVGFEMorphologyElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEMorphologyElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEMergeNodeElement, nsIDOMSVGFEMergeNodeElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEMergeNodeElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEOffsetElement, nsIDOMSVGFEOffsetElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEOffsetElement)
|
2007-01-08 19:48:56 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-07-26 10:57:42 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFEPointLightElement, nsIDOMSVGFEPointLightElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFEPointLightElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFESpecularLightingElement, nsIDOMSVGFESpecularLightingElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFESpecularLightingElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFESpotLightElement, nsIDOMSVGFESpotLightElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFESpotLightElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-07-27 04:50:45 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFETileElement, nsIDOMSVGFETileElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFETileElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-03-23 02:01:14 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFETurbulenceElement, nsIDOMSVGFETurbulenceElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFETurbulenceElement)
|
2007-07-27 04:50:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterPrimitiveStandardAttributes)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGFilterElement, nsIDOMSVGFilterElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFilterElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2007-08-28 03:11:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGGElement, nsIDOMSVGGElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGGElement)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGImageElement, nsIDOMSVGImageElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGImageElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGLinearGradientElement, nsIDOMSVGLinearGradientElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGGradientElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLinearGradientElement)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2007-08-28 03:11:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGLineElement, nsIDOMSVGLineElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLineElement)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-12-09 06:16:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGMarkerElement, nsIDOMSVGMarkerElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMarkerElement)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
|
2004-12-09 06:16:15 +03:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2006-01-20 20:00:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGMaskElement, nsIDOMSVGMaskElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMaskElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2007-08-28 03:11:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
|
2006-01-20 20:00:43 +03:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-01-24 20:42:23 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGMetadataElement, nsIDOMSVGMetadataElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMetadataElement)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathElement, nsIDOMSVGPathElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedPathData)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-09-14 02:38:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPatternElement, nsIDOMSVGPatternElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPatternElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
2005-09-14 02:38:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2007-08-28 03:11:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
|
2005-09-14 02:38:36 +04:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPolygonElement, nsIDOMSVGPolygonElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPolygonElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedPoints)
|
2004-06-23 22:14:04 +04:00
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPolylineElement, nsIDOMSVGPolylineElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPolylineElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedPoints)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGRadialGradientElement, nsIDOMSVGRadialGradientElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGGradientElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRadialGradientElement)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2007-08-28 03:11:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUnitTypes)
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGRectElement, nsIDOMSVGRectElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRectElement)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGScriptElement, nsIDOMSVGScriptElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGScriptElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGStopElement, nsIDOMSVGStopElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStopElement)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGStyleElement, nsIDOMSVGStyleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStyleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLinkStyle)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGSVGElement, nsIDOMSVGSVGElement)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSVGElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
2004-12-03 02:13:13 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGZoomAndPan)
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-02-05 19:26:23 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGSwitchElement, nsIDOMSVGSwitchElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSwitchElement)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-11-23 16:51:57 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGSymbolElement, nsIDOMSVGSymbolElement)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2004-11-23 16:51:57 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSymbolElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGTextElement, nsIDOMSVGTextElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextPositioningElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextContentElement)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-08-26 06:49:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGTextPathElement, nsIDOMSVGTextPathElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextContentElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2005-08-26 06:49:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-01-24 20:42:23 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGTitleElement, nsIDOMSVGTitleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTitleElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGTSpanElement, nsIDOMSVGTSpanElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextPositioningElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTextContentElement)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2005-11-22 20:45:47 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGStylable)
|
|
|
|
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-11-23 16:51:57 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGUseElement, nsIDOMSVGUseElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGUseElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGURIReference)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
// other SVG classes
|
|
|
|
|
2004-12-09 06:16:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAngle, nsIDOMSVGAngle)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAngle)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedAngle, nsIDOMSVGAnimatedAngle)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedAngle)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-06-27 23:02:58 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedBoolean, nsIDOMSVGAnimatedBoolean)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedBoolean)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedEnumeration, nsIDOMSVGAnimatedEnumeration)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedEnumeration)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-09-07 02:30:40 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedInteger, nsIDOMSVGAnimatedInteger)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedInteger)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedLength, nsIDOMSVGAnimatedLength)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedLength)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedLengthList, nsIDOMSVGAnimatedLengthList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedLengthList)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedNumber, nsIDOMSVGAnimatedNumber)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedNumber)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedNumberList, nsIDOMSVGAnimatedNumberList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedNumberList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedPreserveAspectRatio, nsIDOMSVGAnimatedPreserveAspectRatio)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedPreserveAspectRatio)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedRect, nsIDOMSVGAnimatedRect)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedRect)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedString, nsIDOMSVGAnimatedString)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedString)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGAnimatedTransformList, nsIDOMSVGAnimatedTransformList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGAnimatedTransformList)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-08-26 01:31:09 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGEvent, nsIDOMSVGEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGException, nsIDOMSVGException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIException)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGLength, nsIDOMSVGLength)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLength)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGLengthList, nsIDOMSVGLengthList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLengthList)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGMatrix, nsIDOMSVGMatrix)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGMatrix)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGNumber, nsIDOMSVGNumber)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumber)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-10-15 03:02:53 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGNumberList, nsIDOMSVGNumberList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumberList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegArcAbs, nsIDOMSVGPathSegArcAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegArcAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegArcRel, nsIDOMSVGPathSegArcRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegArcRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegClosePath, nsIDOMSVGPathSegClosePath)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegClosePath)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicAbs, nsIDOMSVGPathSegCurvetoCubicAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicRel, nsIDOMSVGPathSegCurvetoCubicRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicSmoothAbs, nsIDOMSVGPathSegCurvetoCubicSmoothAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicSmoothAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoCubicSmoothRel, nsIDOMSVGPathSegCurvetoCubicSmoothRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoCubicSmoothRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticAbs, nsIDOMSVGPathSegCurvetoQuadraticAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticRel, nsIDOMSVGPathSegCurvetoQuadraticRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticSmoothAbs, nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticSmoothAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegCurvetoQuadraticSmoothRel, nsIDOMSVGPathSegCurvetoQuadraticSmoothRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegCurvetoQuadraticSmoothRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoAbs, nsIDOMSVGPathSegLinetoAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoHorizontalAbs, nsIDOMSVGPathSegLinetoHorizontalAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoHorizontalAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2001-12-12 10:59:31 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoHorizontalRel, nsIDOMSVGPathSegLinetoHorizontalRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoHorizontalRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2002-02-09 06:36:55 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoRel, nsIDOMSVGPathSegLinetoRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2002-04-10 17:38:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoVerticalAbs, nsIDOMSVGPathSegLinetoVerticalAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoVerticalAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2002-07-09 04:44:20 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegLinetoVerticalRel, nsIDOMSVGPathSegLinetoVerticalRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegLinetoVerticalRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2003-01-18 20:55:27 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegList, nsIDOMSVGPathSegList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegList)
|
2003-07-09 01:10:52 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegMovetoAbs, nsIDOMSVGPathSegMovetoAbs)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegMovetoAbs)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2003-10-16 04:44:20 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPathSegMovetoRel, nsIDOMSVGPathSegMovetoRel)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSegMovetoRel)
|
2006-08-11 02:17:14 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPathSeg)
|
2003-10-16 04:44:20 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2004-07-26 00:03:55 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPoint, nsIDOMSVGPoint)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPoint)
|
2004-04-13 03:21:42 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2004-07-26 00:03:55 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPointList, nsIDOMSVGPointList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPointList)
|
2004-07-01 12:10:34 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGPreserveAspectRatio, nsIDOMSVGPreserveAspectRatio)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPreserveAspectRatio)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGRect, nsIDOMSVGRect)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRect)
|
2004-07-07 02:52:03 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2004-07-26 00:03:55 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGTransform, nsIDOMSVGTransform)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransform)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGTransformList, nsIDOMSVGTransformList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransformList)
|
2004-07-22 22:34:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2005-08-26 01:31:09 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGZoomEvent, nsIDOMSVGZoomEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGZoomEvent)
|
2009-10-21 13:38:39 +04:00
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
2005-08-26 01:31:09 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
2004-07-26 00:03:55 +04:00
|
|
|
#endif // MOZ_SVG
|
2003-10-16 04:44:20 +04:00
|
|
|
|
2005-04-19 01:03:13 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLCanvasElement, nsIDOMHTMLCanvasElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLCanvasElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2005-04-18 10:33:23 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCanvasRenderingContext2D)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2005-04-20 04:00:23 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CanvasGradient, nsIDOMCanvasGradient)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCanvasGradient)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CanvasPattern, nsIDOMCanvasPattern)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCanvasPattern)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2008-06-11 03:16:59 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TextMetrics, nsIDOMTextMetrics)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTextMetrics)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2005-04-18 10:33:23 +04:00
|
|
|
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XSLTProcessor, nsIXSLTProcessor)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessor)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessorObsolete) // XXX DEPRECATED
|
2006-07-06 04:33:24 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXSLTProcessorPrivate)
|
2005-11-18 16:39:43 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XPathEvaluator, nsIDOMXPathEvaluator)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathEvaluator)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XPathException, nsIDOMXPathException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIException)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XPathExpression, nsIDOMXPathExpression)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathExpression)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSXPathExpression)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XPathNSResolver, nsIDOMXPathNSResolver)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathNSResolver)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XPathResult, nsIDOMXPathResult)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXPathResult)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-05-16 17:59:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(StorageObsolete, nsIDOMStorageObsolete)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageObsolete)
|
2006-05-19 09:57:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-05-16 17:59:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Storage, nsIDOMStorage)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorage)
|
2009-03-19 02:43:45 +03:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(StorageList, nsIDOMStorageList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(StorageItem, nsIDOMStorageItem)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageItem)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMToString)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(StorageEvent, nsIDOMStorageEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageEvent)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2010-01-28 17:53:53 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(StorageEventObsolete, nsIDOMStorageEventObsolete)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageEventObsolete)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2006-04-26 13:19:48 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(DOMParser, nsIDOMParser)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMParser)
|
2006-09-09 08:54:03 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMParserJS)
|
2006-04-26 13:19:48 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XMLSerializer, nsIDOMSerializer)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSerializer)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XMLHttpRequest, nsIXMLHttpRequest)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXMLHttpRequest)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIJSXMLHttpRequest)
|
2008-08-14 15:07:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXMLHttpRequestEventTarget)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2006-04-26 13:19:48 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIInterfaceRequestor)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(XMLHttpProgressEvent, nsIDOMEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMLSProgressEvent)
|
2008-08-14 15:07:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMProgressEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
2006-04-26 13:19:48 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-08-17 17:11:04 +04:00
|
|
|
#ifdef MOZ_SVG
|
2005-06-29 07:51:44 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SVGForeignObjectElement, nsIDOMSVGForeignObjectElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGForeignObjectElement)
|
|
|
|
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
#endif
|
|
|
|
|
2006-05-23 00:37:32 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XULCommandEvent, nsIDOMXULCommandEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMXULCommandEvent)
|
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2006-12-01 14:09:53 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CommandEvent, nsIDOMCommandEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCommandEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-05-29 13:45:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(OfflineResourceList, nsIDOMOfflineResourceList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMOfflineResourceList)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2008-05-09 04:10:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
2007-05-29 13:45:30 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(ClientRect, nsIDOMClientRect)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMClientRect)
|
2007-05-31 02:32:54 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(ClientRectList, nsIDOMClientRectList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMClientRectList)
|
2007-05-31 02:32:54 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-07-25 08:29:47 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(FileList, nsIDOMFileList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMFileList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-10-07 12:30:26 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(FileError, nsIDOMFileError)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMFileError)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-07-25 08:29:47 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(File, nsIDOMFile)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMFile)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(FileException, nsIDOMFileException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMFileException)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIException)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-11-09 23:05:16 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(FileReader, nsIDOMFileReader)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMFileReader)
|
2009-10-07 12:30:26 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXMLHttpRequestEventTarget)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2009-10-07 12:30:26 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIInterfaceRequestor)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-12-04 21:49:38 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ModalContentWindow, nsIDOMWindow)
|
2007-07-26 21:52:26 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMJSWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMWindowInternal)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2007-07-26 21:52:26 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMViewCSS)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMAbstractView)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMStorageWindow)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMModalContentWindow)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2007-12-11 11:18:04 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DataContainerEvent, nsIDOMDataContainerEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataContainerEvent)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-01-30 04:31:29 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(MessageEvent, nsIDOMMessageEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMessageEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-08-14 20:35:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(GeoGeolocation, nsIDOMGeoGeolocation)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGeoGeolocation)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(GeoPosition, nsIDOMGeoPosition)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGeoPosition)
|
2008-07-16 03:37:48 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-02-26 07:33:24 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(GeoPositionCoords, nsIDOMGeoPositionCoords)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGeoPositionCoords)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-08-14 20:35:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(GeoPositionError, nsIDOMGeoPositionError)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMGeoPositionError)
|
2008-07-16 03:37:48 +04:00
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-08-11 01:13:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CSSFontFaceRule, nsIDOMCSSFontFaceRule)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(CSSFontFaceStyleDecl,
|
|
|
|
nsIDOMCSSStyleDeclaration)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSStyleDeclaration)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-07-09 12:22:20 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLVideoElement, nsIDOMHTMLVideoElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLVideoElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLSourceElement, nsIDOMHTMLSourceElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLSourceElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLMediaError, nsIDOMHTMLMediaError)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLMediaError)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(HTMLAudioElement, nsIDOMHTMLAudioElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMHTMLAudioElement)
|
|
|
|
DOM_CLASSINFO_GENERIC_HTML_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2008-08-27 16:07:27 +04:00
|
|
|
|
2008-08-14 15:07:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(ProgressEvent, nsIDOMProgressEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMProgressEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(XMLHttpRequestUpload, nsIXMLHttpRequestUpload)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXMLHttpRequestEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIXMLHttpRequestUpload)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2008-08-14 15:07:46 +04:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2008-07-09 12:22:20 +04:00
|
|
|
|
2008-08-27 16:07:27 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(DataTransfer, nsIDOMDataTransfer)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMDataTransfer)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSDataTransfer)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2008-09-18 13:47:21 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(NotifyPaintEvent, nsIDOMNotifyPaintEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNotifyPaintEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2008-08-27 16:07:27 +04:00
|
|
|
|
2008-10-24 00:15:20 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(SimpleGestureEvent, nsIDOMSimpleGestureEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSimpleGestureEvent)
|
2009-02-17 14:49:03 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent)
|
2008-10-24 00:15:20 +04:00
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2008-11-04 20:21:38 +03:00
|
|
|
#ifdef MOZ_MATHML
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(MathMLElement, nsIDOMElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMElement)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSElement)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2008-11-04 20:21:38 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOM3Node)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNodeSelector)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
#endif
|
|
|
|
|
2008-11-06 09:41:52 +03:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(Worker, nsIWorker)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWorker)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIAbstractWorker)
|
2010-01-13 16:50:01 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSEventTarget)
|
2008-11-06 09:41:52 +03:00
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-09-03 04:47:49 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(CanvasRenderingContextWebGL, nsICanvasRenderingContextWebGL)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsICanvasRenderingContextWebGL)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WebGLBuffer, nsIWebGLBuffer)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLBuffer)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WebGLTexture, nsIWebGLTexture)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLTexture)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WebGLProgram, nsIWebGLProgram)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLProgram)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WebGLShader, nsIWebGLShader)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLShader)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WebGLFramebuffer, nsIWebGLFramebuffer)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLFramebuffer)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(WebGLRenderbuffer, nsIWebGLRenderbuffer)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLRenderbuffer)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
2009-09-04 08:49:18 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(PaintRequest, nsIDOMPaintRequest)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPaintRequest)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(PaintRequestList, nsIDOMPaintRequestList)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMPaintRequestList)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2009-09-12 03:13:56 +04:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(ScrollAreaEvent, nsIDOMScrollAreaEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMScrollAreaEvent)
|
|
|
|
DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2009-09-04 08:49:18 +04:00
|
|
|
|
2009-10-16 12:57:32 +04:00
|
|
|
DOM_CLASSINFO_MAP_BEGIN(EventListenerInfo, nsIEventListenerInfo)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIEventListenerInfo)
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2009-12-23 22:10:31 +03:00
|
|
|
|
|
|
|
DOM_CLASSINFO_MAP_BEGIN(TransitionEvent, nsIDOMTransitionEvent)
|
|
|
|
DOM_CLASSINFO_MAP_ENTRY(nsIDOMTransitionEvent)
|
|
|
|
DOM_CLASSINFO_EVENT_MAP_ENTRIES
|
|
|
|
DOM_CLASSINFO_MAP_END
|
2009-10-16 12:57:32 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
#ifdef NS_DEBUG
|
|
|
|
{
|
2005-11-18 16:39:43 +03:00
|
|
|
PRUint32 i = NS_ARRAY_LENGTH(sClassInfoData);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
if (i != eDOMClassInfoIDCount) {
|
|
|
|
NS_ERROR("The number of items in sClassInfoData doesn't match the "
|
|
|
|
"number of nsIDOMClassInfo ID's, this is bad! Fix it!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_NOT_INITIALIZED;
|
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
for (i = 0; i < eDOMClassInfoIDCount; i++) {
|
2002-03-04 06:37:18 +03:00
|
|
|
if (!sClassInfoData[i].u.mConstructorFptr ||
|
2001-07-11 13:09:30 +04:00
|
|
|
sClassInfoData[i].mDebugID != i) {
|
|
|
|
NS_ERROR("Class info data out of sync, you forgot to update "
|
|
|
|
"nsDOMClassInfo.h and nsDOMClassInfo.cpp! Fix this, "
|
|
|
|
"mozilla will not work without this fixed!");
|
|
|
|
|
|
|
|
return NS_ERROR_NOT_INITIALIZED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < eDOMClassInfoIDCount; i++) {
|
|
|
|
if (!sClassInfoData[i].mInterfaces) {
|
|
|
|
NS_ERROR("Class info data without an interface list! Fix this, "
|
|
|
|
"mozilla will not work without this fixed!");
|
|
|
|
|
|
|
|
return NS_ERROR_NOT_INITIALIZED;
|
|
|
|
}
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Initialize static JSString's
|
2002-08-16 01:18:20 +04:00
|
|
|
DefineStaticJSVals(cx);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
PRInt32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < eDOMClassInfoIDCount; ++i) {
|
|
|
|
RegisterClassName(i);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < eDOMClassInfoIDCount; ++i) {
|
|
|
|
RegisterClassProtos(i);
|
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
RegisterExternalClasses();
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
sDisableDocumentAllSupport =
|
|
|
|
nsContentUtils::GetBoolPref("browser.dom.document.all.disabled");
|
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
sDisableGlobalScopePollutionSupport =
|
|
|
|
nsContentUtils::GetBoolPref("browser.dom.global_scope_pollution.disabled");
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
sIsInitialized = PR_TRUE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
// static
|
|
|
|
PRInt32
|
|
|
|
nsDOMClassInfo::GetArrayIndexFromId(JSContext *cx, jsval id, PRBool *aIsNumber)
|
|
|
|
{
|
|
|
|
jsdouble array_index;
|
|
|
|
|
|
|
|
if (aIsNumber) {
|
|
|
|
*aIsNumber = PR_FALSE;
|
|
|
|
}
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
if (!::JS_ValueToNumber(cx, id, &array_index)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2001-09-05 08:30:12 +04:00
|
|
|
jsint i = -1;
|
2001-06-28 08:26:29 +04:00
|
|
|
|
|
|
|
if (!JSDOUBLE_IS_INT(array_index, i)) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aIsNumber) {
|
|
|
|
*aIsNumber = PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2001-04-01 05:10:59 +04:00
|
|
|
NS_IMETHODIMP
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsDOMClassInfo::GetInterfaces(PRUint32 *aCount, nsIID ***aArray)
|
2001-04-01 05:10:59 +04:00
|
|
|
{
|
2001-07-11 13:09:30 +04:00
|
|
|
PRUint32 count = 0;
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
while (mData->mInterfaces[count]) {
|
2001-07-11 13:09:30 +04:00
|
|
|
count++;
|
|
|
|
}
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
*aCount = count;
|
2001-04-01 05:10:59 +04:00
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
if (!count) {
|
2001-04-01 05:10:59 +04:00
|
|
|
*aArray = nsnull;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2007-07-08 11:08:04 +04:00
|
|
|
*aArray = static_cast<nsIID **>(nsMemory::Alloc(count * sizeof(nsIID *)));
|
2001-04-01 05:10:59 +04:00
|
|
|
NS_ENSURE_TRUE(*aArray, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
PRUint32 i;
|
2001-07-11 13:09:30 +04:00
|
|
|
for (i = 0; i < count; i++) {
|
2007-07-08 11:08:04 +04:00
|
|
|
nsIID *iid = static_cast<nsIID *>(nsMemory::Clone(mData->mInterfaces[i],
|
2002-08-16 01:18:20 +04:00
|
|
|
sizeof(nsIID)));
|
2001-04-01 05:10:59 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
if (!iid) {
|
|
|
|
NS_FREE_XPCOM_ALLOCATED_POINTER_ARRAY(i, *aArray);
|
2001-04-01 05:10:59 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
2001-04-01 05:10:59 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
*((*aArray) + i) = iid;
|
2001-04-01 05:10:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetHelperForLanguage(PRUint32 language, nsISupports **_retval)
|
|
|
|
{
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
if (language == nsIProgrammingLanguage::JAVASCRIPT) {
|
2007-07-08 11:08:04 +04:00
|
|
|
*_retval = static_cast<nsIXPCScriptable *>(this);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
NS_ADDREF(*_retval);
|
|
|
|
} else {
|
|
|
|
*_retval = nsnull;
|
|
|
|
}
|
2001-04-01 05:10:59 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsDOMClassInfo::GetContractID(char **aContractID)
|
2001-04-01 05:10:59 +04:00
|
|
|
{
|
|
|
|
*aContractID = nsnull;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-05-19 13:14:19 +04:00
|
|
|
NS_IMETHODIMP
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsDOMClassInfo::GetClassDescription(char **aClassDescription)
|
|
|
|
{
|
|
|
|
return GetClassName(aClassDescription);
|
|
|
|
}
|
|
|
|
|
2001-04-01 05:10:59 +04:00
|
|
|
NS_IMETHODIMP
|
2001-08-07 07:59:29 +04:00
|
|
|
nsDOMClassInfo::GetClassID(nsCID **aClassID)
|
|
|
|
{
|
|
|
|
*aClassID = nsnull;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetClassIDNoAlloc(nsCID *aClassID)
|
2001-04-01 05:10:59 +04:00
|
|
|
{
|
2001-07-31 23:05:34 +04:00
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
2001-04-01 05:10:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetImplementationLanguage(PRUint32 *aImplLanguage)
|
|
|
|
{
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
*aImplLanguage = nsIProgrammingLanguage::CPLUSPLUS;
|
2001-04-01 05:10:59 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetFlags(PRUint32 *aFlags)
|
|
|
|
{
|
2002-08-29 08:05:39 +04:00
|
|
|
*aFlags = DOMCLASSINFO_STANDARD_FLAGS;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// nsIXPCScriptable
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetClassName(char **aClassName)
|
|
|
|
{
|
2006-11-12 18:15:37 +03:00
|
|
|
*aClassName = NS_strdup(mData->mName);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetScriptableFlags(PRUint32 *aFlags)
|
|
|
|
{
|
2002-03-04 05:25:08 +03:00
|
|
|
*aFlags = mData->mScriptableFlags;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
2005-09-13 04:26:53 +04:00
|
|
|
*parentObj = globalObj;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsPIDOMWindow> piwin = do_QueryWrapper(cx, globalObj);
|
2005-09-13 04:26:53 +04:00
|
|
|
|
|
|
|
if (!piwin) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (piwin->IsOuterWindow()) {
|
|
|
|
*parentObj = ((nsGlobalWindow *)piwin.get())->
|
|
|
|
GetCurrentInnerWindowInternal()->GetGlobalJSObject();
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Create(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::Create Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::PostCreate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj)
|
|
|
|
{
|
2009-06-03 19:30:18 +04:00
|
|
|
NS_WARNING("nsDOMClassInfo::PostCreate Don't call me!");
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::AddProperty Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::DelProperty Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::GetProperty Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::SetProperty Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRBool *_retval)
|
|
|
|
{
|
2008-03-06 23:20:42 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
if (!sSecMan) {
|
|
|
|
NS_ERROR("No security manager!!!");
|
2001-09-01 07:30:51 +04:00
|
|
|
return NS_OK;
|
2008-03-06 23:20:42 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-09-01 07:30:51 +04:00
|
|
|
// Ask the security manager if it's OK to enumerate
|
|
|
|
nsresult rv =
|
2002-08-16 01:18:20 +04:00
|
|
|
sSecMan->CheckPropertyAccess(cx, obj, mData->mName, sEnumerate_id,
|
2001-09-01 07:30:51 +04:00
|
|
|
nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
|
|
|
|
|
2008-03-06 23:20:42 +03:00
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv),
|
|
|
|
"XOWs should have stopped us from getting here!!!");
|
|
|
|
#endif
|
2001-09-20 11:58:49 +04:00
|
|
|
|
2001-09-01 07:30:51 +04:00
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, PRUint32 enum_op,
|
|
|
|
jsval *statep, jsid *idp, PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::NewEnumerate Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2003-01-22 06:22:35 +03:00
|
|
|
nsresult
|
|
|
|
nsDOMClassInfo::ResolveConstructor(JSContext *cx, JSObject *obj,
|
|
|
|
JSObject **objp)
|
|
|
|
{
|
2007-08-10 02:19:59 +04:00
|
|
|
JSObject *global = ::JS_GetGlobalForObject(cx, obj);
|
2003-01-22 06:22:35 +03:00
|
|
|
|
|
|
|
jsval val;
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
2008-03-18 00:19:25 +03:00
|
|
|
if (!::JS_LookupProperty(cx, global, mData->mName, &val)) {
|
2003-01-22 06:22:35 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!JSVAL_IS_PRIMITIVE(val)) {
|
|
|
|
// If val is not an (non-null) object there either is no
|
|
|
|
// constructor for this class, or someone messed with
|
|
|
|
// window.classname, just fall through and let the JS engine
|
|
|
|
// return the Object constructor.
|
|
|
|
|
|
|
|
JSString *str = JSVAL_TO_STRING(sConstructor_id);
|
2006-04-03 20:54:53 +04:00
|
|
|
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), val, nsnull, nsnull,
|
|
|
|
JSPROP_ENUMERATE)) {
|
2003-01-22 06:22:35 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
2003-01-22 06:22:35 +03:00
|
|
|
if (id == sConstructor_id && !(flags & JSRESOLVE_ASSIGNING)) {
|
|
|
|
return ResolveConstructor(cx, obj, objp);
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2003-01-22 06:22:35 +03:00
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Convert(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 type, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::Convert Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::Finalize Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 mode,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2002-05-22 04:34:01 +04:00
|
|
|
PRUint32 mode_type = mode & JSACC_TYPEMASK;
|
|
|
|
|
|
|
|
if ((mode_type == JSACC_WATCH ||
|
|
|
|
mode_type == JSACC_PROTO ||
|
2005-08-12 08:11:00 +04:00
|
|
|
mode_type == JSACC_PARENT) &&
|
|
|
|
sSecMan) {
|
2001-07-04 13:44:57 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsresult rv;
|
|
|
|
JSObject *real_obj;
|
|
|
|
if (wrapper) {
|
|
|
|
rv = wrapper->GetJSObject(&real_obj);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
real_obj = obj;
|
|
|
|
}
|
2001-07-04 13:44:57 +04:00
|
|
|
|
2001-07-21 06:08:00 +04:00
|
|
|
rv =
|
2002-03-04 05:25:08 +03:00
|
|
|
sSecMan->CheckPropertyAccess(cx, real_obj, mData->mName, id,
|
2001-07-21 06:08:00 +04:00
|
|
|
nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
|
|
|
|
|
|
|
|
if (NS_FAILED(rv)) {
|
2001-07-04 13:44:57 +04:00
|
|
|
// Let XPConnect know that the access was not granted.
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::Call Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::Construct Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval val, PRBool *bp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::HasInstance Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2007-05-03 00:20:21 +04:00
|
|
|
nsDOMClassInfo::Trace(nsIXPConnectWrappedNative *wrapper, JSTracer *trc,
|
|
|
|
JSObject *obj)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2007-05-03 00:20:21 +04:00
|
|
|
NS_WARNING("nsDOMClassInfo::Trace Don't call me!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::Equality(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, jsval val, PRBool *bp)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::Equality Don't call me!");
|
2005-07-31 00:57:07 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::OuterObject Don't call me!");
|
2005-07-31 00:57:07 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2005-10-08 04:28:45 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::InnerObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval)
|
|
|
|
{
|
2006-02-22 05:18:33 +03:00
|
|
|
NS_WARNING("nsDOMClassInfo::InnerObject Don't call me!");
|
2005-10-08 04:28:45 +04:00
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
static nsresult
|
|
|
|
GetExternalClassInfo(nsScriptNameSpaceManager *aNameSpaceManager,
|
|
|
|
const nsString &aName,
|
|
|
|
const nsGlobalNameStruct *aStruct,
|
|
|
|
const nsGlobalNameStruct **aResult)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(aStruct->mType ==
|
|
|
|
nsGlobalNameStruct::eTypeExternalClassInfoCreator,
|
|
|
|
"Wrong type!");
|
|
|
|
|
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsIDOMCIExtension> creator(do_CreateInstance(aStruct->mCID, &rv));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMScriptObjectFactory> sof(do_GetService(kDOMSOF_CID));
|
|
|
|
NS_ENSURE_TRUE(sof, NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
rv = creator->RegisterDOMCI(NS_ConvertUTF16toUTF8(aName).get(), sof);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
const nsGlobalNameStruct *name_struct;
|
|
|
|
rv = aNameSpaceManager->LookupName(aName, &name_struct);
|
|
|
|
if (NS_SUCCEEDED(rv) && name_struct &&
|
|
|
|
name_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
|
|
|
|
*aResult = name_struct;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
NS_ERROR("Couldn't get the DOM ClassInfo data.");
|
|
|
|
|
|
|
|
*aResult = nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static nsresult
|
|
|
|
ResolvePrototype(nsIXPConnect *aXPConnect, nsGlobalWindow *aWin, JSContext *cx,
|
2009-06-03 19:30:18 +04:00
|
|
|
JSObject *obj, const PRUnichar *name,
|
|
|
|
const nsDOMClassInfoData *ci_data,
|
2009-03-24 14:02:30 +03:00
|
|
|
const nsGlobalNameStruct *name_struct,
|
|
|
|
nsScriptNameSpaceManager *nameSpaceManager,
|
2009-06-24 10:30:11 +04:00
|
|
|
JSObject *dot_prototype, PRBool install, PRBool *did_resolve);
|
2009-03-24 14:02:30 +03:00
|
|
|
|
|
|
|
|
2008-08-20 06:38:24 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * proto)
|
|
|
|
{
|
|
|
|
PRUint32 flags = (mData->mScriptableFlags & DONT_ENUM_STATIC_PROPS)
|
|
|
|
? 0
|
|
|
|
: JSPROP_ENUMERATE;
|
|
|
|
|
|
|
|
PRUint32 count = 0;
|
|
|
|
while (mData->mInterfaces[count]) {
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!sXPConnect->DefineDOMQuickStubs(cx, proto, flags,
|
|
|
|
count, mData->mInterfaces)) {
|
|
|
|
JS_ClearPendingException(cx);
|
|
|
|
}
|
2009-03-24 14:02:30 +03:00
|
|
|
|
2009-07-01 23:12:32 +04:00
|
|
|
// This is called before any other location that requires
|
|
|
|
// sObjectClass, so compute it here. We assume that nobody has had a
|
|
|
|
// chance to monkey around with proto's prototype chain before this.
|
|
|
|
if (!sObjectClass) {
|
|
|
|
FindObjectClass(proto);
|
|
|
|
NS_ASSERTION(sObjectClass && !strcmp(sObjectClass->name, "Object"),
|
|
|
|
"Incorrect object class!");
|
|
|
|
}
|
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
NS_ASSERTION(::JS_GetPrototype(cx, proto) &&
|
|
|
|
JS_GET_CLASS(cx, ::JS_GetPrototype(cx, proto)) == sObjectClass,
|
|
|
|
"Hmm, somebody did something evil?");
|
2009-12-09 00:46:42 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
#ifdef DEBUG
|
2009-12-09 00:46:42 +03:00
|
|
|
if (mData->mHasClassInterface && mData->mProtoChainInterface &&
|
|
|
|
mData->mProtoChainInterface != &NS_GET_IID(nsISupports)) {
|
2009-03-24 14:02:30 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfoManager>
|
|
|
|
iim(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
|
|
|
|
|
|
|
|
if (iim) {
|
|
|
|
nsCOMPtr<nsIInterfaceInfo> if_info;
|
|
|
|
iim->GetInfoForIID(mData->mProtoChainInterface,
|
|
|
|
getter_AddRefs(if_info));
|
|
|
|
|
|
|
|
if (if_info) {
|
|
|
|
nsXPIDLCString name;
|
|
|
|
if_info->GetName(getter_Copies(name));
|
|
|
|
NS_ASSERTION(nsCRT::strcmp(CutPrefix(name), mData->mName) == 0,
|
|
|
|
"Class name and proto chain interface name mismatch!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
// Make prototype delegation work correctly. Consider if a site sets
|
|
|
|
// HTMLElement.prototype.foopy = function () { ... } Now, calling
|
|
|
|
// document.body.foopy() needs to ensure that looking up foopy on
|
|
|
|
// document.body's prototype will find the right function.
|
|
|
|
JSObject *global = ::JS_GetGlobalForObject(cx, proto);
|
|
|
|
|
|
|
|
// Only do this if the global object is a window.
|
|
|
|
// XXX Is there a better way to check this?
|
2009-05-13 00:20:42 +04:00
|
|
|
nsISupports *globalNative = XPConnect()->GetNativeOfWrapper(cx, global);
|
|
|
|
nsCOMPtr<nsPIDOMWindow> piwin = do_QueryInterface(globalNative);
|
2009-06-03 19:30:18 +04:00
|
|
|
if(!piwin) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromSupports(globalNative);
|
2009-06-03 19:30:18 +04:00
|
|
|
if (win->IsOuterWindow()) {
|
|
|
|
// XXXjst: Do security checks here when we remove the security
|
|
|
|
// checks on the inner window.
|
|
|
|
|
|
|
|
win = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
|
|
|
if (!win || !(global = win->GetGlobalJSObject())) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-24 10:30:11 +04:00
|
|
|
// Don't overwrite a property set by content.
|
|
|
|
JSBool found;
|
2009-08-09 23:42:55 +04:00
|
|
|
if (!::JS_AlreadyHasOwnUCProperty(cx, global, reinterpret_cast<const jschar*>(mData->mNameUTF16),
|
2009-06-24 10:30:11 +04:00
|
|
|
nsCRT::strlen(mData->mNameUTF16), &found)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager =
|
|
|
|
nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ENSURE_TRUE(nameSpaceManager, NS_OK);
|
|
|
|
|
|
|
|
PRBool unused;
|
|
|
|
return ResolvePrototype(sXPConnect, win, cx, global, mData->mNameUTF16,
|
2009-06-24 10:30:11 +04:00
|
|
|
mData, nsnull, nameSpaceManager, proto, !found,
|
|
|
|
&unused);
|
2008-08-20 06:38:24 +04:00
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// static
|
2001-07-11 13:09:30 +04:00
|
|
|
nsIClassInfo *
|
2007-03-19 12:19:16 +03:00
|
|
|
NS_GetDOMClassInfoInstance(nsDOMClassInfoID aID)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
if (aID >= eDOMClassInfoIDCount) {
|
|
|
|
NS_ERROR("Bad ID!");
|
|
|
|
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
2007-03-19 12:19:16 +03:00
|
|
|
if (!nsDOMClassInfo::sIsInitialized) {
|
|
|
|
nsresult rv = nsDOMClassInfo::Init();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
NS_ENSURE_SUCCESS(rv, nsnull);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!sClassInfoData[aID].mCachedClassInfo) {
|
|
|
|
nsDOMClassInfoData& data = sClassInfoData[aID];
|
|
|
|
|
2002-03-04 06:37:18 +03:00
|
|
|
data.mCachedClassInfo = data.u.mConstructorFptr(&data);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(data.mCachedClassInfo, nsnull);
|
|
|
|
|
|
|
|
NS_ADDREF(data.mCachedClassInfo);
|
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
NS_ASSERTION(!IS_EXTERNAL(sClassInfoData[aID].mCachedClassInfo),
|
|
|
|
"This is bad, internal class marked as external!");
|
|
|
|
|
2004-01-06 03:36:01 +03:00
|
|
|
return sClassInfoData[aID].mCachedClassInfo;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
// static
|
|
|
|
nsIClassInfo *
|
|
|
|
nsDOMClassInfo::GetClassInfoInstance(nsDOMClassInfoData* aData)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(IS_EXTERNAL(aData->mCachedClassInfo)
|
|
|
|
|| !aData->mCachedClassInfo,
|
|
|
|
"This is bad, external class marked as internal!");
|
|
|
|
|
|
|
|
if (!aData->mCachedClassInfo) {
|
2002-03-04 06:37:18 +03:00
|
|
|
if (aData->u.mExternalConstructorFptr) {
|
2002-08-16 01:18:20 +04:00
|
|
|
aData->mCachedClassInfo =
|
|
|
|
aData->u.mExternalConstructorFptr(aData->mName);
|
2002-03-04 05:25:08 +03:00
|
|
|
} else {
|
|
|
|
aData->mCachedClassInfo = nsDOMGenericSH::doCreate(aData);
|
|
|
|
}
|
|
|
|
NS_ENSURE_TRUE(aData->mCachedClassInfo, nsnull);
|
|
|
|
|
|
|
|
NS_ADDREF(aData->mCachedClassInfo);
|
|
|
|
aData->mCachedClassInfo = MARK_EXTERNAL(aData->mCachedClassInfo);
|
|
|
|
}
|
|
|
|
|
2004-01-06 03:36:01 +03:00
|
|
|
return GET_CLEAN_CI_PTR(aData->mCachedClassInfo);
|
2002-03-04 05:25:08 +03:00
|
|
|
}
|
|
|
|
|
2006-11-22 22:23:02 +03:00
|
|
|
// static
|
2008-11-13 19:54:52 +03:00
|
|
|
void
|
2007-01-05 01:31:26 +03:00
|
|
|
nsDOMClassInfo::PreserveNodeWrapper(nsIXPConnectWrappedNative *aWrapper)
|
2006-11-22 22:23:02 +03:00
|
|
|
{
|
2009-11-29 11:32:39 +03:00
|
|
|
nsCOMPtr<nsIClassInfo> ci = do_QueryInterface(aWrapper->Native());
|
|
|
|
if (ci) {
|
|
|
|
nsDOMClassInfo* domci = nsnull;
|
|
|
|
CallQueryInterface(ci, &domci);
|
|
|
|
if (domci) {
|
|
|
|
domci->PreserveWrapper(aWrapper->Native());
|
|
|
|
}
|
2007-01-05 01:31:26 +03:00
|
|
|
}
|
|
|
|
}
|
2006-11-23 02:18:16 +03:00
|
|
|
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
// static
|
|
|
|
void
|
|
|
|
nsDOMClassInfo::ShutDown()
|
|
|
|
{
|
2002-03-04 06:37:18 +03:00
|
|
|
if (sClassInfoData[0].u.mConstructorFptr) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
PRUint32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < eDOMClassInfoIDCount; i++) {
|
|
|
|
NS_IF_RELEASE(sClassInfoData[i].mCachedClassInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
sTop_id = JSVAL_VOID;
|
2003-04-26 07:27:21 +04:00
|
|
|
sParent_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sScrollbars_id = JSVAL_VOID;
|
|
|
|
sLocation_id = JSVAL_VOID;
|
2003-01-22 06:22:35 +03:00
|
|
|
sConstructor_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
s_content_id = JSVAL_VOID;
|
|
|
|
sContent_id = JSVAL_VOID;
|
|
|
|
sMenubar_id = JSVAL_VOID;
|
|
|
|
sToolbar_id = JSVAL_VOID;
|
|
|
|
sLocationbar_id = JSVAL_VOID;
|
|
|
|
sPersonalbar_id = JSVAL_VOID;
|
|
|
|
sStatusbar_id = JSVAL_VOID;
|
2009-10-07 04:09:16 +04:00
|
|
|
sDialogArguments_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sDirectories_id = JSVAL_VOID;
|
|
|
|
sControllers_id = JSVAL_VOID;
|
|
|
|
sLength_id = JSVAL_VOID;
|
|
|
|
sInnerHeight_id = JSVAL_VOID;
|
|
|
|
sInnerWidth_id = JSVAL_VOID;
|
|
|
|
sOuterHeight_id = JSVAL_VOID;
|
|
|
|
sOuterWidth_id = JSVAL_VOID;
|
|
|
|
sScreenX_id = JSVAL_VOID;
|
|
|
|
sScreenY_id = JSVAL_VOID;
|
|
|
|
sStatus_id = JSVAL_VOID;
|
|
|
|
sName_id = JSVAL_VOID;
|
|
|
|
sOnmousedown_id = JSVAL_VOID;
|
|
|
|
sOnmouseup_id = JSVAL_VOID;
|
|
|
|
sOnclick_id = JSVAL_VOID;
|
2003-06-10 22:33:58 +04:00
|
|
|
sOndblclick_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sOncontextmenu_id = JSVAL_VOID;
|
|
|
|
sOnmouseover_id = JSVAL_VOID;
|
|
|
|
sOnmouseout_id = JSVAL_VOID;
|
|
|
|
sOnkeydown_id = JSVAL_VOID;
|
|
|
|
sOnkeyup_id = JSVAL_VOID;
|
|
|
|
sOnkeypress_id = JSVAL_VOID;
|
|
|
|
sOnmousemove_id = JSVAL_VOID;
|
|
|
|
sOnfocus_id = JSVAL_VOID;
|
|
|
|
sOnblur_id = JSVAL_VOID;
|
|
|
|
sOnsubmit_id = JSVAL_VOID;
|
|
|
|
sOnreset_id = JSVAL_VOID;
|
|
|
|
sOnchange_id = JSVAL_VOID;
|
|
|
|
sOnselect_id = JSVAL_VOID;
|
|
|
|
sOnload_id = JSVAL_VOID;
|
2004-03-03 03:20:31 +03:00
|
|
|
sOnbeforeunload_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sOnunload_id = JSVAL_VOID;
|
2009-06-26 21:16:50 +04:00
|
|
|
sOnhashchange_id = JSVAL_VOID;
|
2005-07-26 02:09:39 +04:00
|
|
|
sOnpageshow_id = JSVAL_VOID;
|
|
|
|
sOnpagehide_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sOnabort_id = JSVAL_VOID;
|
|
|
|
sOnerror_id = JSVAL_VOID;
|
|
|
|
sOnpaint_id = JSVAL_VOID;
|
|
|
|
sOnresize_id = JSVAL_VOID;
|
|
|
|
sOnscroll_id = JSVAL_VOID;
|
2009-02-18 16:31:31 +03:00
|
|
|
sOndrag_id = JSVAL_VOID;
|
|
|
|
sOndragend_id = JSVAL_VOID;
|
|
|
|
sOndragenter_id = JSVAL_VOID;
|
|
|
|
sOndragleave_id = JSVAL_VOID;
|
|
|
|
sOndragover_id = JSVAL_VOID;
|
|
|
|
sOndragstart_id = JSVAL_VOID;
|
|
|
|
sOndrop_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sScrollX_id = JSVAL_VOID;
|
|
|
|
sScrollY_id = JSVAL_VOID;
|
2003-04-15 17:40:46 +04:00
|
|
|
sScrollMaxX_id = JSVAL_VOID;
|
|
|
|
sScrollMaxY_id = JSVAL_VOID;
|
2002-08-16 01:18:20 +04:00
|
|
|
sOpen_id = JSVAL_VOID;
|
|
|
|
sItem_id = JSVAL_VOID;
|
|
|
|
sEnumerate_id = JSVAL_VOID;
|
|
|
|
sNavigator_id = JSVAL_VOID;
|
|
|
|
sDocument_id = JSVAL_VOID;
|
|
|
|
sWindow_id = JSVAL_VOID;
|
2003-02-14 04:59:52 +03:00
|
|
|
sFrames_id = JSVAL_VOID;
|
2003-02-27 03:54:49 +03:00
|
|
|
sSelf_id = JSVAL_VOID;
|
2003-07-09 04:48:25 +04:00
|
|
|
sOpener_id = JSVAL_VOID;
|
2006-06-23 20:43:29 +04:00
|
|
|
sAll_id = JSVAL_VOID;
|
|
|
|
sTags_id = JSVAL_VOID;
|
|
|
|
sAddEventListener_id= JSVAL_VOID;
|
|
|
|
sBaseURIObject_id = JSVAL_VOID;
|
|
|
|
sNodePrincipal_id = JSVAL_VOID;
|
|
|
|
sDocumentURIObject_id=JSVAL_VOID;
|
2007-07-26 08:14:33 +04:00
|
|
|
sOncopy_id = JSVAL_VOID;
|
|
|
|
sOncut_id = JSVAL_VOID;
|
|
|
|
sOnpaste_id = JSVAL_VOID;
|
2007-10-10 05:24:28 +04:00
|
|
|
sJava_id = JSVAL_VOID;
|
|
|
|
sPackages_id = JSVAL_VOID;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
NS_IF_RELEASE(sXPConnect);
|
|
|
|
NS_IF_RELEASE(sSecMan);
|
2004-06-09 22:36:25 +04:00
|
|
|
sIsInitialized = PR_FALSE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2001-11-21 02:15:32 +03:00
|
|
|
// Window helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2004-08-26 07:49:17 +04:00
|
|
|
nsWindowSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
// Normally ::PreCreate() is used to give XPConnect the parent
|
|
|
|
// object for the object that's being wrapped, this parent object is
|
|
|
|
// set as the parent of the wrapper and it's also used to find the
|
|
|
|
// right scope for the object being wrapped. Now, in the case of the
|
|
|
|
// global object the wrapper shouldn't have a parent but we supply
|
|
|
|
// one here anyway (the global object itself) and this will be used
|
|
|
|
// by XPConnect only to find the right scope, once the scope is
|
|
|
|
// found XPConnect will find the existing wrapper (which always
|
|
|
|
// exists since it's created on window construction), since an
|
|
|
|
// existing wrapper is found the parent we supply here is ignored
|
|
|
|
// after the wrapper is found.
|
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryInterface(nativeObj));
|
2006-03-30 22:40:56 +04:00
|
|
|
NS_ASSERTION(sgo, "nativeObj not a global object!");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
if (sgo) {
|
|
|
|
*parentObj = sgo->GetGlobalJSObject();
|
|
|
|
|
|
|
|
if (*parentObj) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// We're most likely being called when the global object is
|
|
|
|
// created, at that point we won't get a nsIScriptContext but we
|
|
|
|
// know we're called on the correct context so we return globalObj
|
|
|
|
|
|
|
|
*parentObj = globalObj;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
|
|
|
|
// This JS class piggybacks on nsHTMLDocumentSH::ReleaseDocument()...
|
|
|
|
|
|
|
|
static JSClass sGlobalScopePolluterClass = {
|
|
|
|
"Global Scope Polluter",
|
|
|
|
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE,
|
|
|
|
nsWindowSH::SecurityCheckOnSetProp, nsWindowSH::SecurityCheckOnSetProp,
|
|
|
|
nsWindowSH::GlobalScopePolluterGetProperty,
|
|
|
|
nsWindowSH::SecurityCheckOnSetProp, JS_EnumerateStub,
|
|
|
|
(JSResolveOp)nsWindowSH::GlobalScopePolluterNewResolve, JS_ConvertStub,
|
|
|
|
nsHTMLDocumentSH::ReleaseDocument
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// static
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-08-26 07:49:17 +04:00
|
|
|
nsWindowSH::GlobalScopePolluterGetProperty(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, jsval *vp)
|
|
|
|
{
|
|
|
|
// Someone is accessing a element by referencing its name/id in the
|
|
|
|
// global scope, do a security check to make sure that's ok.
|
|
|
|
|
|
|
|
nsresult rv =
|
2007-08-10 02:19:59 +04:00
|
|
|
sSecMan->CheckPropertyAccess(cx, ::JS_GetGlobalForObject(cx, obj),
|
|
|
|
"Window", id,
|
2004-08-26 07:49:17 +04:00
|
|
|
nsIXPCSecurityManager::ACCESS_GET_PROPERTY);
|
|
|
|
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
// The security check failed. The security manager set a JS
|
|
|
|
// exception for us.
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Print a warning on the console so developers have a chance to
|
|
|
|
// catch and fix these mistakes.
|
|
|
|
PrintWarningOnConsole(cx, "GlobalScopeElementReference");
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-08-26 07:49:17 +04:00
|
|
|
nsWindowSH::SecurityCheckOnSetProp(JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp)
|
|
|
|
{
|
|
|
|
// Someone is accessing a element by referencing its name/id in the
|
|
|
|
// global scope, do a security check to make sure that's ok.
|
|
|
|
|
|
|
|
nsresult rv =
|
2007-08-10 02:19:59 +04:00
|
|
|
sSecMan->CheckPropertyAccess(cx, ::JS_GetGlobalForObject(cx, obj),
|
|
|
|
"Window", id,
|
2004-08-26 07:49:17 +04:00
|
|
|
nsIXPCSecurityManager::ACCESS_SET_PROPERTY);
|
|
|
|
|
|
|
|
// If !NS_SUCCEEDED(rv) the security check failed. The security
|
|
|
|
// manager set a JS exception for us.
|
|
|
|
return NS_SUCCEEDED(rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-08-26 07:49:17 +04:00
|
|
|
nsWindowSH::GlobalScopePolluterNewResolve(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, uintN flags,
|
|
|
|
JSObject **objp)
|
|
|
|
{
|
2004-09-02 00:56:23 +04:00
|
|
|
if (flags & (JSRESOLVE_ASSIGNING | JSRESOLVE_DECLARING |
|
|
|
|
JSRESOLVE_CLASSNAME | JSRESOLVE_QUALIFIED) ||
|
2004-12-27 01:48:39 +03:00
|
|
|
!JSVAL_IS_STRING(id)) {
|
2004-09-02 00:56:23 +04:00
|
|
|
// Nothing to do here if we're either assigning or declaring,
|
|
|
|
// resolving a class name, doing a qualified resolve, or
|
|
|
|
// resolving a number.
|
2004-08-26 07:49:17 +04:00
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(cx, obj);
|
2006-12-05 18:46:18 +03:00
|
|
|
nsCOMPtr<nsIDocument> document(do_QueryInterface(doc));
|
2004-08-26 07:49:17 +04:00
|
|
|
|
2006-12-05 18:46:18 +03:00
|
|
|
if (!document ||
|
|
|
|
document->GetCompatibilityMode() != eCompatibility_NavQuirks) {
|
2004-08-26 07:49:17 +04:00
|
|
|
// If we don't have a document, or if the document is not in
|
|
|
|
// quirks mode, return early.
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *proto = ::JS_GetPrototype(cx, obj);
|
|
|
|
JSString *jsstr = JSVAL_TO_STRING(id);
|
|
|
|
JSBool hasProp;
|
|
|
|
|
|
|
|
if (!proto || !::JS_HasUCProperty(cx, proto, ::JS_GetStringChars(jsstr),
|
|
|
|
::JS_GetStringLength(jsstr), &hasProp) ||
|
|
|
|
hasProp) {
|
|
|
|
// No prototype, or the property exists on the prototype. Do
|
|
|
|
// nothing.
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsDependentJSString str(jsstr);
|
|
|
|
nsCOMPtr<nsISupports> result;
|
|
|
|
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMDocument> dom_doc(do_QueryInterface(doc));
|
|
|
|
nsCOMPtr<nsIDOMElement> element;
|
|
|
|
|
|
|
|
dom_doc->GetElementById(str, getter_AddRefs(element));
|
|
|
|
|
|
|
|
result = element;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!result) {
|
|
|
|
doc->ResolveName(str, nsnull, getter_AddRefs(result));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
jsval v;
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, obj, result, PR_TRUE, &v,
|
|
|
|
getter_AddRefs(holder));
|
2007-11-13 00:57:48 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, JS_FALSE);
|
2004-08-26 07:49:17 +04:00
|
|
|
|
|
|
|
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(jsstr),
|
|
|
|
::JS_GetStringLength(jsstr), v, nsnull, nsnull,
|
|
|
|
0)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
2004-08-28 01:06:19 +04:00
|
|
|
// static
|
2005-07-31 00:57:07 +04:00
|
|
|
void
|
|
|
|
nsWindowSH::InvalidateGlobalScopePolluter(JSContext *cx, JSObject *obj)
|
2004-08-28 01:06:19 +04:00
|
|
|
{
|
|
|
|
JSObject *proto;
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2004-08-28 01:06:19 +04:00
|
|
|
while ((proto = ::JS_GetPrototype(cx, obj))) {
|
|
|
|
if (JS_GET_CLASS(cx, proto) == &sGlobalScopePolluterClass) {
|
|
|
|
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(cx, proto);
|
|
|
|
|
|
|
|
NS_IF_RELEASE(doc);
|
|
|
|
|
|
|
|
::JS_SetPrivate(cx, proto, nsnull);
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
// Pull the global scope polluter out of the prototype chain so
|
|
|
|
// that it can be freed.
|
2004-08-31 04:04:04 +04:00
|
|
|
::JS_SetPrototype(cx, obj, ::JS_GetPrototype(cx, proto));
|
|
|
|
|
2004-08-28 01:06:19 +04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
obj = proto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsWindowSH::InstallGlobalScopePolluter(JSContext *cx, JSObject *obj,
|
|
|
|
nsIHTMLDocument *doc)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
// If global scope pollution is disabled, or if our document is not
|
|
|
|
// a HTML document, do nothing
|
|
|
|
if (sDisableGlobalScopePollutionSupport || !doc) {
|
2004-08-26 07:49:17 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
JSObject *gsp = ::JS_NewObject(cx, &sGlobalScopePolluterClass, nsnull, obj);
|
2004-08-26 07:49:17 +04:00
|
|
|
if (!gsp) {
|
2005-07-31 00:57:07 +04:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
2004-08-26 07:49:17 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *o = obj, *proto;
|
|
|
|
|
|
|
|
// Find the place in the prototype chain where we want this global
|
|
|
|
// scope polluter (right before Object.prototype).
|
|
|
|
|
|
|
|
while ((proto = ::JS_GetPrototype(cx, o))) {
|
|
|
|
if (JS_GET_CLASS(cx, proto) == sObjectClass) {
|
|
|
|
// Set the global scope polluters prototype to Object.prototype
|
|
|
|
if (!::JS_SetPrototype(cx, gsp, proto)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
o = proto;
|
|
|
|
}
|
|
|
|
|
2004-08-28 01:06:19 +04:00
|
|
|
// And then set the prototype of the object whose prototype was
|
2004-08-26 07:49:17 +04:00
|
|
|
// Object.prototype to be the global scope polluter.
|
|
|
|
if (!::JS_SetPrototype(cx, o, gsp)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!::JS_SetPrivate(cx, gsp, doc)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The global scope polluter will release doc on destruction (or
|
2005-07-31 00:57:07 +04:00
|
|
|
// invalidation).
|
|
|
|
NS_ADDREF(doc);
|
2004-08-26 07:49:17 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-05-26 23:39:49 +04:00
|
|
|
static
|
|
|
|
already_AddRefed<nsIDOMWindow>
|
2005-07-31 00:57:07 +04:00
|
|
|
GetChildFrame(nsGlobalWindow *win, jsval id)
|
2005-05-26 23:39:49 +04:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMWindowCollection> frames;
|
|
|
|
win->GetFrames(getter_AddRefs(frames));
|
|
|
|
|
|
|
|
nsIDOMWindow *frame = nsnull;
|
|
|
|
|
|
|
|
if (frames) {
|
|
|
|
frames->Item(JSVAL_TO_INT(id), &frame);
|
|
|
|
}
|
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
{
|
2006-07-12 02:58:03 +04:00
|
|
|
JSString *jsstr = ::JS_ValueToString(cx, id);
|
2006-06-13 02:39:55 +04:00
|
|
|
if (jsstr) {
|
|
|
|
nsDependentJSString str(jsstr);
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
if (win->IsInnerWindow()) {
|
2005-07-31 00:57:07 +04:00
|
|
|
#ifdef DEBUG_PRINT_INNER
|
2006-06-13 02:39:55 +04:00
|
|
|
printf("Property '%s' get on inner window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
2005-07-31 00:57:07 +04:00
|
|
|
#endif
|
2006-06-13 02:39:55 +04:00
|
|
|
} else {
|
|
|
|
printf("Property '%s' get on outer window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
}
|
2005-07-31 00:57:07 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-07-26 23:18:06 +04:00
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
if (win->IsOuterWindow() && realObj == obj) {
|
2005-07-31 00:57:07 +04:00
|
|
|
// XXXjst: Do security checks here when we remove the security
|
|
|
|
// checks on the inner window.
|
|
|
|
|
|
|
|
nsGlobalWindow *innerWin = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
|
|
|
JSObject *innerObj;
|
|
|
|
if (innerWin && (innerObj = innerWin->GetGlobalJSObject())) {
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
printf(" --- Forwarding get to inner window %p\n", (void *)innerWin);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Forward the get to the inner object
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
|
|
|
|
|
|
|
*_retval = ::JS_GetUCProperty(cx, innerObj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), vp);
|
|
|
|
} else if (JSVAL_IS_INT(id)) {
|
|
|
|
*_retval = ::JS_GetElement(cx, innerObj, JSVAL_TO_INT(id), vp);
|
|
|
|
} else {
|
|
|
|
NS_ERROR("Write me!");
|
|
|
|
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-12-12 00:07:36 +03:00
|
|
|
// The order in which things are done in this method are a bit
|
|
|
|
// whacky, that's because this method is *extremely* performace
|
|
|
|
// critical. Don't touch this unless you know what you're doing.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-05-21 00:35:35 +04:00
|
|
|
if (JSVAL_IS_INT(id)) {
|
2001-12-12 00:07:36 +03:00
|
|
|
// If we're accessing a numeric property we'll treat that as if
|
2005-05-26 23:39:49 +04:00
|
|
|
// window.frames[n] is accessed (since window.frames === window),
|
|
|
|
// if window.frames[n] is a child frame, wrap the frame and return
|
2001-12-12 00:07:36 +03:00
|
|
|
// it without doing a security check.
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
nsCOMPtr<nsIDOMWindow> frame = GetChildFrame(win, id);
|
2005-05-26 23:39:49 +04:00
|
|
|
nsresult rv = NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-05-26 23:39:49 +04:00
|
|
|
if (frame) {
|
|
|
|
// A numeric property accessed and the numeric property is a
|
|
|
|
// child frame, wrap the child frame without doing a security
|
|
|
|
// check and return.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
nsGlobalWindow *frameWin = (nsGlobalWindow *)frame.get();
|
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2005-08-16 10:38:43 +04:00
|
|
|
rv = WrapNative(cx, frameWin->GetGlobalJSObject(), frame,
|
2009-05-21 12:17:51 +04:00
|
|
|
&NS_GET_IID(nsIDOMWindow), PR_TRUE, vp,
|
2005-09-07 06:56:15 +04:00
|
|
|
getter_AddRefs(holder));
|
2009-06-11 02:41:26 +04:00
|
|
|
|
|
|
|
if (NS_SUCCEEDED(rv) && !win->IsChromeWindow()) {
|
|
|
|
JSObject *scopeobj = JS_GetScopeChain(cx);
|
|
|
|
if (!scopeobj) {
|
|
|
|
*_retval = JS_FALSE;
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = sXPConnect->GetXOWForObject(cx, scopeobj, JSVAL_TO_OBJECT(*vp),
|
|
|
|
vp);
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2005-05-26 23:39:49 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2007-07-26 23:18:06 +04:00
|
|
|
if (JSVAL_IS_STRING(id) && !JSVAL_IS_PRIMITIVE(*vp) &&
|
|
|
|
::JS_TypeOfValue(cx, *vp) != JSTYPE_FUNCTION) {
|
|
|
|
// A named property accessed which could have been resolved to a
|
|
|
|
// child frame in nsWindowSH::NewResolve() (*vp will tell us if
|
|
|
|
// that's the case). If *vp is a window object (i.e. a child
|
|
|
|
// frame), return without doing a security check.
|
2007-12-04 06:53:00 +03:00
|
|
|
//
|
|
|
|
// Calling GetWrappedNativeOfJSObject() is not all that cheap, so
|
|
|
|
// only do that if the JSClass name is one that is likely to be a
|
|
|
|
// window object.
|
|
|
|
|
|
|
|
const char *name = JS_GET_CLASS(cx, JSVAL_TO_OBJECT(*vp))->name;
|
|
|
|
|
|
|
|
// The list of Window class names here need to be kept in sync
|
2008-06-26 04:06:38 +04:00
|
|
|
// with the actual class names! The class name
|
|
|
|
// XPCCrossOriginWrapper needs to be handled here too as XOWs
|
|
|
|
// define child frame names with a XOW as the value, and thus
|
|
|
|
// we'll need to get through here with XOWs class name too.
|
2007-12-04 06:53:00 +03:00
|
|
|
if ((*name == 'W' && strcmp(name, "Window") == 0) ||
|
|
|
|
(*name == 'C' && strcmp(name, "ChromeWindow") == 0) ||
|
2008-06-26 04:06:38 +04:00
|
|
|
(*name == 'M' && strcmp(name, "ModalContentWindow") == 0) ||
|
|
|
|
(*name == 'X' && strcmp(name, "XPCCrossOriginWrapper") == 0)) {
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDOMWindow> window = do_QueryWrapper(cx, JSVAL_TO_OBJECT(*vp));
|
2007-12-04 06:53:00 +03:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
if (window) {
|
|
|
|
// Yup, *vp is a window object, return early (*vp is already
|
|
|
|
// the window, so no need to wrap it again).
|
2007-12-04 06:53:00 +03:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
return NS_SUCCESS_I_DID_SOMETHING;
|
2001-12-12 00:07:36 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
{
|
|
|
|
nsDependentJSString str(::JS_ValueToString(cx, id));
|
|
|
|
|
|
|
|
if (win->IsInnerWindow()) {
|
|
|
|
#ifdef DEBUG_PRINT_INNER
|
|
|
|
printf("Property '%s' set on inner window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
printf("Property '%s' set on outer window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-08-26 00:11:34 +04:00
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
if (win->IsOuterWindow() && obj == realObj) {
|
2005-07-31 00:57:07 +04:00
|
|
|
// XXXjst: Do security checks here when we remove the security
|
|
|
|
// checks on the inner window.
|
|
|
|
|
|
|
|
nsGlobalWindow *innerWin = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
|
|
|
JSObject *innerObj;
|
|
|
|
if (innerWin && (innerObj = innerWin->GetGlobalJSObject())) {
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
printf(" --- Forwarding set to inner window %p\n", (void *)innerWin);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Forward the set to the inner object
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
|
|
|
|
|
|
|
*_retval = ::JS_SetUCProperty(cx, innerObj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), vp);
|
|
|
|
} else if (JSVAL_IS_INT(id)) {
|
|
|
|
*_retval = ::JS_SetElement(cx, innerObj, JSVAL_TO_INT(id), vp);
|
|
|
|
} else {
|
|
|
|
NS_ERROR("Write me!");
|
|
|
|
|
|
|
|
return NS_ERROR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
if (id == sLocation_id) {
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
JSString *val = ::JS_ValueToString(cx, *vp);
|
|
|
|
NS_ENSURE_TRUE(val, NS_ERROR_UNEXPECTED);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
nsCOMPtr<nsIDOMWindowInternal> window(do_QueryWrappedNative(wrapper));
|
2002-08-16 01:18:20 +04:00
|
|
|
NS_ENSURE_TRUE(window, NS_ERROR_UNEXPECTED);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
nsCOMPtr<nsIDOMLocation> location;
|
|
|
|
nsresult rv = window->GetLocation(getter_AddRefs(location));
|
2007-11-12 08:59:41 +03:00
|
|
|
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && location, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, location, &NS_GET_IID(nsIDOMLocation), PR_TRUE,
|
|
|
|
vp, getter_AddRefs(holder));
|
2007-01-06 01:28:00 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
rv = location->SetHref(nsDependentJSString(val));
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-02-17 07:07:51 +03:00
|
|
|
return nsEventReceiverSH::SetProperty(wrapper, cx, obj, id, vp, _retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2001-07-13 11:08:26 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
{
|
|
|
|
nsDependentJSString str(::JS_ValueToString(cx, id));
|
|
|
|
|
|
|
|
if (win->IsInnerWindow()) {
|
|
|
|
#ifdef DEBUG_PRINT_INNER
|
|
|
|
printf("Property '%s' add on inner window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
printf("Property '%s' add on outer window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2007-08-26 00:11:34 +04:00
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
if (win->IsOuterWindow() && obj == realObj) {
|
2005-07-31 00:57:07 +04:00
|
|
|
// XXXjst: Do security checks here when we remove the security
|
|
|
|
// checks on the inner window.
|
|
|
|
|
|
|
|
nsGlobalWindow *innerWin = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
|
|
|
JSObject *innerObj;
|
|
|
|
if (innerWin && (innerObj = innerWin->GetGlobalJSObject())) {
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
printf(" --- Forwarding add to inner window %p\n", (void *)innerWin);
|
|
|
|
#endif
|
|
|
|
|
2007-07-26 02:55:09 +04:00
|
|
|
jsid interned_id;
|
2009-03-15 06:45:20 +03:00
|
|
|
if (!JS_ValueToId(cx, id, &interned_id)) {
|
2007-07-26 04:54:41 +04:00
|
|
|
*_retval = JS_FALSE;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-03-15 06:45:20 +03:00
|
|
|
JSPropertyDescriptor desc;
|
|
|
|
if (!JS_GetPropertyDescriptorById(cx, obj, interned_id,
|
|
|
|
JSRESOLVE_QUALIFIED, &desc)) {
|
2007-07-26 04:54:41 +04:00
|
|
|
*_retval = JS_FALSE;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Forward the add to the inner object
|
2009-03-15 06:45:20 +03:00
|
|
|
*_retval = JS_DefinePropertyById(cx, innerObj, interned_id, *vp,
|
|
|
|
desc.getter, desc.setter,
|
|
|
|
desc.attrs | JSPROP_ENUMERATE);
|
2005-07-31 00:57:07 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-11-18 04:59:51 +03:00
|
|
|
return nsEventReceiverSH::AddProperty(wrapper, cx, obj, id, vp, _retval);
|
2001-07-13 11:08:26 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::DelProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
{
|
|
|
|
nsDependentJSString str(::JS_ValueToString(cx, id));
|
|
|
|
|
|
|
|
if (win->IsInnerWindow()) {
|
|
|
|
#ifdef DEBUG_PRINT_INNER
|
|
|
|
printf("Property '%s' del on inner window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
printf("Property '%s' del on outer window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (win->IsOuterWindow() && !ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
// XXXjst: Do security checks here when we remove the security
|
|
|
|
// checks on the inner window.
|
|
|
|
|
|
|
|
nsGlobalWindow *innerWin = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
|
|
|
JSObject *innerObj;
|
|
|
|
if (innerWin && (innerObj = innerWin->GetGlobalJSObject())) {
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
2005-08-12 08:11:00 +04:00
|
|
|
printf(" --- Forwarding del to inner window %p\n", (void *)innerWin);
|
2005-07-31 00:57:07 +04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// Forward the del to the inner object
|
|
|
|
jsid interned_id;
|
2009-03-15 06:45:20 +03:00
|
|
|
*_retval = (JS_ValueToId(cx, id, &interned_id) &&
|
|
|
|
JS_DeletePropertyById(cx, innerObj, interned_id));
|
2005-07-31 00:57:07 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-05 07:45:16 +03:00
|
|
|
// Notify any XOWs on our outer window.
|
|
|
|
|
|
|
|
nsGlobalWindow *outerWin = win->GetOuterWindowInternal();
|
|
|
|
if (outerWin) {
|
|
|
|
nsCOMPtr<nsIXPConnectWrappedNative> wn;
|
|
|
|
nsIXPConnect *xpc = nsContentUtils::XPConnect();
|
|
|
|
nsresult rv =
|
|
|
|
xpc->GetWrappedNativeOfJSObject(cx, outerWin->GetGlobalJSObject(),
|
|
|
|
getter_AddRefs(wn));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
rv = xpc->UpdateXOWs(cx, wn, nsIXPConnect::XPC_XOW_CLEARSCOPE);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
|
|
|
|
2001-11-21 02:15:32 +03:00
|
|
|
return NS_OK;
|
2001-07-13 11:08:26 +04:00
|
|
|
}
|
|
|
|
|
2005-11-18 16:39:43 +03:00
|
|
|
static const char*
|
2009-06-03 19:30:18 +04:00
|
|
|
FindConstructorContractID(const nsDOMClassInfoData *aDOMClassInfoData)
|
2005-11-18 16:39:43 +03:00
|
|
|
{
|
|
|
|
PRUint32 i;
|
2005-11-18 18:53:43 +03:00
|
|
|
for (i = 0; i < NS_ARRAY_LENGTH(kConstructorMap); ++i) {
|
2009-06-03 19:30:18 +04:00
|
|
|
if (&sClassInfoData[kConstructorMap[i].mDOMClassInfoID] ==
|
|
|
|
aDOMClassInfoData) {
|
2005-11-18 18:53:43 +03:00
|
|
|
return kConstructorMap[i].mContractID;
|
2005-11-18 16:39:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
2008-11-06 09:41:52 +03:00
|
|
|
static nsDOMConstructorFunc
|
2009-06-03 19:30:18 +04:00
|
|
|
FindConstructorFunc(const nsDOMClassInfoData *aDOMClassInfoData)
|
2008-11-06 09:41:52 +03:00
|
|
|
{
|
|
|
|
for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(kConstructorFuncMap); ++i) {
|
2009-06-03 19:30:18 +04:00
|
|
|
if (&sClassInfoData[kConstructorFuncMap[i].mDOMClassInfoID] ==
|
|
|
|
aDOMClassInfoData) {
|
2008-11-06 09:41:52 +03:00
|
|
|
return kConstructorFuncMap[i].mConstructorFunc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
static nsresult
|
2007-12-12 11:33:32 +03:00
|
|
|
BaseStubConstructor(nsIWeakReference* aWeakOwner,
|
|
|
|
const nsGlobalNameStruct *name_struct, JSContext *cx,
|
2003-01-22 06:22:35 +03:00
|
|
|
JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2003-01-22 06:22:35 +03:00
|
|
|
nsresult rv;
|
2002-03-04 05:25:08 +03:00
|
|
|
nsCOMPtr<nsISupports> native;
|
2005-11-18 16:39:43 +03:00
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
2009-06-03 19:30:18 +04:00
|
|
|
const nsDOMClassInfoData* ci_data =
|
|
|
|
&sClassInfoData[name_struct->mDOMClassInfoID];
|
|
|
|
const char *contractid = FindConstructorContractID(ci_data);
|
2008-11-06 09:41:52 +03:00
|
|
|
if (contractid) {
|
|
|
|
native = do_CreateInstance(contractid, &rv);
|
|
|
|
}
|
|
|
|
else {
|
2009-06-03 19:30:18 +04:00
|
|
|
nsDOMConstructorFunc func = FindConstructorFunc(ci_data);
|
2008-11-06 09:41:52 +03:00
|
|
|
if (func) {
|
|
|
|
rv = func(getter_AddRefs(native));
|
|
|
|
}
|
|
|
|
}
|
2005-11-18 16:39:43 +03:00
|
|
|
} else if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructor) {
|
2002-03-04 05:25:08 +03:00
|
|
|
native = do_CreateInstance(name_struct->mCID, &rv);
|
2002-08-30 12:48:58 +04:00
|
|
|
} else if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {
|
|
|
|
native = do_CreateInstance(name_struct->mAlias->mCID, &rv);
|
2002-03-04 05:25:08 +03:00
|
|
|
} else {
|
|
|
|
native = do_CreateInstance(*name_struct->mData->mConstructorCID, &rv);
|
|
|
|
}
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
NS_ERROR("Failed to create the object");
|
2005-12-09 22:08:45 +03:00
|
|
|
return rv;
|
2002-03-04 05:25:08 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIJSNativeInitializer> initializer(do_QueryInterface(native));
|
|
|
|
if (initializer) {
|
2008-04-29 23:22:24 +04:00
|
|
|
// Initialize object using the current inner window, but only if
|
|
|
|
// the caller can access it.
|
2008-02-27 05:03:27 +03:00
|
|
|
nsCOMPtr<nsPIDOMWindow> owner = do_QueryReferent(aWeakOwner);
|
2008-04-29 23:22:24 +04:00
|
|
|
nsPIDOMWindow* outerWindow = owner ? owner->GetOuterWindow() : nsnull;
|
|
|
|
nsPIDOMWindow* currentInner =
|
|
|
|
outerWindow ? outerWindow->GetCurrentInnerWindow() : nsnull;
|
|
|
|
if (!currentInner ||
|
|
|
|
(owner != currentInner &&
|
|
|
|
!nsContentUtils::CanCallerAccess(currentInner))) {
|
|
|
|
return NS_ERROR_DOM_SECURITY_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = initializer->Initialize(currentInner, cx, obj, argc, argv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
2008-11-27 09:16:41 +03:00
|
|
|
return rv;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptObjectOwner> owner(do_QueryInterface(native));
|
|
|
|
if (owner) {
|
2004-02-10 01:48:53 +03:00
|
|
|
nsIScriptContext *context = nsJSUtils::GetStaticScriptContext(cx, obj);
|
2002-03-04 05:25:08 +03:00
|
|
|
if (!context) {
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
2002-03-04 05:25:08 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
JSObject* new_obj;
|
|
|
|
rv = owner->GetScriptObject(context, (void**)&new_obj);
|
|
|
|
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
*rval = OBJECT_TO_JSVAL(new_obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = nsDOMGenericSH::WrapNative(cx, obj, native, PR_TRUE, rval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
return rv;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
static nsresult
|
|
|
|
DefineInterfaceConstants(JSContext *cx, JSObject *obj, const nsIID *aIID)
|
|
|
|
{
|
2005-11-10 19:19:44 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfoManager>
|
|
|
|
iim(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
|
2001-07-11 13:09:30 +04:00
|
|
|
NS_ENSURE_TRUE(iim, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIInterfaceInfo> if_info;
|
|
|
|
|
|
|
|
nsresult rv = iim->GetInfoForIID(aIID, getter_AddRefs(if_info));
|
|
|
|
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && if_info, rv);
|
|
|
|
|
|
|
|
PRUint16 constant_count;
|
|
|
|
|
|
|
|
if_info->GetConstantCount(&constant_count);
|
|
|
|
|
|
|
|
if (!constant_count) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
nsCOMPtr<nsIInterfaceInfo> parent_if_info;
|
|
|
|
|
|
|
|
rv = if_info->GetParent(getter_AddRefs(parent_if_info));
|
|
|
|
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && parent_if_info, rv);
|
|
|
|
|
|
|
|
PRUint16 parent_constant_count, i;
|
|
|
|
parent_if_info->GetConstantCount(&parent_constant_count);
|
|
|
|
|
|
|
|
for (i = parent_constant_count; i < constant_count; i++) {
|
|
|
|
const nsXPTConstant *c = nsnull;
|
|
|
|
|
|
|
|
rv = if_info->GetConstant(i, &c);
|
|
|
|
NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && c, rv);
|
|
|
|
|
|
|
|
PRUint16 type = c->GetType().TagPart();
|
|
|
|
|
2003-01-31 15:10:13 +03:00
|
|
|
jsval v;
|
|
|
|
switch (type) {
|
|
|
|
case nsXPTType::T_I8:
|
|
|
|
case nsXPTType::T_U8:
|
|
|
|
{
|
|
|
|
v = INT_TO_JSVAL(c->GetValue()->val.u8);
|
|
|
|
break;
|
2001-07-11 13:09:30 +04:00
|
|
|
}
|
2003-01-31 15:10:13 +03:00
|
|
|
case nsXPTType::T_I16:
|
|
|
|
case nsXPTType::T_U16:
|
|
|
|
{
|
|
|
|
v = INT_TO_JSVAL(c->GetValue()->val.u16);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case nsXPTType::T_I32:
|
2009-08-11 03:04:21 +04:00
|
|
|
{
|
|
|
|
if (!JS_NewNumberValue(cx, c->GetValue()->val.i32, &v)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2003-01-31 15:10:13 +03:00
|
|
|
case nsXPTType::T_U32:
|
|
|
|
{
|
2009-08-11 03:04:21 +04:00
|
|
|
if (!JS_NewNumberValue(cx, c->GetValue()->val.u32, &v)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2003-01-31 15:10:13 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
2001-07-11 13:09:30 +04:00
|
|
|
#ifdef NS_DEBUG
|
2003-01-31 15:10:13 +03:00
|
|
|
NS_ERROR("Non-numeric constant found in interface.");
|
2001-07-11 13:09:30 +04:00
|
|
|
#endif
|
2003-01-31 15:10:13 +03:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!::JS_DefineProperty(cx, obj, c->GetName(), v, nsnull, nsnull,
|
|
|
|
JSPROP_ENUMERATE)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-07-16 02:46:14 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLBodyElementSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext
|
|
|
|
*cx, JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if (id == sOnhashchange_id) {
|
|
|
|
// Special handling so |"onhashchange" in document.body| returns true.
|
|
|
|
jsid interned_id;
|
|
|
|
|
|
|
|
if (!JS_ValueToId(cx, id, &interned_id) ||
|
|
|
|
!JS_DefinePropertyById(cx, obj, interned_id, JSVAL_VOID,
|
|
|
|
nsnull, nsnull, JSPROP_ENUMERATE)) {
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::NewResolve(wrapper, cx, obj, id, flags, objp, _retval);
|
2009-07-16 02:46:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLBodyElementSH::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if (id == sOnhashchange_id) {
|
|
|
|
// Forward the request to the Window.
|
|
|
|
jsid interned_id;
|
|
|
|
|
|
|
|
if (!JS_ValueToId(cx, id, &interned_id) ||
|
|
|
|
!JS_GetPropertyById(cx, JS_GetGlobalForObject(cx, obj),
|
|
|
|
interned_id, vp)) {
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::GetProperty(wrapper, cx, obj, id, vp, _retval);
|
2009-07-16 02:46:14 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLBodyElementSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if (id == sOnhashchange_id) {
|
|
|
|
// Forward the request to the Window.
|
|
|
|
jsid interned_id;
|
|
|
|
|
|
|
|
if (!JS_ValueToId(cx, id, &interned_id) ||
|
|
|
|
!JS_SetPropertyById(cx, JS_GetGlobalForObject(cx, obj),
|
|
|
|
interned_id, vp)) {
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::SetProperty(wrapper, cx, obj, id, vp, _retval);
|
2009-07-16 02:46:14 +04:00
|
|
|
}
|
|
|
|
|
2007-11-12 09:43:14 +03:00
|
|
|
class nsDOMConstructor : public nsIDOMDOMConstructor
|
2003-01-22 06:22:35 +03:00
|
|
|
{
|
2008-02-27 05:03:27 +03:00
|
|
|
protected:
|
2009-06-03 19:30:18 +04:00
|
|
|
nsDOMConstructor(const PRUnichar* aName,
|
|
|
|
PRBool aIsConstructable,
|
2008-02-27 05:03:27 +03:00
|
|
|
nsPIDOMWindow* aOwner)
|
2007-05-09 16:04:59 +04:00
|
|
|
: mClassName(aName),
|
2009-06-03 19:30:18 +04:00
|
|
|
mConstructable(aIsConstructable),
|
2007-12-12 11:33:32 +03:00
|
|
|
mWeakOwner(do_GetWeakReference(aOwner))
|
2005-12-09 22:08:45 +03:00
|
|
|
{
|
|
|
|
}
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2008-02-27 05:03:27 +03:00
|
|
|
public:
|
|
|
|
|
|
|
|
static nsresult Create(const PRUnichar* aName,
|
2009-06-03 19:30:18 +04:00
|
|
|
const nsDOMClassInfoData* aData,
|
2008-02-27 05:03:27 +03:00
|
|
|
const nsGlobalNameStruct* aNameStruct,
|
|
|
|
nsPIDOMWindow* aOwner,
|
|
|
|
nsDOMConstructor** aResult);
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
2007-11-12 09:43:14 +03:00
|
|
|
NS_DECL_NSIDOMDOMCONSTRUCTOR
|
2005-12-09 22:08:45 +03:00
|
|
|
|
|
|
|
nsresult Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv,
|
|
|
|
jsval *vp, PRBool *_retval);
|
|
|
|
|
|
|
|
nsresult HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval val, PRBool *bp,
|
|
|
|
PRBool *_retval);
|
|
|
|
|
|
|
|
nsresult Install(JSContext *cx, JSObject *target, jsval thisAsVal)
|
|
|
|
{
|
2006-06-05 11:18:02 +04:00
|
|
|
JSBool ok =
|
|
|
|
::JS_DefineUCProperty(cx, target,
|
2007-07-08 11:08:04 +04:00
|
|
|
reinterpret_cast<const jschar *>(mClassName),
|
2006-06-05 11:18:02 +04:00
|
|
|
nsCRT::strlen(mClassName), thisAsVal, nsnull,
|
2009-06-23 18:46:11 +04:00
|
|
|
nsnull, JSPROP_PERMANENT);
|
2006-06-05 11:18:02 +04:00
|
|
|
|
|
|
|
return ok ? NS_OK : NS_ERROR_UNEXPECTED;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
private:
|
2007-05-09 16:04:59 +04:00
|
|
|
const nsGlobalNameStruct *GetNameStruct()
|
|
|
|
{
|
|
|
|
if (!mClassName) {
|
|
|
|
NS_ERROR("Can't get name");
|
|
|
|
return nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
const nsGlobalNameStruct *nameStruct;
|
|
|
|
#ifdef DEBUG
|
|
|
|
nsresult rv =
|
|
|
|
#endif
|
|
|
|
GetNameStruct(nsDependentString(mClassName), &nameStruct);
|
|
|
|
|
|
|
|
NS_ASSERTION(NS_FAILED(rv) || nameStruct, "Name isn't in hash.");
|
|
|
|
|
|
|
|
return nameStruct;
|
|
|
|
}
|
|
|
|
|
|
|
|
static nsresult GetNameStruct(const nsAString& aName,
|
|
|
|
const nsGlobalNameStruct **aNameStruct)
|
|
|
|
{
|
|
|
|
*aNameStruct = nsnull;
|
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
if (!nameSpaceManager) {
|
2007-05-09 16:04:59 +04:00
|
|
|
NS_ERROR("Can't get namespace manager.");
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
nameSpaceManager->LookupName(aName, aNameStruct);
|
2007-05-09 16:04:59 +04:00
|
|
|
|
|
|
|
// Return NS_OK here, aName just isn't a DOM class but nothing failed.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
static PRBool IsConstructable(const nsDOMClassInfoData *aData)
|
|
|
|
{
|
2009-12-09 08:50:27 +03:00
|
|
|
if (IS_EXTERNAL(aData->mCachedClassInfo)) {
|
2009-06-03 19:30:18 +04:00
|
|
|
const nsExternalDOMClassInfoData* data =
|
|
|
|
static_cast<const nsExternalDOMClassInfoData*>(aData);
|
|
|
|
return data->mConstructorCID != nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FindConstructorContractID(aData) || FindConstructorFunc(aData);
|
|
|
|
}
|
2007-05-09 16:04:59 +04:00
|
|
|
static PRBool IsConstructable(const nsGlobalNameStruct *aNameStruct)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
(aNameStruct->mType == nsGlobalNameStruct::eTypeClassConstructor &&
|
2009-06-03 19:30:18 +04:00
|
|
|
IsConstructable(&sClassInfoData[aNameStruct->mDOMClassInfoID])) ||
|
2007-05-09 16:04:59 +04:00
|
|
|
(aNameStruct->mType == nsGlobalNameStruct::eTypeExternalClassInfo &&
|
2009-06-03 19:30:18 +04:00
|
|
|
IsConstructable(aNameStruct->mData)) ||
|
2007-05-09 16:04:59 +04:00
|
|
|
aNameStruct->mType == nsGlobalNameStruct::eTypeExternalConstructor ||
|
|
|
|
aNameStruct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias;
|
|
|
|
}
|
|
|
|
|
2007-12-12 11:33:32 +03:00
|
|
|
const PRUnichar* mClassName;
|
2007-05-09 16:04:59 +04:00
|
|
|
const PRPackedBool mConstructable;
|
2007-12-12 11:33:32 +03:00
|
|
|
nsWeakPtr mWeakOwner;
|
2005-12-09 22:08:45 +03:00
|
|
|
};
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2008-02-27 05:03:27 +03:00
|
|
|
//static
|
|
|
|
nsresult
|
|
|
|
nsDOMConstructor::Create(const PRUnichar* aName,
|
2009-06-03 19:30:18 +04:00
|
|
|
const nsDOMClassInfoData* aData,
|
2008-02-27 05:03:27 +03:00
|
|
|
const nsGlobalNameStruct* aNameStruct,
|
|
|
|
nsPIDOMWindow* aOwner,
|
|
|
|
nsDOMConstructor** aResult)
|
|
|
|
{
|
|
|
|
*aResult = nsnull;
|
2008-12-29 01:42:30 +03:00
|
|
|
// Prevent creating a constructor if aOwner is inner window which doesn't have
|
|
|
|
// an outer window. If the outer window doesn't have an inner window or the
|
|
|
|
// caller can't access the outer window's current inner window then try to use
|
|
|
|
// the owner (so long as it is, in fact, an inner window). If that doesn't
|
|
|
|
// work then prevent creation also.
|
2008-04-25 13:45:58 +04:00
|
|
|
nsPIDOMWindow* outerWindow = aOwner->GetOuterWindow();
|
|
|
|
nsPIDOMWindow* currentInner =
|
2008-12-29 01:42:30 +03:00
|
|
|
outerWindow ? outerWindow->GetCurrentInnerWindow() : aOwner;
|
|
|
|
if (!outerWindow ||
|
2008-04-25 13:45:58 +04:00
|
|
|
(aOwner != currentInner &&
|
2008-12-29 01:42:30 +03:00
|
|
|
!nsContentUtils::CanCallerAccess(currentInner) &&
|
|
|
|
!(currentInner = aOwner)->IsInnerWindow())) {
|
2008-02-27 05:03:27 +03:00
|
|
|
return NS_ERROR_DOM_SECURITY_ERR;
|
|
|
|
}
|
2009-06-03 19:30:18 +04:00
|
|
|
|
|
|
|
PRBool constructable = aNameStruct ?
|
|
|
|
IsConstructable(aNameStruct) :
|
|
|
|
IsConstructable(aData);
|
|
|
|
|
|
|
|
*aResult = new nsDOMConstructor(aName, constructable, currentInner);
|
2008-02-27 05:03:27 +03:00
|
|
|
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
NS_ADDREF(*aResult);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_IMPL_ADDREF(nsDOMConstructor)
|
|
|
|
NS_IMPL_RELEASE(nsDOMConstructor)
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsDOMConstructor)
|
2007-11-12 09:43:14 +03:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIDOMDOMConstructor)
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
2007-05-09 16:04:59 +04:00
|
|
|
if (aIID.Equals(NS_GET_IID(nsIClassInfo))) {
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
const nsGlobalNameStruct *name_struct = GetNameStruct();
|
|
|
|
NS_ASSERTION(!name_struct ||
|
|
|
|
mConstructable == IsConstructable(name_struct),
|
|
|
|
"Can't change constructability dynamically!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
foundInterface =
|
|
|
|
NS_GetDOMClassInfoInstance(mConstructable ?
|
2007-11-12 09:43:14 +03:00
|
|
|
eDOMClassInfo_DOMConstructor_id :
|
|
|
|
eDOMClassInfo_DOMPrototype_id);
|
2007-05-09 16:04:59 +04:00
|
|
|
if (!foundInterface) {
|
|
|
|
*aInstancePtr = nsnull;
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
} else
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_INTERFACE_MAP_END
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2005-12-09 22:52:04 +03:00
|
|
|
nsresult
|
2005-12-09 22:08:45 +03:00
|
|
|
nsDOMConstructor::Construct(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, PRUint32 argc, jsval * argv,
|
|
|
|
jsval * vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
JSObject* class_obj = JSVAL_TO_OBJECT(argv[-2]);
|
|
|
|
if (!class_obj) {
|
|
|
|
NS_ERROR("nsDOMConstructor::Construct couldn't get constructor object.");
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2007-05-09 16:04:59 +04:00
|
|
|
const nsGlobalNameStruct *name_struct = GetNameStruct();
|
|
|
|
NS_ENSURE_TRUE(name_struct, NS_ERROR_FAILURE);
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2007-05-09 16:04:59 +04:00
|
|
|
if (!IsConstructable(name_struct)) {
|
2003-01-22 06:22:35 +03:00
|
|
|
// ignore return value, we return JS_FALSE anyway
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2007-12-12 11:33:32 +03:00
|
|
|
return BaseStubConstructor(mWeakOwner, name_struct, cx, obj, argc, argv, vp);
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2005-12-09 22:52:04 +03:00
|
|
|
nsresult
|
2005-12-09 22:08:45 +03:00
|
|
|
nsDOMConstructor::HasInstance(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext * cx, JSObject * obj,
|
|
|
|
jsval v, PRBool *bp, PRBool *_retval)
|
|
|
|
|
2003-01-22 06:22:35 +03:00
|
|
|
{
|
2004-01-23 20:07:57 +03:00
|
|
|
// No need to look these up in the hash.
|
|
|
|
if (JSVAL_IS_PRIMITIVE(v)) {
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_OK;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2004-01-23 20:07:57 +03:00
|
|
|
JSObject *dom_obj = JSVAL_TO_OBJECT(v);
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ASSERTION(dom_obj, "nsDOMConstructor::HasInstance couldn't get object");
|
2004-01-23 20:07:57 +03:00
|
|
|
|
2005-05-23 01:30:15 +04:00
|
|
|
// This might not be the right object, if XPCNativeWrapping
|
|
|
|
// happened. Get the wrapped native for this object, then get its
|
|
|
|
// JS object.
|
2009-07-06 20:03:42 +04:00
|
|
|
JSObject *wrapped_obj;
|
|
|
|
nsresult rv = nsContentUtils::XPConnect()->GetJSObjectOfWrapper(cx, dom_obj,
|
|
|
|
&wrapped_obj);
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
dom_obj = wrapped_obj;
|
|
|
|
}
|
2005-05-23 01:30:15 +04:00
|
|
|
|
2003-01-31 15:10:13 +03:00
|
|
|
JSClass *dom_class = JS_GET_CLASS(cx, dom_obj);
|
2003-01-22 06:22:35 +03:00
|
|
|
if (!dom_class) {
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ERROR("nsDOMConstructor::HasInstance can't get class.");
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2007-05-09 16:04:59 +04:00
|
|
|
const nsGlobalNameStruct *name_struct;
|
2009-07-06 20:03:42 +04:00
|
|
|
rv = GetNameStruct(NS_ConvertASCIItoUTF16(dom_class->name), &name_struct);
|
2003-01-22 06:22:35 +03:00
|
|
|
if (!name_struct) {
|
2007-05-09 16:04:59 +04:00
|
|
|
return rv;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2007-02-08 19:11:41 +03:00
|
|
|
if (name_struct->mType != nsGlobalNameStruct::eTypeClassConstructor &&
|
|
|
|
name_struct->mType != nsGlobalNameStruct::eTypeExternalClassInfo &&
|
|
|
|
name_struct->mType != nsGlobalNameStruct::eTypeExternalConstructorAlias) {
|
|
|
|
// Doesn't have DOM interfaces.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2007-05-09 16:04:59 +04:00
|
|
|
const nsGlobalNameStruct *class_name_struct = GetNameStruct();
|
|
|
|
NS_ENSURE_TRUE(class_name_struct, NS_ERROR_FAILURE);
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2003-10-21 15:33:34 +04:00
|
|
|
if (name_struct == class_name_struct) {
|
|
|
|
*bp = JS_TRUE;
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_OK;
|
2003-10-21 15:33:34 +04:00
|
|
|
}
|
|
|
|
|
2007-11-13 13:35:49 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ASSERTION(nameSpaceManager, "Can't get namespace manager?");
|
2007-05-09 16:04:59 +04:00
|
|
|
|
2003-10-21 15:33:34 +04:00
|
|
|
const nsIID *class_iid;
|
|
|
|
if (class_name_struct->mType == nsGlobalNameStruct::eTypeInterface ||
|
|
|
|
class_name_struct->mType == nsGlobalNameStruct::eTypeClassProto) {
|
|
|
|
class_iid = &class_name_struct->mIID;
|
|
|
|
} else if (class_name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
|
|
|
class_iid =
|
|
|
|
sClassInfoData[class_name_struct->mDOMClassInfoID].mProtoChainInterface;
|
|
|
|
} else if (class_name_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
|
|
|
|
class_iid = class_name_struct->mData->mProtoChainInterface;
|
|
|
|
} else if (class_name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {
|
|
|
|
const nsGlobalNameStruct* alias_struct =
|
2007-11-13 13:35:49 +03:00
|
|
|
nameSpaceManager->GetConstructorProto(class_name_struct);
|
2003-10-21 15:33:34 +04:00
|
|
|
if (!alias_struct) {
|
|
|
|
NS_ERROR("Couldn't get constructor prototype.");
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
2003-10-21 15:33:34 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (alias_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
|
|
|
class_iid =
|
|
|
|
sClassInfoData[alias_struct->mDOMClassInfoID].mProtoChainInterface;
|
|
|
|
} else if (alias_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
|
|
|
|
class_iid = alias_struct->mData->mProtoChainInterface;
|
|
|
|
} else {
|
|
|
|
NS_ERROR("Expected eTypeClassConstructor or eTypeExternalClassInfo.");
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
2003-10-21 15:33:34 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
*bp = JS_FALSE;
|
2003-01-22 06:22:35 +03:00
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_OK;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {
|
2007-11-13 13:35:49 +03:00
|
|
|
name_struct = nameSpaceManager->GetConstructorProto(name_struct);
|
2003-01-22 06:22:35 +03:00
|
|
|
if (!name_struct) {
|
|
|
|
NS_ERROR("Couldn't get constructor prototype.");
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_ASSERTION(name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor ||
|
|
|
|
name_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo,
|
|
|
|
"The constructor was set up with a struct of the wrong type.");
|
|
|
|
|
|
|
|
const nsDOMClassInfoData *ci_data = nsnull;
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor &&
|
|
|
|
name_struct->mDOMClassInfoID >= 0) {
|
|
|
|
ci_data = &sClassInfoData[name_struct->mDOMClassInfoID];
|
|
|
|
} else if (name_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
|
|
|
|
ci_data = name_struct->mData;
|
|
|
|
}
|
|
|
|
|
2005-11-10 19:19:44 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfoManager>
|
|
|
|
iim(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
|
2003-01-22 06:22:35 +03:00
|
|
|
if (!iim) {
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ERROR("nsDOMConstructor::HasInstance can't get interface info mgr.");
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIInterfaceInfo> if_info;
|
|
|
|
PRUint32 count = 0;
|
|
|
|
const nsIID* class_interface;
|
|
|
|
while ((class_interface = ci_data->mInterfaces[count++])) {
|
2003-10-21 15:33:34 +04:00
|
|
|
if (class_iid->Equals(*class_interface)) {
|
2003-01-22 06:22:35 +03:00
|
|
|
*bp = JS_TRUE;
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_OK;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
iim->GetInfoForIID(class_interface, getter_AddRefs(if_info));
|
|
|
|
if (!if_info) {
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ERROR("nsDOMConstructor::HasInstance can't get interface info.");
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2003-10-21 15:33:34 +04:00
|
|
|
if_info->HasAncestor(class_iid, bp);
|
2003-01-22 06:22:35 +03:00
|
|
|
|
|
|
|
if (*bp) {
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_OK;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
return NS_OK;
|
2003-01-22 06:22:35 +03:00
|
|
|
}
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMConstructor::ToString(nsAString &aResult)
|
2003-01-22 06:22:35 +03:00
|
|
|
{
|
2005-12-10 04:08:51 +03:00
|
|
|
aResult.AssignLiteral("[object ");
|
2005-12-09 22:08:45 +03:00
|
|
|
aResult.Append(mClassName);
|
|
|
|
aResult.Append(PRUnichar(']'));
|
2003-01-22 06:22:35 +03:00
|
|
|
|
|
|
|
return NS_OK;
|
2001-07-11 13:09:30 +04:00
|
|
|
}
|
|
|
|
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
static nsresult
|
2009-06-03 19:30:18 +04:00
|
|
|
GetXPCProto(nsIXPConnect *aXPConnect, JSContext *cx, nsGlobalWindow *aWin,
|
|
|
|
const nsGlobalNameStruct *aNameStruct,
|
|
|
|
nsIXPConnectJSObjectHolder **aProto)
|
2009-03-24 14:02:30 +03:00
|
|
|
{
|
2009-06-03 19:30:18 +04:00
|
|
|
NS_ASSERTION(aNameStruct->mType ==
|
2009-03-24 14:02:30 +03:00
|
|
|
nsGlobalNameStruct::eTypeClassConstructor ||
|
2009-06-03 19:30:18 +04:00
|
|
|
aNameStruct->mType == nsGlobalNameStruct::eTypeExternalClassInfo,
|
2009-03-24 14:02:30 +03:00
|
|
|
"Wrong type!");
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
nsCOMPtr<nsIClassInfo> ci;
|
|
|
|
if (aNameStruct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
|
|
|
PRInt32 id = aNameStruct->mDOMClassInfoID;
|
|
|
|
NS_ABORT_IF_FALSE(id >= 0, "Negative DOM classinfo?!?");
|
2003-01-31 15:10:13 +03:00
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
nsDOMClassInfoID ci_id = (nsDOMClassInfoID)id;
|
2005-12-09 22:08:45 +03:00
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
ci = NS_GetDOMClassInfoInstance(ci_id);
|
|
|
|
|
|
|
|
// In most cases we want to find the wrapped native prototype in
|
|
|
|
// aWin's scope and use that prototype for
|
|
|
|
// ClassName.prototype. But in the case where we're setting up
|
|
|
|
// "Window.prototype" or "ChromeWindow.prototype" we want to do
|
|
|
|
// the look up in aWin's outer window's scope since the inner
|
|
|
|
// window's wrapped native prototype comes from the outer
|
|
|
|
// window's scope.
|
|
|
|
if (ci_id == eDOMClassInfo_Window_id ||
|
|
|
|
ci_id == eDOMClassInfo_ModalContentWindow_id ||
|
|
|
|
ci_id == eDOMClassInfo_ChromeWindow_id) {
|
|
|
|
nsGlobalWindow *scopeWindow = aWin->GetOuterWindowInternal();
|
|
|
|
|
|
|
|
if (scopeWindow) {
|
|
|
|
aWin = scopeWindow;
|
|
|
|
}
|
2009-03-24 14:02:30 +03:00
|
|
|
}
|
2009-03-26 17:53:33 +03:00
|
|
|
}
|
2009-06-03 19:30:18 +04:00
|
|
|
else {
|
|
|
|
ci = nsDOMClassInfo::GetClassInfoInstance(aNameStruct->mData);
|
|
|
|
}
|
|
|
|
NS_ENSURE_TRUE(ci, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
return aXPConnect->GetWrappedNativePrototype(cx, aWin->GetGlobalJSObject(),
|
|
|
|
ci, aProto);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Either ci_data must be non-null or name_struct must be non-null and of type
|
|
|
|
// eTypeClassProto.
|
|
|
|
static nsresult
|
|
|
|
ResolvePrototype(nsIXPConnect *aXPConnect, nsGlobalWindow *aWin, JSContext *cx,
|
|
|
|
JSObject *obj, const PRUnichar *name,
|
|
|
|
const nsDOMClassInfoData *ci_data,
|
|
|
|
const nsGlobalNameStruct *name_struct,
|
|
|
|
nsScriptNameSpaceManager *nameSpaceManager,
|
2009-06-24 10:30:11 +04:00
|
|
|
JSObject *dot_prototype, PRBool install, PRBool *did_resolve)
|
2009-06-03 19:30:18 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(ci_data ||
|
|
|
|
(name_struct &&
|
|
|
|
name_struct->mType == nsGlobalNameStruct::eTypeClassProto),
|
|
|
|
"Wrong type or missing ci_data!");
|
2003-11-12 17:25:03 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsRefPtr<nsDOMConstructor> constructor;
|
2009-06-03 19:30:18 +04:00
|
|
|
nsresult rv = nsDOMConstructor::Create(name, ci_data, name_struct, aWin,
|
2009-03-24 14:02:30 +03:00
|
|
|
getter_AddRefs(constructor));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2003-11-12 17:25:03 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
|
|
|
jsval v;
|
2005-12-09 22:08:45 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
rv = nsDOMClassInfo::WrapNative(cx, obj, constructor,
|
2009-05-21 12:17:51 +04:00
|
|
|
&NS_GET_IID(nsIDOMDOMConstructor),
|
|
|
|
PR_FALSE, &v, getter_AddRefs(holder));
|
2009-03-24 14:02:30 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-06-24 10:30:11 +04:00
|
|
|
if (install) {
|
|
|
|
rv = constructor->Install(cx, obj, v);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
JSObject *class_obj;
|
|
|
|
holder->GetJSObject(&class_obj);
|
|
|
|
NS_ASSERTION(class_obj, "The return value lied");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
const nsIID *primary_iid = &NS_GET_IID(nsISupports);
|
2002-08-30 12:48:58 +04:00
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
if (!ci_data) {
|
2009-03-24 14:02:30 +03:00
|
|
|
primary_iid = &name_struct->mIID;
|
2009-06-03 19:30:18 +04:00
|
|
|
}
|
|
|
|
else if (ci_data->mProtoChainInterface) {
|
2009-03-24 14:02:30 +03:00
|
|
|
primary_iid = ci_data->mProtoChainInterface;
|
|
|
|
}
|
2005-12-09 22:08:45 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfo> if_info;
|
|
|
|
nsCOMPtr<nsIInterfaceInfo> parent;
|
|
|
|
const char *class_parent_name = nsnull;
|
2003-11-12 17:25:03 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (!primary_iid->Equals(NS_GET_IID(nsISupports))) {
|
|
|
|
rv = DefineInterfaceConstants(cx, class_obj, primary_iid);
|
2009-03-26 17:53:33 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2005-12-09 22:08:45 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
// Special case for |Node|, which needs constants from Node3
|
|
|
|
// too for forwards compatibility.
|
|
|
|
if (primary_iid->Equals(NS_GET_IID(nsIDOMNode))) {
|
|
|
|
rv = DefineInterfaceConstants(cx, class_obj,
|
|
|
|
&NS_GET_IID(nsIDOM3Node));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
2003-11-12 17:25:03 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
// Special case for |Event|, Event needs constants from NSEvent
|
|
|
|
// too for backwards compatibility.
|
|
|
|
if (primary_iid->Equals(NS_GET_IID(nsIDOMEvent))) {
|
|
|
|
rv = DefineInterfaceConstants(cx, class_obj,
|
|
|
|
&NS_GET_IID(nsIDOMNSEvent));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
2003-11-12 17:25:03 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsCOMPtr<nsIInterfaceInfoManager>
|
|
|
|
iim(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
|
|
|
|
NS_ENSURE_TRUE(iim, NS_ERROR_NOT_AVAILABLE);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
iim->GetInfoForIID(primary_iid, getter_AddRefs(if_info));
|
|
|
|
NS_ENSURE_TRUE(if_info, NS_ERROR_UNEXPECTED);
|
2005-12-09 22:08:45 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
const nsIID *iid = nsnull;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (ci_data && !ci_data->mHasClassInterface) {
|
|
|
|
if_info->GetIIDShared(&iid);
|
|
|
|
} else {
|
|
|
|
if_info->GetParent(getter_AddRefs(parent));
|
|
|
|
NS_ENSURE_TRUE(parent, NS_ERROR_UNEXPECTED);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
parent->GetIIDShared(&iid);
|
2009-03-26 17:53:33 +03:00
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (iid) {
|
|
|
|
if (!iid->Equals(NS_GET_IID(nsISupports))) {
|
|
|
|
if (ci_data && !ci_data->mHasClassInterface) {
|
|
|
|
// If the class doesn't have a class interface the primary
|
|
|
|
// interface is the interface that should be
|
|
|
|
// constructor.prototype.__proto__.
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if_info->GetNameShared(&class_parent_name);
|
|
|
|
} else {
|
|
|
|
// If the class does have a class interface (or there's no
|
|
|
|
// real class for this name) then the parent of the
|
|
|
|
// primary interface is what we want on
|
|
|
|
// constructor.prototype.__proto__.
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
NS_ASSERTION(parent, "Whoa, this is bad, null parent here!");
|
2003-06-12 06:54:16 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
parent->GetNameShared(&class_parent_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-12-06 09:57:03 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
JSObject *proto = nsnull;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (class_parent_name) {
|
|
|
|
jsval val;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (!::JS_LookupProperty(cx, obj, CutPrefix(class_parent_name), &val)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
JSObject *tmp = JSVAL_IS_OBJECT(val) ? JSVAL_TO_OBJECT(val) : nsnull;
|
2001-11-07 10:52:41 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (tmp) {
|
|
|
|
if (!::JS_LookupProperty(cx, tmp, "prototype", &val)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (JSVAL_IS_OBJECT(val)) {
|
|
|
|
proto = JSVAL_TO_OBJECT(val);
|
|
|
|
}
|
2009-03-26 17:53:33 +03:00
|
|
|
}
|
2009-03-24 14:02:30 +03:00
|
|
|
}
|
2001-11-07 10:52:41 +03:00
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
if (dot_prototype) {
|
2009-03-24 14:02:30 +03:00
|
|
|
JSObject *xpc_proto_proto = ::JS_GetPrototype(cx, dot_prototype);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (proto &&
|
|
|
|
(!xpc_proto_proto ||
|
2009-07-01 23:27:24 +04:00
|
|
|
JS_GET_CLASS(cx, xpc_proto_proto) == sObjectClass)) {
|
2009-03-24 14:02:30 +03:00
|
|
|
if (!::JS_SetPrototype(cx, dot_prototype, proto)) {
|
2009-03-26 17:53:33 +03:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2009-03-24 14:02:30 +03:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
dot_prototype = ::JS_NewObject(cx, &sDOMConstructorProtoClass, proto,
|
|
|
|
obj);
|
|
|
|
NS_ENSURE_TRUE(dot_prototype, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
}
|
2009-03-24 14:02:30 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
v = OBJECT_TO_JSVAL(dot_prototype);
|
2002-08-30 12:48:58 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
// Per ECMA, the prototype property is {DontEnum, DontDelete, ReadOnly}
|
|
|
|
if (!::JS_DefineProperty(cx, class_obj, "prototype", v, nsnull, nsnull,
|
|
|
|
JSPROP_PERMANENT | JSPROP_READONLY)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
*did_resolve = PR_TRUE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx,
|
|
|
|
JSObject *obj, JSString *str, PRBool *did_resolve)
|
|
|
|
{
|
|
|
|
*did_resolve = PR_FALSE;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsScriptNameSpaceManager *nameSpaceManager = nsJSRuntime::GetNameSpaceManager();
|
|
|
|
NS_ENSURE_TRUE(nameSpaceManager, NS_ERROR_NOT_INITIALIZED);
|
2005-09-02 03:02:57 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsDependentJSString name(str);
|
2005-09-02 03:02:57 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
const nsGlobalNameStruct *name_struct = nsnull;
|
|
|
|
const PRUnichar *class_name = nsnull;
|
2005-09-02 03:02:57 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nameSpaceManager->LookupName(name, &name_struct, &class_name);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (!name_struct) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
NS_ENSURE_TRUE(class_name, NS_ERROR_UNEXPECTED);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsresult rv = NS_OK;
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfoCreator) {
|
|
|
|
rv = GetExternalClassInfo(nameSpaceManager, name, name_struct,
|
|
|
|
&name_struct);
|
|
|
|
if (NS_FAILED(rv) || !name_struct) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
}
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeInterface) {
|
|
|
|
// We're resolving a name of a DOM interface for which there is no
|
|
|
|
// direct DOM class, create a constructor object...
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsRefPtr<nsDOMConstructor> constructor;
|
2009-06-03 19:30:18 +04:00
|
|
|
rv = nsDOMConstructor::Create(class_name,
|
|
|
|
nsnull,
|
2009-03-24 14:02:30 +03:00
|
|
|
name_struct,
|
|
|
|
static_cast<nsPIDOMWindow*>(aWin),
|
|
|
|
getter_AddRefs(constructor));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2002-03-04 05:25:08 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
|
|
|
jsval v;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, constructor, &NS_GET_IID(nsIDOMDOMConstructor),
|
|
|
|
PR_FALSE, &v, getter_AddRefs(holder));
|
2009-03-24 14:02:30 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2009-03-24 16:47:01 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
rv = constructor->Install(cx, obj, v);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2009-03-24 14:02:30 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
JSObject *class_obj;
|
|
|
|
holder->GetJSObject(&class_obj);
|
|
|
|
NS_ASSERTION(class_obj, "The return value lied");
|
2009-03-26 17:53:33 +03:00
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
// ... and define the constants from the DOM interface on that
|
|
|
|
// constructor object.
|
|
|
|
|
|
|
|
rv = DefineInterfaceConstants(cx, class_obj, &name_struct->mIID);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2001-07-11 13:09:30 +04:00
|
|
|
|
|
|
|
*did_resolve = PR_TRUE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-03-24 14:02:30 +03:00
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor ||
|
2009-06-03 19:30:18 +04:00
|
|
|
name_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
|
|
|
|
// Create the XPConnect prototype for our classinfo, PostCreateProto will
|
|
|
|
// set up the prototype chain.
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> proto_holder;
|
|
|
|
rv = GetXPCProto(sXPConnect, cx, aWin, name_struct,
|
|
|
|
getter_AddRefs(proto_holder));
|
|
|
|
|
2009-07-22 22:50:24 +04:00
|
|
|
if (NS_SUCCEEDED(rv) && obj != aWin->GetGlobalJSObject()) {
|
|
|
|
JSObject* dot_prototype;
|
|
|
|
rv = proto_holder->GetJSObject(&dot_prototype);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
const nsDOMClassInfoData *ci_data;
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
|
|
|
ci_data = &sClassInfoData[name_struct->mDOMClassInfoID];
|
|
|
|
} else {
|
|
|
|
ci_data = name_struct->mData;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ResolvePrototype(sXPConnect, aWin, cx, obj, class_name, ci_data,
|
|
|
|
name_struct, nameSpaceManager, dot_prototype,
|
|
|
|
PR_TRUE, did_resolve);
|
|
|
|
}
|
|
|
|
|
2009-06-03 19:30:18 +04:00
|
|
|
*did_resolve = NS_SUCCEEDED(rv);
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeClassProto) {
|
|
|
|
// We don't have a XPConnect prototype object, let ResolvePrototype create
|
|
|
|
// one.
|
|
|
|
return ResolvePrototype(sXPConnect, aWin, cx, obj, class_name, nsnull,
|
2009-06-24 10:30:11 +04:00
|
|
|
name_struct, nameSpaceManager, nsnull, PR_TRUE,
|
|
|
|
did_resolve);
|
2009-06-03 19:30:18 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructorAlias) {
|
|
|
|
const nsGlobalNameStruct *alias_struct =
|
|
|
|
nameSpaceManager->GetConstructorProto(name_struct);
|
|
|
|
NS_ENSURE_TRUE(alias_struct, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
// We need to use the XPConnect prototype for the DOM class that this
|
|
|
|
// constructor is an alias for (for example for Image we need the prototype
|
|
|
|
// for HTMLImageElement).
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> proto_holder;
|
|
|
|
rv = GetXPCProto(sXPConnect, cx, aWin, alias_struct,
|
|
|
|
getter_AddRefs(proto_holder));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
JSObject* dot_prototype;
|
|
|
|
rv = proto_holder->GetJSObject(&dot_prototype);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
const nsDOMClassInfoData *ci_data;
|
|
|
|
if (alias_struct->mType == nsGlobalNameStruct::eTypeClassConstructor) {
|
|
|
|
ci_data = &sClassInfoData[alias_struct->mDOMClassInfoID];
|
|
|
|
} else if (alias_struct->mType == nsGlobalNameStruct::eTypeExternalClassInfo) {
|
|
|
|
ci_data = alias_struct->mData;
|
|
|
|
} else {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ResolvePrototype(sXPConnect, aWin, cx, obj, class_name, ci_data,
|
2009-06-24 10:30:11 +04:00
|
|
|
name_struct, nameSpaceManager, nsnull, PR_TRUE,
|
|
|
|
did_resolve);
|
2009-03-24 14:02:30 +03:00
|
|
|
}
|
|
|
|
|
2001-07-11 13:09:30 +04:00
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeExternalConstructor) {
|
2008-02-27 05:03:27 +03:00
|
|
|
nsRefPtr<nsDOMConstructor> constructor;
|
2009-06-03 19:30:18 +04:00
|
|
|
rv = nsDOMConstructor::Create(class_name, nsnull, name_struct,
|
2008-02-27 05:03:27 +03:00
|
|
|
static_cast<nsPIDOMWindow*>(aWin),
|
|
|
|
getter_AddRefs(constructor));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
jsval val;
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2008-12-16 18:46:18 +03:00
|
|
|
rv = WrapNative(cx, obj, constructor, &NS_GET_IID(nsIDOMDOMConstructor),
|
2009-05-21 12:17:51 +04:00
|
|
|
PR_FALSE, &val, getter_AddRefs(holder));
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
rv = constructor->Install(cx, obj, val);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
JSObject* class_obj;
|
|
|
|
holder->GetJSObject(&class_obj);
|
|
|
|
NS_ASSERTION(class_obj, "Why didn't we get a JSObject?");
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
*did_resolve = PR_TRUE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeProperty) {
|
2007-06-26 18:44:20 +04:00
|
|
|
if (name_struct->mPrivilegedOnly && !nsContentUtils::IsCallerChrome())
|
|
|
|
return NS_OK;
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsCOMPtr<nsISupports> native(do_CreateInstance(name_struct->mCID, &rv));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2003-06-25 01:47:33 +04:00
|
|
|
jsval prop_val; // Property value.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsCOMPtr<nsIScriptObjectOwner> owner(do_QueryInterface(native));
|
|
|
|
if (owner) {
|
2004-02-10 01:48:53 +03:00
|
|
|
nsIScriptContext *context = nsJSUtils::GetStaticScriptContext(cx, obj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(context, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSObject *prop_obj = nsnull;
|
|
|
|
rv = owner->GetScriptObject(context, (void**)&prop_obj);
|
|
|
|
NS_ENSURE_TRUE(prop_obj, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
prop_val = OBJECT_TO_JSVAL(prop_obj);
|
|
|
|
} else {
|
2005-08-12 08:11:00 +04:00
|
|
|
JSObject *scope;
|
|
|
|
|
|
|
|
if (aWin->IsOuterWindow()) {
|
|
|
|
nsGlobalWindow *inner = aWin->GetCurrentInnerWindowInternal();
|
|
|
|
NS_ENSURE_TRUE(inner, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
scope = inner->GetGlobalJSObject();
|
|
|
|
} else {
|
|
|
|
scope = aWin->GetGlobalJSObject();
|
|
|
|
}
|
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, scope, native, PR_TRUE, &prop_val,
|
|
|
|
getter_AddRefs(holder));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2005-08-17 10:01:42 +04:00
|
|
|
JSBool ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str),
|
|
|
|
prop_val, nsnull, nsnull,
|
|
|
|
JSPROP_ENUMERATE);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
*did_resolve = PR_TRUE;
|
|
|
|
|
2005-08-17 10:01:42 +04:00
|
|
|
return ok ? NS_OK : NS_ERROR_FAILURE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (name_struct->mType == nsGlobalNameStruct::eTypeDynamicNameSet) {
|
|
|
|
nsCOMPtr<nsIScriptExternalNameSet> nameset =
|
|
|
|
do_CreateInstance(name_struct->mCID, &rv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
nsIScriptContext *context = aWin->GetContext();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(context, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
rv = nameset->InitializeNameSet(context);
|
|
|
|
|
|
|
|
*did_resolve = PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2005-09-14 07:22:27 +04:00
|
|
|
// Native code for window._content getter, this simply maps
|
|
|
|
// window._content to window.content for backwards compatibility only.
|
2008-09-07 02:21:43 +04:00
|
|
|
static JSBool
|
2005-09-14 07:22:27 +04:00
|
|
|
ContentWindowGetter(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|
|
|
jsval *rval)
|
|
|
|
{
|
|
|
|
return ::JS_GetProperty(cx, obj, "content", rval);
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
2005-07-31 00:57:07 +04:00
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
{
|
|
|
|
nsDependentJSString str(::JS_ValueToString(cx, id));
|
|
|
|
|
|
|
|
if (win->IsInnerWindow()) {
|
|
|
|
#ifdef DEBUG_PRINT_INNER
|
|
|
|
printf("Property '%s' resolve on inner window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
printf("Property '%s' resolve on outer window %p\n",
|
|
|
|
NS_ConvertUTF16toUTF8(str).get(), (void *)win);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Note, we won't forward resolve of the location property to the
|
|
|
|
// inner window, we need to deal with that one for the outer too
|
|
|
|
// since we've got special security protection code for that
|
2006-09-07 06:53:58 +04:00
|
|
|
// property. Also note that we want to enter this block even for
|
|
|
|
// native wrappers, so that we'll ensure an inner window to wrap
|
|
|
|
// against for the result of whatever we're getting.
|
|
|
|
if (win->IsOuterWindow() && id != sLocation_id) {
|
2005-07-31 00:57:07 +04:00
|
|
|
// XXXjst: Do security checks here when we remove the security
|
|
|
|
// checks on the inner window.
|
|
|
|
|
|
|
|
nsGlobalWindow *innerWin = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
2006-11-17 04:06:41 +03:00
|
|
|
if ((!innerWin || !innerWin->GetExtantDocument()) &&
|
|
|
|
!win->IsCreatingInnerWindow()) {
|
2005-07-31 00:57:07 +04:00
|
|
|
// We're resolving a property on an outer window for which there
|
2006-11-17 04:06:41 +03:00
|
|
|
// is no inner window yet, and we're not in the midst of
|
|
|
|
// creating the inner window or in the middle of initializing
|
|
|
|
// XPConnect classes on it. If the context is already
|
|
|
|
// initialized, force creation of a new inner window. This will
|
|
|
|
// create a synthetic about:blank document, and an inner window
|
|
|
|
// which may be reused by the actual document being loaded into
|
|
|
|
// this outer window. This way properties defined on the window
|
|
|
|
// before the document load started will be visible to the
|
|
|
|
// document once it's loaded, assuming same origin etc.
|
2005-07-31 00:57:07 +04:00
|
|
|
nsIScriptContext *scx = win->GetContextInternal();
|
|
|
|
|
|
|
|
if (scx && scx->IsContextInitialized()) {
|
|
|
|
// Grab the new inner window.
|
2005-12-11 23:38:29 +03:00
|
|
|
innerWin = win->EnsureInnerWindowInternal();
|
2005-08-12 08:11:00 +04:00
|
|
|
|
|
|
|
if (!innerWin) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
2005-07-31 00:57:07 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *innerObj;
|
2007-08-26 00:11:34 +04:00
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
if (realObj == obj &&
|
2006-09-07 06:53:58 +04:00
|
|
|
innerWin && (innerObj = innerWin->GetGlobalJSObject())) {
|
2005-07-31 00:57:07 +04:00
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
printf(" --- Forwarding resolve to inner window %p\n", (void *)innerWin);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
jsid interned_id;
|
2008-09-25 20:13:31 +04:00
|
|
|
JSObject *pobj = NULL;
|
|
|
|
jsval val;
|
2005-07-31 00:57:07 +04:00
|
|
|
|
|
|
|
*_retval = (::JS_ValueToId(cx, id, &interned_id) &&
|
2008-10-24 21:09:09 +04:00
|
|
|
::JS_LookupPropertyWithFlagsById(cx, innerObj, interned_id,
|
2008-09-25 20:13:31 +04:00
|
|
|
flags, &pobj, &val));
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2008-09-25 20:13:31 +04:00
|
|
|
if (*_retval && pobj) {
|
2005-07-31 00:57:07 +04:00
|
|
|
#ifdef DEBUG_SH_FORWARDING
|
|
|
|
printf(" --- Resolve on inner window found property.\n");
|
|
|
|
#endif
|
|
|
|
*objp = pobj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-05-26 23:39:49 +04:00
|
|
|
if (!JSVAL_IS_STRING(id)) {
|
|
|
|
if (JSVAL_IS_INT(id) && !(flags & JSRESOLVE_ASSIGNING)) {
|
|
|
|
// If we're resolving a numeric property, treat that as if
|
|
|
|
// window.frames[n] is resolved (since window.frames ===
|
|
|
|
// window), if window.frames[n] is a child frame, define a
|
|
|
|
// property for this index.
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
nsCOMPtr<nsIDOMWindow> frame = GetChildFrame(win, id);
|
2005-05-26 23:39:49 +04:00
|
|
|
|
|
|
|
if (frame) {
|
|
|
|
// A numeric property accessed and the numeric property is a
|
|
|
|
// child frame. Define a property for this index.
|
|
|
|
|
|
|
|
*_retval = ::JS_DefineElement(cx, obj, JSVAL_TO_INT(id), JSVAL_VOID,
|
|
|
|
nsnull, nsnull, 0);
|
|
|
|
|
|
|
|
if (*_retval) {
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_OK;
|
2005-05-26 23:39:49 +04:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
nsIScriptContext *my_context = win->GetContextInternal();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
nsresult rv = NS_OK;
|
2001-07-11 13:09:30 +04:00
|
|
|
|
2006-06-27 01:22:12 +04:00
|
|
|
// Resolve standard classes on my_context's JSContext (or on cx,
|
|
|
|
// if we don't have a my_context yet), in case the two contexts
|
|
|
|
// have different origins. We want lazy standard class
|
|
|
|
// initialization to behave as if it were done eagerly, on each
|
|
|
|
// window's own context (not on some other window-caller's
|
|
|
|
// context).
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
JSBool did_resolve = JS_FALSE;
|
2006-06-27 01:22:12 +04:00
|
|
|
JSContext *my_cx;
|
2005-04-22 01:05:10 +04:00
|
|
|
|
2006-06-27 01:22:12 +04:00
|
|
|
if (!my_context) {
|
|
|
|
my_cx = cx;
|
|
|
|
} else {
|
|
|
|
my_cx = (JSContext *)my_context->GetNativeContext();
|
|
|
|
}
|
2003-05-31 22:43:48 +04:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
JSBool ok;
|
|
|
|
jsval exn;
|
|
|
|
{
|
|
|
|
JSAutoSuspendRequest asr(my_cx != cx ? cx : nsnull);
|
|
|
|
{
|
|
|
|
JSAutoRequest ar(my_cx);
|
2006-01-21 05:59:22 +03:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
2003-05-31 22:43:48 +04:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
// Don't resolve standard classes on XPCNativeWrapper etc, only
|
|
|
|
// resolve them if we're resolving on the real global object.
|
|
|
|
ok = obj == realObj ?
|
|
|
|
::JS_ResolveStandardClass(my_cx, obj, id, &did_resolve) :
|
|
|
|
JS_TRUE;
|
2008-03-18 23:42:19 +03:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
if (!ok) {
|
|
|
|
// Trust the JS engine (or the script security manager) to set
|
|
|
|
// the exception in the JS engine.
|
2006-01-21 05:59:22 +03:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
if (!JS_GetPendingException(my_cx, &exn)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2006-01-21 05:59:22 +03:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
// Return NS_OK to avoid stomping over the exception that was passed
|
|
|
|
// down from the ResolveStandardClass call.
|
|
|
|
// Note that the order of the JS_ClearPendingException and
|
|
|
|
// JS_SetPendingException is important in the case that my_cx == cx.
|
2006-01-21 05:59:22 +03:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
JS_ClearPendingException(my_cx);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-01-21 05:59:22 +03:00
|
|
|
|
2008-08-14 23:07:08 +04:00
|
|
|
if (!ok) {
|
2006-06-27 01:22:12 +04:00
|
|
|
JS_SetPendingException(cx, exn);
|
|
|
|
*_retval = JS_FALSE;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2003-05-31 22:43:48 +04:00
|
|
|
|
2006-06-27 01:22:12 +04:00
|
|
|
if (did_resolve) {
|
|
|
|
*objp = obj;
|
2003-05-31 22:43:48 +04:00
|
|
|
|
2006-06-27 01:22:12 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2003-05-31 22:43:48 +04:00
|
|
|
|
2006-06-27 01:22:12 +04:00
|
|
|
if (!(flags & JSRESOLVE_ASSIGNING)) {
|
2005-03-10 03:39:28 +03:00
|
|
|
// We want this code to be before the child frame lookup code
|
|
|
|
// below so that a child frame named 'constructor' doesn't
|
|
|
|
// shadow the window's constructor property.
|
|
|
|
if (id == sConstructor_id) {
|
|
|
|
return ResolveConstructor(cx, obj, objp);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2005-03-10 03:39:28 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-04-22 01:05:10 +04:00
|
|
|
if (!my_context || !my_context->IsContextInitialized()) {
|
|
|
|
// The context is not yet initialized so there's nothing we can do
|
|
|
|
// here yet.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
// Hmm, we do an awful lot of QIs here; maybe we should add a
|
|
|
|
// method on an interface that would let us just call into the
|
|
|
|
// window code directly...
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
// Don't resolve named frames on native wrappers
|
|
|
|
if (!ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
nsCOMPtr<nsIDocShellTreeNode> dsn(do_QueryInterface(win->GetDocShell()));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
PRInt32 count = 0;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
if (dsn) {
|
|
|
|
dsn->GetChildCount(&count);
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
if (count > 0) {
|
|
|
|
nsCOMPtr<nsIDocShellTreeItem> child;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
const jschar *chars = ::JS_GetStringChars(str);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2007-07-08 11:08:04 +04:00
|
|
|
dsn->FindChildWithName(reinterpret_cast<const PRUnichar*>(chars),
|
2005-08-19 19:12:36 +04:00
|
|
|
PR_FALSE, PR_TRUE, nsnull, nsnull,
|
|
|
|
getter_AddRefs(child));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
nsCOMPtr<nsIDOMWindow> child_win(do_GetInterface(child));
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
if (child_win) {
|
|
|
|
// We found a subframe of the right name, define the property
|
|
|
|
// on the wrapper so that ::NewResolve() doesn't get called
|
|
|
|
// again for this property name.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
JSObject *wrapperObj;
|
|
|
|
wrapper->GetJSObject(&wrapperObj);
|
2001-12-12 00:07:36 +03:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
jsval v;
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2005-08-19 19:12:36 +04:00
|
|
|
rv = WrapNative(cx, wrapperObj, child_win,
|
2009-05-21 12:17:51 +04:00
|
|
|
&NS_GET_IID(nsIDOMWindowInternal), PR_TRUE, &v,
|
2005-09-07 06:56:15 +04:00
|
|
|
getter_AddRefs(holder));
|
2005-08-19 19:12:36 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2001-12-12 00:07:36 +03:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
if (!win->IsChromeWindow()) {
|
|
|
|
NS_ASSERTION(JSVAL_IS_OBJECT(v) &&
|
|
|
|
!strcmp(STOBJ_GET_CLASS(JSVAL_TO_OBJECT(v))->name,
|
|
|
|
"XPCCrossOriginWrapper"),
|
|
|
|
"Didn't wrap a window!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2007-07-26 23:18:06 +04:00
|
|
|
PRBool ok = ::JS_DefineUCProperty(cx, obj, chars,
|
|
|
|
::JS_GetStringLength(str),
|
|
|
|
v, nsnull, nsnull, 0);
|
2005-08-19 19:12:36 +04:00
|
|
|
|
|
|
|
if (!ok) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2001-12-12 00:07:36 +03:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
*objp = obj;
|
2001-12-12 00:07:36 +03:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
return NS_OK;
|
2005-03-10 03:39:28 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2005-03-10 03:39:28 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
// It is not worth calling GlobalResolve() if we are resolving
|
|
|
|
// for assignment, since only read-write properties get dealt
|
|
|
|
// with there.
|
|
|
|
if (!(flags & JSRESOLVE_ASSIGNING)) {
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
// Call GlobalResolve() after we call FindChildWithName() so
|
|
|
|
// that named child frames will override external properties
|
|
|
|
// which have been registered with the script namespace manager.
|
2003-12-05 05:35:48 +03:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
JSBool did_resolve = JS_FALSE;
|
2009-03-24 14:02:30 +03:00
|
|
|
rv = GlobalResolve(win, cx, obj, str, &did_resolve);
|
2005-03-10 03:39:28 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2003-12-05 05:35:48 +03:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (did_resolve) {
|
|
|
|
// GlobalResolve() resolved something, so we're done here.
|
|
|
|
*objp = obj;
|
2003-12-05 05:35:48 +03:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_OK;
|
2003-12-05 05:35:48 +03:00
|
|
|
}
|
2005-03-10 03:39:28 +03:00
|
|
|
}
|
2003-12-05 05:35:48 +03:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (id == s_content_id) {
|
|
|
|
// Map window._content to window.content for backwards
|
|
|
|
// compatibility, this should spit out an message on the JS
|
|
|
|
// console.
|
2005-09-14 07:22:27 +04:00
|
|
|
|
|
|
|
JSObject *windowObj = win->GetGlobalJSObject();
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-09-14 07:22:27 +04:00
|
|
|
JSFunction *fun = ::JS_NewFunction(cx, ContentWindowGetter, 0, 0,
|
|
|
|
windowObj, "_content");
|
|
|
|
if (!fun) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *funObj = ::JS_GetFunctionObject(fun);
|
|
|
|
|
2006-04-04 06:39:12 +04:00
|
|
|
nsAutoGCRoot root(&funObj, &rv);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2005-09-14 07:22:27 +04:00
|
|
|
if (!::JS_DefineUCProperty(cx, windowObj, ::JS_GetStringChars(str),
|
2005-03-10 03:39:28 +03:00
|
|
|
::JS_GetStringLength(str), JSVAL_VOID,
|
2009-03-11 01:21:25 +03:00
|
|
|
JS_DATA_TO_FUNC_PTR(JSPropertyOp, funObj),
|
|
|
|
nsnull,
|
2005-03-10 03:39:28 +03:00
|
|
|
JSPROP_ENUMERATE | JSPROP_GETTER |
|
|
|
|
JSPROP_SHARED)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
*objp = obj;
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (id == sLocation_id) {
|
|
|
|
// This must be done even if we're just getting the value of
|
|
|
|
// window.location (i.e. no checking flags & JSRESOLVE_ASSIGNING
|
|
|
|
// here) since we must define window.location to prevent the
|
|
|
|
// getter from being overriden (for security reasons).
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
nsCOMPtr<nsIDOMLocation> location;
|
2005-07-31 00:57:07 +04:00
|
|
|
rv = win->GetLocation(getter_AddRefs(location));
|
2005-03-10 03:39:28 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
// Make sure we wrap the location object in the inner window's
|
|
|
|
// scope if we've got an inner window.
|
|
|
|
JSObject *scope = nsnull;
|
|
|
|
if (win->IsOuterWindow()) {
|
|
|
|
nsGlobalWindow *innerWin = win->GetCurrentInnerWindowInternal();
|
|
|
|
|
|
|
|
if (innerWin) {
|
|
|
|
scope = innerWin->GetGlobalJSObject();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!scope) {
|
2005-08-12 08:11:00 +04:00
|
|
|
wrapper->GetJSObject(&scope);
|
2005-07-31 00:57:07 +04:00
|
|
|
}
|
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-07-31 03:53:04 +04:00
|
|
|
jsval v;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, scope, location, &NS_GET_IID(nsIDOMLocation), PR_TRUE,
|
|
|
|
&v, getter_AddRefs(holder));
|
2005-03-10 03:39:28 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
#ifdef DEBUG
|
2009-05-21 14:54:41 +04:00
|
|
|
if (!win->IsChromeWindow()) {
|
2009-05-21 12:17:51 +04:00
|
|
|
NS_ASSERTION(JSVAL_IS_OBJECT(v) &&
|
|
|
|
!strcmp(STOBJ_GET_CLASS(JSVAL_TO_OBJECT(v))->name,
|
|
|
|
"XPCCrossOriginWrapper"),
|
|
|
|
"Didn't wrap a location object!");
|
2009-05-21 14:54:41 +04:00
|
|
|
}
|
2009-05-21 12:17:51 +04:00
|
|
|
#endif
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
JSBool ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
2007-08-29 04:28:32 +04:00
|
|
|
::JS_GetStringLength(str), v, nsnull,
|
|
|
|
nsnull, JSPROP_ENUMERATE);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (!ok) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-07-16 02:46:14 +04:00
|
|
|
if (id == sOnhashchange_id) {
|
|
|
|
// Special handling so |"onhashchange" in window| returns true
|
|
|
|
jsid interned_id;
|
|
|
|
|
|
|
|
if (!JS_ValueToId(cx, id, &interned_id) ||
|
|
|
|
!JS_DefinePropertyById(cx, obj, interned_id, JSVAL_VOID,
|
|
|
|
nsnull, nsnull, JSPROP_ENUMERATE)) {
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (flags & JSRESOLVE_ASSIGNING) {
|
|
|
|
if (IsReadonlyReplaceable(id) ||
|
|
|
|
(!(flags & JSRESOLVE_QUALIFIED) && IsWritableReplaceable(id))) {
|
|
|
|
// A readonly "replaceable" property is being set, or a
|
|
|
|
// readwrite "replaceable" property is being set w/o being
|
|
|
|
// fully qualified. Define the property on obj with the value
|
|
|
|
// undefined to override the predefined property. This is done
|
|
|
|
// for compatibility with other browsers.
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
2005-03-10 03:39:28 +03:00
|
|
|
|
|
|
|
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
2007-08-29 04:28:32 +04:00
|
|
|
::JS_GetStringLength(str),
|
2009-03-06 01:44:11 +03:00
|
|
|
JSVAL_VOID, JS_PropertyStub, JS_PropertyStub,
|
2007-08-29 04:28:32 +04:00
|
|
|
JSPROP_ENUMERATE)) {
|
2002-05-22 04:34:01 +04:00
|
|
|
return NS_ERROR_FAILURE;
|
2001-05-10 13:45:46 +04:00
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2005-03-10 03:39:28 +03:00
|
|
|
} else {
|
|
|
|
if (id == sNavigator_id) {
|
|
|
|
nsCOMPtr<nsIDOMNavigator> navigator;
|
2005-07-31 00:57:07 +04:00
|
|
|
rv = win->GetNavigator(getter_AddRefs(navigator));
|
2005-03-10 03:39:28 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2002-04-20 04:04:33 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
jsval v;
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, navigator, &NS_GET_IID(nsIDOMNavigator), PR_TRUE,
|
|
|
|
&v, getter_AddRefs(holder));
|
2005-03-10 03:39:28 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2002-04-20 04:04:33 +04:00
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
2006-07-13 22:27:35 +04:00
|
|
|
::JS_GetStringLength(str), v, nsnull, nsnull,
|
|
|
|
JSPROP_READONLY | JSPROP_PERMANENT |
|
|
|
|
JSPROP_ENUMERATE)) {
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
2002-04-20 04:04:33 +04:00
|
|
|
}
|
2005-03-10 03:39:28 +03:00
|
|
|
*objp = obj;
|
2002-04-20 04:04:33 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-05-10 13:45:46 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (id == sDocument_id) {
|
2005-07-31 00:57:07 +04:00
|
|
|
nsCOMPtr<nsIDOMDocument> document;
|
2005-12-03 10:42:40 +03:00
|
|
|
rv = win->GetDocument(getter_AddRefs(document));
|
2005-07-31 00:57:07 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2001-05-19 13:13:32 +04:00
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
jsval v;
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, document, &NS_GET_IID(nsIDOMDocument), PR_FALSE,
|
|
|
|
&v, getter_AddRefs(holder));
|
2005-03-10 03:39:28 +03:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2002-04-27 04:03:47 +04:00
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
// The PostCreate hook for the document will handle defining the
|
2005-09-07 06:56:15 +04:00
|
|
|
// property
|
|
|
|
*objp = obj;
|
2002-04-27 04:03:47 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2002-04-27 04:03:47 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
if (id == sWindow_id) {
|
2005-07-31 00:57:07 +04:00
|
|
|
// window should *always* be the outer window object.
|
2007-07-31 01:47:03 +04:00
|
|
|
nsGlobalWindow *oldWin = win;
|
2005-07-31 00:57:07 +04:00
|
|
|
win = win->GetOuterWindowInternal();
|
2005-08-12 08:11:00 +04:00
|
|
|
NS_ENSURE_TRUE(win, NS_ERROR_NOT_AVAILABLE);
|
2002-04-27 04:03:47 +04:00
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2007-07-26 23:18:06 +04:00
|
|
|
jsval winVal = OBJECT_TO_JSVAL(win->GetGlobalJSObject());
|
2007-08-03 03:34:38 +04:00
|
|
|
if (!win->IsChromeWindow()) {
|
2007-07-31 01:47:03 +04:00
|
|
|
JSObject *scope;
|
|
|
|
nsGlobalWindow *innerWin;
|
|
|
|
if (oldWin->IsInnerWindow()) {
|
|
|
|
scope = oldWin->GetGlobalJSObject();
|
|
|
|
} else if ((innerWin = oldWin->GetCurrentInnerWindowInternal())) {
|
|
|
|
scope = innerWin->GetGlobalJSObject();
|
|
|
|
} else {
|
|
|
|
NS_ERROR("I don't know what scope to use!");
|
|
|
|
scope = oldWin->GetGlobalJSObject();
|
|
|
|
}
|
|
|
|
|
2008-01-05 07:45:16 +03:00
|
|
|
rv = sXPConnect->GetXOWForObject(cx, scope, JSVAL_TO_OBJECT(winVal),
|
|
|
|
&winVal);
|
2007-07-26 23:18:06 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
2006-10-15 19:42:29 +04:00
|
|
|
PRBool ok =
|
|
|
|
::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str),
|
2009-05-21 02:39:02 +04:00
|
|
|
winVal, JS_PropertyStub, JS_PropertyStub,
|
2006-10-15 19:42:29 +04:00
|
|
|
JSPROP_READONLY | JSPROP_ENUMERATE);
|
|
|
|
|
|
|
|
if (!ok) {
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
2002-04-27 04:03:47 +04:00
|
|
|
}
|
2005-03-10 03:39:28 +03:00
|
|
|
*objp = obj;
|
2002-04-27 04:03:47 +04:00
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-10-10 05:24:28 +04:00
|
|
|
|
2009-04-10 06:38:21 +04:00
|
|
|
if (id == sJava_id || id == sPackages_id) {
|
2007-10-10 05:24:28 +04:00
|
|
|
static PRBool isResolvingJavaProperties;
|
|
|
|
|
|
|
|
if (!isResolvingJavaProperties) {
|
|
|
|
isResolvingJavaProperties = PR_TRUE;
|
|
|
|
|
|
|
|
// Tell the window to initialize the Java properties. The
|
|
|
|
// window needs to do this as we need to do this only once,
|
|
|
|
// and detecting that reliably from here is hard.
|
|
|
|
|
|
|
|
win->InitJavaProperties();
|
|
|
|
|
|
|
|
PRBool hasProp;
|
|
|
|
PRBool ok = ::JS_HasProperty(cx, obj, ::JS_GetStringBytes(str),
|
|
|
|
&hasProp);
|
|
|
|
|
|
|
|
isResolvingJavaProperties = PR_FALSE;
|
|
|
|
|
|
|
|
if (!ok) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasProp) {
|
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
2009-10-07 04:09:16 +04:00
|
|
|
} else if (id == sDialogArguments_id &&
|
|
|
|
mData == &sClassInfoData[eDOMClassInfo_ModalContentWindow_id]) {
|
|
|
|
nsCOMPtr<nsIArray> args;
|
|
|
|
((nsGlobalModalWindow *)win)->GetDialogArguments(getter_AddRefs(args));
|
|
|
|
|
|
|
|
nsIScriptContext *script_cx = win->GetContext();
|
|
|
|
if (script_cx) {
|
|
|
|
JSAutoSuspendRequest asr(cx);
|
|
|
|
|
|
|
|
// Make nsJSContext::SetProperty()'s magic argument array
|
|
|
|
// handling happen.
|
|
|
|
rv = script_cx->SetProperty(obj, "dialogArguments", args);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
2007-10-10 05:24:28 +04:00
|
|
|
}
|
2008-03-04 04:52:34 +03:00
|
|
|
}
|
|
|
|
|
2008-03-04 04:52:34 +03:00
|
|
|
JSObject *oldobj = *objp;
|
|
|
|
rv = nsEventReceiverSH::NewResolve(wrapper, cx, obj, id, flags, objp,
|
|
|
|
_retval);
|
|
|
|
|
|
|
|
if (NS_FAILED(rv) || *objp != oldobj) {
|
|
|
|
// Something went wrong, or the property got resolved. Return.
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2008-03-05 07:43:57 +03:00
|
|
|
// Make a fast expando if we're assigning to (not declaring or
|
|
|
|
// binding a name) a new undefined property that's not already
|
|
|
|
// defined on our prototype chain. This way we can access this
|
|
|
|
// expando w/o ever getting back into XPConnect.
|
2009-10-07 04:09:16 +04:00
|
|
|
if ((flags & JSRESOLVE_ASSIGNING) && !(flags & JSRESOLVE_WITH) &&
|
2008-09-25 20:13:31 +04:00
|
|
|
win->IsInnerWindow()) {
|
2008-03-04 04:52:34 +03:00
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
|
|
|
|
if (obj == realObj) {
|
|
|
|
JSObject *proto = STOBJ_GET_PROTO(obj);
|
|
|
|
if (proto) {
|
|
|
|
jsid interned_id;
|
2008-09-25 20:13:31 +04:00
|
|
|
JSObject *pobj = NULL;
|
|
|
|
jsval val;
|
2008-03-04 04:52:34 +03:00
|
|
|
|
|
|
|
if (!::JS_ValueToId(cx, id, &interned_id) ||
|
2008-10-24 21:09:09 +04:00
|
|
|
!::JS_LookupPropertyWithFlagsById(cx, proto, interned_id, flags,
|
2008-09-25 20:13:31 +04:00
|
|
|
&pobj, &val)) {
|
2008-03-04 04:52:34 +03:00
|
|
|
*_retval = JS_FALSE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-09-25 20:13:31 +04:00
|
|
|
if (pobj) {
|
|
|
|
// A property was found on the prototype chain.
|
|
|
|
*objp = pobj;
|
2008-03-04 04:52:34 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Define a fast expando, the key here is to use JS_PropertyStub
|
|
|
|
// as the getter/setter, which makes us stay out of XPConnect
|
|
|
|
// when using this property.
|
|
|
|
//
|
|
|
|
// We don't need to worry about property attributes here as we
|
|
|
|
// know here we're dealing with an undefined property set, so
|
|
|
|
// we're not declaring readonly or permanent properties.
|
2009-04-15 18:09:58 +04:00
|
|
|
//
|
|
|
|
// Since we always create the undeclared property here without given a
|
|
|
|
// chance for the interpreter to report applicable strict mode warnings,
|
|
|
|
// we must take care to check those warnings here.
|
2008-03-04 04:52:34 +03:00
|
|
|
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
2009-04-15 18:09:58 +04:00
|
|
|
if (!::js_CheckUndeclaredVarAssignment(cx) ||
|
|
|
|
!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
2008-03-04 04:52:34 +03:00
|
|
|
::JS_GetStringLength(str), JSVAL_VOID,
|
|
|
|
JS_PropertyStub, JS_PropertyStub,
|
|
|
|
JSPROP_ENUMERATE)) {
|
|
|
|
*_retval = JS_FALSE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2005-09-30 05:18:43 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
|
|
|
jsid *idp, PRBool *_retval)
|
|
|
|
{
|
2006-06-20 22:03:34 +04:00
|
|
|
switch ((JSIterateOp)enum_op) {
|
2005-09-30 05:18:43 +04:00
|
|
|
case JSENUMERATE_INIT:
|
|
|
|
{
|
2006-05-19 09:57:36 +04:00
|
|
|
// First, do the security check that nsDOMClassInfo does to see
|
|
|
|
// if we need to do any work at all.
|
2005-09-30 05:18:43 +04:00
|
|
|
nsDOMClassInfo::Enumerate(wrapper, cx, obj, _retval);
|
|
|
|
if (!*_retval) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The security check passed, let's see if we need to get the inner
|
|
|
|
// window's JS object or if we can just start enumerating.
|
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
JSObject *enumobj = win->GetGlobalJSObject();
|
|
|
|
if (win->IsOuterWindow()) {
|
|
|
|
nsGlobalWindow *inner = win->GetCurrentInnerWindowInternal();
|
|
|
|
if (inner) {
|
|
|
|
enumobj = inner->GetGlobalJSObject();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Great, we have the js object, now let's enumerate it.
|
|
|
|
JSObject *iterator = JS_NewPropertyIterator(cx, enumobj);
|
|
|
|
if (!iterator) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
*statep = OBJECT_TO_JSVAL(iterator);
|
|
|
|
if (idp) {
|
|
|
|
// Note: With these property iterators, we can't tell ahead of time how
|
|
|
|
// many properties we're going to be iterating over.
|
|
|
|
*idp = JSVAL_ZERO;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case JSENUMERATE_NEXT:
|
|
|
|
{
|
|
|
|
JSObject *iterator = (JSObject*)JSVAL_TO_OBJECT(*statep);
|
|
|
|
if (!JS_NextProperty(cx, iterator, idp)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*idp != JSVAL_VOID) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fall through.
|
|
|
|
}
|
|
|
|
case JSENUMERATE_DESTROY:
|
|
|
|
// Let GC at our iterator object.
|
|
|
|
*statep = JSVAL_NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::Finalize(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj)
|
|
|
|
{
|
2005-03-10 03:39:28 +03:00
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo(do_QueryWrappedNative(wrapper));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(sgo, NS_ERROR_UNEXPECTED);
|
|
|
|
|
2006-06-13 07:07:47 +04:00
|
|
|
sgo->OnFinalize(nsIProgrammingLanguage::JAVASCRIPT, obj);
|
2004-02-10 01:48:53 +03:00
|
|
|
|
2007-02-24 09:57:20 +03:00
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::Equality(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, jsval val, PRBool *bp)
|
|
|
|
{
|
|
|
|
*bp = PR_FALSE;
|
|
|
|
|
|
|
|
if (JSVAL_IS_PRIMITIVE(val)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXPConnectWrappedNative> other_wrapper;
|
|
|
|
nsContentUtils::XPConnect()->
|
|
|
|
GetWrappedNativeOfJSObject(cx, JSVAL_TO_OBJECT(val),
|
|
|
|
getter_AddRefs(other_wrapper));
|
|
|
|
if (!other_wrapper) {
|
|
|
|
// Not equal.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
2005-08-12 08:11:00 +04:00
|
|
|
NS_ASSERTION(win->IsOuterWindow(),
|
|
|
|
"Inner window detected in Equality hook!");
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
nsCOMPtr<nsPIDOMWindow> other = do_QueryWrappedNative(other_wrapper);
|
|
|
|
|
|
|
|
if (other) {
|
2005-08-12 08:11:00 +04:00
|
|
|
NS_ASSERTION(other->IsOuterWindow(),
|
|
|
|
"Inner window detected in Equality hook!");
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
*bp = win->GetOuterWindow() == other->GetOuterWindow();
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::OuterObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval)
|
|
|
|
{
|
2008-03-01 03:17:38 +03:00
|
|
|
nsGlobalWindow *origWin = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
nsGlobalWindow *win = origWin->GetOuterWindowInternal();
|
2005-08-12 08:11:00 +04:00
|
|
|
|
2005-10-08 04:28:45 +04:00
|
|
|
if (!win) {
|
2005-08-12 08:11:00 +04:00
|
|
|
// If we no longer have an outer window. No code should ever be
|
|
|
|
// running on a window w/o an outer, which means this hook should
|
|
|
|
// never be called when we have no outer. But just in case, return
|
|
|
|
// null to prevent leaking an inner window to code in a different
|
|
|
|
// window.
|
|
|
|
*_retval = nsnull;
|
2005-10-08 04:28:45 +04:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
2005-08-12 08:11:00 +04:00
|
|
|
}
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2009-02-17 00:16:13 +03:00
|
|
|
JSObject *winObj = win->GetGlobalJSObject();
|
|
|
|
if (!winObj) {
|
|
|
|
NS_ASSERTION(origWin->IsOuterWindow(), "What window is this?");
|
|
|
|
*_retval = obj;
|
|
|
|
return NS_OK;
|
2007-08-03 03:34:38 +04:00
|
|
|
}
|
2005-10-08 04:28:45 +04:00
|
|
|
|
2009-02-17 00:16:13 +03:00
|
|
|
*_retval = winObj;
|
|
|
|
return NS_OK;
|
2005-07-31 00:57:07 +04:00
|
|
|
}
|
|
|
|
|
2005-10-08 04:28:45 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsWindowSH::InnerObject(nsIXPConnectWrappedNative *wrapper, JSContext * cx,
|
|
|
|
JSObject * obj, JSObject * *_retval)
|
|
|
|
{
|
|
|
|
nsGlobalWindow *win = nsGlobalWindow::FromWrapper(wrapper);
|
|
|
|
|
2006-10-28 04:21:53 +04:00
|
|
|
if (win->IsInnerWindow() || win->IsFrozen()) {
|
|
|
|
// Return the inner window, or the outer if we're dealing with a
|
|
|
|
// frozen outer.
|
2005-10-08 04:28:45 +04:00
|
|
|
|
|
|
|
*_retval = obj;
|
|
|
|
} else {
|
|
|
|
// Try to find the current inner window.
|
|
|
|
|
|
|
|
nsGlobalWindow *inner = win->GetCurrentInnerWindowInternal();
|
|
|
|
if (!inner) {
|
|
|
|
// Yikes! No inner window! Instead of leaking the outer window into the
|
|
|
|
// scope chain, let's return an error.
|
|
|
|
|
|
|
|
*_retval = nsnull;
|
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
*_retval = inner->GetGlobalJSObject();
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-05-22 04:34:01 +04:00
|
|
|
// DOM Location helper
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsLocationSH::CheckAccess(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 mode,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if ((mode & JSACC_TYPEMASK) == JSACC_PROTO && (mode & JSACC_WRITE)) {
|
|
|
|
// No setting location.__proto__, ever!
|
|
|
|
|
|
|
|
// Let XPConnect know that the access was not granted.
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
|
|
|
|
return NS_ERROR_DOM_SECURITY_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsDOMGenericSH::CheckAccess(wrapper, cx, obj, id, mode, vp, _retval);
|
|
|
|
}
|
|
|
|
|
2005-08-23 05:42:49 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsLocationSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
|
|
|
// window.location can be held onto by both evil pages that want to track the
|
|
|
|
// user's progress on the web and bookmarklets that want to use the location
|
|
|
|
// object. Parent it to the outer window so that access checks do the Right
|
|
|
|
// Thing.
|
|
|
|
*parentObj = globalObj;
|
|
|
|
|
2005-12-19 23:29:54 +03:00
|
|
|
nsCOMPtr<nsIDOMLocation> safeLoc(do_QueryInterface(nativeObj));
|
|
|
|
if (!safeLoc) {
|
|
|
|
// Oops, this wasn't really a location object. This can happen if someone
|
|
|
|
// tries to use our scriptable helper as a real object and tries to wrap
|
|
|
|
// it, see bug 319296
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsLocation *loc = (nsLocation *)safeLoc.get();
|
2005-08-23 05:42:49 +04:00
|
|
|
nsIDocShell *ds = loc->GetDocShell();
|
|
|
|
if (!ds) {
|
|
|
|
NS_WARNING("Refusing to create a location in the wrong scope");
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds);
|
|
|
|
|
|
|
|
if (sgo) {
|
|
|
|
JSObject *global = sgo->GetGlobalJSObject();
|
|
|
|
|
|
|
|
if (global) {
|
|
|
|
*parentObj = global;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
// DOM Navigator helper
|
|
|
|
nsresult
|
|
|
|
nsNavigatorSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
|
|
|
// window.navigator is persisted across document transitions if
|
|
|
|
// we're loading a page from the same origin. Because of that we
|
|
|
|
// need to parent the navigator wrapper at the outer window to avoid
|
|
|
|
// holding on to the inner window where the navigator was initially
|
|
|
|
// created too long.
|
|
|
|
*parentObj = globalObj;
|
|
|
|
|
2005-12-19 23:29:54 +03:00
|
|
|
nsCOMPtr<nsIDOMNavigator> safeNav(do_QueryInterface(nativeObj));
|
|
|
|
if (!safeNav) {
|
|
|
|
// Oops, this wasn't really a navigator object. This can happen if someone
|
|
|
|
// tries to use our scriptable helper as a real object and tries to wrap
|
|
|
|
// it, see bug 319296.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsNavigator *nav = (nsNavigator *)safeNav.get();
|
2005-07-31 00:57:07 +04:00
|
|
|
nsIDocShell *ds = nav->GetDocShell();
|
2005-08-18 22:43:33 +04:00
|
|
|
if (!ds) {
|
|
|
|
NS_WARNING("Refusing to create a navigator in the wrong scope");
|
2005-08-23 05:42:49 +04:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
2005-08-18 22:43:33 +04:00
|
|
|
}
|
2005-07-31 00:57:07 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> sgo = do_GetInterface(ds);
|
|
|
|
|
|
|
|
if (sgo) {
|
|
|
|
JSObject *global = sgo->GetGlobalJSObject();
|
|
|
|
|
|
|
|
if (global) {
|
|
|
|
*parentObj = global;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// DOM Node helper
|
|
|
|
|
2006-06-23 20:43:29 +04:00
|
|
|
PRBool
|
|
|
|
nsNodeSH::IsCapabilityEnabled(const char* aCapability)
|
|
|
|
{
|
|
|
|
PRBool enabled;
|
|
|
|
return sSecMan &&
|
|
|
|
NS_SUCCEEDED(sSecMan->IsCapabilityEnabled(aCapability, &enabled)) &&
|
|
|
|
enabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsNodeSH::DefineVoidProp(JSContext* cx, JSObject* obj, jsval id,
|
|
|
|
JSObject** objp)
|
|
|
|
{
|
|
|
|
NS_ASSERTION(JSVAL_IS_STRING(id), "id must be a string");
|
|
|
|
|
|
|
|
JSString* str = JSVAL_TO_STRING(id);
|
|
|
|
|
|
|
|
// We want this to be as invisible to content script as possible. So
|
|
|
|
// don't enumerate this, and set is as JSPROP_SHARED so it won't get
|
|
|
|
// cached on the object.
|
|
|
|
JSBool ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), JSVAL_VOID,
|
|
|
|
nsnull, nsnull, JSPROP_SHARED);
|
|
|
|
|
|
|
|
if (!ok) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNodeSH::PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj,
|
|
|
|
JSObject **parentObj)
|
|
|
|
{
|
2007-12-11 04:19:18 +03:00
|
|
|
nsINode *node = static_cast<nsINode*>(nativeObj);
|
2006-05-06 07:25:58 +04:00
|
|
|
|
2007-12-11 04:19:18 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsINode> node_qi(do_QueryInterface(nativeObj));
|
|
|
|
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsINode pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(node_qi == node, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-05-06 07:25:58 +04:00
|
|
|
// Make sure that we get the owner document of the content node, in case
|
|
|
|
// we're in document teardown. If we are, it's important to *not* use
|
|
|
|
// globalObj as the nodes parent since that would give the node the
|
|
|
|
// principal of globalObj (i.e. the principal of the document that's being
|
|
|
|
// loaded) and not the principal of the document that's being unloaded.
|
|
|
|
// See http://bugzilla.mozilla.org/show_bug.cgi?id=227417
|
|
|
|
nsIDocument* doc = node->GetOwnerDoc();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2003-12-04 05:13:55 +03:00
|
|
|
if (!doc) {
|
2006-05-06 07:25:58 +04:00
|
|
|
// No document reachable from nativeObj, use the global object
|
|
|
|
// that was passed to this method.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2006-05-06 07:25:58 +04:00
|
|
|
*parentObj = globalObj;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-04-23 11:21:22 +04:00
|
|
|
return node->IsInNativeAnonymousSubtree() ?
|
|
|
|
NS_SUCCESS_CHROME_ACCESS_ONLY : NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-10-13 20:12:26 +04:00
|
|
|
// If we have a document, make sure one of these is true
|
|
|
|
// (1) it has a script handling object,
|
|
|
|
// (2) has had one, or has been marked to have had one,
|
|
|
|
// (3) we are running a privileged script.
|
|
|
|
// Event handling is possible only if (1). If (2) event handling is prevented.
|
|
|
|
// If document has never had a script handling object,
|
|
|
|
// untrusted scripts (3) shouldn't touch it!
|
|
|
|
PRBool hasHadScriptHandlingObject = PR_FALSE;
|
|
|
|
NS_ENSURE_STATE(doc->GetScriptHandlingObject(hasHadScriptHandlingObject) ||
|
|
|
|
hasHadScriptHandlingObject ||
|
|
|
|
IsPrivilegedScript());
|
|
|
|
|
2004-01-27 02:41:34 +03:00
|
|
|
nsISupports *native_parent;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
PRBool slimWrappers = PR_TRUE;
|
2009-08-25 00:02:07 +04:00
|
|
|
PRBool nodeIsElement = node->IsNodeOfType(nsINode::eELEMENT);
|
|
|
|
if (nodeIsElement && static_cast<nsIContent*>(node)->IsXUL()) {
|
2006-05-06 07:25:58 +04:00
|
|
|
// For XUL elements, use the parent, if any.
|
|
|
|
native_parent = node->GetParent();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2006-05-06 07:25:58 +04:00
|
|
|
if (!native_parent) {
|
2004-01-27 02:41:34 +03:00
|
|
|
native_parent = doc;
|
2006-05-06 07:25:58 +04:00
|
|
|
}
|
2006-06-06 19:42:41 +04:00
|
|
|
} else if (!node->IsNodeOfType(nsINode::eDOCUMENT)) {
|
|
|
|
NS_ASSERTION(node->IsNodeOfType(nsINode::eCONTENT) ||
|
|
|
|
node->IsNodeOfType(nsINode::eATTRIBUTE),
|
|
|
|
"Unexpected node type");
|
|
|
|
|
|
|
|
// For attributes and non-XUL content, use the document as scope parent.
|
2006-05-06 07:25:58 +04:00
|
|
|
native_parent = doc;
|
|
|
|
|
|
|
|
// But for HTML form controls, use the form as scope parent.
|
2009-08-25 00:02:07 +04:00
|
|
|
if (nodeIsElement &&
|
|
|
|
node->IsNodeOfType(nsINode::eHTML_FORM_CONTROL)) {
|
2006-05-06 07:25:58 +04:00
|
|
|
nsCOMPtr<nsIFormControl> form_control(do_QueryInterface(node));
|
|
|
|
|
|
|
|
if (form_control) {
|
|
|
|
nsCOMPtr<nsIDOMHTMLFormElement> form;
|
|
|
|
form_control->GetForm(getter_AddRefs(form));
|
|
|
|
|
|
|
|
if (form) {
|
|
|
|
// Found a form, use it.
|
|
|
|
native_parent = form;
|
2004-01-27 02:41:34 +03:00
|
|
|
}
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2004-01-27 02:41:34 +03:00
|
|
|
} else {
|
2006-06-06 19:42:41 +04:00
|
|
|
// We're called for a document object; set the parent to be the
|
|
|
|
// document's global object, if there is one
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2006-04-11 07:49:44 +04:00
|
|
|
// Get the scope object from the document.
|
|
|
|
native_parent = doc->GetScopeObject();
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2004-01-27 02:41:34 +03:00
|
|
|
if (!native_parent) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// No global object reachable from this document, use the
|
|
|
|
// global object that was passed to this method.
|
|
|
|
|
|
|
|
*parentObj = globalObj;
|
|
|
|
|
2009-04-23 11:21:22 +04:00
|
|
|
return node->IsInNativeAnonymousSubtree() ?
|
|
|
|
NS_SUCCESS_CHROME_ACCESS_ONLY : NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2009-05-13 00:20:42 +04:00
|
|
|
|
|
|
|
slimWrappers = PR_FALSE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2005-07-31 00:57:07 +04:00
|
|
|
// XXXjst: Maybe we need to find the global to use from the
|
|
|
|
// nsIScriptGlobalObject that's reachable from the node we're about
|
|
|
|
// to wrap here? But that's not always reachable, let's use
|
|
|
|
// globalObj for now...
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
if (native_parent == doc && (*parentObj = doc->GetWrapper()))
|
|
|
|
return node->IsInNativeAnonymousSubtree() ?
|
|
|
|
NS_SUCCESS_CHROME_ACCESS_ONLY :
|
|
|
|
(slimWrappers ? NS_SUCCESS_ALLOW_SLIM_WRAPPERS : NS_OK);
|
2007-12-04 06:49:33 +03:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
jsval v;
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, globalObj, native_parent, PR_FALSE, &v,
|
2005-09-07 06:56:15 +04:00
|
|
|
getter_AddRefs(holder));
|
2009-04-23 11:21:22 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
*parentObj = JSVAL_TO_OBJECT(v);
|
|
|
|
|
2009-04-23 11:21:22 +04:00
|
|
|
return node->IsInNativeAnonymousSubtree() ?
|
2009-05-13 00:20:42 +04:00
|
|
|
NS_SUCCESS_CHROME_ACCESS_ONLY :
|
|
|
|
(slimWrappers ? NS_SUCCESS_ALLOW_SLIM_WRAPPERS : NS_OK);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNodeSH::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-11-29 11:32:39 +03:00
|
|
|
nsNodeSH::PreserveWrapper(GetNative(wrapper, obj));
|
2005-07-20 01:40:33 +04:00
|
|
|
return nsEventReceiverSH::AddProperty(wrapper, cx, obj, id, vp, _retval);
|
2005-03-30 03:26:56 +04:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2006-06-23 20:43:29 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNodeSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if ((id == sBaseURIObject_id || id == sNodePrincipal_id) &&
|
|
|
|
IsPrivilegedScript()) {
|
|
|
|
return DefineVoidProp(cx, obj, id, objp);
|
|
|
|
}
|
|
|
|
|
2008-11-13 19:54:52 +03:00
|
|
|
if (id == sOnload_id || id == sOnerror_id) {
|
|
|
|
// Make sure that this node can't go away while waiting for a
|
|
|
|
// network load that could fire an event handler.
|
2009-11-29 11:32:39 +03:00
|
|
|
nsNodeSH::PreserveWrapper(GetNative(wrapper, obj));
|
2008-11-13 19:54:52 +03:00
|
|
|
}
|
|
|
|
|
2006-06-23 20:43:29 +04:00
|
|
|
return nsEventReceiverSH::NewResolve(wrapper, cx, obj, id, flags, objp,
|
|
|
|
_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNodeSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if (id == sBaseURIObject_id && IsPrivilegedScript()) {
|
|
|
|
// I wish GetBaseURI lived on nsINode
|
|
|
|
nsCOMPtr<nsIURI> uri;
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIContent> content = do_QueryWrappedNative(wrapper, obj);
|
2006-06-23 20:43:29 +04:00
|
|
|
if (content) {
|
|
|
|
uri = content->GetBaseURI();
|
|
|
|
NS_ENSURE_TRUE(uri, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
} else {
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDocument> doc = do_QueryWrappedNative(wrapper, obj);
|
2006-06-23 20:43:29 +04:00
|
|
|
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
uri = doc->GetBaseURI();
|
|
|
|
NS_ENSURE_TRUE(uri, NS_ERROR_NOT_AVAILABLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, obj, uri, &NS_GET_IID(nsIURI), PR_TRUE, vp,
|
2006-06-23 20:43:29 +04:00
|
|
|
getter_AddRefs(holder));
|
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (id == sNodePrincipal_id && IsPrivilegedScript()) {
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsINode> node = do_QueryWrappedNative(wrapper, obj);
|
2006-06-23 20:43:29 +04:00
|
|
|
NS_ENSURE_TRUE(node, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
|
|
|
nsresult rv = WrapNative(cx, obj, node->NodePrincipal(),
|
2009-05-21 12:17:51 +04:00
|
|
|
&NS_GET_IID(nsIPrincipal), PR_TRUE, vp,
|
2006-06-23 20:43:29 +04:00
|
|
|
getter_AddRefs(holder));
|
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Note: none of our ancestors want GetProperty
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNodeSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if ((id == sBaseURIObject_id || id == sNodePrincipal_id) &&
|
|
|
|
IsPrivilegedScript()) {
|
2007-10-27 05:29:48 +04:00
|
|
|
// We don't want privileged script that can read this property to set it,
|
|
|
|
// but _do_ want to allow everyone else to set a value they can then read.
|
|
|
|
//
|
|
|
|
// XXXbz Is there a better error we could use here?
|
2006-06-23 20:43:29 +04:00
|
|
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsEventReceiverSH::SetProperty(wrapper, cx, obj, id, vp,_retval);
|
|
|
|
}
|
|
|
|
|
2002-08-29 08:05:39 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNodeSH::GetFlags(PRUint32 *aFlags)
|
|
|
|
{
|
|
|
|
*aFlags = DOMCLASSINFO_STANDARD_FLAGS | nsIClassInfo::CONTENT_NODE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-11-29 11:32:39 +03:00
|
|
|
void
|
|
|
|
nsNodeSH::PreserveWrapper(nsISupports *aNative)
|
|
|
|
{
|
|
|
|
nsINode *node = static_cast<nsINode*>(aNative);
|
|
|
|
nsContentUtils::PreserveWrapper(aNative, node);
|
|
|
|
}
|
|
|
|
|
2003-05-31 09:39:14 +04:00
|
|
|
// EventReceiver helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
// static
|
|
|
|
PRBool
|
2003-05-31 09:39:14 +04:00
|
|
|
nsEventReceiverSH::ReallyIsEventName(jsval id, jschar aFirstChar)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
// I wonder if this is faster than using a hash...
|
|
|
|
|
|
|
|
switch (aFirstChar) {
|
|
|
|
case 'a' :
|
2002-08-16 01:18:20 +04:00
|
|
|
return id == sOnabort_id;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'b' :
|
2004-03-03 03:20:31 +03:00
|
|
|
return (id == sOnbeforeunload_id ||
|
2008-02-24 13:55:37 +03:00
|
|
|
id == sOnblur_id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'e' :
|
2002-08-16 01:18:20 +04:00
|
|
|
return id == sOnerror_id;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'f' :
|
2004-06-22 03:41:30 +04:00
|
|
|
return id == sOnfocus_id;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'c' :
|
2004-03-03 03:20:31 +03:00
|
|
|
return (id == sOnchange_id ||
|
|
|
|
id == sOnclick_id ||
|
2007-07-26 08:14:33 +04:00
|
|
|
id == sOncontextmenu_id ||
|
|
|
|
id == sOncopy_id ||
|
|
|
|
id == sOncut_id);
|
2003-06-10 22:33:58 +04:00
|
|
|
case 'd' :
|
2009-02-18 16:31:31 +03:00
|
|
|
return (id == sOndblclick_id ||
|
|
|
|
id == sOndrag_id ||
|
|
|
|
id == sOndragend_id ||
|
|
|
|
id == sOndragenter_id ||
|
|
|
|
id == sOndragleave_id ||
|
|
|
|
id == sOndragover_id ||
|
|
|
|
id == sOndragstart_id ||
|
|
|
|
id == sOndrop_id);
|
2009-06-26 21:16:50 +04:00
|
|
|
case 'h' :
|
|
|
|
return id == sOnhashchange_id;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'l' :
|
2002-08-16 01:18:20 +04:00
|
|
|
return id == sOnload_id;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'p' :
|
2005-07-26 02:09:39 +04:00
|
|
|
return (id == sOnpaint_id ||
|
|
|
|
id == sOnpageshow_id ||
|
2007-07-26 08:14:33 +04:00
|
|
|
id == sOnpagehide_id ||
|
2010-01-30 05:50:46 +03:00
|
|
|
id == sOnpaste_id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'k' :
|
2004-03-03 03:20:31 +03:00
|
|
|
return (id == sOnkeydown_id ||
|
|
|
|
id == sOnkeypress_id ||
|
|
|
|
id == sOnkeyup_id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'u' :
|
2002-08-16 01:18:20 +04:00
|
|
|
return id == sOnunload_id;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'm' :
|
2004-03-03 03:20:31 +03:00
|
|
|
return (id == sOnmousemove_id ||
|
|
|
|
id == sOnmouseout_id ||
|
|
|
|
id == sOnmouseover_id ||
|
|
|
|
id == sOnmouseup_id ||
|
|
|
|
id == sOnmousedown_id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 'r' :
|
2004-03-03 03:20:31 +03:00
|
|
|
return (id == sOnreset_id ||
|
|
|
|
id == sOnresize_id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
case 's' :
|
2004-03-03 03:20:31 +03:00
|
|
|
return (id == sOnscroll_id ||
|
|
|
|
id == sOnselect_id ||
|
|
|
|
id == sOnsubmit_id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2003-05-31 09:39:14 +04:00
|
|
|
nsEventReceiverSH::RegisterCompileHandler(nsIXPConnectWrappedNative *wrapper,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, PRBool compile,
|
2004-11-05 18:28:17 +03:00
|
|
|
PRBool remove,
|
2005-04-29 03:48:28 +04:00
|
|
|
PRBool *did_define)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2005-04-29 03:48:28 +04:00
|
|
|
NS_PRECONDITION(!compile || !remove,
|
|
|
|
"Can't both compile and remove at the same time");
|
|
|
|
*did_define = PR_FALSE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
if (!IsEventName(id)) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
if (ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
}
|
|
|
|
|
2004-02-10 01:48:53 +03:00
|
|
|
nsIScriptContext *script_cx = nsJSUtils::GetStaticScriptContext(cx, obj);
|
|
|
|
NS_ENSURE_TRUE(script_cx, NS_ERROR_UNEXPECTED);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsPIDOMEventTarget> piTarget =
|
|
|
|
do_QueryWrappedNative(wrapper, obj);
|
2007-05-14 13:11:38 +04:00
|
|
|
if (!piTarget) {
|
2006-06-06 19:42:41 +04:00
|
|
|
// Doesn't do events
|
2007-05-14 13:11:38 +04:00
|
|
|
NS_WARNING("Doesn't QI to nsPIDOMEventTarget?");
|
2006-06-06 19:42:41 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-06-23 15:23:52 +04:00
|
|
|
nsIEventListenerManager* manager = piTarget->GetListenerManager(PR_TRUE);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(manager, NS_ERROR_UNEXPECTED);
|
|
|
|
|
2004-02-10 01:48:53 +03:00
|
|
|
nsCOMPtr<nsIAtom> atom(do_GetAtom(nsDependentJSString(id)));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(atom, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
2004-02-10 01:48:53 +03:00
|
|
|
nsresult rv;
|
|
|
|
|
2007-08-10 02:19:59 +04:00
|
|
|
JSObject *scope = ::JS_GetGlobalForObject(cx, obj);
|
2005-07-31 00:57:07 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
if (compile) {
|
2007-05-14 13:11:38 +04:00
|
|
|
rv = manager->CompileScriptEventListener(script_cx, scope, piTarget, atom,
|
2005-04-29 03:48:28 +04:00
|
|
|
did_define);
|
2004-11-05 18:28:17 +03:00
|
|
|
} else if (remove) {
|
|
|
|
rv = manager->RemoveScriptEventListener(atom);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
} else {
|
2007-05-14 13:11:38 +04:00
|
|
|
rv = manager->RegisterScriptEventListener(script_cx, scope, piTarget,
|
2005-07-31 00:57:07 +04:00
|
|
|
atom);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2003-05-31 09:39:14 +04:00
|
|
|
nsEventReceiverSH::NewResolve(nsIXPConnectWrappedNative *wrapper,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
PRUint32 flags, JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
2006-10-07 07:37:15 +04:00
|
|
|
if (!JSVAL_IS_STRING(id)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags & JSRESOLVE_ASSIGNING) {
|
|
|
|
if (!IsEventName(id)) {
|
|
|
|
// Bail out. We don't care about this assignment.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we're assigning to an on* property, just resolve to null for
|
2007-11-23 04:37:22 +03:00
|
|
|
// now; the assignment will then set the right value. Only do this
|
|
|
|
// in the case where the property isn't already defined on the
|
|
|
|
// object's prototype chain though.
|
2006-10-07 07:37:15 +04:00
|
|
|
JSString* str = JSVAL_TO_STRING(id);
|
|
|
|
JSAutoRequest ar(cx);
|
2007-11-23 04:37:22 +03:00
|
|
|
|
|
|
|
JSObject *proto = ::JS_GetPrototype(cx, obj);
|
|
|
|
PRBool ok = PR_TRUE, hasProp = PR_FALSE;
|
|
|
|
if (!proto || ((ok = ::JS_HasUCProperty(cx, proto, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str),
|
|
|
|
&hasProp)) &&
|
|
|
|
!hasProp)) {
|
|
|
|
// Make sure the flags here match those in
|
|
|
|
// nsJSContext::BindCompiledEventHandler
|
|
|
|
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), JSVAL_NULL,
|
|
|
|
nsnull, nsnull,
|
|
|
|
JSPROP_ENUMERATE | JSPROP_PERMANENT)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
return NS_OK;
|
2006-10-07 07:37:15 +04:00
|
|
|
}
|
|
|
|
|
2007-11-23 04:37:22 +03:00
|
|
|
return ok ? NS_OK : NS_ERROR_FAILURE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2006-10-07 07:37:15 +04:00
|
|
|
if (id == sAddEventListener_id) {
|
2010-01-13 16:50:01 +03:00
|
|
|
return NS_OK;
|
2005-04-29 03:48:28 +04:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
PRBool did_define = PR_FALSE;
|
2004-11-05 18:28:17 +03:00
|
|
|
nsresult rv = RegisterCompileHandler(wrapper, cx, obj, id, PR_TRUE, PR_FALSE,
|
2005-04-29 03:48:28 +04:00
|
|
|
&did_define);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2005-04-29 03:48:28 +04:00
|
|
|
if (did_define) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
return nsDOMGenericSH::NewResolve(wrapper, cx, obj, id, flags, objp,
|
|
|
|
_retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2003-05-31 09:39:14 +04:00
|
|
|
nsEventReceiverSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2004-11-05 18:28:17 +03:00
|
|
|
if ((::JS_TypeOfValue(cx, *vp) != JSTYPE_FUNCTION && !JSVAL_IS_NULL(*vp)) ||
|
2005-04-29 03:48:28 +04:00
|
|
|
!JSVAL_IS_STRING(id) || id == sAddEventListener_id) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRBool did_compile; // Ignored here.
|
|
|
|
|
2004-11-05 18:28:17 +03:00
|
|
|
return RegisterCompileHandler(wrapper, cx, obj, id, PR_FALSE,
|
|
|
|
JSVAL_IS_NULL(*vp), &did_compile);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2003-11-18 04:59:51 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsEventReceiverSH::AddProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
return nsEventReceiverSH::SetProperty(wrapper, cx, obj, id, vp, _retval);
|
|
|
|
}
|
|
|
|
|
2008-08-14 15:04:43 +04:00
|
|
|
// EventTarget helper
|
|
|
|
|
2008-11-13 19:54:52 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsEventTargetSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
|
|
|
nsXHREventTarget *target = nsXHREventTarget::FromSupports(nativeObj);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIScriptGlobalObject> native_parent;
|
|
|
|
target->GetParentObject(getter_AddRefs(native_parent));
|
|
|
|
|
|
|
|
*parentObj = native_parent ? native_parent->GetGlobalJSObject() : globalObj;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-09-25 18:40:30 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsEventTargetSH::AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
if (id == sAddEventListener_id) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2008-11-13 19:54:52 +03:00
|
|
|
|
2009-11-29 11:32:39 +03:00
|
|
|
nsEventTargetSH::PreserveWrapper(GetNative(wrapper, obj));
|
2008-11-13 19:54:52 +03:00
|
|
|
|
2008-11-06 14:09:30 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-11-29 11:32:39 +03:00
|
|
|
void
|
|
|
|
nsEventTargetSH::PreserveWrapper(nsISupports *aNative)
|
|
|
|
{
|
|
|
|
nsXHREventTarget *target = nsXHREventTarget::FromSupports(aNative);
|
|
|
|
nsContentUtils::PreserveWrapper(aNative, target);
|
|
|
|
}
|
|
|
|
|
2008-11-13 19:54:52 +03:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// Element helper
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
static PRBool
|
|
|
|
GetBindingURL(nsIContent *aContent, nsIDocument *aDocument,
|
|
|
|
nsCSSValue::URL **aResult)
|
|
|
|
{
|
2009-10-02 00:17:25 +04:00
|
|
|
// If we have a frame the frame has already loaded the binding. And
|
|
|
|
// otherwise, don't do anything else here unless we're dealing with
|
|
|
|
// XUL.
|
2009-05-13 00:20:42 +04:00
|
|
|
nsIPresShell *shell = aDocument->GetPrimaryShell();
|
2009-12-25 00:20:06 +03:00
|
|
|
if (!shell || aContent->GetPrimaryFrame() || !aContent->IsXUL()) {
|
2009-05-13 00:20:42 +04:00
|
|
|
*aResult = nsnull;
|
|
|
|
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get the computed -moz-binding directly from the style context
|
|
|
|
nsPresContext *pctx = shell->GetPresContext();
|
|
|
|
NS_ENSURE_TRUE(pctx, PR_FALSE);
|
|
|
|
|
|
|
|
nsRefPtr<nsStyleContext> sc = pctx->StyleSet()->ResolveStyleFor(aContent,
|
|
|
|
nsnull);
|
|
|
|
NS_ENSURE_TRUE(sc, PR_FALSE);
|
|
|
|
|
|
|
|
*aResult = sc->GetStyleDisplay()->mBinding;
|
|
|
|
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsElementSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
|
|
|
nsresult rv = nsNodeSH::PreCreate(nativeObj, cx, globalObj, parentObj);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
nsIContent *content = static_cast<nsIContent*>(nativeObj);
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIContent> content_qi(do_QueryInterface(nativeObj));
|
|
|
|
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsIContent pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(content_qi == content, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
nsIDocument *doc = content->HasFlag(NODE_FORCE_XBL_BINDINGS) ?
|
|
|
|
content->GetOwnerDoc() :
|
|
|
|
content->GetCurrentDoc();
|
|
|
|
|
|
|
|
if (!doc) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (content->HasFlag(NODE_MAY_BE_IN_BINDING_MNGR) &&
|
|
|
|
doc->BindingManager()->GetBinding(content)) {
|
|
|
|
// Don't allow slim wrappers.
|
|
|
|
return rv == NS_SUCCESS_ALLOW_SLIM_WRAPPERS ? NS_OK : rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCSSValue::URL *bindingURL;
|
|
|
|
PRBool ok = GetBindingURL(content, doc, &bindingURL);
|
|
|
|
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
// Only allow slim wrappers if there's no binding.
|
|
|
|
if (!bindingURL) {
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
content->SetFlags(NODE_ATTACH_BINDING_ON_POSTCREATE);
|
|
|
|
|
|
|
|
return rv == NS_SUCCESS_ALLOW_SLIM_WRAPPERS ? NS_OK : rv;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsElementSH::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj)
|
|
|
|
{
|
2007-12-11 04:19:18 +03:00
|
|
|
nsIContent *content = static_cast<nsIContent*>(wrapper->Native());
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIContent> content_qi(do_QueryWrappedNative(wrapper));
|
|
|
|
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsIContent pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(content_qi == content, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsIDocument* doc;
|
2007-05-16 05:13:47 +04:00
|
|
|
if (content->HasFlag(NODE_FORCE_XBL_BINDINGS)) {
|
|
|
|
doc = content->GetOwnerDoc();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
doc = content->GetCurrentDoc();
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
if (!doc) {
|
2001-07-11 13:09:30 +04:00
|
|
|
// There's no baseclass that cares about this call so we just
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// return here.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2007-10-27 04:14:43 +04:00
|
|
|
// We must ensure that the XBL Binding is installed before we hand
|
|
|
|
// back this object.
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
if (!content->HasFlag(NODE_ATTACH_BINDING_ON_POSTCREATE)) {
|
2008-03-15 02:08:57 +03:00
|
|
|
// There's already a binding for this element so nothing left to
|
|
|
|
// be done here.
|
|
|
|
|
|
|
|
// In theory we could call ExecuteAttachedHandler here when it's safe to
|
|
|
|
// run script if we also removed the binding from the PAQ queue, but that
|
|
|
|
// seems like a scary change that would mosly just add more
|
|
|
|
// inconsistencies.
|
2007-10-27 04:14:43 +04:00
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
return NS_OK;
|
2007-10-27 04:14:43 +04:00
|
|
|
}
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
content->UnsetFlags(NODE_ATTACH_BINDING_ON_POSTCREATE);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-08 06:41:12 +04:00
|
|
|
// Make sure the style context goes away _before_ we load the binding
|
|
|
|
// since that can destroy the relevant presshell.
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCSSValue::URL *bindingURL;
|
|
|
|
PRBool ok = GetBindingURL(content, doc, &bindingURL);
|
|
|
|
NS_ENSURE_TRUE(ok, NS_ERROR_FAILURE);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
if (!bindingURL) {
|
|
|
|
// No binding, nothing left to do here.
|
|
|
|
return NS_OK;
|
2009-05-08 06:41:12 +04:00
|
|
|
}
|
2007-03-23 02:01:14 +03:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIURI> uri = bindingURL->mURI;
|
|
|
|
nsCOMPtr<nsIPrincipal> principal = bindingURL->mOriginPrincipal;
|
|
|
|
|
2009-05-08 06:41:12 +04:00
|
|
|
// We have a binding that must be installed.
|
|
|
|
PRBool dummy;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-08 06:41:12 +04:00
|
|
|
nsCOMPtr<nsIXBLService> xblService(do_GetService("@mozilla.org/xbl;1"));
|
|
|
|
NS_ENSURE_TRUE(xblService, NS_ERROR_NOT_AVAILABLE);
|
|
|
|
|
|
|
|
nsRefPtr<nsXBLBinding> binding;
|
|
|
|
xblService->LoadBindings(content, uri, principal, PR_FALSE,
|
|
|
|
getter_AddRefs(binding), &dummy);
|
2007-05-05 09:45:24 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
if (binding) {
|
2008-03-15 02:08:57 +03:00
|
|
|
if (nsContentUtils::IsSafeToRunScript()) {
|
|
|
|
binding->ExecuteAttachedHandler();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
nsContentUtils::AddScriptRunner(new nsRunnableMethod<nsXBLBinding>(
|
|
|
|
binding, &nsXBLBinding::ExecuteAttachedHandler));
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2007-09-28 17:45:01 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsElementSH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRBool *_retval)
|
|
|
|
{
|
|
|
|
// Make sure to not call the superclass here!
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIContent> content(do_QueryWrappedNative(wrapper, obj));
|
2007-09-28 17:45:01 +04:00
|
|
|
NS_ENSURE_TRUE(content, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsIDocument* doc = content->GetOwnerDoc();
|
|
|
|
if (!doc) {
|
|
|
|
// Nothing else to do here
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2007-11-28 02:46:53 +03:00
|
|
|
nsRefPtr<nsXBLBinding> binding = doc->BindingManager()->GetBinding(content);
|
2007-09-28 17:45:01 +04:00
|
|
|
if (!binding) {
|
|
|
|
// Nothing else to do here
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*_retval = binding->ResolveAllFields(cx, obj);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-23 02:01:14 +03:00
|
|
|
// Generic array scriptable helper.
|
|
|
|
|
2007-09-28 17:45:03 +04:00
|
|
|
NS_IMETHODIMP
|
2007-03-23 02:01:14 +03:00
|
|
|
nsGenericArraySH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
2005-10-04 09:50:42 +04:00
|
|
|
{
|
2008-09-06 05:10:35 +04:00
|
|
|
if (id == sLength_id) {
|
|
|
|
// Bail early; this isn't something we're interested in
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-10-04 09:50:42 +04:00
|
|
|
PRBool is_number = PR_FALSE;
|
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id, &is_number);
|
|
|
|
|
|
|
|
if (is_number && n >= 0) {
|
2005-10-06 23:58:26 +04:00
|
|
|
// XXX The following is a cheap optimization to avoid hitting xpconnect to
|
|
|
|
// get the length. We may want to consider asking our concrete
|
|
|
|
// implementation for the length, and falling back onto the GetProperty if
|
|
|
|
// it doesn't provide one.
|
2005-10-04 09:50:42 +04:00
|
|
|
|
2005-10-06 23:58:26 +04:00
|
|
|
PRUint32 length;
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult rv = GetLength(wrapper, cx, obj, &length);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2005-10-04 09:50:42 +04:00
|
|
|
|
2005-10-06 23:58:26 +04:00
|
|
|
if ((PRUint32)n < length) {
|
2005-10-04 09:50:42 +04:00
|
|
|
*_retval = ::JS_DefineElement(cx, obj, n, JSVAL_VOID, nsnull, nsnull,
|
2005-10-12 23:07:42 +04:00
|
|
|
JSPROP_ENUMERATE | JSPROP_SHARED);
|
2005-10-04 09:50:42 +04:00
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult
|
|
|
|
nsGenericArraySH::GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length)
|
|
|
|
{
|
|
|
|
*length = 0;
|
|
|
|
|
|
|
|
jsval lenval;
|
|
|
|
if (!JS_GetProperty(cx, obj, "length", &lenval)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!JSVAL_IS_INT(lenval)) {
|
|
|
|
// This can apparently happen with some sparse array impls falling back
|
|
|
|
// onto this code.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRInt32 slen = JSVAL_TO_INT(lenval);
|
|
|
|
if (slen < 0) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
*length = (PRUint32)slen;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2003-09-19 12:43:14 +04:00
|
|
|
NS_IMETHODIMP
|
2003-10-16 04:44:20 +04:00
|
|
|
nsGenericArraySH::Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRBool *_retval)
|
2003-09-19 12:43:14 +04:00
|
|
|
{
|
|
|
|
// Recursion protection in case someone tries to be smart and call
|
|
|
|
// the enumerate hook from a user defined .length getter, or
|
|
|
|
// somesuch.
|
|
|
|
|
|
|
|
static PRBool sCurrentlyEnumerating;
|
|
|
|
|
|
|
|
if (sCurrentlyEnumerating) {
|
|
|
|
// Don't recurse to death.
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sCurrentlyEnumerating = PR_TRUE;
|
|
|
|
|
|
|
|
jsval len_val;
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
2003-09-19 12:43:14 +04:00
|
|
|
JSBool ok = ::JS_GetProperty(cx, obj, "length", &len_val);
|
|
|
|
|
|
|
|
if (ok && JSVAL_IS_INT(len_val)) {
|
|
|
|
PRInt32 length = JSVAL_TO_INT(len_val);
|
|
|
|
|
|
|
|
for (PRInt32 i = 0; ok && i < length; ++i) {
|
2008-10-08 17:12:50 +04:00
|
|
|
ok = ::JS_DefineElement(cx, obj, i, JSVAL_VOID, nsnull, nsnull,
|
|
|
|
JSPROP_ENUMERATE | JSPROP_SHARED);
|
2003-09-19 12:43:14 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sCurrentlyEnumerating = PR_FALSE;
|
|
|
|
|
|
|
|
return ok ? NS_OK : NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
// Array scriptable helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsArraySH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2001-06-28 08:26:29 +04:00
|
|
|
PRBool is_number = PR_FALSE;
|
2003-11-12 17:25:03 +03:00
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id, &is_number);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
nsresult rv = NS_OK;
|
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
if (is_number) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
if (n < 0) {
|
|
|
|
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
// Make sure rv == NS_OK here, so GetItemAt implementations that never fail
|
|
|
|
// don't have to set rv.
|
|
|
|
rv = NS_OK;
|
2009-05-13 00:20:42 +04:00
|
|
|
nsISupports* array_item = GetItemAt(GetNative(wrapper, obj), n, &rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2001-10-16 05:24:16 +04:00
|
|
|
if (array_item) {
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, array_item, PR_TRUE, vp);
|
2001-10-16 05:24:16 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2005-09-28 17:44:31 +04:00
|
|
|
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
2001-10-16 05:24:16 +04:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return rv;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
// NodeList scriptable helper
|
|
|
|
|
2008-11-13 19:54:52 +03:00
|
|
|
nsresult
|
|
|
|
nsNodeListSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
|
|
|
nsWrapperCache* cache = nsnull;
|
|
|
|
CallQueryInterface(nativeObj, &cache);
|
|
|
|
if (!cache) {
|
|
|
|
*parentObj = globalObj;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// nsChildContentList is the only class that uses nsNodeListSH and has a
|
|
|
|
// cached wrapper.
|
|
|
|
nsChildContentList *list = nsChildContentList::FromSupports(nativeObj);
|
2009-10-06 03:16:22 +04:00
|
|
|
nsINode *native_parent = list->GetParentObject();
|
2008-11-13 19:54:52 +03:00
|
|
|
if (!native_parent) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2009-10-06 03:16:22 +04:00
|
|
|
nsresult rv =
|
|
|
|
WrapNativeParent(cx, globalObj, native_parent, native_parent, parentObj);
|
2009-05-13 00:20:42 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2008-11-13 19:54:52 +03:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
|
2008-11-13 19:54:52 +03:00
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult
|
|
|
|
nsNodeListSH::GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length)
|
|
|
|
{
|
2009-05-13 00:20:42 +04:00
|
|
|
nsINodeList* list = static_cast<nsINodeList*>(GetNative(wrapper, obj));
|
2008-10-22 18:31:14 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsINodeList> list_qi = do_QueryWrappedNative(wrapper, obj);
|
2008-10-22 18:31:14 +04:00
|
|
|
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsINodeList pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(list_qi == list, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return list->GetLength(length);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsISupports*
|
|
|
|
nsNodeListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult)
|
|
|
|
{
|
|
|
|
nsINodeList* list = static_cast<nsINodeList*>(aNative);
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsINodeList> list_qi = do_QueryInterface(aNative);
|
|
|
|
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsINodeList pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(list_qi == list, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return list->GetNodeAt(aIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-16 04:44:20 +04:00
|
|
|
// StringList scriptable helper
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsStringListSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMDOMStringList> list(do_QueryInterface(aNative));
|
|
|
|
NS_ENSURE_TRUE(list, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
return list->Item(aIndex, aResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-08-12 12:55:14 +04:00
|
|
|
// DOMTokenList scriptable helper
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsDOMTokenListSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMDOMTokenList> list(do_QueryInterface(aNative));
|
|
|
|
NS_ENSURE_TRUE(list, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
return list->Item(aIndex, aResult);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// Named Array helper
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNamedArraySH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2005-09-30 02:08:09 +04:00
|
|
|
if (JSVAL_IS_STRING(id) && !ObjectIsNativeWrapper(cx, obj)) {
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult rv = NS_OK;
|
2009-05-13 00:20:42 +04:00
|
|
|
nsISupports* item = GetNamedItem(GetNative(wrapper, obj),
|
|
|
|
nsDependentJSString(id),
|
2008-11-01 00:40:35 +03:00
|
|
|
&rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (item) {
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, item, PR_TRUE, vp);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2005-09-28 17:44:31 +04:00
|
|
|
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
2005-09-24 21:38:14 +04:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-09-24 21:38:14 +04:00
|
|
|
// Don't fall through to nsArraySH::GetProperty() here
|
2005-09-28 17:44:31 +04:00
|
|
|
return rv;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return nsArraySH::GetProperty(wrapper, cx, obj, id, vp, _retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// NamedNodeMap helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsNamedNodeMapSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsDOMAttributeMap* map = nsDOMAttributeMap::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return map->GetItemAt(aIndex, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2002-03-24 03:16:18 +03:00
|
|
|
nsNamedNodeMapSH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsDOMAttributeMap* map = nsDOMAttributeMap::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return map->GetNamedItem(aName, aResult);
|
2008-10-31 21:07:26 +03:00
|
|
|
}
|
2008-10-31 18:55:59 +03:00
|
|
|
|
|
|
|
|
2008-10-31 21:07:26 +03:00
|
|
|
// HTMLCollection helper
|
2008-10-31 18:55:59 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult
|
|
|
|
nsHTMLCollectionSH::GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length)
|
|
|
|
{
|
|
|
|
nsIHTMLCollection* collection =
|
2009-05-13 00:20:42 +04:00
|
|
|
static_cast<nsIHTMLCollection*>(GetNative(wrapper, obj));
|
2008-11-01 00:40:35 +03:00
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIHTMLCollection> collection_qi =
|
2009-05-13 00:20:42 +04:00
|
|
|
do_QueryWrappedNative(wrapper, obj);
|
2008-11-01 00:40:35 +03:00
|
|
|
|
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsIHTMLCollection pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(collection_qi == collection, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return collection->GetLength(length);
|
|
|
|
}
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsHTMLCollectionSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsIHTMLCollection* collection = static_cast<nsIHTMLCollection*>(aNative);
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIHTMLCollection> collection_qi = do_QueryInterface(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsIHTMLCollection pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(collection_qi == collection, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return collection->GetNodeAt(aIndex, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2001-05-11 08:45:15 +04:00
|
|
|
nsHTMLCollectionSH::GetNamedItem(nsISupports *aNative,
|
2002-03-24 03:16:18 +03:00
|
|
|
const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsIHTMLCollection* collection = static_cast<nsIHTMLCollection*>(aNative);
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIHTMLCollection> collection_qi = do_QueryInterface(aNative);
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsIHTMLCollection pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(collection_qi == collection, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return collection->GetNamedItem(aName, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-09 04:44:20 +04:00
|
|
|
// ContentList helper
|
|
|
|
nsresult
|
|
|
|
nsContentListSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsContentList *contentList = nsContentList::FromSupports(nativeObj);
|
2009-10-06 03:16:22 +04:00
|
|
|
nsINode *native_parent = contentList->GetParentObject();
|
2002-07-09 04:44:20 +04:00
|
|
|
|
|
|
|
if (!native_parent) {
|
2008-11-13 19:54:52 +03:00
|
|
|
return NS_ERROR_FAILURE;
|
2002-07-09 04:44:20 +04:00
|
|
|
}
|
|
|
|
|
2009-10-06 03:16:22 +04:00
|
|
|
nsresult rv =
|
|
|
|
WrapNativeParent(cx, globalObj, native_parent, native_parent, parentObj);
|
2009-05-13 00:20:42 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2002-07-09 04:44:20 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
|
2002-07-09 04:44:20 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult
|
|
|
|
nsContentListSH::GetLength(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 *length)
|
2008-10-22 18:31:14 +04:00
|
|
|
{
|
2009-05-13 00:20:42 +04:00
|
|
|
nsContentList *list =
|
|
|
|
nsContentList::FromSupports(GetNative(wrapper, obj));
|
2008-10-22 18:31:14 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return list->GetLength(length);
|
2008-10-31 18:55:59 +03:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
|
|
|
nsContentListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult)
|
|
|
|
{
|
|
|
|
nsContentList *list = nsContentList::FromSupports(aNative);
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return list->GetNodeAt(aIndex, aResult);
|
|
|
|
}
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
|
|
|
nsContentListSH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsContentList *list = nsContentList::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return list->GetNamedItem(aName, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDocumentSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
2003-05-31 22:43:48 +04:00
|
|
|
nsresult rv;
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
if (id == sLocation_id) {
|
2009-07-31 03:53:04 +04:00
|
|
|
// Define the location property on the document object itself so
|
|
|
|
// that we can intercept getting and setting of document.location.
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDOMNSDocument> doc(do_QueryWrappedNative(wrapper, obj));
|
2002-05-22 04:34:01 +04:00
|
|
|
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-05-22 04:34:01 +04:00
|
|
|
nsCOMPtr<nsIDOMLocation> location;
|
2003-05-31 22:43:48 +04:00
|
|
|
rv = doc->GetLocation(getter_AddRefs(location));
|
2002-05-22 04:34:01 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2001-05-10 13:45:46 +04:00
|
|
|
|
2002-05-22 04:34:01 +04:00
|
|
|
jsval v;
|
2001-05-10 13:45:46 +04:00
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, location, &NS_GET_IID(nsIDOMLocation), PR_TRUE,
|
|
|
|
&v, getter_AddRefs(holder));
|
2002-05-22 04:34:01 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2001-05-10 13:45:46 +04:00
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-03-10 03:39:28 +03:00
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
2002-05-22 04:34:01 +04:00
|
|
|
JSBool ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), v, nsnull,
|
2003-06-05 01:33:15 +04:00
|
|
|
nsnull, JSPROP_ENUMERATE);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-05-22 04:34:01 +04:00
|
|
|
if (!ok) {
|
|
|
|
return NS_ERROR_FAILURE;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2002-05-22 04:34:01 +04:00
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2006-06-23 20:43:29 +04:00
|
|
|
if (id == sDocumentURIObject_id && IsPrivilegedScript()) {
|
|
|
|
return DefineVoidProp(cx, obj, id, objp);
|
|
|
|
}
|
|
|
|
|
2001-05-10 13:45:46 +04:00
|
|
|
return nsNodeSH::NewResolve(wrapper, cx, obj, id, flags, objp, _retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2002-07-24 10:02:05 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDocumentSH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2006-06-23 20:43:29 +04:00
|
|
|
if (id == sDocumentURIObject_id && IsPrivilegedScript()) {
|
|
|
|
nsCOMPtr<nsIDocument> doc = do_QueryWrappedNative(wrapper);
|
|
|
|
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsIURI* uri = doc->GetDocumentURI();
|
|
|
|
NS_ENSURE_TRUE(uri, NS_ERROR_NOT_AVAILABLE);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, obj, uri, &NS_GET_IID(nsIURI), PR_TRUE, vp,
|
2006-06-23 20:43:29 +04:00
|
|
|
getter_AddRefs(holder));
|
|
|
|
|
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nsNodeSH::GetProperty(wrapper, cx, obj, id, vp, _retval);
|
2002-07-24 10:02:05 +04:00
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDocumentSH::SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2002-08-16 01:18:20 +04:00
|
|
|
if (id == sLocation_id) {
|
2005-03-10 03:39:28 +03:00
|
|
|
nsCOMPtr<nsIDOMNSDocument> doc(do_QueryWrappedNative(wrapper));
|
2002-08-16 01:18:20 +04:00
|
|
|
NS_ENSURE_TRUE(doc, NS_ERROR_UNEXPECTED);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
nsCOMPtr<nsIDOMLocation> location;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
nsresult rv = doc->GetLocation(getter_AddRefs(location));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
if (location) {
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
JSString *val = ::JS_ValueToString(cx, *vp);
|
|
|
|
NS_ENSURE_TRUE(val, NS_ERROR_UNEXPECTED);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-03-30 03:26:56 +04:00
|
|
|
rv = location->SetHref(nsDependentJSString(val));
|
2002-08-16 01:18:20 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, location, &NS_GET_IID(nsIDOMLocation), PR_TRUE,
|
|
|
|
vp, getter_AddRefs(holder));
|
2005-07-29 19:11:08 +04:00
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-06-23 20:43:29 +04:00
|
|
|
if (id == sDocumentURIObject_id && IsPrivilegedScript()) {
|
2007-10-27 05:30:24 +04:00
|
|
|
// We don't want privileged script that can read this property to set it,
|
|
|
|
// but _do_ want to allow everyone else to set a value they can then read.
|
|
|
|
//
|
|
|
|
// XXXbz Is there a better error we could use here?
|
2006-06-23 20:43:29 +04:00
|
|
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
return nsNodeSH::SetProperty(wrapper, cx, obj, id, vp, _retval);
|
|
|
|
}
|
|
|
|
|
2002-08-29 08:05:39 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDocumentSH::GetFlags(PRUint32* aFlags)
|
|
|
|
{
|
|
|
|
*aFlags = DOMCLASSINFO_STANDARD_FLAGS;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2005-07-28 20:15:00 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDocumentSH::PostCreate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj)
|
|
|
|
{
|
|
|
|
// If this is the current document for the window that's the script global
|
|
|
|
// object of this document, then define this document object on the window.
|
|
|
|
// That will make sure that the document is referenced (via window.document)
|
|
|
|
// and prevent it from going away in GC.
|
|
|
|
nsCOMPtr<nsIDocument> doc = do_QueryWrappedNative(wrapper);
|
|
|
|
if (!doc) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2007-07-26 23:18:06 +04:00
|
|
|
nsIScriptGlobalObject *sgo = doc->GetScriptGlobalObject();
|
|
|
|
nsCOMPtr<nsPIDOMWindow> win = do_QueryInterface(sgo);
|
2005-07-28 20:15:00 +04:00
|
|
|
if (!win) {
|
|
|
|
// No window, nothing else to do here
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIDOMDocument* currentDoc = win->GetExtantDocument();
|
|
|
|
|
|
|
|
if (SameCOMIdentity(doc, currentDoc)) {
|
2008-03-01 03:17:38 +03:00
|
|
|
jsval winVal;
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, obj, win, &NS_GET_IID(nsIDOMWindow), PR_FALSE,
|
|
|
|
&winVal, getter_AddRefs(holder));
|
2005-07-28 20:15:00 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
2005-07-31 00:57:07 +04:00
|
|
|
|
2005-07-28 20:15:00 +04:00
|
|
|
NS_NAMED_LITERAL_STRING(doc_str, "document");
|
|
|
|
|
|
|
|
if (!::JS_DefineUCProperty(cx, JSVAL_TO_OBJECT(winVal),
|
2007-07-08 11:08:04 +04:00
|
|
|
reinterpret_cast<const jschar *>
|
|
|
|
(doc_str.get()),
|
2009-05-13 00:18:52 +04:00
|
|
|
doc_str.Length(), OBJECT_TO_JSVAL(obj),
|
|
|
|
JS_PropertyStub, JS_PropertyStub,
|
|
|
|
JSPROP_READONLY | JSPROP_ENUMERATE)) {
|
2005-07-28 20:15:00 +04:00
|
|
|
return NS_ERROR_FAILURE;
|
2007-07-26 23:18:06 +04:00
|
|
|
}
|
2007-12-04 06:49:33 +03:00
|
|
|
}
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// HTMLDocument helper
|
|
|
|
|
2001-12-20 13:16:25 +03:00
|
|
|
// static
|
2001-05-21 16:37:38 +04:00
|
|
|
nsresult
|
2002-02-05 09:44:04 +03:00
|
|
|
nsHTMLDocumentSH::ResolveImpl(JSContext *cx,
|
|
|
|
nsIXPConnectWrappedNative *wrapper, jsval id,
|
2001-05-21 16:37:38 +04:00
|
|
|
nsISupports **result)
|
|
|
|
{
|
2007-12-21 16:44:58 +03:00
|
|
|
nsHTMLDocument *doc =
|
|
|
|
static_cast<nsHTMLDocument*>(static_cast<nsINode*>
|
|
|
|
(wrapper->Native()));
|
2001-05-21 16:37:38 +04:00
|
|
|
|
2002-02-05 09:44:04 +03:00
|
|
|
// 'id' is not always a string, it can be a number since document.1
|
|
|
|
// should map to <input name="1">. Thus we can't use
|
|
|
|
// JSVAL_TO_STRING() here.
|
|
|
|
JSString *str = JS_ValueToString(cx, id);
|
2004-02-10 01:48:53 +03:00
|
|
|
NS_ENSURE_TRUE(str, NS_ERROR_UNEXPECTED);
|
2001-05-21 16:37:38 +04:00
|
|
|
|
2004-02-10 01:48:53 +03:00
|
|
|
return doc->ResolveName(nsDependentJSString(str), nsnull, result);
|
2001-05-21 16:37:38 +04:00
|
|
|
}
|
|
|
|
|
2001-12-20 13:16:25 +03:00
|
|
|
// static
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2001-12-20 13:16:25 +03:00
|
|
|
nsHTMLDocumentSH::DocumentOpen(JSContext *cx, JSObject *obj, uintN argc,
|
|
|
|
jsval *argv, jsval *rval)
|
|
|
|
{
|
|
|
|
if (argc > 2) {
|
2007-08-10 02:19:59 +04:00
|
|
|
JSObject *global = ::JS_GetGlobalForObject(cx, obj);
|
2001-12-20 13:16:25 +03:00
|
|
|
|
|
|
|
// DOM0 quirk that makes document.open() call window.open() if
|
|
|
|
// called with 3 or more arguments.
|
|
|
|
|
|
|
|
return ::JS_CallFunctionName(cx, global, "open", argc, argv, rval);
|
|
|
|
}
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsISupports> native = do_QueryWrapper(cx, obj);
|
|
|
|
if (!native) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_FAILURE);
|
2003-07-15 01:58:59 +04:00
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
2001-12-20 13:16:25 +03:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDOMNSHTMLDocument> doc = do_QueryInterface(native);
|
2001-12-20 13:16:25 +03:00
|
|
|
NS_ENSURE_TRUE(doc, JS_FALSE);
|
|
|
|
|
2004-05-22 03:31:37 +04:00
|
|
|
nsCAutoString contentType("text/html");
|
2004-05-22 01:32:11 +04:00
|
|
|
if (argc > 0) {
|
|
|
|
JSString* jsstr = JS_ValueToString(cx, argv[0]);
|
|
|
|
if (!jsstr) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
2004-05-22 03:31:37 +04:00
|
|
|
nsAutoString type;
|
|
|
|
type.Assign(nsDependentJSString(jsstr));
|
|
|
|
ToLowerCase(type);
|
2005-06-01 19:33:44 +04:00
|
|
|
nsCAutoString actualType, dummy;
|
|
|
|
NS_ParseContentType(NS_ConvertUTF16toUTF8(type), actualType, dummy);
|
2005-10-27 06:39:18 +04:00
|
|
|
if (!actualType.EqualsLiteral("text/html") &&
|
|
|
|
!type.EqualsLiteral("replace")) {
|
2004-05-22 03:31:37 +04:00
|
|
|
contentType = "text/plain";
|
|
|
|
}
|
2004-05-22 01:32:11 +04:00
|
|
|
}
|
|
|
|
|
2004-04-28 05:40:39 +04:00
|
|
|
PRBool replace = PR_FALSE;
|
|
|
|
if (argc > 1) {
|
|
|
|
JSString* jsstr = JS_ValueToString(cx, argv[1]);
|
|
|
|
if (!jsstr) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
2001-12-20 13:16:25 +03:00
|
|
|
|
2004-04-28 05:40:39 +04:00
|
|
|
replace = NS_LITERAL_STRING("replace").
|
2007-07-08 11:08:04 +04:00
|
|
|
Equals(reinterpret_cast<const PRUnichar*>
|
|
|
|
(::JS_GetStringChars(jsstr)));
|
2004-04-28 05:40:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMDocument> retval;
|
2009-05-13 00:20:42 +04:00
|
|
|
nsresult rv = doc->Open(contentType, replace, getter_AddRefs(retval));
|
2003-07-15 01:58:59 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
2001-12-20 13:16:25 +03:00
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, retval, &NS_GET_IID(nsIDOMDocument), PR_FALSE, rval,
|
2005-09-07 06:56:15 +04:00
|
|
|
getter_AddRefs(holder));
|
2001-12-20 13:16:25 +03:00
|
|
|
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to wrap native!");
|
|
|
|
|
|
|
|
return NS_SUCCEEDED(rv);
|
|
|
|
}
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
|
|
|
|
static JSClass sHTMLDocumentAllClass = {
|
|
|
|
"HTML document.all class",
|
2004-08-26 07:49:17 +04:00
|
|
|
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_NEW_RESOLVE |
|
2004-08-24 05:31:19 +04:00
|
|
|
JSCLASS_HAS_RESERVED_SLOTS(1),
|
2004-07-23 04:26:02 +04:00
|
|
|
JS_PropertyStub, JS_PropertyStub, nsHTMLDocumentSH::DocumentAllGetProperty,
|
|
|
|
JS_PropertyStub, JS_EnumerateStub,
|
|
|
|
(JSResolveOp)nsHTMLDocumentSH::DocumentAllNewResolve, JS_ConvertStub,
|
|
|
|
nsHTMLDocumentSH::ReleaseDocument, nsnull, nsnull,
|
|
|
|
nsHTMLDocumentSH::CallToGetPropMapper
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static JSClass sHTMLDocumentAllHelperClass = {
|
|
|
|
"HTML document.all helper class", JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE,
|
|
|
|
JS_PropertyStub, JS_PropertyStub,
|
|
|
|
nsHTMLDocumentSH::DocumentAllHelperGetProperty,
|
|
|
|
JS_PropertyStub, JS_EnumerateStub,
|
|
|
|
(JSResolveOp)nsHTMLDocumentSH::DocumentAllHelperNewResolve, JS_ConvertStub,
|
2009-07-22 20:23:21 +04:00
|
|
|
nsnull
|
2004-07-23 04:26:02 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static JSClass sHTMLDocumentAllTagsClass = {
|
|
|
|
"HTML document.all.tags class",
|
|
|
|
JSCLASS_HAS_PRIVATE | JSCLASS_NEW_RESOLVE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
|
|
|
|
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
|
|
|
|
JS_EnumerateStub, (JSResolveOp)nsHTMLDocumentSH::DocumentAllTagsNewResolve,
|
|
|
|
JS_ConvertStub, nsHTMLDocumentSH::ReleaseDocument, nsnull, nsnull,
|
|
|
|
nsHTMLDocumentSH::CallToGetPropMapper
|
|
|
|
};
|
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
// static
|
|
|
|
JSBool
|
|
|
|
nsHTMLDocumentSH::GetDocumentAllNodeList(JSContext *cx, JSObject *obj,
|
|
|
|
nsIDOMDocument *domdoc,
|
|
|
|
nsIDOMNodeList **nodeList)
|
|
|
|
{
|
|
|
|
// The document.all object is a mix of the node list returned by
|
|
|
|
// document.getElementsByTagName("*") and a map of elements in the
|
|
|
|
// document exposed by their id and/or name. To make access to the
|
|
|
|
// node list part (i.e. access to elements by index) not walk the
|
|
|
|
// document each time, we create a nsContentList and hold on to it
|
|
|
|
// in a reserved slot (0) on the document.all JSObject.
|
|
|
|
jsval collection;
|
|
|
|
nsresult rv = NS_OK;
|
|
|
|
|
|
|
|
if (!JS_GetReservedSlot(cx, obj, 0, &collection)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!JSVAL_IS_PRIMITIVE(collection)) {
|
|
|
|
// We already have a node list in our reserved slot, use it.
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsISupports *native =
|
|
|
|
sXPConnect->GetNativeOfWrapper(cx, JSVAL_TO_OBJECT(collection));
|
|
|
|
if (native) {
|
|
|
|
CallQueryInterface(native, nodeList);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
rv = NS_ERROR_FAILURE;
|
2004-08-24 05:31:19 +04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// No node list for this document.all yet, create one...
|
|
|
|
|
|
|
|
rv |= domdoc->GetElementsByTagName(NS_LITERAL_STRING("*"), nodeList);
|
|
|
|
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
rv |= nsDOMClassInfo::WrapNative(cx, obj, *nodeList, PR_FALSE, &collection,
|
2005-09-07 06:56:15 +04:00
|
|
|
getter_AddRefs(holder));
|
2004-08-24 05:31:19 +04:00
|
|
|
|
|
|
|
// ... and store it in our reserved slot.
|
|
|
|
if (!JS_SetReservedSlot(cx, obj, 0, collection)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return *nodeList != nsnull;
|
|
|
|
}
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-07-23 04:26:02 +04:00
|
|
|
nsHTMLDocumentSH::DocumentAllGetProperty(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, jsval *vp)
|
|
|
|
{
|
2004-08-24 05:31:19 +04:00
|
|
|
// document.all.item and .namedItem get their value in the
|
|
|
|
// newResolve hook, so nothing to do for those properties here. And
|
|
|
|
// we need to return early to prevent <div id="item"> from shadowing
|
|
|
|
// document.all.item(), etc.
|
|
|
|
if (id == sItem_id || id == sNamedItem_id) {
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
2009-05-19 03:45:29 +04:00
|
|
|
while (STOBJ_GET_CLASS(obj) != &sHTMLDocumentAllClass) {
|
|
|
|
obj = STOBJ_GET_PROTO(obj);
|
|
|
|
|
|
|
|
if (!obj) {
|
|
|
|
NS_ERROR("The JS engine lies!");
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(cx, obj);
|
2004-08-24 05:31:19 +04:00
|
|
|
nsCOMPtr<nsIDOMHTMLDocument> domdoc(do_QueryInterface(doc));
|
|
|
|
nsCOMPtr<nsISupports> result;
|
|
|
|
nsresult rv = NS_OK;
|
2004-07-23 04:26:02 +04:00
|
|
|
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
2004-08-24 05:31:19 +04:00
|
|
|
if (id == sLength_id) {
|
|
|
|
// Map document.all.length to the length of the collection
|
|
|
|
// document.getElementsByTagName("*"), and make sure <div
|
|
|
|
// id="length"> doesn't shadow document.all.length.
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMNodeList> nodeList;
|
|
|
|
if (!GetDocumentAllNodeList(cx, obj, domdoc, getter_AddRefs(nodeList))) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint32 length;
|
|
|
|
rv = nodeList->GetLength(&length);
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*vp = INT_TO_JSVAL(length);
|
2008-08-26 03:48:37 +04:00
|
|
|
|
|
|
|
return JS_TRUE;
|
2004-08-24 05:31:19 +04:00
|
|
|
} else if (id != sTags_id) {
|
|
|
|
// For all other strings, look for an element by id or name.
|
|
|
|
|
|
|
|
nsDependentJSString str(id);
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2007-07-26 04:36:19 +04:00
|
|
|
rv = doc->GetDocumentAllResult(str, getter_AddRefs(result));
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2007-07-26 04:36:19 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
2007-03-23 02:01:14 +03:00
|
|
|
|
2007-07-26 04:36:19 +04:00
|
|
|
return JS_FALSE;
|
2004-08-24 05:31:19 +04:00
|
|
|
}
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
2008-08-26 03:48:37 +04:00
|
|
|
} else if (JSVAL_IS_INT(id) && JSVAL_TO_INT(id) >= 0) {
|
2004-08-24 05:31:19 +04:00
|
|
|
// Map document.all[n] (where n is a number) to the n:th item in
|
|
|
|
// the document.all node list.
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
nsCOMPtr<nsIDOMNodeList> nodeList;
|
|
|
|
if (!GetDocumentAllNodeList(cx, obj, domdoc, getter_AddRefs(nodeList))) {
|
|
|
|
return JS_FALSE;
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
nsCOMPtr<nsIDOMNode> node;
|
|
|
|
nodeList->Item(JSVAL_TO_INT(id), getter_AddRefs(node));
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
result = node;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (result) {
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, result, PR_TRUE, vp);
|
2004-08-24 05:31:19 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
2007-07-26 04:36:19 +04:00
|
|
|
} else {
|
|
|
|
*vp = JSVAL_VOID;
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-08-26 07:49:17 +04:00
|
|
|
nsHTMLDocumentSH::DocumentAllNewResolve(JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
uintN flags, JSObject **objp)
|
2004-07-23 04:26:02 +04:00
|
|
|
{
|
2004-08-24 05:31:19 +04:00
|
|
|
if (flags & JSRESOLVE_ASSIGNING) {
|
|
|
|
// Nothing to do here if we're assigning
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
jsval v = JSVAL_VOID;
|
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
if (id == sItem_id || id == sNamedItem_id) {
|
|
|
|
// Define the item() or namedItem() method.
|
|
|
|
|
|
|
|
JSFunction *fnc =
|
|
|
|
::JS_DefineFunction(cx, obj, ::JS_GetStringBytes(JSVAL_TO_STRING(id)),
|
|
|
|
CallToGetPropMapper, 0, JSPROP_ENUMERATE);
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return fnc != nsnull;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (id == sLength_id) {
|
|
|
|
// document.all.length. Any jsval other than undefined would do
|
|
|
|
// here, all we need is to get into the code below that defines
|
|
|
|
// this propery on obj, the rest happens in
|
|
|
|
// DocumentAllGetProperty().
|
|
|
|
|
|
|
|
v = JSVAL_ONE;
|
|
|
|
} else if (id == sTags_id) {
|
2004-07-23 04:26:02 +04:00
|
|
|
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(cx, obj);
|
|
|
|
|
|
|
|
JSObject *tags = ::JS_NewObject(cx, &sHTMLDocumentAllTagsClass, nsnull,
|
2007-08-10 02:19:59 +04:00
|
|
|
::JS_GetGlobalForObject(cx, obj));
|
2004-07-23 04:26:02 +04:00
|
|
|
if (!tags) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!::JS_SetPrivate(cx, tags, doc)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The "tags" JSObject now also owns doc.
|
|
|
|
NS_ADDREF(doc);
|
|
|
|
|
|
|
|
v = OBJECT_TO_JSVAL(tags);
|
|
|
|
} else {
|
|
|
|
if (!DocumentAllGetProperty(cx, obj, id, &v)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
JSBool ok = JS_TRUE;
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
if (v != JSVAL_VOID) {
|
2004-08-24 05:31:19 +04:00
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
ok = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), v, nsnull, nsnull,
|
|
|
|
0);
|
|
|
|
} else {
|
|
|
|
ok = ::JS_DefineElement(cx, obj, JSVAL_TO_INT(id), v, nsnull, nsnull, 0);
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
return ok;
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
// Finalize hook used by document related JS objects, but also by
|
|
|
|
// sGlobalScopePolluterClass!
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
void
|
2004-07-23 04:26:02 +04:00
|
|
|
nsHTMLDocumentSH::ReleaseDocument(JSContext *cx, JSObject *obj)
|
|
|
|
{
|
|
|
|
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(cx, obj);
|
|
|
|
|
|
|
|
NS_IF_RELEASE(doc);
|
|
|
|
}
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-07-23 04:26:02 +04:00
|
|
|
nsHTMLDocumentSH::CallToGetPropMapper(JSContext *cx, JSObject *obj, uintN argc,
|
|
|
|
jsval *argv, jsval *rval)
|
|
|
|
{
|
|
|
|
// Handle document.all("foo") style access to document.all.
|
|
|
|
|
|
|
|
if (argc != 1) {
|
|
|
|
// XXX: Should throw NS_ERROR_XPC_NOT_ENOUGH_ARGS for argc < 1,
|
|
|
|
// and create a new NS_ERROR_XPC_TOO_MANY_ARGS for argc > 1? IE
|
|
|
|
// accepts nothing other than one arg.
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_INVALID_ARG);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all types to string.
|
|
|
|
JSString *str = ::JS_ValueToString(cx, argv[0]);
|
|
|
|
if (!str) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
2004-08-24 05:31:19 +04:00
|
|
|
JSObject *self;
|
|
|
|
|
2005-06-03 22:16:26 +04:00
|
|
|
if (::JS_TypeOfValue(cx, argv[-2]) == JSTYPE_FUNCTION) {
|
|
|
|
// If argv[-2] is a function, we're called through
|
|
|
|
// document.all.item() or something similar. In such a case, self
|
2004-08-24 05:31:19 +04:00
|
|
|
// is passed as obj.
|
|
|
|
|
|
|
|
self = obj;
|
|
|
|
} else {
|
|
|
|
// In other cases (i.e. document.all("foo")), self is passed as
|
|
|
|
// argv[-2].
|
|
|
|
|
|
|
|
self = JSVAL_TO_OBJECT(argv[-2]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ::JS_GetUCProperty(cx, self, ::JS_GetStringChars(str),
|
2004-07-23 04:26:02 +04:00
|
|
|
::JS_GetStringLength(str), rval);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static inline JSObject *
|
|
|
|
GetDocumentAllHelper(JSContext *cx, JSObject *obj)
|
|
|
|
{
|
|
|
|
while (obj && JS_GET_CLASS(cx, obj) != &sHTMLDocumentAllHelperClass) {
|
|
|
|
obj = ::JS_GetPrototype(cx, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-07-23 04:26:02 +04:00
|
|
|
nsHTMLDocumentSH::DocumentAllHelperGetProperty(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, jsval *vp)
|
|
|
|
{
|
|
|
|
if (id != nsDOMClassInfo::sAll_id) {
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *helper = GetDocumentAllHelper(cx, obj);
|
|
|
|
|
|
|
|
if (!helper) {
|
|
|
|
NS_ERROR("Uh, how'd we get here?");
|
|
|
|
|
|
|
|
// Let scripts continue, if we somehow did get here...
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
PRUint32 flags = JSVAL_TO_INT(PRIVATE_TO_JSVAL(::JS_GetPrivate(cx, helper)));
|
|
|
|
|
|
|
|
if (flags & JSRESOLVE_DETECTING || !(flags & JSRESOLVE_QUALIFIED)) {
|
|
|
|
// document.all is either being detected, e.g. if (document.all),
|
|
|
|
// or it was not being resolved with a qualified name. Claim that
|
|
|
|
// document.all is undefined.
|
|
|
|
|
|
|
|
*vp = JSVAL_VOID;
|
|
|
|
} else {
|
|
|
|
// document.all is not being detected, and it resolved with a
|
|
|
|
// qualified name. Expose the document.all collection.
|
|
|
|
|
|
|
|
if (!JSVAL_IS_OBJECT(*vp)) {
|
|
|
|
// First time through, create the collection, and set the
|
|
|
|
// document as its private nsISupports data.
|
2009-05-13 00:20:42 +04:00
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsIHTMLDocument> doc = do_QueryWrapper(cx, obj, &rv);
|
2004-07-23 04:26:02 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *all = ::JS_NewObject(cx, &sHTMLDocumentAllClass, nsnull,
|
2007-08-10 02:19:59 +04:00
|
|
|
::JS_GetGlobalForObject(cx, obj));
|
2004-07-23 04:26:02 +04:00
|
|
|
if (!all) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Let the JSObject take over ownership of doc.
|
|
|
|
if (!::JS_SetPrivate(cx, all, doc)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
doc.forget();
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
*vp = OBJECT_TO_JSVAL(all);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-07-23 04:26:02 +04:00
|
|
|
nsHTMLDocumentSH::DocumentAllHelperNewResolve(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, uintN flags,
|
|
|
|
JSObject **objp)
|
|
|
|
{
|
|
|
|
if (id == nsDOMClassInfo::sAll_id) {
|
|
|
|
// document.all is resolved for the first time. Define it.
|
|
|
|
JSObject *helper = GetDocumentAllHelper(cx, obj);
|
|
|
|
|
|
|
|
if (helper) {
|
2006-04-03 20:54:53 +04:00
|
|
|
if (!::JS_DefineProperty(cx, helper, "all", JSVAL_VOID, nsnull, nsnull,
|
|
|
|
JSPROP_ENUMERATE)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
2004-07-23 04:26:02 +04:00
|
|
|
|
|
|
|
*objp = helper;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-09-07 02:21:43 +04:00
|
|
|
JSBool
|
2004-07-23 04:26:02 +04:00
|
|
|
nsHTMLDocumentSH::DocumentAllTagsNewResolve(JSContext *cx, JSObject *obj,
|
|
|
|
jsval id, uintN flags,
|
|
|
|
JSObject **objp)
|
|
|
|
{
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
nsIHTMLDocument *doc = (nsIHTMLDocument *)::JS_GetPrivate(cx, obj);
|
|
|
|
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
|
|
|
|
2007-02-23 05:18:22 +03:00
|
|
|
JSObject *proto = ::JS_GetPrototype(cx, obj);
|
|
|
|
if (NS_UNLIKELY(!proto)) {
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
JSBool found;
|
2007-02-23 05:18:22 +03:00
|
|
|
if (!::JS_HasUCProperty(cx, proto,
|
2004-07-23 04:26:02 +04:00
|
|
|
::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), &found)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (found) {
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMDocument> domdoc(do_QueryInterface(doc));
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMNodeList> tags;
|
|
|
|
domdoc->GetElementsByTagName(nsDependentJSString(str),
|
|
|
|
getter_AddRefs(tags));
|
|
|
|
|
|
|
|
if (tags) {
|
|
|
|
jsval v;
|
2005-09-07 06:56:15 +04:00
|
|
|
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = nsDOMClassInfo::WrapNative(cx, obj, tags, PR_TRUE, &v,
|
2005-09-07 06:56:15 +04:00
|
|
|
getter_AddRefs(holder));
|
2004-07-23 04:26:02 +04:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, rv);
|
|
|
|
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), v, nsnull, nsnull,
|
|
|
|
0)) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return JS_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
2001-05-21 16:37:38 +04:00
|
|
|
nsHTMLDocumentSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2003-05-31 22:43:48 +04:00
|
|
|
// nsDocumentSH::NewResolve() does a security check that we'd kinda
|
|
|
|
// want to do here too before doing anything else. But given that we
|
|
|
|
// only define dynamic properties here before the call to
|
|
|
|
// nsDocumentSH::NewResolve() we're ok, since once those properties
|
|
|
|
// are accessed, we'll do the necessary security check.
|
|
|
|
|
2002-02-05 09:44:04 +03:00
|
|
|
if (!(flags & JSRESOLVE_ASSIGNING)) {
|
2005-08-19 19:12:36 +04:00
|
|
|
// For native wrappers, do not resolve random names on document
|
2006-06-13 02:39:55 +04:00
|
|
|
|
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
if (!ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
nsCOMPtr<nsISupports> result;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
nsresult rv = ResolveImpl(cx, wrapper, id, getter_AddRefs(result));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
if (result) {
|
|
|
|
JSString *str = JS_ValueToString(cx, id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
JSBool ok = *_retval =
|
|
|
|
::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str), JSVAL_VOID, nsnull,
|
|
|
|
nsnull, 0);
|
|
|
|
*objp = obj;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
return ok ? NS_OK : NS_ERROR_FAILURE;
|
|
|
|
}
|
2001-05-21 16:37:38 +04:00
|
|
|
}
|
2001-12-20 13:16:25 +03:00
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
if (id == sOpen_id) {
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
2001-12-20 13:16:25 +03:00
|
|
|
JSFunction *fnc =
|
2002-08-16 01:18:20 +04:00
|
|
|
::JS_DefineFunction(cx, obj, ::JS_GetStringBytes(str),
|
2001-12-20 13:16:25 +03:00
|
|
|
DocumentOpen, 0, JSPROP_ENUMERATE);
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return fnc ? NS_OK : NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2004-07-23 04:26:02 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
if (id == sAll_id && !sDisableDocumentAllSupport &&
|
|
|
|
!ObjectIsNativeWrapper(cx, obj)) {
|
2007-12-21 16:44:58 +03:00
|
|
|
nsIDocument *doc = static_cast<nsIDocument*>(wrapper->Native());
|
2004-08-26 07:49:17 +04:00
|
|
|
|
|
|
|
if (doc->GetCompatibilityMode() == eCompatibility_NavQuirks) {
|
|
|
|
JSObject *helper =
|
|
|
|
GetDocumentAllHelper(cx, ::JS_GetPrototype(cx, obj));
|
|
|
|
|
2004-10-07 05:40:19 +04:00
|
|
|
JSObject *proto = ::JS_GetPrototype(cx, helper ? helper : obj);
|
|
|
|
|
|
|
|
// Check if the property all is defined on obj's (or helper's
|
2006-03-16 21:30:36 +03:00
|
|
|
// if obj doesn't exist) prototype, if it is, don't expose our
|
2004-10-07 05:40:19 +04:00
|
|
|
// document.all helper.
|
|
|
|
|
|
|
|
JSBool hasAll = JS_FALSE;
|
|
|
|
if (proto && !JS_HasProperty(cx, proto, "all", &hasAll)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasAll && helper) {
|
|
|
|
// Our helper's prototype now has an "all" property, remove
|
|
|
|
// the helper out of the prototype chain to prevent
|
|
|
|
// shadowing of the now defined "all" property.
|
|
|
|
JSObject *tmp = obj, *tmpProto;
|
|
|
|
|
|
|
|
while ((tmpProto = ::JS_GetPrototype(cx, tmp)) != helper) {
|
|
|
|
tmp = tmpProto;
|
|
|
|
}
|
|
|
|
|
|
|
|
::JS_SetPrototype(cx, tmp, proto);
|
|
|
|
}
|
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
// If we don't already have a helper, and we're resolving
|
|
|
|
// document.all qualified, and we're *not* detecting
|
2004-10-07 05:40:19 +04:00
|
|
|
// document.all, e.g. if (document.all), and "all" isn't
|
|
|
|
// already defined on our prototype, create a helper.
|
2004-08-26 07:49:17 +04:00
|
|
|
if (!helper && flags & JSRESOLVE_QUALIFIED &&
|
2004-10-07 05:40:19 +04:00
|
|
|
!(flags & JSRESOLVE_DETECTING) && !hasAll) {
|
2006-03-16 21:30:36 +03:00
|
|
|
// Print a warning so developers can stop using document.all
|
|
|
|
PrintWarningOnConsole(cx, "DocumentAllUsed");
|
|
|
|
|
|
|
|
helper = ::JS_NewObject(cx, &sHTMLDocumentAllHelperClass,
|
|
|
|
::JS_GetPrototype(cx, obj),
|
2007-08-10 02:19:59 +04:00
|
|
|
::JS_GetGlobalForObject(cx, obj));
|
2004-08-26 07:49:17 +04:00
|
|
|
|
|
|
|
if (!helper) {
|
|
|
|
return NS_ERROR_OUT_OF_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Insert the helper into our prototype chain. helper's prototype
|
|
|
|
// is already obj's current prototype.
|
|
|
|
if (!::JS_SetPrototype(cx, obj, helper)) {
|
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2004-07-23 04:26:02 +04:00
|
|
|
}
|
|
|
|
|
2004-08-26 07:49:17 +04:00
|
|
|
// If we have (or just created) a helper, pass the resolve flags
|
|
|
|
// to the helper as its private data.
|
|
|
|
if (helper &&
|
|
|
|
!::JS_SetPrivate(cx, helper,
|
|
|
|
JSVAL_TO_PRIVATE(INT_TO_JSVAL(flags)))) {
|
2004-07-23 04:26:02 +04:00
|
|
|
nsDOMClassInfo::ThrowJSException(cx, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2001-05-21 16:37:38 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return nsDocumentSH::NewResolve(wrapper, cx, obj, id, flags, objp, _retval);
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-05-21 16:37:38 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLDocumentSH::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2005-08-19 19:12:36 +04:00
|
|
|
// For native wrappers, do not get random names on document
|
2007-09-28 18:28:16 +04:00
|
|
|
if (!ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
nsCOMPtr<nsISupports> result;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2007-09-28 18:28:16 +04:00
|
|
|
JSAutoRequest ar(cx);
|
2006-06-13 02:39:55 +04:00
|
|
|
|
2007-09-28 18:28:16 +04:00
|
|
|
nsresult rv = ResolveImpl(cx, wrapper, id, getter_AddRefs(result));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2007-09-28 18:28:16 +04:00
|
|
|
if (result) {
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, result, PR_TRUE, vp);
|
2007-09-28 18:28:16 +04:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
return rv;
|
2005-07-29 19:11:08 +04:00
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2007-09-28 18:28:16 +04:00
|
|
|
return nsDocumentSH::GetProperty(wrapper, cx, obj, id, vp, _retval);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// HTMLFormElement helper
|
|
|
|
|
2001-05-12 09:26:07 +04:00
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsHTMLFormElementSH::FindNamedItem(nsIForm *aForm, JSString *str,
|
|
|
|
nsISupports **aResult)
|
|
|
|
{
|
2004-02-10 01:48:53 +03:00
|
|
|
nsDependentJSString name(str);
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2008-10-10 03:31:40 +04:00
|
|
|
*aResult = aForm->ResolveName(name).get();
|
2001-05-12 09:26:07 +04:00
|
|
|
|
|
|
|
if (!*aResult) {
|
|
|
|
nsCOMPtr<nsIContent> content(do_QueryInterface(aForm));
|
|
|
|
nsCOMPtr<nsIDOMHTMLFormElement> form_element(do_QueryInterface(aForm));
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
nsCOMPtr<nsIHTMLDocument> html_doc =
|
|
|
|
do_QueryInterface(content->GetDocument());
|
2001-05-12 09:26:07 +04:00
|
|
|
|
|
|
|
if (html_doc && form_element) {
|
|
|
|
html_doc->ResolveName(name, form_element, aResult);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLFormElementSH::NewResolve(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
PRUint32 flags, JSObject **objp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2005-08-19 19:12:36 +04:00
|
|
|
// For native wrappers, do not resolve random names on form
|
|
|
|
if ((!(JSRESOLVE_ASSIGNING & flags)) && JSVAL_IS_STRING(id) &&
|
|
|
|
!ObjectIsNativeWrapper(cx, obj)) {
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIForm> form(do_QueryWrappedNative(wrapper, obj));
|
2001-05-12 09:26:07 +04:00
|
|
|
nsCOMPtr<nsISupports> result;
|
|
|
|
|
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
|
|
|
FindNamedItem(form, str, getter_AddRefs(result));
|
|
|
|
|
|
|
|
if (result) {
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
2001-05-12 09:26:07 +04:00
|
|
|
*_retval = ::JS_DefineUCProperty(cx, obj, ::JS_GetStringChars(str),
|
|
|
|
::JS_GetStringLength(str),
|
|
|
|
JSVAL_VOID, nsnull, nsnull, 0);
|
|
|
|
|
|
|
|
*objp = obj;
|
|
|
|
|
|
|
|
return *_retval ? NS_OK : NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::NewResolve(wrapper, cx, obj, id, flags, objp, _retval);
|
2001-05-12 09:26:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLFormElementSH::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIForm> form(do_QueryWrappedNative(wrapper, obj));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
2005-08-19 19:12:36 +04:00
|
|
|
// For native wrappers, do not get random names on form
|
|
|
|
if (!ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
nsCOMPtr<nsISupports> result;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
JSString *str = JSVAL_TO_STRING(id);
|
|
|
|
FindNamedItem(form, str, getter_AddRefs(result));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-08-19 19:12:36 +04:00
|
|
|
if (result) {
|
|
|
|
// Wrap result, result can be either an element or a list of
|
|
|
|
// elements
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, obj, result, PR_TRUE, vp);
|
2005-08-19 19:12:36 +04:00
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
2007-09-28 18:28:16 +04:00
|
|
|
} else {
|
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id);
|
2001-05-30 06:25:52 +04:00
|
|
|
|
2007-09-28 18:28:16 +04:00
|
|
|
if (n >= 0) {
|
2009-10-30 04:49:11 +03:00
|
|
|
nsIFormControl* control = form->GetElementAt(n);
|
2007-03-23 02:01:14 +03:00
|
|
|
|
2007-09-28 18:28:16 +04:00
|
|
|
if (control) {
|
2009-05-21 12:17:51 +04:00
|
|
|
nsresult rv = WrapNative(cx, obj, control, PR_TRUE, vp);
|
2007-09-28 18:28:16 +04:00
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::GetProperty(wrapper, cx, obj, id, vp, _retval);;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2002-03-20 11:01:54 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLFormElementSH::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj,
|
|
|
|
PRUint32 enum_op, jsval *statep,
|
|
|
|
jsid *idp, PRBool *_retval)
|
|
|
|
{
|
2002-08-16 01:18:20 +04:00
|
|
|
switch (enum_op) {
|
|
|
|
case JSENUMERATE_INIT:
|
2002-03-20 11:01:54 +03:00
|
|
|
{
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIForm> form(do_QueryWrappedNative(wrapper, obj));
|
2002-03-20 11:01:54 +03:00
|
|
|
|
|
|
|
if (!form) {
|
|
|
|
*statep = JSVAL_NULL;
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2002-08-16 01:18:20 +04:00
|
|
|
|
2002-03-20 11:01:54 +03:00
|
|
|
*statep = INT_TO_JSVAL(0);
|
2002-08-16 01:18:20 +04:00
|
|
|
|
|
|
|
if (idp) {
|
2008-10-10 03:31:40 +04:00
|
|
|
PRUint32 count = form->GetElementCount();
|
2002-08-16 01:18:20 +04:00
|
|
|
|
2002-03-20 11:01:54 +03:00
|
|
|
*idp = INT_TO_JSVAL(count);
|
2002-08-16 01:18:20 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2002-03-20 11:01:54 +03:00
|
|
|
}
|
2002-08-16 01:18:20 +04:00
|
|
|
case JSENUMERATE_NEXT:
|
2002-03-20 11:01:54 +03:00
|
|
|
{
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIForm> form(do_QueryWrappedNative(wrapper, obj));
|
2002-03-20 11:01:54 +03:00
|
|
|
NS_ENSURE_TRUE(form, NS_ERROR_FAILURE);
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
PRInt32 index = (PRInt32)JSVAL_TO_INT(*statep);
|
|
|
|
|
2008-10-10 03:31:40 +04:00
|
|
|
PRUint32 count = form->GetElementCount();
|
2002-08-16 01:18:20 +04:00
|
|
|
|
2002-03-20 11:01:54 +03:00
|
|
|
if ((PRUint32)index < count) {
|
2009-10-30 04:49:11 +03:00
|
|
|
nsIFormControl* controlNode = form->GetElementAt(index);
|
2002-03-20 11:01:54 +03:00
|
|
|
NS_ENSURE_TRUE(controlNode, NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMElement> domElement = do_QueryInterface(controlNode);
|
|
|
|
NS_ENSURE_TRUE(domElement, NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
nsAutoString attr;
|
|
|
|
domElement->GetAttribute(NS_LITERAL_STRING("name"), attr);
|
|
|
|
if (attr.IsEmpty()) {
|
|
|
|
// If name is not there, use index instead
|
|
|
|
attr.AppendInt(index);
|
|
|
|
}
|
2006-06-13 02:39:55 +04:00
|
|
|
|
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2002-08-16 01:18:20 +04:00
|
|
|
JSString *jsname =
|
2007-07-08 11:08:04 +04:00
|
|
|
JS_NewUCStringCopyN(cx, reinterpret_cast<const jschar *>
|
|
|
|
(attr.get()),
|
2002-08-16 01:18:20 +04:00
|
|
|
attr.Length());
|
2002-03-20 11:01:54 +03:00
|
|
|
NS_ENSURE_TRUE(jsname, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
JS_ValueToId(cx, STRING_TO_JSVAL(jsname), idp);
|
|
|
|
|
|
|
|
*statep = INT_TO_JSVAL(++index);
|
|
|
|
} else {
|
|
|
|
*statep = JSVAL_NULL;
|
|
|
|
}
|
2002-08-16 01:18:20 +04:00
|
|
|
|
2002-03-20 11:01:54 +03:00
|
|
|
break;
|
|
|
|
}
|
2002-08-16 01:18:20 +04:00
|
|
|
case JSENUMERATE_DESTROY:
|
|
|
|
*statep = JSVAL_NULL;
|
|
|
|
|
|
|
|
break;
|
2002-03-20 11:01:54 +03:00
|
|
|
}
|
2002-08-16 01:18:20 +04:00
|
|
|
|
2002-03-20 11:01:54 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-05-12 09:26:07 +04:00
|
|
|
// HTMLSelectElement helper
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLSelectElementSH::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2001-06-28 08:26:29 +04:00
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id);
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
nsresult rv = NS_OK;
|
2001-06-28 08:26:29 +04:00
|
|
|
if (n >= 0) {
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDOMHTMLSelectElement> s = do_QueryWrappedNative(wrapper, obj);
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2003-03-14 10:00:53 +03:00
|
|
|
nsCOMPtr<nsIDOMHTMLOptionsCollection> options;
|
2001-05-12 09:26:07 +04:00
|
|
|
s->GetOptions(getter_AddRefs(options));
|
|
|
|
|
|
|
|
if (options) {
|
|
|
|
nsCOMPtr<nsIDOMNode> node;
|
|
|
|
|
|
|
|
options->Item(n, getter_AddRefs(node));
|
|
|
|
|
2009-05-21 12:17:51 +04:00
|
|
|
rv = WrapNative(cx, obj, node, &NS_GET_IID(nsIDOMNode), PR_TRUE, vp);
|
2005-07-29 19:11:08 +04:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
2007-09-28 18:28:16 +04:00
|
|
|
return rv;
|
2001-05-12 09:26:07 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::GetProperty(wrapper, cx, obj, id, vp, _retval);;
|
2001-05-12 09:26:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsHTMLSelectElementSH::SetOption(JSContext *cx, jsval *vp, PRUint32 aIndex,
|
|
|
|
nsIDOMNSHTMLOptionCollection *aOptCollection)
|
|
|
|
{
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2001-05-12 09:26:07 +04:00
|
|
|
// vp must refer to an object
|
2006-06-13 02:39:55 +04:00
|
|
|
if (!JSVAL_IS_OBJECT(*vp) && !::JS_ConvertValue(cx, *vp, JSTYPE_OBJECT, vp)) {
|
2001-05-12 09:26:07 +04:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMHTMLOptionElement> new_option;
|
|
|
|
|
|
|
|
if (!JSVAL_IS_NULL(*vp)) {
|
2009-05-13 00:20:42 +04:00
|
|
|
new_option = do_QueryWrapper(cx, JSVAL_TO_OBJECT(*vp));
|
2001-05-12 09:26:07 +04:00
|
|
|
if (!new_option) {
|
|
|
|
// Someone is trying to set an option to a non-option object.
|
|
|
|
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return aOptCollection->SetOption(aIndex, new_option);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLSelectElementSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2003-11-12 17:25:03 +03:00
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id);
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2001-07-10 11:31:31 +04:00
|
|
|
if (n >= 0) {
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDOMHTMLSelectElement> select =
|
|
|
|
do_QueryWrappedNative(wrapper, obj);
|
2001-07-10 11:31:31 +04:00
|
|
|
NS_ENSURE_TRUE(select, NS_ERROR_UNEXPECTED);
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2003-03-14 10:00:53 +03:00
|
|
|
nsCOMPtr<nsIDOMHTMLOptionsCollection> options;
|
2001-07-10 11:31:31 +04:00
|
|
|
select->GetOptions(getter_AddRefs(options));
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2001-07-10 11:31:31 +04:00
|
|
|
nsCOMPtr<nsIDOMNSHTMLOptionCollection> oc(do_QueryInterface(options));
|
|
|
|
NS_ENSURE_TRUE(oc, NS_ERROR_UNEXPECTED);
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
nsresult rv = SetOption(cx, vp, n, oc);
|
|
|
|
return NS_FAILED(rv) ? rv : NS_SUCCESS_I_DID_SOMETHING;
|
2001-07-10 11:31:31 +04:00
|
|
|
}
|
2001-05-12 09:26:07 +04:00
|
|
|
|
2001-07-10 11:31:31 +04:00
|
|
|
return nsElementSH::SetProperty(wrapper, cx, obj, id, vp, _retval);
|
2001-05-12 09:26:07 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// HTMLObject/EmbedElement helper
|
|
|
|
|
2007-08-29 04:28:32 +04:00
|
|
|
// static
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsresult
|
2008-03-15 02:08:57 +03:00
|
|
|
nsHTMLPluginObjElementSH::GetPluginInstanceIfSafe(nsIXPConnectWrappedNative *wrapper,
|
2009-05-13 00:20:42 +04:00
|
|
|
JSObject *obj,
|
2008-03-15 02:08:57 +03:00
|
|
|
nsIPluginInstance **_result)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
*_result = nsnull;
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIContent> content(do_QueryWrappedNative(wrapper, obj));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(content, NS_ERROR_UNEXPECTED);
|
|
|
|
|
2005-12-03 14:27:42 +03:00
|
|
|
nsCOMPtr<nsIObjectLoadingContent> objlc(do_QueryInterface(content));
|
|
|
|
NS_ASSERTION(objlc, "Object nodes must implement nsIObjectLoadingContent");
|
2008-03-15 02:08:57 +03:00
|
|
|
|
|
|
|
// If it's not safe to run script we'll only return the instance if it
|
|
|
|
// exists.
|
|
|
|
if (!nsContentUtils::IsSafeToRunScript()) {
|
|
|
|
return objlc->GetPluginInstance(_result);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make sure that there is a plugin
|
2005-12-03 14:27:42 +03:00
|
|
|
return objlc->EnsureInstantiation(_result);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Check if proto is already in obj's prototype chain.
|
|
|
|
|
|
|
|
static PRBool
|
|
|
|
IsObjInProtoChain(JSContext *cx, JSObject *obj, JSObject *proto)
|
|
|
|
{
|
|
|
|
JSObject *o = obj;
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
while (o) {
|
|
|
|
JSObject *p = ::JS_GetPrototype(cx, o);
|
|
|
|
|
|
|
|
if (p == proto) {
|
|
|
|
return PR_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
o = p;
|
|
|
|
}
|
|
|
|
|
|
|
|
return PR_FALSE;
|
|
|
|
}
|
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
class nsPluginProtoChainInstallRunner : public nsIRunnable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
2008-03-15 02:08:59 +03:00
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
nsPluginProtoChainInstallRunner(nsIXPConnectWrappedNative* wrapper,
|
|
|
|
nsIScriptContext* scriptContext)
|
|
|
|
: mWrapper(wrapper),
|
|
|
|
mContext(scriptContext)
|
|
|
|
{
|
|
|
|
}
|
2008-03-11 03:49:19 +03:00
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
NS_IMETHOD Run()
|
|
|
|
{
|
2008-05-07 01:37:50 +04:00
|
|
|
JSContext* cx = nsnull;
|
|
|
|
if (mContext) {
|
|
|
|
cx = (JSContext*)mContext->GetNativeContext();
|
|
|
|
} else {
|
|
|
|
nsCOMPtr<nsIThreadJSContextStack> stack =
|
|
|
|
do_GetService("@mozilla.org/js/xpc/ContextStack;1");
|
|
|
|
NS_ENSURE_TRUE(stack, NS_OK);
|
|
|
|
|
|
|
|
stack->GetSafeJSContext(&cx);
|
|
|
|
NS_ENSURE_TRUE(cx, NS_OK);
|
|
|
|
}
|
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
JSObject* obj = nsnull;
|
|
|
|
mWrapper->GetJSObject(&obj);
|
|
|
|
NS_ASSERTION(obj, "Should never be null");
|
2008-05-07 01:37:50 +04:00
|
|
|
nsHTMLPluginObjElementSH::SetupProtoChain(mWrapper, cx, obj);
|
2008-03-15 02:08:57 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIXPConnectWrappedNative> mWrapper;
|
|
|
|
nsCOMPtr<nsIScriptContext> mContext;
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_IMPL_ISUPPORTS1(nsPluginProtoChainInstallRunner, nsIRunnable)
|
|
|
|
|
|
|
|
// static
|
|
|
|
nsresult
|
|
|
|
nsHTMLPluginObjElementSH::SetupProtoChain(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx,
|
|
|
|
JSObject *obj)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-03-15 02:08:57 +03:00
|
|
|
NS_ASSERTION(nsContentUtils::IsSafeToRunScript(),
|
|
|
|
"Shouldn't have gotten in here");
|
|
|
|
|
|
|
|
nsCxPusher cxPusher;
|
|
|
|
if (!cxPusher.Push(cx)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIPluginInstance> pi;
|
2009-05-13 00:20:42 +04:00
|
|
|
nsresult rv = GetPluginInstanceIfSafe(wrapper, obj, getter_AddRefs(pi));
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (!pi) {
|
|
|
|
// No plugin around for this object.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *pi_obj = nsnull; // XPConnect-wrapped peer object, when we get it.
|
|
|
|
JSObject *pi_proto = nsnull; // 'pi.__proto__'
|
|
|
|
|
|
|
|
rv = GetPluginJSObject(cx, obj, pi, &pi_obj, &pi_proto);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2002-06-21 00:32:46 +04:00
|
|
|
if (!pi_obj) {
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// Didn't get a plugin instance JSObject, nothing we can do then.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (IsObjInProtoChain(cx, obj, pi_obj)) {
|
2002-06-21 00:32:46 +04:00
|
|
|
// We must have re-entered ::PostCreate() from nsObjectFrame()
|
2005-12-03 14:27:42 +03:00
|
|
|
// (through the EnsureInstantiation() call in
|
2008-03-15 02:08:57 +03:00
|
|
|
// GetPluginInstanceIfSafe()), this means that we've already done what
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// we're about to do in this function so we can just return here.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// If we got an xpconnect-wrapped plugin object, set obj's
|
|
|
|
// prototype's prototype to the scriptable plugin.
|
|
|
|
|
|
|
|
JSObject *my_proto = nsnull;
|
|
|
|
|
|
|
|
// Get 'this.__proto__'
|
|
|
|
rv = wrapper->GetJSObjectPrototype(&my_proto);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// Set 'this.__proto__' to pi
|
|
|
|
if (!::JS_SetPrototype(cx, obj, pi_obj)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
|
2002-06-21 00:32:46 +04:00
|
|
|
if (pi_proto && JS_GET_CLASS(cx, pi_proto) != sObjectClass) {
|
|
|
|
// The plugin wrapper has a proto that's not Object.prototype, set
|
|
|
|
// 'pi.__proto__.__proto__' to the original 'this.__proto__'
|
2008-04-23 09:23:57 +04:00
|
|
|
if (pi_proto != my_proto && !::JS_SetPrototype(cx, pi_proto, my_proto)) {
|
2002-06-21 00:32:46 +04:00
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
|
|
|
} else {
|
2009-07-01 02:55:16 +04:00
|
|
|
// 'pi' didn't have a prototype, or pi's proto was
|
|
|
|
// 'Object.prototype' (i.e. pi is an NPRuntime wrapped JS object)
|
|
|
|
// set 'pi.__proto__' to the original 'this.__proto__'
|
2002-06-21 00:32:46 +04:00
|
|
|
if (!::JS_SetPrototype(cx, pi_obj, my_proto)) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Before this proto dance the objects involved looked like this:
|
|
|
|
//
|
|
|
|
// this.__proto__.__proto__
|
|
|
|
// ^ ^ ^
|
2002-06-21 00:32:46 +04:00
|
|
|
// | | |__ Object.prototype
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// | |
|
|
|
|
// | |__ xpc embed wrapper proto (shared)
|
|
|
|
// |
|
|
|
|
// |__ xpc wrapped native embed node
|
2002-06-21 00:32:46 +04:00
|
|
|
//
|
2009-07-07 00:56:18 +04:00
|
|
|
// pi.__proto__
|
|
|
|
// ^ ^
|
|
|
|
// | |__ Object.prototype
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// |
|
2009-07-07 00:56:18 +04:00
|
|
|
// |__ Plugin NPRuntime JS object wrapper
|
2002-06-21 00:32:46 +04:00
|
|
|
//
|
|
|
|
// Now, after the above prototype setup the prototype chain should
|
2009-07-07 00:56:18 +04:00
|
|
|
// look like this:
|
2002-06-21 00:32:46 +04:00
|
|
|
//
|
|
|
|
// this.__proto__.__proto__.__proto__
|
|
|
|
// ^ ^ ^ ^
|
|
|
|
// | | | |__ Object.prototype
|
|
|
|
// | | |
|
|
|
|
// | | |__ xpc embed wrapper proto (shared)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// | |
|
2009-07-07 00:56:18 +04:00
|
|
|
// | |__ Plugin NPRuntime JS object wrapper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// |
|
|
|
|
// |__ xpc wrapped native embed node
|
|
|
|
//
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLPluginObjElementSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
2009-08-10 18:41:12 +04:00
|
|
|
nsresult rv = nsElementSH::PreCreate(nativeObj, cx, globalObj, parentObj);
|
2009-05-13 00:20:42 +04:00
|
|
|
|
|
|
|
// For now we don't support slim wrappers for plugins.
|
|
|
|
return rv == NS_SUCCESS_ALLOW_SLIM_WRAPPERS ? NS_OK : rv;
|
|
|
|
}
|
|
|
|
|
2008-03-15 02:08:57 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLPluginObjElementSH::PostCreate(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj)
|
|
|
|
{
|
|
|
|
if (nsContentUtils::IsSafeToRunScript()) {
|
2009-10-07 04:09:16 +04:00
|
|
|
#ifdef DEBUG
|
|
|
|
nsresult rv =
|
|
|
|
#endif
|
|
|
|
SetupProtoChain(wrapper, cx, obj);
|
2008-05-07 01:37:50 +04:00
|
|
|
|
|
|
|
// If SetupProtoChain failed then we're in real trouble. We're about to fail
|
|
|
|
// PostCreate but it's more than likely that we handed our (now invalid)
|
|
|
|
// wrapper to someone already. Bug 429442 is an example of the kind of crash
|
|
|
|
// that can result from such a situation. We'll return NS_OK for the time
|
|
|
|
// being and hope for the best.
|
|
|
|
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "SetupProtoChain failed!");
|
|
|
|
return NS_OK;
|
2008-03-15 02:08:57 +03:00
|
|
|
}
|
|
|
|
|
2008-05-07 01:37:50 +04:00
|
|
|
// This may be null if the JS context is not a DOM context. That's ok, we'll
|
|
|
|
// use the safe context from XPConnect in the runnable.
|
|
|
|
nsCOMPtr<nsIScriptContext> scriptContext = GetScriptContextFromJSContext(cx);
|
2008-03-15 02:08:57 +03:00
|
|
|
|
2008-05-07 01:37:50 +04:00
|
|
|
nsRefPtr<nsPluginProtoChainInstallRunner> runner =
|
|
|
|
new nsPluginProtoChainInstallRunner(wrapper, scriptContext);
|
|
|
|
nsContentUtils::AddScriptRunner(runner);
|
2008-03-15 02:08:57 +03:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2004-04-02 09:11:44 +04:00
|
|
|
NS_IMETHODIMP
|
2007-08-29 04:28:32 +04:00
|
|
|
nsHTMLPluginObjElementSH::GetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
2004-04-02 09:11:44 +04:00
|
|
|
{
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2004-10-28 05:54:21 +04:00
|
|
|
JSObject *pi_obj = ::JS_GetPrototype(cx, obj);
|
2007-02-23 05:18:22 +03:00
|
|
|
if (NS_UNLIKELY(!pi_obj)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2004-10-28 05:54:21 +04:00
|
|
|
|
|
|
|
const jschar *id_chars = nsnull;
|
|
|
|
size_t id_length = 0;
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
JSBool found = PR_FALSE;
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
if (!ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
JSString *id_str = JSVAL_TO_STRING(id);
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
id_chars = ::JS_GetStringChars(id_str);
|
|
|
|
id_length = ::JS_GetStringLength(id_str);
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
*_retval = ::JS_HasUCProperty(cx, pi_obj, id_chars, id_length, &found);
|
|
|
|
} else {
|
|
|
|
*_retval = JS_HasElement(cx, pi_obj, JSVAL_TO_INT(id), &found);
|
|
|
|
}
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
if (!*_retval) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2004-10-28 05:54:21 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (found) {
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
*_retval = ::JS_GetUCProperty(cx, pi_obj, id_chars, id_length, vp);
|
|
|
|
} else {
|
|
|
|
*_retval = ::JS_GetElement(cx, pi_obj, JSVAL_TO_INT(id), vp);
|
|
|
|
}
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return *_retval ? NS_SUCCESS_I_DID_SOMETHING : NS_ERROR_FAILURE;
|
2004-04-02 09:11:44 +04:00
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::GetProperty(wrapper, cx, obj, id, vp, _retval);
|
2004-10-28 05:54:21 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2007-08-29 04:28:32 +04:00
|
|
|
nsHTMLPluginObjElementSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
2004-10-28 05:54:21 +04:00
|
|
|
{
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2004-04-02 09:11:44 +04:00
|
|
|
JSObject *pi_obj = ::JS_GetPrototype(cx, obj);
|
2007-02-23 05:18:22 +03:00
|
|
|
if (NS_UNLIKELY(!pi_obj)) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2004-10-28 05:54:21 +04:00
|
|
|
|
|
|
|
const jschar *id_chars = nsnull;
|
|
|
|
size_t id_length = 0;
|
2004-04-02 09:11:44 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
JSBool found = PR_FALSE;
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
if (!ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
JSString *id_str = JSVAL_TO_STRING(id);
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
id_chars = ::JS_GetStringChars(id_str);
|
|
|
|
id_length = ::JS_GetStringLength(id_str);
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
*_retval = ::JS_HasUCProperty(cx, pi_obj, id_chars, id_length, &found);
|
|
|
|
} else {
|
|
|
|
*_retval = JS_HasElement(cx, pi_obj, JSVAL_TO_INT(id), &found);
|
|
|
|
}
|
2004-10-28 05:54:21 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
if (!*_retval) {
|
|
|
|
return NS_ERROR_UNEXPECTED;
|
|
|
|
}
|
2004-04-02 09:11:44 +04:00
|
|
|
}
|
|
|
|
|
2004-07-23 04:26:02 +04:00
|
|
|
if (found) {
|
2004-10-28 05:54:21 +04:00
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
*_retval = ::JS_SetUCProperty(cx, pi_obj, id_chars, id_length, vp);
|
|
|
|
} else {
|
|
|
|
*_retval = ::JS_SetElement(cx, pi_obj, JSVAL_TO_INT(id), vp);
|
|
|
|
}
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return *_retval ? NS_SUCCESS_I_DID_SOMETHING : NS_ERROR_FAILURE;
|
2004-04-02 09:11:44 +04:00
|
|
|
}
|
|
|
|
|
2009-08-10 18:41:12 +04:00
|
|
|
return nsElementSH::SetProperty(wrapper, cx, obj, id, vp, _retval);
|
2004-04-02 09:11:44 +04:00
|
|
|
}
|
|
|
|
|
2004-08-30 08:31:16 +04:00
|
|
|
NS_IMETHODIMP
|
2007-08-29 04:28:32 +04:00
|
|
|
nsHTMLPluginObjElementSH::Call(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, PRUint32 argc,
|
|
|
|
jsval *argv, jsval *vp, PRBool *_retval)
|
2004-08-30 08:31:16 +04:00
|
|
|
{
|
|
|
|
nsCOMPtr<nsIPluginInstance> pi;
|
2009-05-13 00:20:42 +04:00
|
|
|
nsresult rv = GetPluginInstanceIfSafe(wrapper, obj, getter_AddRefs(pi));
|
2004-08-30 08:31:16 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2009-07-07 00:56:18 +04:00
|
|
|
// If obj is a native wrapper, or if there's no plugin around for
|
|
|
|
// this object, throw.
|
2009-10-16 21:27:33 +04:00
|
|
|
if (ObjectIsNativeWrapper(cx, obj) || !pi) {
|
2004-08-30 08:31:16 +04:00
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *pi_obj = nsnull;
|
|
|
|
JSObject *pi_proto = nsnull;
|
|
|
|
|
|
|
|
rv = GetPluginJSObject(cx, obj, pi, &pi_obj, &pi_proto);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (!pi) {
|
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// XPConnect passes us the XPConnect wrapper JSObject as obj, and
|
|
|
|
// not the 'this' parameter that the JS engine passes in. Pass in
|
|
|
|
// the real this parameter from JS (argv[-1]) here.
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
2004-08-30 08:31:16 +04:00
|
|
|
*_retval = ::JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(argv[-1]),
|
|
|
|
OBJECT_TO_JSVAL(pi_obj), argc, argv, vp);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2004-04-02 09:11:44 +04:00
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsresult
|
|
|
|
nsHTMLPluginObjElementSH::GetPluginJSObject(JSContext *cx, JSObject *obj,
|
|
|
|
nsIPluginInstance *plugin_inst,
|
|
|
|
JSObject **plugin_obj,
|
|
|
|
JSObject **plugin_proto)
|
|
|
|
{
|
|
|
|
*plugin_obj = nsnull;
|
|
|
|
*plugin_proto = nsnull;
|
|
|
|
|
2007-09-19 04:26:39 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2009-07-02 08:52:07 +04:00
|
|
|
if (plugin_inst) {
|
|
|
|
plugin_inst->GetJSObject(cx, plugin_obj);
|
2004-07-12 19:53:22 +04:00
|
|
|
if (*plugin_obj) {
|
|
|
|
*plugin_proto = ::JS_GetPrototype(cx, *plugin_obj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-19 23:37:09 +04:00
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2009-12-25 21:16:57 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLPluginObjElementSH::NewResolve(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
PRUint32 flags, JSObject **objp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
|
|
|
// Make sure the plugin instance is loaded and instantiated, if
|
|
|
|
// possible.
|
|
|
|
|
|
|
|
nsCOMPtr<nsIPluginInstance> pi;
|
|
|
|
nsresult rv = GetPluginInstanceIfSafe(wrapper, obj, getter_AddRefs(pi));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-12-25 21:16:57 +03:00
|
|
|
return nsElementSH::NewResolve(wrapper, cx, obj, id, flags, objp,
|
|
|
|
_retval);
|
|
|
|
}
|
|
|
|
|
2003-03-14 10:00:53 +03:00
|
|
|
// HTMLOptionsCollection helper
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2003-03-14 10:00:53 +03:00
|
|
|
nsHTMLOptionsCollectionSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2003-11-12 17:25:03 +03:00
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
if (n < 0) {
|
2001-05-12 09:26:07 +04:00
|
|
|
return NS_OK;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsCOMPtr<nsIDOMNSHTMLOptionCollection> oc =
|
|
|
|
do_QueryWrappedNative(wrapper, obj);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
NS_ENSURE_TRUE(oc, NS_ERROR_UNEXPECTED);
|
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
nsresult rv = nsHTMLSelectElementSH::SetOption(cx, vp, n, oc);
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
return rv;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Plugin helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsPluginSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsPluginElement* plugin = nsPluginElement::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return plugin->GetItemAt(aIndex, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2002-03-24 03:16:18 +03:00
|
|
|
nsPluginSH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsPluginElement* plugin = nsPluginElement::FromSupports(aNative);
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return plugin->GetNamedItem(aName, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// PluginArray helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsPluginArraySH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsPluginArray* array = nsPluginArray::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return array->GetItemAt(aIndex, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2002-03-24 03:16:18 +03:00
|
|
|
nsPluginArraySH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsPluginArray* array = nsPluginArray::FromSupports(aNative);
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return array->GetNamedItem(aName, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MimeTypeArray helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsMimeTypeArraySH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsMimeTypeArray* array = nsMimeTypeArray::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return array->GetItemAt(aIndex, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2002-03-24 03:16:18 +03:00
|
|
|
nsMimeTypeArraySH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsMimeTypeArray* array = nsMimeTypeArray::FromSupports(aNative);
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return array->GetNamedItem(aName, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// StringArray helper
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStringArraySH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
2001-06-28 08:26:29 +04:00
|
|
|
PRBool is_number = PR_FALSE;
|
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id, &is_number);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
if (!is_number) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
nsAutoString val;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2009-05-13 00:20:42 +04:00
|
|
|
nsresult rv = GetStringAt(GetNative(wrapper, obj), n, val);
|
2001-06-28 08:26:29 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
// XXX: Null strings?
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2006-06-13 02:39:55 +04:00
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
2001-06-28 08:26:29 +04:00
|
|
|
JSString *str =
|
2007-07-08 11:08:04 +04:00
|
|
|
::JS_NewUCStringCopyN(cx, reinterpret_cast<const jschar *>(val.get()),
|
2001-06-28 08:26:29 +04:00
|
|
|
val.Length());
|
|
|
|
NS_ENSURE_TRUE(str, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
*vp = STRING_TO_JSVAL(str);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2005-07-29 19:11:08 +04:00
|
|
|
return NS_SUCCESS_I_DID_SOMETHING;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// History helper
|
|
|
|
|
2001-08-31 06:36:45 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHistorySH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
PRBool is_number = PR_FALSE;
|
|
|
|
GetArrayIndexFromId(cx, id, &is_number);
|
|
|
|
|
|
|
|
if (!is_number) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult rv =
|
2002-08-16 01:18:20 +04:00
|
|
|
sSecMan->CheckPropertyAccess(cx, obj, mData->mName, sItem_id,
|
2001-08-31 06:36:45 +04:00
|
|
|
nsIXPCSecurityManager::ACCESS_CALL_METHOD);
|
|
|
|
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
// Let XPConnect know that the access was not granted.
|
|
|
|
*_retval = PR_FALSE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// sec check
|
|
|
|
|
|
|
|
return nsStringArraySH::GetProperty(wrapper, cx, obj, id, vp, _retval);
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsresult
|
|
|
|
nsHistorySH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
2002-03-24 03:16:18 +03:00
|
|
|
nsAString& aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
if (aIndex < 0) {
|
|
|
|
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMHistory> history(do_QueryInterface(aNative));
|
|
|
|
|
2001-08-31 06:36:45 +04:00
|
|
|
return history->Item(aIndex, aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MediaList helper
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
nsMediaListSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
2002-03-24 03:16:18 +03:00
|
|
|
nsAString& aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
if (aIndex < 0) {
|
|
|
|
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMMediaList> media_list(do_QueryInterface(aNative));
|
|
|
|
|
2001-05-30 06:25:52 +04:00
|
|
|
return media_list->Item(PRUint32(aIndex), aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// StyleSheetList helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsStyleSheetListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *rv)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsDOMStyleSheetList* list = nsDOMStyleSheetList::FromSupports(aNative);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return list->GetItemAt(aIndex);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-07-08 11:11:59 +04:00
|
|
|
// CSSValueList helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
2002-07-08 11:11:59 +04:00
|
|
|
nsCSSValueListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
2002-07-08 11:11:59 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsDOMCSSValueList* list = nsDOMCSSValueList::FromSupports(aNative);
|
2002-07-08 11:11:59 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return list->GetItemAt(aIndex);
|
2002-07-08 11:11:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// CSSStyleDeclaration helper
|
|
|
|
|
2009-07-13 15:14:57 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsCSSStyleDeclSH::PreCreate(nsISupports *nativeObj, JSContext *cx,
|
|
|
|
JSObject *globalObj, JSObject **parentObj)
|
|
|
|
{
|
|
|
|
nsWrapperCache* cache = nsnull;
|
|
|
|
CallQueryInterface(nativeObj, &cache);
|
|
|
|
if (!cache) {
|
|
|
|
return nsDOMClassInfo::PreCreate(nativeObj, cx, globalObj, parentObj);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsICSSDeclaration *declaration = static_cast<nsICSSDeclaration*>(nativeObj);
|
2009-10-06 03:16:22 +04:00
|
|
|
nsINode *native_parent = declaration->GetParentObject();
|
2009-07-13 15:14:57 +04:00
|
|
|
if (!native_parent) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2009-10-06 03:16:22 +04:00
|
|
|
nsresult rv =
|
|
|
|
WrapNativeParent(cx, globalObj, native_parent, native_parent, parentObj);
|
2009-07-13 15:14:57 +04:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
return NS_SUCCESS_ALLOW_SLIM_WRAPPERS;
|
|
|
|
}
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
nsresult
|
|
|
|
nsCSSStyleDeclSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
2002-03-24 03:16:18 +03:00
|
|
|
nsAString& aResult)
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
{
|
|
|
|
if (aIndex < 0) {
|
|
|
|
return NS_ERROR_DOM_INDEX_SIZE_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMCSSStyleDeclaration> style_decl(do_QueryInterface(aNative));
|
|
|
|
|
2001-05-30 06:25:52 +04:00
|
|
|
return style_decl->Item(PRUint32(aIndex), aResult);
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-14 02:16:45 +04:00
|
|
|
// CSSRuleList scriptable helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
2001-05-14 02:16:45 +04:00
|
|
|
nsCSSRuleListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
2001-05-14 02:16:45 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsICSSRuleList* list = static_cast<nsICSSRuleList*>(aNative);
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsICSSRuleList> list_qi = do_QueryInterface(aNative);
|
2001-05-14 02:16:45 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
// If this assertion fires the QI implementation for the object in
|
|
|
|
// question doesn't use the nsICSSRuleList pointer as the nsISupports
|
|
|
|
// pointer. That must be fixed, or we'll crash...
|
|
|
|
NS_ASSERTION(list_qi == list, "Uh, fix QI!");
|
|
|
|
}
|
|
|
|
#endif
|
2001-05-14 02:16:45 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return list->GetItemAt(aIndex, aResult);
|
2001-05-14 02:16:45 +04:00
|
|
|
}
|
|
|
|
|
2008-03-12 03:59:15 +03:00
|
|
|
// ClientRectList scriptable helper
|
2007-05-31 02:32:54 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
2008-03-12 03:59:15 +03:00
|
|
|
nsClientRectListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
2007-05-31 02:32:54 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsClientRectList* list = nsClientRectList::FromSupports(aNative);
|
2007-05-31 02:32:54 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return list->GetItemAt(aIndex);
|
2007-05-31 02:32:54 +04:00
|
|
|
}
|
2001-05-14 02:16:45 +04:00
|
|
|
|
2009-09-04 08:49:18 +04:00
|
|
|
// PaintRequestList scriptable helper
|
|
|
|
|
|
|
|
nsISupports*
|
|
|
|
nsPaintRequestListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
|
|
|
nsresult *aResult)
|
|
|
|
{
|
|
|
|
nsPaintRequestList* list = nsPaintRequestList::FromSupports(aNative);
|
|
|
|
|
|
|
|
return list->GetItemAt(aIndex);
|
|
|
|
}
|
|
|
|
|
2004-04-17 09:53:38 +04:00
|
|
|
#ifdef MOZ_XUL
|
|
|
|
// TreeColumns helper
|
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
2004-04-17 09:53:38 +04:00
|
|
|
nsTreeColumnsSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
2004-04-17 09:53:38 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsTreeColumns* columns = nsTreeColumns::FromSupports(aNative);
|
2004-04-17 09:53:38 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return columns->GetColumnAt(aIndex);
|
2004-04-17 09:53:38 +04:00
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2004-04-17 09:53:38 +04:00
|
|
|
nsTreeColumnsSH::GetNamedItem(nsISupports *aNative,
|
|
|
|
const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
2004-04-17 09:53:38 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsTreeColumns* columns = nsTreeColumns::FromSupports(aNative);
|
2008-10-31 21:07:26 +03:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return columns->GetNamedColumn(aName);
|
2004-04-17 09:53:38 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
// Storage scriptable helper
|
|
|
|
|
|
|
|
// One reason we need a newResolve hook is that in order for
|
|
|
|
// enumeration of storage object keys to work the keys we're
|
|
|
|
// enumerating need to exist on the storage object for the JS engine
|
|
|
|
// to find them.
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorageSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
|
|
|
|
// First check to see if the property is defined on our prototype,
|
|
|
|
// after converting id to a string if it's an integer.
|
|
|
|
|
|
|
|
JSString *jsstr = JS_ValueToString(cx, id);
|
|
|
|
if (!jsstr) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *proto = ::JS_GetPrototype(cx, realObj);
|
|
|
|
JSBool hasProp;
|
|
|
|
|
|
|
|
if (proto &&
|
|
|
|
(::JS_HasUCProperty(cx, proto, ::JS_GetStringChars(jsstr),
|
|
|
|
::JS_GetStringLength(jsstr), &hasProp) &&
|
|
|
|
hasProp)) {
|
|
|
|
// We found the property we're resolving on the prototype,
|
|
|
|
// nothing left to do here then.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We're resolving property that doesn't exist on the prototype,
|
|
|
|
// check if the key exists in the storage object.
|
|
|
|
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorageObsolete> storage(do_QueryWrappedNative(wrapper));
|
2006-05-19 09:57:36 +04:00
|
|
|
|
|
|
|
// GetItem() will return null if the caller can't access the session
|
|
|
|
// storage item.
|
|
|
|
nsCOMPtr<nsIDOMStorageItem> item;
|
|
|
|
nsresult rv = storage->GetItem(nsDependentJSString(jsstr),
|
|
|
|
getter_AddRefs(item));
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (item) {
|
|
|
|
if (!::JS_DefineUCProperty(cx, realObj, ::JS_GetStringChars(jsstr),
|
|
|
|
::JS_GetStringLength(jsstr), JSVAL_VOID, nsnull,
|
|
|
|
nsnull, 0)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = realObj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2006-05-19 09:57:36 +04:00
|
|
|
nsStorageSH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
2006-05-19 09:57:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsDOMStorage* storage = nsDOMStorage::FromSupports(aNative);
|
2006-05-19 09:57:36 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return storage->GetNamedItem(aName, aResult);
|
2006-05-19 09:57:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorageSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorageObsolete> storage(do_QueryWrappedNative(wrapper));
|
2006-05-19 09:57:36 +04:00
|
|
|
NS_ENSURE_TRUE(storage, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSString *key = ::JS_ValueToString(cx, id);
|
|
|
|
NS_ENSURE_TRUE(key, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSString *value = ::JS_ValueToString(cx, *vp);
|
|
|
|
NS_ENSURE_TRUE(value, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsresult rv = storage->SetItem(nsDependentJSString(key),
|
|
|
|
nsDependentJSString(value));
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorageSH::DelProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorageObsolete> storage(do_QueryWrappedNative(wrapper));
|
2006-05-19 09:57:36 +04:00
|
|
|
NS_ENSURE_TRUE(storage, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSString *key = ::JS_ValueToString(cx, id);
|
|
|
|
NS_ENSURE_TRUE(key, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsresult rv = storage->RemoveItem(nsDependentJSString(key));
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorageSH::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
|
|
|
jsid *idp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
nsTArray<nsString> *keys =
|
|
|
|
(nsTArray<nsString> *)JSVAL_TO_PRIVATE(*statep);
|
|
|
|
|
|
|
|
switch (enum_op) {
|
|
|
|
case JSENUMERATE_INIT:
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsPIDOMStorage> storage(do_QueryWrappedNative(wrapper));
|
|
|
|
|
|
|
|
// XXXndeakin need to free the keys afterwards
|
|
|
|
keys = storage->GetKeys();
|
|
|
|
NS_ENSURE_TRUE(keys, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
*statep = PRIVATE_TO_JSVAL(keys);
|
|
|
|
|
|
|
|
if (idp) {
|
|
|
|
*idp = INT_TO_JSVAL(keys->Length());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case JSENUMERATE_NEXT:
|
|
|
|
if (keys->Length() != 0) {
|
|
|
|
nsString& key = keys->ElementAt(0);
|
|
|
|
JSString *str =
|
2007-07-08 11:08:04 +04:00
|
|
|
JS_NewUCStringCopyN(cx, reinterpret_cast<const jschar *>
|
|
|
|
(key.get()),
|
2006-05-19 09:57:36 +04:00
|
|
|
key.Length());
|
|
|
|
NS_ENSURE_TRUE(str, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
JS_ValueToId(cx, STRING_TO_JSVAL(str), idp);
|
|
|
|
|
|
|
|
keys->RemoveElementAt(0);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fall through
|
|
|
|
case JSENUMERATE_DESTROY:
|
|
|
|
delete keys;
|
|
|
|
|
|
|
|
*statep = JSVAL_NULL;
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
NS_NOTREACHED("Bad call from the JS engine");
|
|
|
|
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-03-19 02:43:45 +03:00
|
|
|
// Storage2SH
|
|
|
|
|
|
|
|
// One reason we need a newResolve hook is that in order for
|
|
|
|
// enumeration of storage object keys to work the keys we're
|
|
|
|
// enumerating need to exist on the storage object for the JS engine
|
|
|
|
// to find them.
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorage2SH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, PRUint32 flags,
|
|
|
|
JSObject **objp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
JSObject *realObj;
|
|
|
|
wrapper->GetJSObject(&realObj);
|
|
|
|
|
|
|
|
// First check to see if the property is defined on our prototype,
|
|
|
|
// after converting id to a string if it's an integer.
|
|
|
|
|
|
|
|
JSString *jsstr = JS_ValueToString(cx, id);
|
|
|
|
if (!jsstr) {
|
|
|
|
return JS_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
JSObject *proto = ::JS_GetPrototype(cx, realObj);
|
|
|
|
JSBool hasProp;
|
|
|
|
|
|
|
|
if (proto &&
|
|
|
|
(::JS_HasUCProperty(cx, proto, ::JS_GetStringChars(jsstr),
|
|
|
|
::JS_GetStringLength(jsstr), &hasProp) &&
|
|
|
|
hasProp)) {
|
|
|
|
// We found the property we're resolving on the prototype,
|
|
|
|
// nothing left to do here then.
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We're resolving property that doesn't exist on the prototype,
|
|
|
|
// check if the key exists in the storage object.
|
|
|
|
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorage> storage(do_QueryWrappedNative(wrapper));
|
2009-03-19 02:43:45 +03:00
|
|
|
|
|
|
|
// GetItem() will return null if the caller can't access the session
|
|
|
|
// storage item.
|
|
|
|
nsAutoString data;
|
|
|
|
nsresult rv = storage->GetItem(nsDependentJSString(jsstr), data);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (!DOMStringIsNull(data)) {
|
|
|
|
if (!::JS_DefineUCProperty(cx, realObj, ::JS_GetStringChars(jsstr),
|
|
|
|
::JS_GetStringLength(jsstr), JSVAL_VOID, nsnull,
|
|
|
|
nsnull, 0)) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*objp = realObj;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorage2SH::GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, jsval id, jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorage> storage(do_QueryWrappedNative(wrapper));
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_ENSURE_TRUE(storage, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsAutoString val;
|
|
|
|
nsresult rv = NS_OK;
|
|
|
|
|
|
|
|
if (JSVAL_IS_STRING(id)) {
|
|
|
|
// For native wrappers, do not get random names on storage objects.
|
|
|
|
if (ObjectIsNativeWrapper(cx, obj)) {
|
|
|
|
return NS_ERROR_NOT_AVAILABLE;
|
|
|
|
}
|
|
|
|
|
|
|
|
rv = storage->GetItem(nsDependentJSString(id), val);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
} else {
|
|
|
|
PRInt32 n = GetArrayIndexFromId(cx, id);
|
|
|
|
NS_ENSURE_TRUE(n >= 0, NS_ERROR_NOT_AVAILABLE);
|
|
|
|
|
|
|
|
rv = storage->Key(n, val);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
JSAutoRequest ar(cx);
|
|
|
|
|
|
|
|
if (DOMStringIsNull(val)) {
|
|
|
|
*vp = JSVAL_NULL;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
JSString *str =
|
|
|
|
::JS_NewUCStringCopyN(cx, reinterpret_cast<const jschar *>(val.get()),
|
|
|
|
val.Length());
|
|
|
|
NS_ENSURE_TRUE(str, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
*vp = STRING_TO_JSVAL(str);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorage2SH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorage> storage(do_QueryWrappedNative(wrapper));
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_ENSURE_TRUE(storage, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSString *key = ::JS_ValueToString(cx, id);
|
|
|
|
NS_ENSURE_TRUE(key, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSString *value = ::JS_ValueToString(cx, *vp);
|
|
|
|
NS_ENSURE_TRUE(value, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsresult rv = storage->SetItem(nsDependentJSString(key),
|
|
|
|
nsDependentJSString(value));
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorage2SH::DelProperty(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval id,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
2009-05-16 17:59:30 +04:00
|
|
|
nsCOMPtr<nsIDOMStorage> storage(do_QueryWrappedNative(wrapper));
|
2009-03-19 02:43:45 +03:00
|
|
|
NS_ENSURE_TRUE(storage, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
JSString *key = ::JS_ValueToString(cx, id);
|
|
|
|
NS_ENSURE_TRUE(key, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsresult rv = storage->RemoveItem(nsDependentJSString(key));
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = NS_SUCCESS_I_DID_SOMETHING;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsStorage2SH::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 enum_op, jsval *statep,
|
|
|
|
jsid *idp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
nsTArray<nsString> *keys =
|
|
|
|
(nsTArray<nsString> *)JSVAL_TO_PRIVATE(*statep);
|
|
|
|
|
|
|
|
switch (enum_op) {
|
|
|
|
case JSENUMERATE_INIT:
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsPIDOMStorage> storage(do_QueryWrappedNative(wrapper));
|
|
|
|
|
|
|
|
// XXXndeakin need to free the keys afterwards
|
|
|
|
keys = storage->GetKeys();
|
|
|
|
NS_ENSURE_TRUE(keys, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
*statep = PRIVATE_TO_JSVAL(keys);
|
|
|
|
|
|
|
|
if (idp) {
|
|
|
|
*idp = INT_TO_JSVAL(keys->Length());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case JSENUMERATE_NEXT:
|
|
|
|
if (keys->Length() != 0) {
|
|
|
|
nsString& key = keys->ElementAt(0);
|
|
|
|
JSString *str =
|
|
|
|
JS_NewUCStringCopyN(cx, reinterpret_cast<const jschar *>
|
|
|
|
(key.get()),
|
|
|
|
key.Length());
|
|
|
|
NS_ENSURE_TRUE(str, NS_ERROR_OUT_OF_MEMORY);
|
|
|
|
|
|
|
|
JS_ValueToId(cx, STRING_TO_JSVAL(str), idp);
|
|
|
|
|
|
|
|
keys->RemoveElementAt(0);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fall through
|
|
|
|
case JSENUMERATE_DESTROY:
|
|
|
|
delete keys;
|
|
|
|
|
|
|
|
*statep = JSVAL_NULL;
|
|
|
|
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
NS_NOTREACHED("Bad call from the JS engine");
|
|
|
|
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2006-05-19 09:57:36 +04:00
|
|
|
// StorageList scriptable helper
|
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
nsISupports*
|
2006-05-19 09:57:36 +04:00
|
|
|
nsStorageListSH::GetNamedItem(nsISupports *aNative, const nsAString& aName,
|
2008-11-01 00:40:35 +03:00
|
|
|
nsresult *aResult)
|
2006-05-19 09:57:36 +04:00
|
|
|
{
|
2008-11-01 00:40:35 +03:00
|
|
|
nsDOMStorageList* storagelist = static_cast<nsDOMStorageList*>(aNative);
|
2006-05-19 09:57:36 +04:00
|
|
|
|
2008-11-01 00:40:35 +03:00
|
|
|
return storagelist->GetNamedItem(aName, aResult);
|
2006-05-19 09:57:36 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 21:42:36 +04:00
|
|
|
// nsIDOMEventListener::HandleEvent() 'this' converter helper
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(nsEventListenerThisTranslator)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsIXPCFunctionThisTranslator)
|
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMPL_ADDREF(nsEventListenerThisTranslator)
|
|
|
|
NS_IMPL_RELEASE(nsEventListenerThisTranslator)
|
|
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsEventListenerThisTranslator::TranslateThis(nsISupports *aInitialThis,
|
|
|
|
nsIInterfaceInfo *aInterfaceInfo,
|
|
|
|
PRUint16 aMethodIndex,
|
|
|
|
PRBool *aHideFirstParamFromJS,
|
|
|
|
nsIID * *aIIDOfResult,
|
|
|
|
nsISupports **_retval)
|
|
|
|
{
|
|
|
|
*aHideFirstParamFromJS = PR_FALSE;
|
|
|
|
*aIIDOfResult = nsnull;
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMEvent> event(do_QueryInterface(aInitialThis));
|
|
|
|
NS_ENSURE_TRUE(event, NS_ERROR_UNEXPECTED);
|
|
|
|
|
|
|
|
nsCOMPtr<nsIDOMEventTarget> target;
|
|
|
|
event->GetCurrentTarget(getter_AddRefs(target));
|
|
|
|
|
|
|
|
*_retval = target;
|
|
|
|
NS_IF_ADDREF(*_retval);
|
2001-04-01 05:10:59 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2005-12-09 22:08:45 +03:00
|
|
|
|
2007-05-09 16:04:59 +04:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMConstructorSH::Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv, jsval *vp,
|
|
|
|
PRBool *_retval)
|
|
|
|
{
|
|
|
|
nsDOMConstructor *wrapped =
|
2007-07-08 11:08:04 +04:00
|
|
|
static_cast<nsDOMConstructor *>(wrapper->Native());
|
2007-05-09 16:04:59 +04:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
2007-11-12 09:43:14 +03:00
|
|
|
nsCOMPtr<nsIDOMDOMConstructor> is_constructor =
|
|
|
|
do_QueryWrappedNative(wrapper);
|
2007-05-09 16:04:59 +04:00
|
|
|
NS_ASSERTION(is_constructor, "How did we not get a constructor?");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return wrapped->Construct(wrapper, cx, obj, argc, argv, vp, _retval);
|
|
|
|
}
|
|
|
|
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMConstructorSH::Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
|
|
|
|
JSObject *obj, PRUint32 argc, jsval *argv,
|
|
|
|
jsval *vp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
nsDOMConstructor *wrapped =
|
2007-07-08 11:08:04 +04:00
|
|
|
static_cast<nsDOMConstructor *>(wrapper->Native());
|
2005-12-09 22:08:45 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
2007-11-12 09:52:07 +03:00
|
|
|
nsCOMPtr<nsIDOMDOMConstructor> is_constructor =
|
2007-11-12 09:43:14 +03:00
|
|
|
do_QueryWrappedNative(wrapper);
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ASSERTION(is_constructor, "How did we not get a constructor?");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return wrapped->Construct(wrapper, cx, obj, argc, argv, vp, _retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsDOMConstructorSH::HasInstance(nsIXPConnectWrappedNative *wrapper,
|
|
|
|
JSContext *cx, JSObject *obj, jsval val,
|
|
|
|
PRBool *bp, PRBool *_retval)
|
|
|
|
{
|
|
|
|
nsDOMConstructor *wrapped =
|
2007-07-08 11:08:04 +04:00
|
|
|
static_cast<nsDOMConstructor *>(wrapper->Native());
|
2005-12-09 22:08:45 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
2007-11-12 09:43:14 +03:00
|
|
|
nsCOMPtr<nsIDOMDOMConstructor> is_constructor =
|
|
|
|
do_QueryWrappedNative(wrapper);
|
2005-12-09 22:08:45 +03:00
|
|
|
NS_ASSERTION(is_constructor, "How did we not get a constructor?");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return wrapped->HasInstance(wrapper, cx, obj, val, bp, _retval);
|
|
|
|
}
|
2006-02-23 06:17:11 +03:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsNonDOMObjectSH::GetFlags(PRUint32 *aFlags)
|
|
|
|
{
|
|
|
|
// This is NOT a DOM Object. Use this helper class for cases when you need
|
|
|
|
// to do something like implement nsISecurityCheckedComponent in a meaningful
|
|
|
|
// way.
|
|
|
|
*aFlags = nsIClassInfo::MAIN_THREAD_ONLY;
|
2006-02-23 06:38:59 +03:00
|
|
|
return NS_OK;
|
2006-02-23 06:17:11 +03:00
|
|
|
}
|
2006-06-06 19:42:41 +04:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsAttributeSH::GetFlags(PRUint32 *aFlags)
|
|
|
|
{
|
|
|
|
// Just like nsNodeSH, but without CONTENT_NODE
|
|
|
|
*aFlags = DOMCLASSINFO_STANDARD_FLAGS;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-05-29 13:45:30 +04:00
|
|
|
|
|
|
|
// nsOfflineResourceListSH
|
|
|
|
nsresult
|
|
|
|
nsOfflineResourceListSH::GetStringAt(nsISupports *aNative, PRInt32 aIndex,
|
|
|
|
nsAString& aResult)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMOfflineResourceList> list(do_QueryInterface(aNative));
|
|
|
|
NS_ENSURE_TRUE(list, NS_ERROR_UNEXPECTED);
|
|
|
|
|
2009-01-26 09:50:44 +03:00
|
|
|
return list->MozItem(aIndex, aResult);
|
2007-05-29 13:45:30 +04:00
|
|
|
}
|
2007-07-09 10:19:27 +04:00
|
|
|
|
2007-07-25 08:29:47 +04:00
|
|
|
// nsFileListSH
|
2008-10-22 18:31:14 +04:00
|
|
|
nsISupports*
|
2007-07-25 08:29:47 +04:00
|
|
|
nsFileListSH::GetItemAt(nsISupports *aNative, PRUint32 aIndex,
|
2008-10-22 18:31:14 +04:00
|
|
|
nsresult *aResult)
|
2007-07-25 08:29:47 +04:00
|
|
|
{
|
2008-10-22 18:31:14 +04:00
|
|
|
nsDOMFileList* list = nsDOMFileList::FromSupports(aNative);
|
2007-07-25 08:29:47 +04:00
|
|
|
|
2008-10-22 18:31:14 +04:00
|
|
|
return list->GetItemAt(aIndex);
|
2007-07-25 08:29:47 +04:00
|
|
|
}
|