2015-05-03 12:32:37 -07: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 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-12-08 18:52:54 -08:00
|
|
|
#include "mozilla/ArrayUtils.h"
|
2014-04-02 21:18:36 -07:00
|
|
|
#include "mozilla/EventStates.h"
|
2011-10-10 22:50:08 -07:00
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
#include "mozilla/dom/SVGImageElement.h"
|
2013-11-02 04:10:38 -07:00
|
|
|
#include "mozilla/gfx/2D.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIURI.h"
|
|
|
|
#include "nsNetUtil.h"
|
2012-10-12 09:11:22 -07:00
|
|
|
#include "imgINotificationObserver.h"
|
2013-01-06 01:32:01 -08:00
|
|
|
#include "mozilla/dom/SVGImageElementBinding.h"
|
2013-01-31 15:11:49 -08:00
|
|
|
#include "nsContentUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Image)
|
|
|
|
|
2013-11-02 04:10:38 -07:00
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
JSObject*
|
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 07:13:33 -07:00
|
|
|
SVGImageElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
|
2013-01-06 01:32:01 -08:00
|
|
|
{
|
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 07:13:33 -07:00
|
|
|
return SVGImageElementBinding::Wrap(aCx, this, aGivenProto);
|
2013-01-06 01:32:01 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
nsSVGElement::LengthInfo SVGImageElement::sLengthInfo[4] =
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-09-22 12:26:05 -07:00
|
|
|
{ &nsGkAtoms::x, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
|
|
|
|
{ &nsGkAtoms::y, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
|
|
|
|
{ &nsGkAtoms::width, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::X },
|
|
|
|
{ &nsGkAtoms::height, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::Y },
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
nsSVGElement::StringInfo SVGImageElement::sStringInfo[1] =
|
2008-06-14 02:01:02 -07:00
|
|
|
{
|
2011-10-17 07:59:28 -07:00
|
|
|
{ &nsGkAtoms::href, kNameSpaceID_XLink, true }
|
2008-06-14 02:01:02 -07:00
|
|
|
};
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods
|
|
|
|
|
2014-04-27 00:06:00 -07:00
|
|
|
NS_IMPL_ISUPPORTS_INHERITED(SVGImageElement, SVGImageElementBase,
|
|
|
|
nsIDOMNode, nsIDOMElement,
|
|
|
|
nsIDOMSVGElement,
|
|
|
|
imgINotificationObserver,
|
|
|
|
nsIImageLoadingContent, imgIOnloadBlocker)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
SVGImageElement::SVGImageElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-01-06 01:32:01 -08:00
|
|
|
: SVGImageElementBase(aNodeInfo)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2011-05-31 18:46:57 -07:00
|
|
|
// We start out broken
|
|
|
|
AddStatesSilently(NS_EVENT_STATE_BROKEN);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::~SVGImageElement()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
DestroyImageLoadingContent();
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIDOMNode methods
|
|
|
|
|
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGImageElement)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
2013-01-06 01:32:01 -08:00
|
|
|
|
2013-01-19 12:56:00 -08:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::X()
|
|
|
|
{
|
2013-01-06 01:32:02 -08:00
|
|
|
return mLengthAttributes[ATTR_X].ToDOMAnimatedLength(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-01-19 12:56:00 -08:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::Y()
|
|
|
|
{
|
2013-01-06 01:32:02 -08:00
|
|
|
return mLengthAttributes[ATTR_Y].ToDOMAnimatedLength(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-01-19 12:56:00 -08:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::Width()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-01-06 01:32:02 -08:00
|
|
|
return mLengthAttributes[ATTR_WIDTH].ToDOMAnimatedLength(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-01-19 12:56:00 -08:00
|
|
|
already_AddRefed<SVGAnimatedLength>
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::Height()
|
|
|
|
{
|
2013-01-06 01:32:02 -08:00
|
|
|
return mLengthAttributes[ATTR_HEIGHT].ToDOMAnimatedLength(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-01-06 01:32:01 -08:00
|
|
|
already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
|
|
|
|
SVGImageElement::PreserveAspectRatio()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2015-01-27 01:51:34 -08:00
|
|
|
return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2013-06-14 15:37:27 -07:00
|
|
|
already_AddRefed<SVGAnimatedString>
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::Href()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-02-07 00:08:56 -08:00
|
|
|
return mStringAttributes[HREF].ToDOMAnimatedString(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2008-06-14 02:01:02 -07:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2008-08-07 07:03:58 -07:00
|
|
|
nsresult
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::LoadSVGImage(bool aForce, bool aNotify)
|
2008-06-14 02:01:02 -07:00
|
|
|
{
|
|
|
|
// resolve href attribute
|
|
|
|
nsCOMPtr<nsIURI> baseURI = GetBaseURI();
|
|
|
|
|
2009-01-21 16:56:51 -08:00
|
|
|
nsAutoString href;
|
|
|
|
mStringAttributes[HREF].GetAnimValue(href, this);
|
2008-08-07 07:03:58 -07:00
|
|
|
href.Trim(" \t\n\r");
|
|
|
|
|
|
|
|
if (baseURI && !href.IsEmpty())
|
|
|
|
NS_MakeAbsoluteURI(href, href, baseURI);
|
2008-06-14 02:01:02 -07:00
|
|
|
|
2014-08-19 14:49:38 -07:00
|
|
|
return LoadImage(href, aForce, aNotify, eImageLoadType_Normal);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIContent methods:
|
|
|
|
|
2011-10-29 01:18:25 -07:00
|
|
|
nsresult
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
|
|
|
|
const nsAttrValue* aValue, bool aNotify)
|
2011-10-29 01:18:25 -07:00
|
|
|
{
|
|
|
|
if (aNamespaceID == kNameSpaceID_XLink && aName == nsGkAtoms::href) {
|
|
|
|
|
2011-11-19 09:53:52 -08:00
|
|
|
// If there isn't a frame we still need to load the image in case
|
|
|
|
// the frame is created later e.g. by attaching to a document.
|
|
|
|
// If there is a frame then it should deal with loading as the image
|
|
|
|
// url may be animated
|
2011-10-29 01:18:25 -07:00
|
|
|
if (!GetPrimaryFrame()) {
|
|
|
|
|
|
|
|
// Prevent setting image.src by exiting early
|
|
|
|
if (nsContentUtils::IsImageSrcSetDisabled()) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (aValue) {
|
|
|
|
LoadSVGImage(true, aNotify);
|
|
|
|
} else {
|
|
|
|
CancelImageRequests(aNotify);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-01-06 01:32:01 -08:00
|
|
|
return SVGImageElementBase::AfterSetAttr(aNamespaceID, aName,
|
|
|
|
aValue, aNotify);
|
2011-10-29 01:18:25 -07:00
|
|
|
}
|
|
|
|
|
2009-05-20 01:00:04 -07:00
|
|
|
void
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::MaybeLoadSVGImage()
|
2009-05-20 01:00:04 -07:00
|
|
|
{
|
2011-07-01 00:19:52 -07:00
|
|
|
if (mStringAttributes[HREF].IsExplicitlySet() &&
|
2011-10-17 07:59:28 -07:00
|
|
|
(NS_FAILED(LoadSVGImage(false, true)) ||
|
2009-05-20 01:00:04 -07:00
|
|
|
!LoadingEnabled())) {
|
2011-10-17 07:59:28 -07:00
|
|
|
CancelImageRequests(true);
|
2009-05-20 01:00:04 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|
|
|
nsIContent* aBindingParent,
|
|
|
|
bool aCompileEventHandlers)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-01-06 01:32:01 -08:00
|
|
|
nsresult rv = SVGImageElementBase::BindToTree(aDocument, aParent,
|
|
|
|
aBindingParent,
|
|
|
|
aCompileEventHandlers);
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2012-08-13 15:11:50 -07:00
|
|
|
nsImageLoadingContent::BindToTree(aDocument, aParent, aBindingParent,
|
|
|
|
aCompileEventHandlers);
|
|
|
|
|
2011-07-01 00:19:52 -07:00
|
|
|
if (mStringAttributes[HREF].IsExplicitlySet()) {
|
2011-05-31 18:46:57 -07:00
|
|
|
// FIXME: Bug 660963 it would be nice if we could just have
|
|
|
|
// ClearBrokenState update our state and do it fast...
|
2009-05-20 01:00:04 -07:00
|
|
|
ClearBrokenState();
|
2011-05-31 18:46:57 -07:00
|
|
|
RemoveStatesSilently(NS_EVENT_STATE_BROKEN);
|
2009-05-20 01:00:04 -07:00
|
|
|
nsContentUtils::AddScriptRunner(
|
2013-01-06 01:32:01 -08:00
|
|
|
NS_NewRunnableMethod(this, &SVGImageElement::MaybeLoadSVGImage));
|
2008-09-20 08:07:54 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2012-08-13 15:11:50 -07:00
|
|
|
void
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
2012-08-13 15:11:50 -07:00
|
|
|
{
|
|
|
|
nsImageLoadingContent::UnbindFromTree(aDeep, aNullParent);
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElementBase::UnbindFromTree(aDeep, aNullParent);
|
2012-08-13 15:11:50 -07:00
|
|
|
}
|
|
|
|
|
2014-04-02 21:18:36 -07:00
|
|
|
EventStates
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::IntrinsicState() const
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-01-06 01:32:01 -08:00
|
|
|
return SVGImageElementBase::IntrinsicState() |
|
2007-03-22 10:30:00 -07:00
|
|
|
nsImageLoadingContent::ImageState();
|
|
|
|
}
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP_(bool)
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::IsAttributeMapped(const nsIAtom* name) const
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
static const MappedAttributeEntry* const map[] = {
|
|
|
|
sViewportsMap,
|
|
|
|
};
|
2013-01-06 01:32:01 -08:00
|
|
|
|
2011-12-18 02:09:27 -08:00
|
|
|
return FindAttributeDependence(name, map) ||
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElementBase::IsAttributeMapped(name);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGPathGeometryElement methods
|
|
|
|
|
|
|
|
/* For the purposes of the update/invalidation logic pretend to
|
|
|
|
be a rectangle. */
|
2015-01-21 05:09:45 -08:00
|
|
|
bool
|
2015-02-03 10:36:32 -08:00
|
|
|
SVGImageElement::GetGeometryBounds(
|
|
|
|
Rect* aBounds, const StrokeOptions& aStrokeOptions, const Matrix& aTransform)
|
2015-01-21 05:09:45 -08:00
|
|
|
{
|
|
|
|
Rect rect;
|
|
|
|
GetAnimatedLengthValues(&rect.x, &rect.y, &rect.width,
|
|
|
|
&rect.height, nullptr);
|
|
|
|
|
|
|
|
if (rect.IsEmpty()) {
|
|
|
|
// Rendering of the element disabled
|
|
|
|
rect.SetEmpty(); // Make sure width/height are zero and not negative
|
|
|
|
}
|
|
|
|
|
|
|
|
*aBounds = aTransform.TransformBounds(rect);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-06-17 07:00:52 -07:00
|
|
|
already_AddRefed<Path>
|
2014-07-05 13:53:04 -07:00
|
|
|
SVGImageElement::BuildPath(PathBuilder* aBuilder)
|
2013-11-02 04:10:38 -07:00
|
|
|
{
|
|
|
|
// We get called in order to get bounds for this element, and for
|
|
|
|
// hit-testing against it. For that we just pretend to be a rectangle.
|
|
|
|
|
|
|
|
float x, y, width, height;
|
|
|
|
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
|
|
|
|
|
|
|
|
if (width <= 0 || height <= 0) {
|
2013-11-06 02:05:18 -08:00
|
|
|
return nullptr;
|
2013-11-02 04:10:38 -07:00
|
|
|
}
|
|
|
|
|
2013-11-06 02:05:18 -08:00
|
|
|
Rect r(x, y, width, height);
|
2014-10-04 04:13:30 -07:00
|
|
|
aBuilder->MoveTo(r.TopLeft());
|
|
|
|
aBuilder->LineTo(r.TopRight());
|
|
|
|
aBuilder->LineTo(r.BottomRight());
|
|
|
|
aBuilder->LineTo(r.BottomLeft());
|
|
|
|
aBuilder->Close();
|
2013-11-06 02:05:18 -08:00
|
|
|
|
2014-10-04 04:13:30 -07:00
|
|
|
return aBuilder->Finish();
|
2013-11-02 04:10:38 -07:00
|
|
|
}
|
|
|
|
|
2008-06-14 02:01:02 -07:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGElement methods
|
|
|
|
|
2012-03-03 01:21:09 -08:00
|
|
|
/* virtual */ bool
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::HasValidDimensions() const
|
2012-03-03 01:21:09 -08:00
|
|
|
{
|
2013-01-06 01:32:01 -08:00
|
|
|
return mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() &&
|
|
|
|
mLengthAttributes[ATTR_WIDTH].GetAnimValInSpecifiedUnits() > 0 &&
|
|
|
|
mLengthAttributes[ATTR_HEIGHT].IsExplicitlySet() &&
|
|
|
|
mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0;
|
2012-03-03 01:21:09 -08:00
|
|
|
}
|
|
|
|
|
2009-01-04 17:19:38 -08:00
|
|
|
nsSVGElement::LengthAttributesInfo
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::GetLengthInfo()
|
2009-01-04 17:19:38 -08:00
|
|
|
{
|
|
|
|
return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
|
2011-10-10 22:50:08 -07:00
|
|
|
ArrayLength(sLengthInfo));
|
2009-01-04 17:19:38 -08:00
|
|
|
}
|
|
|
|
|
2010-12-19 16:45:29 -08:00
|
|
|
SVGAnimatedPreserveAspectRatio *
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::GetPreserveAspectRatio()
|
2009-01-04 17:19:38 -08:00
|
|
|
{
|
|
|
|
return &mPreserveAspectRatio;
|
|
|
|
}
|
|
|
|
|
2008-06-14 02:01:02 -07:00
|
|
|
nsSVGElement::StringAttributesInfo
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::GetStringInfo()
|
2008-06-14 02:01:02 -07:00
|
|
|
{
|
|
|
|
return StringAttributesInfo(mStringAttributes, sStringInfo,
|
2011-10-10 22:50:08 -07:00
|
|
|
ArrayLength(sStringInfo));
|
2008-06-14 02:01:02 -07:00
|
|
|
}
|
2009-12-10 20:02:13 -08:00
|
|
|
|
|
|
|
nsresult
|
2013-01-06 01:32:01 -08:00
|
|
|
SVGImageElement::CopyInnerTo(Element* aDest)
|
2009-12-10 20:02:13 -08:00
|
|
|
{
|
2011-10-18 03:53:36 -07:00
|
|
|
if (aDest->OwnerDoc()->IsStaticDocument()) {
|
2013-01-06 01:32:01 -08:00
|
|
|
CreateStaticImageClone(static_cast<SVGImageElement*>(aDest));
|
2009-12-10 20:02:13 -08:00
|
|
|
}
|
2013-01-06 01:32:01 -08:00
|
|
|
return SVGImageElementBase::CopyInnerTo(aDest);
|
2009-12-10 20:02:13 -08:00
|
|
|
}
|
2013-01-06 01:32:01 -08:00
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|