1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsContentCreatorFunctions_h__
8 #define nsContentCreatorFunctions_h__
12 #include "mozilla/dom/FromParser.h"
15 * Functions to create content, to be used only inside Gecko
16 * (mozilla/content and mozilla/layout).
22 class imgRequestProxy
;
23 class nsGenericHTMLElement
;
25 namespace mozilla::dom
{
28 struct CustomElementDefinition
;
29 } // namespace mozilla::dom
31 nsresult
NS_NewElement(mozilla::dom::Element
** aResult
,
32 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
,
33 mozilla::dom::FromParser aFromParser
,
34 const nsAString
* aIs
= nullptr);
36 nsresult
NS_NewXMLElement(mozilla::dom::Element
** aResult
,
37 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
39 nsresult
NS_NewHTMLElement(
40 mozilla::dom::Element
** aResult
,
41 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
,
42 mozilla::dom::FromParser aFromParser
, nsAtom
* aIsAtom
= nullptr,
43 mozilla::dom::CustomElementDefinition
* aDefinition
= nullptr);
45 // First argument should be nsHTMLTag, but that adds dependency to parser
46 // for a bunch of files.
47 already_AddRefed
<nsGenericHTMLElement
> CreateHTMLElement(
48 uint32_t aNodeType
, already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
,
49 mozilla::dom::FromParser aFromParser
);
51 nsresult
NS_NewMathMLElement(
52 mozilla::dom::Element
** aResult
,
53 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
55 nsresult
NS_NewXULElement(
56 mozilla::dom::Element
** aResult
,
57 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
,
58 mozilla::dom::FromParser aFromParser
, nsAtom
* aIsAtom
= nullptr,
59 mozilla::dom::CustomElementDefinition
* aDefinition
= nullptr);
61 void NS_TrustedNewXULElement(
62 mozilla::dom::Element
** aResult
,
63 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
65 nsresult
NS_NewSVGElement(mozilla::dom::Element
** aResult
,
66 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
,
67 mozilla::dom::FromParser aFromParser
);
69 #endif // nsContentCreatorFunctions_h__