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;
|
|
|
|
|
2013-07-12 01:26:54 +04:00
|
|
|
class SVGDocument MOZ_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,
|
|
|
|
bool aNotify) MOZ_OVERRIDE;
|
2014-06-20 06:01:40 +04:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-03-20 20:22:26 +04:00
|
|
|
|
|
|
|
// WebIDL API
|
|
|
|
void GetDomain(nsAString& aDomain, ErrorResult& aRv);
|
|
|
|
nsSVGElement* GetRootElement(ErrorResult& aRv);
|
|
|
|
|
2014-05-24 23:29:11 +04:00
|
|
|
virtual SVGDocument* AsSVGDocument() MOZ_OVERRIDE {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
void EnsureNonSVGUserAgentStyleSheetsLoaded();
|
|
|
|
|
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
The only manual changes here are to BindingUtils.h, BindingUtils.cpp,
Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp,
dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp,
Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp,
Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The
rest of this diff was generated by running the following commands:
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g'
find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
2015-03-19 17:13:33 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_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
|