Bug 1377158 - (Part 2) Add style backend type member in SVGDocumentWrapper and create SVG document with specified style backend. r=heycam

MozReview-Commit-ID: 7CRBzWcrtIc

--HG--
extra : rebase_source : f2ba1e5b00133852d7f6099e1d6d876caa3092e1
This commit is contained in:
KuoE0 2017-07-13 14:42:30 +08:00
Родитель 8caf7792c4
Коммит 996aa7f004
2 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -22,6 +22,8 @@
#include "nsIXMLContentSink.h"
#include "nsNetCID.h"
#include "nsComponentManagerUtils.h"
#include "nsContentDLF.h"
#include "nsContentCID.h"
#include "nsSMILAnimationController.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/dom/SVGSVGElement.h"
@ -48,8 +50,9 @@ NS_IMPL_ISUPPORTS(SVGDocumentWrapper,
nsIObserver,
nsISupportsWeakReference)
SVGDocumentWrapper::SVGDocumentWrapper()
: mIgnoreInvalidation(false),
SVGDocumentWrapper::SVGDocumentWrapper(StyleBackendType aStyleBackendType /* = StyleBackendType::None */)
: mStyleBackendType(aStyleBackendType),
mIgnoreInvalidation(false),
mRegisteredForXPCOMShutdown(false)
{ }
@ -345,7 +348,7 @@ SVGDocumentWrapper::SetupViewer(nsIRequest* aRequest,
newLoadGroup,
NS_LITERAL_CSTRING(IMAGE_SVG_XML),
nullptr, nullptr,
nsIDocumentLoaderFactory::STYLE_BACKEND_TYPE_NONE,
(int16_t)mStyleBackendType,
getter_AddRefs(listener),
getter_AddRefs(viewer));
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -9,6 +9,7 @@
#define mozilla_image_SVGDocumentWrapper_h
#include "mozilla/Attributes.h"
#include "mozilla/StyleBackendType.h"
#include "nsCOMPtr.h"
#include "nsIStreamListener.h"
@ -39,7 +40,7 @@ class SVGDocumentWrapper final : public nsIStreamListener,
nsSupportsWeakReference
{
public:
SVGDocumentWrapper();
explicit SVGDocumentWrapper(StyleBackendType aStyleBackendType = StyleBackendType::None);
NS_DECL_ISUPPORTS
NS_DECL_NSISTREAMLISTENER
@ -141,6 +142,7 @@ private:
nsCOMPtr<nsIContentViewer> mViewer;
nsCOMPtr<nsILoadGroup> mLoadGroup;
nsCOMPtr<nsIStreamListener> mListener;
StyleBackendType mStyleBackendType;
bool mIgnoreInvalidation;
bool mRegisteredForXPCOMShutdown;
};