2008-10-22 14:31:14 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-07-09 06:19:27 +00:00
|
|
|
|
2014-06-10 02:11:00 +00:00
|
|
|
#ifndef mozilla_dom_CSSRuleList_h
|
|
|
|
#define mozilla_dom_CSSRuleList_h
|
2007-07-09 06:19:27 +00:00
|
|
|
|
2013-07-24 07:27:17 +00:00
|
|
|
#include "nsIDOMCSSRule.h"
|
2008-10-22 14:31:14 +00:00
|
|
|
#include "nsIDOMCSSRuleList.h"
|
2014-05-03 07:32:54 +00:00
|
|
|
#include "nsWrapperCache.h"
|
|
|
|
|
2014-06-20 11:00:08 +00:00
|
|
|
namespace mozilla {
|
2014-06-20 10:32:49 +00:00
|
|
|
class CSSStyleSheet;
|
|
|
|
|
2014-06-10 02:11:00 +00:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
// IID for the CSSRuleList interface
|
2008-10-22 14:31:14 +00:00
|
|
|
#define NS_ICSSRULELIST_IID \
|
2014-05-03 07:32:54 +00:00
|
|
|
{ 0x56ac8d1c, 0xc1ed, 0x45fe, \
|
|
|
|
{ 0x9a, 0x4d, 0x3a, 0xdc, 0xf9, 0xd1, 0xb9, 0x3f } }
|
2008-10-22 14:31:14 +00:00
|
|
|
|
2014-06-10 02:11:00 +00:00
|
|
|
class CSSRuleList : public nsIDOMCSSRuleList
|
|
|
|
, public nsWrapperCache
|
2007-07-09 06:19:27 +00:00
|
|
|
{
|
2008-10-22 14:31:14 +00:00
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSRULELIST_IID)
|
|
|
|
|
2014-05-03 07:32:54 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
2014-06-10 02:11:00 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CSSRuleList)
|
2014-05-03 07:32:54 +00:00
|
|
|
|
2014-06-20 10:32:49 +00:00
|
|
|
virtual CSSStyleSheet* GetParentObject() = 0;
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 14:13:33 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE MOZ_FINAL;
|
2014-05-03 07:32:54 +00:00
|
|
|
|
2013-07-24 07:27:17 +00:00
|
|
|
NS_IMETHOD
|
|
|
|
GetLength(uint32_t* aLength) MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
*aLength = Length();
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
NS_IMETHOD
|
|
|
|
Item(uint32_t aIndex, nsIDOMCSSRule** aReturn) MOZ_OVERRIDE MOZ_FINAL
|
|
|
|
{
|
|
|
|
NS_IF_ADDREF(*aReturn = Item(aIndex));
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// WebIDL API
|
|
|
|
nsIDOMCSSRule* Item(uint32_t aIndex)
|
|
|
|
{
|
|
|
|
bool unused;
|
|
|
|
return IndexedGetter(aIndex, unused);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual nsIDOMCSSRule* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
|
|
|
|
virtual uint32_t Length() = 0;
|
2014-06-23 22:40:01 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual ~CSSRuleList() {}
|
2007-07-09 06:19:27 +00:00
|
|
|
};
|
2008-10-22 14:31:14 +00:00
|
|
|
|
2014-06-10 02:11:00 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(CSSRuleList, NS_ICSSRULELIST_IID)
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2008-10-22 14:31:14 +00:00
|
|
|
|
2014-06-10 02:11:00 +00:00
|
|
|
#endif /* mozilla_dom_CSSRuleList_h */
|