2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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
|
|
|
namespace mozilla {
|
2018-04-21 19:48:29 +03:00
|
|
|
|
|
|
|
class SVGContextPaint;
|
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
namespace dom {
|
|
|
|
|
2018-12-21 11:58:14 +03:00
|
|
|
class SVGElement;
|
2014-05-24 23:29:11 +04:00
|
|
|
class SVGForeignObjectElement;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class SVGDocument final : public XMLDocument {
|
2011-03-26 19:06:27 +03:00
|
|
|
public:
|
2014-05-24 22:51:06 +04:00
|
|
|
SVGDocument() : XMLDocument("image/svg+xml") { mType = eSVG; }
|
|
|
|
|
2018-08-09 02:58:44 +03:00
|
|
|
virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
|
2013-03-20 20:22:26 +04:00
|
|
|
|
2018-04-21 19:48:29 +03:00
|
|
|
void SetCurrentContextPaint(const SVGContextPaint* aContextPaint) {
|
|
|
|
mCurrentContextPaint = aContextPaint;
|
|
|
|
}
|
|
|
|
|
|
|
|
const SVGContextPaint* GetCurrentContextPaint() const {
|
|
|
|
return mCurrentContextPaint;
|
2014-05-24 23:29:11 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2018-04-21 19:48:29 +03:00
|
|
|
// This is maintained by AutoSetRestoreSVGContextPaint.
|
|
|
|
const SVGContextPaint* mCurrentContextPaint = nullptr;
|
2001-12-12 10:59:31 +03:00
|
|
|
};
|
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
inline SVGDocument* Document::AsSVGDocument() {
|
2018-04-21 19:42:31 +03:00
|
|
|
MOZ_ASSERT(IsSVGDocument());
|
2019-01-02 16:05:23 +03:00
|
|
|
return static_cast<SVGDocument*>(this);
|
2018-04-21 19:42:31 +03:00
|
|
|
}
|
|
|
|
|
2019-01-02 16:05:23 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-03-20 20:22:26 +04:00
|
|
|
#endif // mozilla_dom_SVGDocument_h
|