Bug 1550519 - Show a translucent parent highlight when a subgrid is highlighted....
[gecko.git] / dom / base / DOMImplementation.h
blobcda347eddc99d7fb12e105df0f4547682870b773
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 mozilla_dom_DOMImplementation_h
8 #define mozilla_dom_DOMImplementation_h
10 #include "nsWrapperCache.h"
12 #include "mozilla/Attributes.h"
13 #include "mozilla/ErrorResult.h"
14 #include "nsCOMPtr.h"
15 #include "nsCycleCollectionParticipant.h"
16 #include "mozilla/dom/Document.h"
17 #include "nsIScriptGlobalObject.h"
18 #include "nsIURI.h"
19 #include "nsIWeakReferenceUtils.h"
20 #include "nsString.h"
22 namespace mozilla {
23 namespace dom {
24 class Document;
25 class DocumentType;
27 class DOMImplementation final : public nsISupports, public nsWrapperCache {
28 ~DOMImplementation() {}
30 public:
31 DOMImplementation(Document* aOwner, nsIGlobalObject* aScriptObject,
32 nsIURI* aDocumentURI, nsIURI* aBaseURI)
33 : mOwner(aOwner),
34 mScriptObject(do_GetWeakReference(aScriptObject)),
35 mDocumentURI(aDocumentURI),
36 mBaseURI(aBaseURI) {
37 MOZ_ASSERT(aOwner);
40 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
41 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMImplementation)
43 Document* GetParentObject() const { return mOwner; }
45 virtual JSObject* WrapObject(JSContext* aCx,
46 JS::Handle<JSObject*> aGivenProto) override;
48 bool HasFeature() { return true; }
50 already_AddRefed<DocumentType> CreateDocumentType(
51 const nsAString& aQualifiedName, const nsAString& aPublicId,
52 const nsAString& aSystemId, ErrorResult& aRv);
54 already_AddRefed<Document> CreateDocument(const nsAString& aNamespaceURI,
55 const nsAString& aQualifiedName,
56 DocumentType* aDoctype,
57 ErrorResult& aRv);
59 already_AddRefed<Document> CreateHTMLDocument(
60 const Optional<nsAString>& aTitle, ErrorResult& aRv);
62 private:
63 nsresult CreateDocument(const nsAString& aNamespaceURI,
64 const nsAString& aQualifiedName,
65 DocumentType* aDoctype, Document** aDocument);
66 nsresult CreateHTMLDocument(const nsAString& aTitle, Document** aDocument);
68 nsCOMPtr<Document> mOwner;
69 nsWeakPtr mScriptObject;
70 nsCOMPtr<nsIURI> mDocumentURI;
71 nsCOMPtr<nsIURI> mBaseURI;
74 } // namespace dom
75 } // namespace mozilla
77 #endif // mozilla_dom_DOMImplementation_h