Bug 825834 - Move SVGViewElement to mozilla:::dom r=bz

--HG--
rename : content/svg/content/src/nsSVGViewElement.cpp => content/svg/content/src/SVGViewElement.cpp
rename : content/svg/content/src/nsSVGViewElement.h => content/svg/content/src/SVGViewElement.h
This commit is contained in:
David Zbarsky 2013-01-07 22:22:41 -05:00
parent 26b82f4427
commit a3aaae810c
8 changed files with 83 additions and 66 deletions

View File

@ -68,7 +68,6 @@ CPPSRCS = \
nsSVGUnknownElement.cpp \ nsSVGUnknownElement.cpp \
nsSVGUseElement.cpp \ nsSVGUseElement.cpp \
nsSVGViewBox.cpp \ nsSVGViewBox.cpp \
nsSVGViewElement.cpp \
SVGAltGlyphElement.cpp \ SVGAltGlyphElement.cpp \
SVGAngle.cpp \ SVGAngle.cpp \
SVGAnimatedAngle.cpp \ SVGAnimatedAngle.cpp \
@ -137,6 +136,7 @@ CPPSRCS = \
SVGTransformListSMILType.cpp \ SVGTransformListSMILType.cpp \
SVGTSpanElement.cpp \ SVGTSpanElement.cpp \
SVGViewBoxSMILType.cpp \ SVGViewBoxSMILType.cpp \
SVGViewElement.cpp \
$(NULL) $(NULL)
include $(topsrcdir)/config/config.mk include $(topsrcdir)/config/config.mk
@ -188,6 +188,7 @@ EXPORTS_mozilla/dom = \
SVGTitleElement.h \ SVGTitleElement.h \
SVGTransformableElement.h \ SVGTransformableElement.h \
SVGTSpanElement.h \ SVGTSpanElement.h \
SVGViewElement.h \
$(NULL) $(NULL)
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

View File

