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