2001-12-12 10:59:31 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
#ifndef mozilla_dom_SVGDocument_h
|
|
|
|
#define mozilla_dom_SVGDocument_h
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-05-30 00:43:41 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-03-20 20:22:26 +04:00
|
|
|
#include "mozilla/dom/XMLDocument.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
class nsSVGElement;
|
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-05-24 23:29:11 +04:00
|
|
|
class SVGForeignObjectElement;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGDocument final : public XMLDocument
|
2001-12-12 10:59:31 +03:00
|
|
|
{
|
2014-05-24 23:29:11 +04:00
|
|
|
friend class SVGForeignObjectElement; // To call EnsureNonSVGUserAgentStyleSheetsLoaded
|
|
|
|
|
2011-03-26 19:06:27 +03:00
|
|
|
public:
|
2014-05-24 22:51:06 +04:00
|
|
|
SVGDocument()
|
|
|
|
: XMLDocument("image/svg+xml")
|
2014-05-24 23:29:11 +04:00
|
|
|
, mHasLoadedNonSVGUserAgentStyleSheets(false)
|
2014-05-24 22:51:06 +04:00
|
|
|
{
|
2014-05-24 23:28:48 +04:00
|
|
|
mType = eSVG;
|
2014-05-24 22:51:06 +04:00
|
|
|
}
|
|
|
|
|
2014-06-05 04:01:39 +04:00
|
|
|
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool aNotify) override;
|
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2013-03-20 20:22:26 +04:00
|
|
|
|
|
|
|
// WebIDL API
|
|
|
|
void GetDomain(nsAString& aDomain, ErrorResult& aRv);
|
|
|
|
nsSVGElement* GetRootElement(ErrorResult& aRv);
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual SVGDocument* AsSVGDocument() override {
|
2014-05-24 23:29:11 +04:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void EnsureNonSVGUserAgentStyleSheetsLoaded();
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2014-05-24 23:29:11 +04:00
|
|
|
|
|
|
|
bool mHasLoadedNonSVGUserAgentStyleSheets;
|
2001-12-12 10:59:31 +03:00
|
|
|
};
|
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGDocument_h
|