@ -6,7 +6,7 @@
#include "SVGFragmentIdentifier.h" #include "SVGFragmentIdentifier.h"
#include "nsIDOMSVGDocument.h" #include "nsIDOMSVGDocument.h"
#include "nsSVGSVGElement.h" #include "nsSVGSVGElement.h"
#include "nsSVGViewElement.h" #include "mozilla/dom/SVGViewElement.h"
#include "SVGAnimatedTransformList.h" #include "SVGAnimatedTransformList.h"
using namespace mozilla; using namespace mozilla;
@ -27,12 +27,12 @@ IgnoreWhitespace(PRUnichar aChar)
return false; return false;
} }
static nsSVGViewElement* static dom::SVGViewElement*
GetViewElement(nsIDocument *aDocument, const nsAString &aId) GetViewElement(nsIDocument *aDocument, const nsAString &aId)
{ {
dom::Element* element = aDocument->GetElementById(aId); dom::Element* element = aDocument->GetElementById(aId);
return (element && element->IsSVG(nsGkAtoms::view)) ? return (element && element->IsSVG(nsGkAtoms::view)) ?
static_cast<nsSVGViewElement*>(element) : nullptr; static_cast<dom::SVGViewElement*>(element) : nullptr;
} }
void void
@ -236,7 +236,7 @@ SVGFragmentIdentifier::ProcessFragmentIdentifier(nsIDocument *aDocument,
SaveOldZoomAndPan(rootElement); SaveOldZoomAndPan(rootElement);
} }
const nsSVGViewElement *viewElement = GetViewElement(aDocument, aAnchorName); const dom::SVGViewElement *viewElement = GetViewElement(aDocument, aAnchorName);
if (viewElement) { if (viewElement) {
if (!rootElement->mCurrentViewID) { if (!rootElement->mCurrentViewID) {

View File

@ -3,24 +3,28 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsSVGViewElement.h" #include "mozilla/dom/SVGViewElement.h"
#include "DOMSVGStringList.h" #include "DOMSVGStringList.h"
using namespace mozilla; DOMCI_NODE_DATA(SVGViewElement, mozilla::dom::SVGViewElement)
using namespace mozilla::dom;
nsSVGElement::StringListInfo nsSVGViewElement::sStringListInfo[1] = NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(View)
namespace mozilla {
namespace dom {
nsSVGElement::StringListInfo SVGViewElement::sStringListInfo[1] =
{ {
{ &nsGkAtoms::viewTarget } { &nsGkAtoms::viewTarget }
}; };
nsSVGEnumMapping nsSVGViewElement::sZoomAndPanMap[] = { nsSVGEnumMapping SVGViewElement::sZoomAndPanMap[] = {
{&nsGkAtoms::disable, nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE}, {&nsGkAtoms::disable, nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE},
{&nsGkAtoms::magnify, nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY}, {&nsGkAtoms::magnify, nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY},
{nullptr, 0} {nullptr, 0}
}; };
nsSVGElement::EnumInfo nsSVGViewElement::sEnumInfo[1] = nsSVGElement::EnumInfo SVGViewElement::sEnumInfo[1] =
{ {
{ &nsGkAtoms::zoomAndPan, { &nsGkAtoms::zoomAndPan,
sZoomAndPanMap, sZoomAndPanMap,
@ -28,50 +32,46 @@ nsSVGElement::EnumInfo nsSVGViewElement::sEnumInfo[1] =
} }
}; };
NS_IMPL_NS_NEW_SVG_ELEMENT(View)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// nsISupports methods // nsISupports methods
NS_IMPL_ADDREF_INHERITED(nsSVGViewElement,nsSVGViewElementBase) NS_IMPL_ADDREF_INHERITED(SVGViewElement,SVGViewElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGViewElement,nsSVGViewElementBase) NS_IMPL_RELEASE_INHERITED(SVGViewElement,SVGViewElementBase)
DOMCI_NODE_DATA(SVGViewElement, nsSVGViewElement) NS_INTERFACE_TABLE_HEAD(SVGViewElement)
NS_NODE_INTERFACE_TABLE6(SVGViewElement, nsIDOMNode, nsIDOMElement,
NS_INTERFACE_TABLE_HEAD(nsSVGViewElement)
NS_NODE_INTERFACE_TABLE6(nsSVGViewElement, nsIDOMNode, nsIDOMElement,
nsIDOMSVGElement, nsIDOMSVGViewElement, nsIDOMSVGElement, nsIDOMSVGViewElement,
nsIDOMSVGFitToViewBox, nsIDOMSVGFitToViewBox,
nsIDOMSVGZoomAndPan) nsIDOMSVGZoomAndPan)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGViewElement) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGViewElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGViewElementBase) NS_INTERFACE_MAP_END_INHERITING(SVGViewElementBase)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Implementation // Implementation
nsSVGViewElement::nsSVGViewElement(already_AddRefed<nsINodeInfo> aNodeInfo) SVGViewElement::SVGViewElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGViewElementBase(aNodeInfo) : SVGViewElementBase(aNodeInfo)
{ {
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// nsIDOMNode methods // nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGViewElement) NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGViewElement)
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// nsIDOMSVGZoomAndPan methods // nsIDOMSVGZoomAndPan methods
/* attribute unsigned short zoomAndPan; */ /* attribute unsigned short zoomAndPan; */
NS_IMETHODIMP NS_IMETHODIMP
nsSVGViewElement::GetZoomAndPan(uint16_t *aZoomAndPan) SVGViewElement::GetZoomAndPan(uint16_t *aZoomAndPan)
{ {
*aZoomAndPan = mEnumAttributes[ZOOMANDPAN].GetAnimValue(); *aZoomAndPan = mEnumAttributes[ZOOMANDPAN].GetAnimValue();
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
nsSVGViewElement::SetZoomAndPan(uint16_t aZoomAndPan) SVGViewElement::SetZoomAndPan(uint16_t aZoomAndPan)
{ {
if (aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE || if (aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE ||
aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY) { aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY) {
@ -87,15 +87,15 @@ nsSVGViewElement::SetZoomAndPan(uint16_t aZoomAndPan)
/* readonly attribute nsIDOMSVGAnimatedRect viewBox; */ /* readonly attribute nsIDOMSVGAnimatedRect viewBox; */
NS_IMETHODIMP NS_IMETHODIMP
nsSVGViewElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox) SVGViewElement::GetViewBox(nsIDOMSVGAnimatedRect * *aViewBox)
{ {
return mViewBox.ToDOMAnimatedRect(aViewBox, this); return mViewBox.ToDOMAnimatedRect(aViewBox, this);
} }
/* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */ /* readonly attribute SVGPreserveAspectRatio preserveAspectRatio; */
NS_IMETHODIMP NS_IMETHODIMP
nsSVGViewElement::GetPreserveAspectRatio(nsISupports SVGViewElement::GetPreserveAspectRatio(nsISupports
**aPreserveAspectRatio) **aPreserveAspectRatio)
{ {
nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio; nsRefPtr<DOMSVGAnimatedPreserveAspectRatio> ratio;
mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this); mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(getter_AddRefs(ratio), this);
@ -107,7 +107,7 @@ nsSVGViewElement::GetPreserveAspectRatio(nsISupports
// nsIDOMSVGViewElement methods // nsIDOMSVGViewElement methods
/* readonly attribute nsIDOMSVGStringList viewTarget; */ /* readonly attribute nsIDOMSVGStringList viewTarget; */
NS_IMETHODIMP nsSVGViewElement::GetViewTarget(nsIDOMSVGStringList * *aViewTarget) NS_IMETHODIMP SVGViewElement::GetViewTarget(nsIDOMSVGStringList * *aViewTarget)
{ {
*aViewTarget = DOMSVGStringList::GetDOMWrapper( *aViewTarget = DOMSVGStringList::GetDOMWrapper(
&mStringListAttributes[VIEW_TARGET], this, false, VIEW_TARGET).get(); &mStringListAttributes[VIEW_TARGET], this, false, VIEW_TARGET).get();
@ -118,27 +118,30 @@ NS_IMETHODIMP nsSVGViewElement::GetViewTarget(nsIDOMSVGStringList * *aViewTarget
// nsSVGElement methods // nsSVGElement methods
nsSVGElement::EnumAttributesInfo nsSVGElement::EnumAttributesInfo
nsSVGViewElement::GetEnumInfo() SVGViewElement::GetEnumInfo()
{ {
return EnumAttributesInfo(mEnumAttributes, sEnumInfo, return EnumAttributesInfo(mEnumAttributes, sEnumInfo,
ArrayLength(sEnumInfo)); ArrayLength(sEnumInfo));
} }
nsSVGViewBox * nsSVGViewBox *
nsSVGViewElement::GetViewBox() SVGViewElement::GetViewBox()
{ {
return &mViewBox; return &mViewBox;
} }
SVGAnimatedPreserveAspectRatio * SVGAnimatedPreserveAspectRatio *
nsSVGViewElement::GetPreserveAspectRatio() SVGViewElement::GetPreserveAspectRatio()
{ {
return &mPreserveAspectRatio; return &mPreserveAspectRatio;
} }
nsSVGElement::StringListAttributesInfo nsSVGElement::StringListAttributesInfo
nsSVGViewElement::GetStringListInfo() SVGViewElement::GetStringListInfo()
{ {
return StringListAttributesInfo(mStringListAttributes, sStringListInfo, return StringListAttributesInfo(mStringListAttributes, sStringListInfo,
ArrayLength(sStringListInfo)); ArrayLength(sStringListInfo));
} }
} // namespace dom
} // namespace mozilla

View File

@ -3,8 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef __NS_SVGVIEWELEMENT_H__ #ifndef mozilla_dom_SVGViewElement_h
#define __NS_SVGVIEWELEMENT_H__ #define mozilla_dom_SVGViewElement_h
#include "nsIDOMSVGViewElement.h" #include "nsIDOMSVGViewElement.h"
#include "nsIDOMSVGFitToViewBox.h" #include "nsIDOMSVGFitToViewBox.h"
@ -15,27 +15,34 @@
#include "SVGAnimatedPreserveAspectRatio.h" #include "SVGAnimatedPreserveAspectRatio.h"
#include "SVGStringList.h" #include "SVGStringList.h"
typedef nsSVGElement SVGViewElementBase;
class nsSVGSVGElement;
class nsSVGOuterSVGFrame;
nsresult NS_NewSVGViewElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
namespace mozilla { namespace mozilla {
class SVGFragmentIdentifier; class SVGFragmentIdentifier;
}
typedef nsSVGElement nsSVGViewElementBase; namespace dom {
class nsSVGViewElement : public nsSVGViewElementBase, class SVGViewElement : public SVGViewElementBase,
public nsIDOMSVGViewElement, public nsIDOMSVGViewElement,
public nsIDOMSVGFitToViewBox, public nsIDOMSVGFitToViewBox,
public nsIDOMSVGZoomAndPan public nsIDOMSVGZoomAndPan
{ {
friend class mozilla::SVGFragmentIdentifier; friend class mozilla::SVGFragmentIdentifier;
friend class nsSVGSVGElement; friend class ::nsSVGSVGElement;
friend class nsSVGOuterSVGFrame; friend class ::nsSVGOuterSVGFrame;
friend nsresult NS_NewSVGViewElement(nsIContent **aResult, SVGViewElement(already_AddRefed<nsINodeInfo> aNodeInfo);
already_AddRefed<nsINodeInfo> aNodeInfo); friend nsresult (::NS_NewSVGViewElement(nsIContent **aResult,
nsSVGViewElement(already_AddRefed<nsINodeInfo> aNodeInfo); already_AddRefed<nsINodeInfo> aNodeInfo));
public: public:
// interfaces: // interfaces:
NS_DECL_ISUPPORTS_INHERITED NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGVIEWELEMENT NS_DECL_NSIDOMSVGVIEWELEMENT
NS_DECL_NSIDOMSVGFITTOVIEWBOX NS_DECL_NSIDOMSVGFITTOVIEWBOX
@ -45,7 +52,7 @@ public:
// forward here :-( // forward here :-(
NS_FORWARD_NSIDOMNODE_TO_NSINODE NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGViewElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(SVGViewElementBase::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const; virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
@ -76,4 +83,7 @@ private:
static StringListInfo sStringListInfo[1]; static StringListInfo sStringListInfo[1];
}; };
#endif } // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGViewElement_h

View File

@ -28,7 +28,7 @@
#include "nsGUIEvent.h" #include "nsGUIEvent.h"
#include "nsSVGSVGElement.h" #include "nsSVGSVGElement.h"
#include "nsSVGUtils.h" #include "nsSVGUtils.h"
#include "nsSVGViewElement.h" #include "mozilla/dom/SVGViewElement.h"
#include "nsStyleUtil.h" #include "nsStyleUtil.h"
#include "SVGContentUtils.h" #include "SVGContentUtils.h"
@ -608,11 +608,11 @@ nsSVGSVGElement::GetPreserveAspectRatio(nsISupports
NS_IMETHODIMP NS_IMETHODIMP
nsSVGSVGElement::GetZoomAndPan(uint16_t *aZoomAndPan) nsSVGSVGElement::GetZoomAndPan(uint16_t *aZoomAndPan)
{ {
nsSVGViewElement* viewElement = GetCurrentViewElement(); SVGViewElement* viewElement = GetCurrentViewElement();
if (viewElement && viewElement->mEnumAttributes[ if (viewElement && viewElement->mEnumAttributes[
nsSVGViewElement::ZOOMANDPAN].IsExplicitlySet()) { SVGViewElement::ZOOMANDPAN].IsExplicitlySet()) {
*aZoomAndPan = viewElement->mEnumAttributes[ *aZoomAndPan = viewElement->mEnumAttributes[
nsSVGViewElement::ZOOMANDPAN].GetAnimValue(); SVGViewElement::ZOOMANDPAN].GetAnimValue();
} else { } else {
*aZoomAndPan = mEnumAttributes[ZOOMANDPAN].GetAnimValue(); *aZoomAndPan = mEnumAttributes[ZOOMANDPAN].GetAnimValue();
} }
@ -974,7 +974,7 @@ nsSVGSVGElement::HasPreserveAspectRatio()
mPreserveAspectRatio.IsAnimated(); mPreserveAspectRatio.IsAnimated();
} }
nsSVGViewElement* SVGViewElement*
nsSVGSVGElement::GetCurrentViewElement() const nsSVGSVGElement::GetCurrentViewElement() const
{ {
if (mCurrentViewID) { if (mCurrentViewID) {
@ -982,7 +982,7 @@ nsSVGSVGElement::GetCurrentViewElement() const
if (doc) { if (doc) {
Element *element = doc->GetElementById(*mCurrentViewID); Element *element = doc->GetElementById(*mCurrentViewID);
if (element && element->IsSVG(nsGkAtoms::view)) { if (element && element->IsSVG(nsGkAtoms::view)) {
return static_cast<nsSVGViewElement*>(element); return static_cast<SVGViewElement*>(element);
} }
} }
} }
@ -994,7 +994,7 @@ nsSVGSVGElement::GetViewBoxWithSynthesis(
float aViewportWidth, float aViewportHeight) const float aViewportWidth, float aViewportHeight) const
{ {
// The logic here should match HasViewBox(). // The logic here should match HasViewBox().
nsSVGViewElement* viewElement = GetCurrentViewElement(); SVGViewElement* viewElement = GetCurrentViewElement();
if (viewElement && viewElement->mViewBox.IsExplicitlySet()) { if (viewElement && viewElement->mViewBox.IsExplicitlySet()) {
return viewElement->mViewBox.GetAnimValue(); return viewElement->mViewBox.GetAnimValue();
} }
@ -1029,7 +1029,7 @@ nsSVGSVGElement::GetPreserveAspectRatioWithOverride() const
} }
} }
nsSVGViewElement* viewElement = GetCurrentViewElement(); SVGViewElement* viewElement = GetCurrentViewElement();
// This check is equivalent to "!HasViewBox() && ShouldSynthesizeViewBox()". // This check is equivalent to "!HasViewBox() && ShouldSynthesizeViewBox()".
// We're just holding onto the viewElement that HasViewBox() would look up, // We're just holding onto the viewElement that HasViewBox() would look up,
@ -1055,7 +1055,7 @@ nsSVGSVGElement::GetLength(uint8_t aCtxType)
{ {
float h, w; float h, w;
nsSVGViewElement* viewElement = GetCurrentViewElement(); SVGViewElement* viewElement = GetCurrentViewElement();
const nsSVGViewBoxRect* viewbox = nullptr; const nsSVGViewBoxRect* viewbox = nullptr;
// The logic here should match HasViewBox(). // The logic here should match HasViewBox().
@ -1177,7 +1177,7 @@ nsSVGSVGElement::GetPreserveAspectRatio()
bool bool
nsSVGSVGElement::HasViewBox() const nsSVGSVGElement::HasViewBox() const
{ {
nsSVGViewElement* viewElement = GetCurrentViewElement(); SVGViewElement* viewElement = GetCurrentViewElement();
if (viewElement && viewElement->mViewBox.IsExplicitlySet()) { if (viewElement && viewElement->mViewBox.IsExplicitlySet()) {
return true; return true;
} }

View File

@ -21,10 +21,13 @@
#include "mozilla/Attributes.h" #include "mozilla/Attributes.h"
class nsSMILTimeContainer; class nsSMILTimeContainer;
class nsSVGViewElement;
namespace mozilla { namespace mozilla {
class DOMSVGMatrix; class DOMSVGMatrix;
class SVGFragmentIdentifier; class SVGFragmentIdentifier;
namespace dom {
class SVGViewElement;
}
} }
typedef mozilla::dom::SVGGraphicsElement nsSVGSVGElementBase; typedef mozilla::dom::SVGGraphicsElement nsSVGSVGElementBase;
@ -261,7 +264,7 @@ private:
// implementation helpers: // implementation helpers:
nsSVGViewElement* GetCurrentViewElement() const; mozilla::dom::SVGViewElement* GetCurrentViewElement() const;
// Methods for <image> elements to override my "PreserveAspectRatio" value. // Methods for <image> elements to override my "PreserveAspectRatio" value.
// These are private so that only our friends (nsSVGImageFrame in // These are private so that only our friends (nsSVGImageFrame in

View File

@ -8,7 +8,7 @@
#include "nsGkAtoms.h" #include "nsGkAtoms.h"
#include "nsSVGOuterSVGFrame.h" #include "nsSVGOuterSVGFrame.h"
#include "nsSVGSVGElement.h" #include "nsSVGSVGElement.h"
#include "nsSVGViewElement.h" #include "mozilla/dom/SVGViewElement.h"
typedef nsFrame SVGViewFrameBase; typedef nsFrame SVGViewFrameBase;

View File

@ -21,7 +21,7 @@
#include "nsSVGForeignObjectFrame.h" #include "nsSVGForeignObjectFrame.h"
#include "nsSVGSVGElement.h" #include "nsSVGSVGElement.h"
#include "nsSVGTextFrame.h" #include "nsSVGTextFrame.h"
#include "nsSVGViewElement.h" #include "mozilla/dom/SVGViewElement.h"
#include "nsSubDocumentFrame.h" #include "nsSubDocumentFrame.h"
namespace dom = mozilla::dom; namespace dom = mozilla::dom;
@ -286,7 +286,7 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
return ratio; return ratio;
} }
nsSVGViewElement* viewElement = content->GetCurrentViewElement(); dom::SVGViewElement* viewElement = content->GetCurrentViewElement();
const nsSVGViewBoxRect* viewbox = nullptr; const nsSVGViewBoxRect* viewbox = nullptr;
// The logic here should match HasViewBox(). // The logic here should match HasViewBox().