2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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
|
|
|
|
2012-03-26 04:58:59 -07:00
|
|
|
// Main header first:
|
2009-04-24 16:17:43 -07:00
|
|
|
#include "nsSVGInnerSVGFrame.h"
|
2012-03-20 05:15:55 -07:00
|
|
|
|
2012-03-26 04:58:59 -07:00
|
|
|
// Keep others in (case-insensitive) order:
|
|
|
|
#include "gfxContext.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsISVGChildFrame.h"
|
2012-03-26 04:58:59 -07:00
|
|
|
#include "nsRenderingContext.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2013-04-25 02:18:42 -07:00
|
|
|
#include "nsSVGEffects.h"
|
2012-06-30 04:20:46 -07:00
|
|
|
#include "nsSVGIntegrationUtils.h"
|
2013-01-09 15:02:45 -08:00
|
|
|
#include "mozilla/dom/SVGSVGElement.h"
|
|
|
|
|
|
|
|
using namespace mozilla;
|
|
|
|
using namespace mozilla::dom;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsIFrame*
|
2009-01-19 10:31:34 -08:00
|
|
|
NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2007-07-25 02:16:02 -07:00
|
|
|
return new (aPresShell) nsSVGInnerSVGFrame(aContext);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGInnerSVGFrame)
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIFrame methods
|
|
|
|
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_QUERYFRAME_HEAD(nsSVGInnerSVGFrame)
|
2009-04-24 16:17:43 -07:00
|
|
|
NS_QUERYFRAME_ENTRY(nsSVGInnerSVGFrame)
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_QUERYFRAME_ENTRY(nsISVGSVGFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsSVGInnerSVGFrameBase)
|
|
|
|
|
2009-01-19 10:31:34 -08:00
|
|
|
#ifdef DEBUG
|
2013-03-19 18:47:48 -07:00
|
|
|
void
|
2009-01-19 10:31:34 -08:00
|
|
|
nsSVGInnerSVGFrame::Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
2013-01-07 19:22:41 -08:00
|
|
|
NS_ASSERTION(aContent->IsSVG(nsGkAtoms::svg),
|
|
|
|
"Content is not an SVG 'svg' element!");
|
2009-01-19 10:31:34 -08:00
|
|
|
|
2013-03-19 18:47:48 -07:00
|
|
|
nsSVGInnerSVGFrameBase::Init(aContent, aParent, aPrevInFlow);
|
2009-01-19 10:31:34 -08:00
|
|
|
}
|
|
|
|
#endif /* DEBUG */
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIAtom *
|
|
|
|
nsSVGInnerSVGFrame::GetType() const
|
|
|
|
{
|
|
|
|
return nsGkAtoms::svgInnerSVGFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGChildFrame methods
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-03-02 00:28:59 -08:00
|
|
|
nsSVGInnerSVGFrame::PaintSVG(nsRenderingContext *aContext,
|
2008-10-20 01:42:03 -07:00
|
|
|
const nsIntRect *aDirtyRect)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-07-20 11:12:29 -07:00
|
|
|
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
2013-07-12 00:13:07 -07:00
|
|
|
(mState & NS_FRAME_IS_NONDISPLAY),
|
2012-07-20 11:12:29 -07:00
|
|
|
"If display lists are enabled, only painting of non-display "
|
|
|
|
"SVG should take this code path");
|
|
|
|
|
2008-01-27 12:39:27 -08:00
|
|
|
gfxContextAutoSaveRestore autoSR;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-02-16 13:51:02 -08:00
|
|
|
if (StyleDisplay()->IsScrollableOverflow()) {
|
2008-01-27 12:39:27 -08:00
|
|
|
float x, y, width, height;
|
2013-01-09 15:02:45 -08:00
|
|
|
static_cast<SVGSVGElement*>(mContent)->
|
2012-07-30 07:20:58 -07:00
|
|
|
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-01-27 12:39:27 -08:00
|
|
|
if (width <= 0 || height <= 0) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-06-18 04:31:25 -07:00
|
|
|
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(mParent);
|
2012-06-30 04:20:46 -07:00
|
|
|
gfxMatrix clipTransform = parent->GetCanvasTM(FOR_PAINTING);
|
2009-06-18 04:31:25 -07:00
|
|
|
|
2012-03-02 00:28:59 -08:00
|
|
|
gfxContext *gfx = aContext->ThebesContext();
|
2009-06-18 04:31:25 -07:00
|
|
|
autoSR.SetContext(gfx);
|
|
|
|
gfxRect clipRect =
|
|
|
|
nsSVGUtils::GetClipRectForFrame(this, x, y, width, height);
|
|
|
|
nsSVGUtils::SetClipRect(gfx, clipTransform, clipRect);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2008-01-27 12:39:27 -08:00
|
|
|
return nsSVGInnerSVGFrameBase::PaintSVG(aContext, aDirtyRect);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2012-05-16 21:05:09 -07:00
|
|
|
void
|
2012-07-21 17:01:44 -07:00
|
|
|
nsSVGInnerSVGFrame::ReflowSVG()
|
2012-05-16 21:05:09 -07:00
|
|
|
{
|
|
|
|
// mRect must be set before FinishAndStoreOverflow is called in order
|
|
|
|
// for our overflow areas to be clipped correctly.
|
|
|
|
float x, y, width, height;
|
2013-01-09 15:02:45 -08:00
|
|
|
static_cast<SVGSVGElement*>(mContent)->
|
2012-07-30 07:20:58 -07:00
|
|
|
GetAnimatedLengthValues(&x, &y, &width, &height, nullptr);
|
2012-05-16 21:05:09 -07:00
|
|
|
mRect = nsLayoutUtils::RoundGfxRectToAppRect(
|
|
|
|
gfxRect(x, y, width, height),
|
|
|
|
PresContext()->AppUnitsPerCSSPixel());
|
2012-07-21 17:01:44 -07:00
|
|
|
nsSVGInnerSVGFrameBase::ReflowSVG();
|
2012-05-16 21:05:09 -07:00
|
|
|
}
|
|
|
|
|
2008-01-25 01:27:03 -08:00
|
|
|
void
|
2012-08-22 08:56:38 -07:00
|
|
|
nsSVGInnerSVGFrame::NotifySVGChanged(uint32_t aFlags)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-03-11 08:53:36 -07:00
|
|
|
NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED),
|
|
|
|
"Invalidation logic may need adjusting");
|
|
|
|
|
2008-01-25 01:27:03 -08:00
|
|
|
if (aFlags & COORD_CONTEXT_CHANGED) {
|
|
|
|
|
2013-01-09 15:02:45 -08:00
|
|
|
SVGSVGElement *svg = static_cast<SVGSVGElement*>(mContent);
|
2008-01-25 01:27:03 -08:00
|
|
|
|
2012-06-23 09:36:46 -07:00
|
|
|
bool xOrYIsPercentage =
|
2013-01-09 15:02:47 -08:00
|
|
|
svg->mLengthAttributes[SVGSVGElement::ATTR_X].IsPercentage() ||
|
|
|
|
svg->mLengthAttributes[SVGSVGElement::ATTR_Y].IsPercentage();
|
2012-06-23 09:36:46 -07:00
|
|
|
bool widthOrHeightIsPercentage =
|
2013-01-09 15:02:47 -08:00
|
|
|
svg->mLengthAttributes[SVGSVGElement::ATTR_WIDTH].IsPercentage() ||
|
|
|
|
svg->mLengthAttributes[SVGSVGElement::ATTR_HEIGHT].IsPercentage();
|
2012-06-23 09:36:46 -07:00
|
|
|
|
|
|
|
if (xOrYIsPercentage || widthOrHeightIsPercentage) {
|
|
|
|
// Ancestor changes can't affect how we render from the perspective of
|
|
|
|
// any rendering observers that we may have, so we don't need to
|
|
|
|
// invalidate them. We also don't need to invalidate ourself, since our
|
|
|
|
// changed ancestor will have invalidated its entire area, which includes
|
|
|
|
// our area.
|
|
|
|
// For perf reasons we call this before calling NotifySVGChanged() below.
|
2012-07-21 17:01:44 -07:00
|
|
|
nsSVGUtils::ScheduleReflowSVG(this);
|
2012-06-23 09:36:46 -07:00
|
|
|
}
|
|
|
|
|
2008-01-25 01:27:03 -08:00
|
|
|
// Coordinate context changes affect mCanvasTM if we have a
|
|
|
|
// percentage 'x' or 'y', or if we have a percentage 'width' or 'height' AND
|
|
|
|
// a 'viewBox'.
|
|
|
|
|
|
|
|
if (!(aFlags & TRANSFORM_CHANGED) &&
|
2012-06-23 09:36:46 -07:00
|
|
|
(xOrYIsPercentage ||
|
2013-02-26 08:58:06 -08:00
|
|
|
(widthOrHeightIsPercentage && svg->HasViewBoxRect()))) {
|
2008-01-25 01:27:03 -08:00
|
|
|
aFlags |= TRANSFORM_CHANGED;
|
|
|
|
}
|
|
|
|
|
2013-02-26 08:58:06 -08:00
|
|
|
if (svg->HasViewBoxRect() || !widthOrHeightIsPercentage) {
|
2012-05-19 06:50:07 -07:00
|
|
|
// Remove COORD_CONTEXT_CHANGED, since we establish the coordinate
|
|
|
|
// context for our descendants and this notification won't change its
|
|
|
|
// dimensions:
|
|
|
|
aFlags &= ~COORD_CONTEXT_CHANGED;
|
|
|
|
|
2012-07-23 04:00:43 -07:00
|
|
|
if (!aFlags) {
|
2012-05-19 06:50:07 -07:00
|
|
|
return; // No notification flags left
|
|
|
|
}
|
|
|
|
}
|
2008-01-25 01:27:03 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (aFlags & TRANSFORM_CHANGED) {
|
|
|
|
// make sure our cached transform matrix gets (lazily) updated
|
2012-07-30 07:20:58 -07:00
|
|
|
mCanvasTM = nullptr;
|
2008-01-25 01:27:03 -08:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-01-25 01:27:03 -08:00
|
|
|
nsSVGInnerSVGFrameBase::NotifySVGChanged(aFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2010-10-07 12:19:32 -07:00
|
|
|
NS_IMETHODIMP
|
2012-08-22 08:56:38 -07:00
|
|
|
nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
|
2010-10-07 12:19:32 -07:00
|
|
|
nsIAtom* aAttribute,
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t aModType)
|
2010-10-07 12:19:32 -07:00
|
|
|
{
|
2012-08-15 04:58:06 -07:00
|
|
|
if (aNameSpaceID == kNameSpaceID_None &&
|
2013-07-12 00:13:07 -07:00
|
|
|
!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
2012-05-16 21:05:09 -07:00
|
|
|
|
2013-01-09 15:02:45 -08:00
|
|
|
SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
|
2012-05-16 21:05:09 -07:00
|
|
|
|
2010-10-07 12:19:32 -07:00
|
|
|
if (aAttribute == nsGkAtoms::width ||
|
2011-09-30 01:25:01 -07:00
|
|
|
aAttribute == nsGkAtoms::height) {
|
2013-04-25 02:18:42 -07:00
|
|
|
nsSVGEffects::InvalidateRenderingObservers(this);
|
2012-11-28 01:42:13 -08:00
|
|
|
nsSVGUtils::ScheduleReflowSVG(this);
|
2011-09-30 01:25:01 -07:00
|
|
|
|
2012-05-16 21:05:09 -07:00
|
|
|
if (content->HasViewBoxOrSyntheticViewBox()) {
|
2011-09-30 01:25:01 -07:00
|
|
|
// make sure our cached transform matrix gets (lazily) updated
|
2012-07-30 07:20:58 -07:00
|
|
|
mCanvasTM = nullptr;
|
2012-05-16 21:05:09 -07:00
|
|
|
content->ChildrenOnlyTransformChanged();
|
2011-09-30 01:25:01 -07:00
|
|
|
nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
|
|
|
|
} else {
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t flags = COORD_CONTEXT_CHANGED;
|
2012-03-03 01:21:09 -08:00
|
|
|
if (mCanvasTM && mCanvasTM->IsSingular()) {
|
2012-07-30 07:20:58 -07:00
|
|
|
mCanvasTM = nullptr;
|
2012-03-03 01:21:09 -08:00
|
|
|
flags |= TRANSFORM_CHANGED;
|
|
|
|
}
|
|
|
|
nsSVGUtils::NotifyChildrenOfSVGChange(this, flags);
|
2011-09-30 01:25:01 -07:00
|
|
|
}
|
|
|
|
|
2010-10-07 12:19:32 -07:00
|
|
|
} else if (aAttribute == nsGkAtoms::transform ||
|
2011-09-30 01:25:01 -07:00
|
|
|
aAttribute == nsGkAtoms::preserveAspectRatio ||
|
|
|
|
aAttribute == nsGkAtoms::viewBox ||
|
2010-10-07 12:19:32 -07:00
|
|
|
aAttribute == nsGkAtoms::x ||
|
|
|
|
aAttribute == nsGkAtoms::y) {
|
|
|
|
// make sure our cached transform matrix gets (lazily) updated
|
2012-07-30 07:20:58 -07:00
|
|
|
mCanvasTM = nullptr;
|
2010-10-07 12:19:32 -07:00
|
|
|
|
2011-09-30 01:25:01 -07:00
|
|
|
nsSVGUtils::NotifyChildrenOfSVGChange(
|
|
|
|
this, aAttribute == nsGkAtoms::viewBox ?
|
|
|
|
TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED);
|
2012-05-16 21:05:09 -07:00
|
|
|
|
2013-05-23 00:04:21 -07:00
|
|
|
// We don't invalidate for transform changes (the layers code does that).
|
|
|
|
// Also note that SVGTransformableElement::GetAttributeChangeHint will
|
|
|
|
// return nsChangeHint_UpdateOverflow for "transform" attribute changes
|
|
|
|
// and cause DoApplyRenderingChangeToTree to make the SchedulePaint call.
|
|
|
|
|
2013-04-25 02:18:42 -07:00
|
|
|
if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y) {
|
|
|
|
nsSVGEffects::InvalidateRenderingObservers(this);
|
|
|
|
nsSVGUtils::ScheduleReflowSVG(this);
|
|
|
|
} else if (aAttribute == nsGkAtoms::viewBox ||
|
|
|
|
(aAttribute == nsGkAtoms::preserveAspectRatio &&
|
|
|
|
content->HasViewBoxOrSyntheticViewBox())) {
|
2012-05-16 21:05:09 -07:00
|
|
|
content->ChildrenOnlyTransformChanged();
|
2013-02-11 15:25:56 -08:00
|
|
|
// SchedulePaint sets a global state flag so we only need to call it once
|
|
|
|
// (on ourself is fine), not once on each child (despite bug 828240).
|
|
|
|
SchedulePaint();
|
2012-05-16 21:05:09 -07:00
|
|
|
}
|
2010-10-07 12:19:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-08-25 02:23:54 -07:00
|
|
|
NS_IMETHODIMP_(nsIFrame*)
|
|
|
|
nsSVGInnerSVGFrame::GetFrameForPoint(const nsPoint &aPoint)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-07-20 11:12:29 -07:00
|
|
|
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
2013-07-12 00:13:07 -07:00
|
|
|
(mState & NS_FRAME_IS_NONDISPLAY),
|
2012-07-20 11:12:29 -07:00
|
|
|
"If display lists are enabled, only hit-testing of non-display "
|
|
|
|
"SVG should take this code path");
|
|
|
|
|
2013-02-16 13:51:02 -08:00
|
|
|
if (StyleDisplay()->IsScrollableOverflow()) {
|
2009-07-23 01:35:59 -07:00
|
|
|
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
|
|
|
|
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(mParent);
|
2009-07-21 15:55:48 -07:00
|
|
|
|
2009-07-23 01:35:59 -07:00
|
|
|
float clipX, clipY, clipWidth, clipHeight;
|
2012-07-30 07:20:58 -07:00
|
|
|
content->GetAnimatedLengthValues(&clipX, &clipY, &clipWidth, &clipHeight, nullptr);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-30 04:20:46 -07:00
|
|
|
if (!nsSVGUtils::HitTestRect(parent->GetCanvasTM(FOR_HIT_TESTING),
|
2007-03-22 10:30:00 -07:00
|
|
|
clipX, clipY, clipWidth, clipHeight,
|
2008-08-25 02:23:54 -07:00
|
|
|
PresContext()->AppUnitsToDevPixels(aPoint.x),
|
|
|
|
PresContext()->AppUnitsToDevPixels(aPoint.y))) {
|
2012-07-30 07:20:58 -07:00
|
|
|
return nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-08-25 02:23:54 -07:00
|
|
|
return nsSVGInnerSVGFrameBase::GetFrameForPoint(aPoint);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGSVGFrame methods:
|
|
|
|
|
2012-02-04 05:58:46 -08:00
|
|
|
void
|
2012-08-22 08:56:38 -07:00
|
|
|
nsSVGInnerSVGFrame::NotifyViewportOrTransformChanged(uint32_t aFlags)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-05-03 09:05:53 -07:00
|
|
|
// The dimensions of inner-<svg> frames are purely defined by their "width"
|
|
|
|
// and "height" attributes, and transform changes can only occur as a result
|
|
|
|
// of changes to their "width", "height", "viewBox" or "preserveAspectRatio"
|
|
|
|
// attributes. Changes to all of these attributes are handled in
|
|
|
|
// AttributeChanged(), so we should never be called.
|
|
|
|
NS_ERROR("Not called for nsSVGInnerSVGFrame");
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGContainerFrame methods:
|
|
|
|
|
2009-04-28 21:31:34 -07:00
|
|
|
gfxMatrix
|
2012-08-22 08:56:38 -07:00
|
|
|
nsSVGInnerSVGFrame::GetCanvasTM(uint32_t aFor)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2013-07-12 00:13:07 -07:00
|
|
|
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
2012-06-30 04:20:46 -07:00
|
|
|
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
|
|
|
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
|
|
|
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
|
|
|
}
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!mCanvasTM) {
|
|
|
|
NS_ASSERTION(mParent, "null parent");
|
|
|
|
|
2009-04-28 21:31:34 -07:00
|
|
|
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(mParent);
|
2013-01-09 15:02:45 -08:00
|
|
|
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-06-30 04:20:46 -07:00
|
|
|
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM(aFor));
|
2009-04-28 21:31:34 -07:00
|
|
|
|
2011-09-25 14:04:32 -07:00
|
|
|
mCanvasTM = new gfxMatrix(tm);
|
2009-04-28 21:31:34 -07:00
|
|
|
}
|
2011-09-25 14:04:32 -07:00
|
|
|
return *mCanvasTM;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2012-05-16 21:05:09 -07:00
|
|
|
bool
|
|
|
|
nsSVGInnerSVGFrame::HasChildrenOnlyTransform(gfxMatrix *aTransform) const
|
|
|
|
{
|
2013-01-09 15:02:45 -08:00
|
|
|
SVGSVGElement *content = static_cast<SVGSVGElement*>(mContent);
|
2012-05-16 21:05:09 -07:00
|
|
|
|
|
|
|
if (content->HasViewBoxOrSyntheticViewBox()) {
|
|
|
|
// XXX Maybe return false if the transform is the identity transform?
|
|
|
|
if (aTransform) {
|
|
|
|
*aTransform = content->GetViewBoxTransform();
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|