From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- dom/base/nsContentListDeclarations.h | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 dom/base/nsContentListDeclarations.h (limited to 'dom/base/nsContentListDeclarations.h') diff --git a/dom/base/nsContentListDeclarations.h b/dom/base/nsContentListDeclarations.h new file mode 100644 index 000000000..db3a09036 --- /dev/null +++ b/dom/base/nsContentListDeclarations.h @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* 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/. */ + +#ifndef nsContentListDeclarations_h +#define nsContentListDeclarations_h + +#include +#include "nsCOMPtr.h" + +class nsContentList; +class nsIAtom; +class nsIContent; +class nsINode; +// Can't use nsStringFwd.h because that's internal-API-only. +class nsString; +class nsAString; + +// Magic namespace id that means "match all namespaces". This is +// negative so it won't collide with actual namespace constants. +#define kNameSpaceID_Wildcard INT32_MIN + +// This is a callback function type that can be used to implement an +// arbitrary matching algorithm. aContent is the content that may +// match the list, while aNamespaceID, aAtom, and aData are whatever +// was passed to the list's constructor. +typedef bool (*nsContentListMatchFunc)(nsIContent* aContent, + int32_t aNamespaceID, + nsIAtom* aAtom, + void* aData); + +typedef void (*nsContentListDestroyFunc)(void* aData); + +/** + * A function that allocates the matching data for this + * FuncStringContentList. Returning aString is perfectly fine; in + * that case the destructor function should be a no-op. + */ +typedef void* (*nsFuncStringContentListDataAllocator)(nsINode* aRootNode, + const nsString* aString); + +// If aMatchNameSpaceId is kNameSpaceID_Unknown, this will return a +// content list which matches ASCIIToLower(aTagname) against HTML +// elements in HTML documents and aTagname against everything else. +// For any other value of aMatchNameSpaceId, the list will match +// aTagname against all elements. +already_AddRefed +NS_GetContentList(nsINode* aRootNode, + int32_t aMatchNameSpaceId, + const nsAString& aTagname); + +already_AddRefed +NS_GetFuncStringNodeList(nsINode* aRootNode, + nsContentListMatchFunc aFunc, + nsContentListDestroyFunc aDestroyFunc, + nsFuncStringContentListDataAllocator aDataAllocator, + const nsAString& aString); +already_AddRefed +NS_GetFuncStringHTMLCollection(nsINode* aRootNode, + nsContentListMatchFunc aFunc, + nsContentListDestroyFunc aDestroyFunc, + nsFuncStringContentListDataAllocator aDataAllocator, + const nsAString& aString); + +#endif // nsContentListDeclarations_h -- cgit v1.2.3