content/base/src/StyleSheetList.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/src/StyleSheetList.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "mozilla/dom/StyleSheetList.h"
    1.10 +
    1.11 +#include "mozilla/dom/StyleSheetListBinding.h"
    1.12 +#include "nsCSSStyleSheet.h"
    1.13 +
    1.14 +namespace mozilla {
    1.15 +namespace dom {
    1.16 +
    1.17 +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(StyleSheetList)
    1.18 +
    1.19 +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(StyleSheetList)
    1.20 +  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
    1.21 +  NS_INTERFACE_MAP_ENTRY(nsIDOMStyleSheetList)
    1.22 +  NS_INTERFACE_MAP_ENTRY(nsISupports)
    1.23 +NS_INTERFACE_MAP_END
    1.24 +
    1.25 +NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheetList)
    1.26 +NS_IMPL_CYCLE_COLLECTING_RELEASE(StyleSheetList)
    1.27 +
    1.28 +/* virtual */ JSObject*
    1.29 +StyleSheetList::WrapObject(JSContext* aCx)
    1.30 +{
    1.31 +  return StyleSheetListBinding::Wrap(aCx, this);
    1.32 +}
    1.33 +
    1.34 +NS_IMETHODIMP
    1.35 +StyleSheetList::GetLength(uint32_t* aLength)
    1.36 +{
    1.37 +  *aLength = Length();
    1.38 +  return NS_OK;
    1.39 +}
    1.40 +
    1.41 +NS_IMETHODIMP
    1.42 +StyleSheetList::SlowItem(uint32_t aIndex, nsIDOMStyleSheet** aItem)
    1.43 +{
    1.44 +  NS_IF_ADDREF(*aItem = Item(aIndex));
    1.45 +  return NS_OK;
    1.46 +}
    1.47 +
    1.48 +} // namespace dom
    1.49 +} // namespace mozilla

mercurial