2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is the Mozilla SVG project.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Crocodile Clips Ltd..
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2001
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
* Alex Fritze <alex.fritze@crocodile-clips.com> (original author)
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
2012-03-26 04:58:59 -07:00
|
|
|
// Main header first:
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGForeignObjectFrame.h"
|
|
|
|
|
2012-03-26 04:58:59 -07:00
|
|
|
// Keep others in (case-insensitive) order:
|
|
|
|
#include "gfxContext.h"
|
|
|
|
#include "gfxMatrix.h"
|
|
|
|
#include "nsGkAtoms.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIDOMSVGForeignObjectElem.h"
|
2012-03-26 04:58:59 -07:00
|
|
|
#include "nsINameSpaceManager.h"
|
|
|
|
#include "nsLayoutUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsRegion.h"
|
2012-03-20 05:15:55 -07:00
|
|
|
#include "nsRenderingContext.h"
|
2012-03-26 04:58:59 -07:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-20 05:15:53 -07:00
|
|
|
#include "nsSVGEffects.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsSVGForeignObjectElement.h"
|
2012-03-26 04:58:59 -07:00
|
|
|
#include "nsSVGOuterSVGFrame.h"
|
|
|
|
#include "nsSVGUtils.h"
|
2012-04-16 15:32:12 -07:00
|
|
|
#include "mozilla/AutoRestore.h"
|
|
|
|
|
|
|
|
using namespace mozilla;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation
|
|
|
|
|
|
|
|
nsIFrame*
|
2007-06-21 16:01:10 -07:00
|
|
|
NS_NewSVGForeignObjectFrame(nsIPresShell *aPresShell,
|
|
|
|
nsStyleContext *aContext)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
return new (aPresShell) nsSVGForeignObjectFrame(aContext);
|
|
|
|
}
|
|
|
|
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGForeignObjectFrame)
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsSVGForeignObjectFrame::nsSVGForeignObjectFrame(nsStyleContext* aContext)
|
|
|
|
: nsSVGForeignObjectFrameBase(aContext),
|
2011-10-17 07:59:28 -07:00
|
|
|
mInReflow(false)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2010-08-13 06:31:31 -07:00
|
|
|
AddStateBits(NS_FRAME_REFLOW_ROOT | NS_FRAME_MAY_BE_TRANSFORMED);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2009-01-09 08:35:24 -08:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIFrame methods
|
2008-11-05 11:25:30 -08:00
|
|
|
|
2009-01-12 11:20:59 -08:00
|
|
|
NS_QUERYFRAME_HEAD(nsSVGForeignObjectFrame)
|
|
|
|
NS_QUERYFRAME_ENTRY(nsISVGChildFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsSVGForeignObjectFrameBase)
|
|
|
|
|
2007-11-20 01:10:18 -08:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGForeignObjectFrame::Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
2009-01-19 10:31:34 -08:00
|
|
|
#ifdef DEBUG
|
|
|
|
nsCOMPtr<nsIDOMSVGForeignObjectElement> foreignObject = do_QueryInterface(aContent);
|
|
|
|
NS_ASSERTION(foreignObject, "Content is not an SVG foreignObject!");
|
|
|
|
#endif
|
|
|
|
|
2007-11-20 01:10:18 -08:00
|
|
|
nsresult rv = nsSVGForeignObjectFrameBase::Init(aContent, aParent, aPrevInFlow);
|
2011-04-20 02:16:01 -07:00
|
|
|
AddStateBits(aParent->GetStateBits() &
|
2012-03-20 05:15:53 -07:00
|
|
|
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
|
2012-04-16 15:32:12 -07:00
|
|
|
AddStateBits(NS_FRAME_FONT_INFLATION_CONTAINER |
|
|
|
|
NS_FRAME_FONT_INFLATION_FLOW_ROOT);
|
2007-11-20 01:10:18 -08:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIAtom *
|
|
|
|
nsSVGForeignObjectFrame::GetType() const
|
|
|
|
{
|
|
|
|
return nsGkAtoms::svgForeignObjectFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2007-06-21 16:01:10 -07:00
|
|
|
nsSVGForeignObjectFrame::AttributeChanged(PRInt32 aNameSpaceID,
|
|
|
|
nsIAtom *aAttribute,
|
|
|
|
PRInt32 aModType)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
if (aNameSpaceID == kNameSpaceID_None) {
|
|
|
|
if (aAttribute == nsGkAtoms::width ||
|
|
|
|
aAttribute == nsGkAtoms::height) {
|
2012-03-20 05:15:53 -07:00
|
|
|
nsSVGUtils::InvalidateAndScheduleBoundsUpdate(this);
|
2007-11-20 01:10:18 -08:00
|
|
|
// XXXjwatt: why mark intrinsic widths dirty? can't we just use eResize?
|
2007-05-05 04:11:07 -07:00
|
|
|
RequestReflow(nsIPresShell::eStyleChange);
|
2007-03-22 10:30:00 -07:00
|
|
|
} else if (aAttribute == nsGkAtoms::x ||
|
2009-06-18 04:31:25 -07:00
|
|
|
aAttribute == nsGkAtoms::y ||
|
|
|
|
aAttribute == nsGkAtoms::transform) {
|
2007-03-22 10:30:00 -07:00
|
|
|
// make sure our cached transform matrix gets (lazily) updated
|
|
|
|
mCanvasTM = nsnull;
|
2012-03-20 05:15:53 -07:00
|
|
|
nsSVGUtils::InvalidateAndScheduleBoundsUpdate(this);
|
|
|
|
} else if (aAttribute == nsGkAtoms::viewBox ||
|
|
|
|
aAttribute == nsGkAtoms::preserveAspectRatio) {
|
|
|
|
nsSVGUtils::InvalidateBounds(this);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-12-17 01:09:19 -08:00
|
|
|
/* virtual */ void
|
|
|
|
nsSVGForeignObjectFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
|
|
|
{
|
|
|
|
nsSVGForeignObjectFrameBase::DidSetStyleContext(aOldStyleContext);
|
|
|
|
|
2011-12-29 03:59:02 -08:00
|
|
|
// No need to invalidate before first reflow - that will happen elsewhere.
|
|
|
|
// Moreover we haven't been initialised properly yet so we may not have the
|
|
|
|
// right state bits.
|
|
|
|
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
2012-03-20 05:15:53 -07:00
|
|
|
// XXXperf: probably only need a bounds update if 'font-size' changed and
|
|
|
|
// we have em unit width/height. Or, once we map 'transform' into style,
|
|
|
|
// if some transform property changed.
|
|
|
|
nsSVGUtils::InvalidateAndScheduleBoundsUpdate(this);
|
2011-12-29 03:59:02 -08:00
|
|
|
}
|
2011-12-17 01:09:19 -08:00
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aDesiredSize,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus)
|
|
|
|
{
|
2012-03-20 05:15:53 -07:00
|
|
|
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Should not have been called");
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
// Only InvalidateAndScheduleBoundsUpdate marks us with NS_FRAME_IS_DIRTY,
|
|
|
|
// so if that bit is still set we still have a resize pending. If we hit
|
|
|
|
// this assertion, then we should get the presShell to skip reflow roots
|
|
|
|
// that have a dirty parent since a reflow is going to come via the
|
|
|
|
// reflow root's parent anyway.
|
|
|
|
NS_ASSERTION(!(GetStateBits() & NS_FRAME_IS_DIRTY),
|
|
|
|
"Reflowing while a resize is pending is wasteful");
|
|
|
|
|
|
|
|
// UpdateBounds makes sure mRect is up to date before we're called.
|
2007-06-21 16:01:10 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_ASSERTION(!aReflowState.parentReflowState,
|
|
|
|
"should only get reflow from being reflow root");
|
|
|
|
NS_ASSERTION(aReflowState.ComputedWidth() == GetSize().width &&
|
2007-08-02 11:08:05 -07:00
|
|
|
aReflowState.ComputedHeight() == GetSize().height,
|
2009-07-27 01:47:02 -07:00
|
|
|
"reflow roots should be reflowed at existing size and "
|
2007-03-22 10:30:00 -07:00
|
|
|
"svg.css should ensure we have no padding/border/margin");
|
|
|
|
|
|
|
|
DoReflow();
|
|
|
|
|
|
|
|
aDesiredSize.width = aReflowState.ComputedWidth();
|
2007-08-02 11:08:05 -07:00
|
|
|
aDesiredSize.height = aReflowState.ComputedHeight();
|
2010-10-06 21:25:46 -07:00
|
|
|
aDesiredSize.SetOverflowAreasToDesiredBounds();
|
2007-03-22 10:30:00 -07:00
|
|
|
aStatus = NS_FRAME_COMPLETE;
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2007-06-21 16:01:10 -07:00
|
|
|
void
|
|
|
|
nsSVGForeignObjectFrame::InvalidateInternal(const nsRect& aDamageRect,
|
|
|
|
nscoord aX, nscoord aY,
|
|
|
|
nsIFrame* aForChild,
|
2008-09-18 02:47:21 -07:00
|
|
|
PRUint32 aFlags)
|
2007-06-21 16:01:10 -07:00
|
|
|
{
|
2009-06-18 04:31:25 -07:00
|
|
|
// This is called by our descendants when they change.
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
if (GetStateBits() & NS_FRAME_IS_DIRTY) {
|
|
|
|
// Our entire area has been (or will be) invalidated, so no point
|
|
|
|
// keeping track of sub-areas that our descendants dirty.
|
2012-03-20 05:15:53 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
|
|
|
nsSVGEffects::InvalidateRenderingObservers(this);
|
2007-06-21 16:01:10 -07:00
|
|
|
return;
|
2012-03-20 05:15:53 -07:00
|
|
|
}
|
2007-06-21 16:01:10 -07:00
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
if (!mInReflow) {
|
|
|
|
// We can't collect dirty areas, since we don't have a place to reliably
|
|
|
|
// call FlushDirtyRegion before we paint, so we have to invalidate now.
|
|
|
|
InvalidateDirtyRect(nsSVGUtils::GetOuterSVGFrame(this), aDamageRect + nsPoint(aX, aY), aFlags);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-09-18 02:47:21 -07:00
|
|
|
nsRegion* region = (aFlags & INVALIDATE_CROSS_DOC)
|
2009-06-11 08:23:43 -07:00
|
|
|
? &mSubDocDirtyRegion : &mSameDocDirtyRegion;
|
2008-09-18 02:47:21 -07:00
|
|
|
region->Or(*region, aDamageRect + nsPoint(aX, aY));
|
2007-06-21 16:01:10 -07:00
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
2009-06-18 04:31:25 -07:00
|
|
|
* Returns the app unit canvas bounds of a userspace rect.
|
|
|
|
*
|
|
|
|
* @param aToCanvas Transform from userspace to canvas device space.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2007-06-21 16:01:10 -07:00
|
|
|
static nsRect
|
2009-06-18 04:31:25 -07:00
|
|
|
ToCanvasBounds(const gfxRect &aUserspaceRect,
|
|
|
|
const gfxMatrix &aToCanvas,
|
|
|
|
const nsPresContext *presContext)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2009-06-18 04:31:25 -07:00
|
|
|
return nsLayoutUtils::RoundGfxRectToAppRect(
|
|
|
|
aToCanvas.TransformBounds(aUserspaceRect),
|
|
|
|
presContext->AppUnitsPerDevPixel());
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-03-02 00:28:59 -08:00
|
|
|
nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext,
|
2008-10-20 01:42:03 -07:00
|
|
|
const nsIntRect *aDirtyRect)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2007-06-25 01:31:31 -07:00
|
|
|
if (IsDisabled())
|
|
|
|
return NS_OK;
|
|
|
|
|
2011-08-24 13:54:30 -07:00
|
|
|
nsIFrame* kid = GetFirstPrincipalChild();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!kid)
|
|
|
|
return NS_OK;
|
|
|
|
|
2010-01-30 11:28:02 -08:00
|
|
|
gfxMatrix matrixForChildren = GetCanvasTMForChildren();
|
|
|
|
gfxMatrix matrix = GetCanvasTM();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-03-02 00:28:59 -08:00
|
|
|
if (matrixForChildren.IsSingular()) {
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_WARNING("Can't render foreignObject element!");
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
|
2012-02-10 04:33:46 -08:00
|
|
|
nsRect kidDirtyRect = kid->GetVisualOverflowRect();
|
|
|
|
|
2008-12-06 07:22:01 -08:00
|
|
|
/* Check if we need to draw anything. */
|
2012-01-01 07:47:27 -08:00
|
|
|
if (aDirtyRect) {
|
2012-02-10 04:33:46 -08:00
|
|
|
// Transform the dirty rect into app units in our userspace.
|
|
|
|
gfxMatrix invmatrix = matrix;
|
|
|
|
invmatrix.Invert();
|
|
|
|
NS_ASSERTION(!invmatrix.IsSingular(),
|
|
|
|
"inverse of non-singular matrix should be non-singular");
|
|
|
|
|
|
|
|
gfxRect transDirtyRect = gfxRect(aDirtyRect->x, aDirtyRect->y,
|
|
|
|
aDirtyRect->width, aDirtyRect->height);
|
|
|
|
transDirtyRect = invmatrix.TransformBounds(transDirtyRect);
|
|
|
|
|
|
|
|
kidDirtyRect.IntersectRect(kidDirtyRect,
|
|
|
|
nsLayoutUtils::RoundGfxRectToAppRect(transDirtyRect,
|
|
|
|
PresContext()->AppUnitsPerCSSPixel()));
|
|
|
|
|
|
|
|
// XXX after bug 614732 is fixed, we will compare mRect with aDirtyRect,
|
|
|
|
// not with kidDirtyRect. I.e.
|
|
|
|
// PRInt32 appUnitsPerDevPx = PresContext()->AppUnitsPerDevPixel();
|
|
|
|
// mRect.ToOutsidePixels(appUnitsPerDevPx).Intersects(*aDirtyRect)
|
|
|
|
if (kidDirtyRect.IsEmpty())
|
2012-01-01 07:47:27 -08:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2008-12-06 07:22:01 -08:00
|
|
|
|
2012-03-02 00:28:59 -08:00
|
|
|
gfxContext *gfx = aContext->ThebesContext();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
gfx->Save();
|
2007-04-30 02:02:38 -07:00
|
|
|
|
|
|
|
if (GetStyleDisplay()->IsScrollableOverflow()) {
|
2007-05-23 01:39:00 -07:00
|
|
|
float x, y, width, height;
|
2007-07-08 00:08:04 -07:00
|
|
|
static_cast<nsSVGElement*>(mContent)->
|
2007-05-23 01:39:00 -07:00
|
|
|
GetAnimatedLengthValues(&x, &y, &width, &height, nsnull);
|
2007-04-30 02:02:38 -07:00
|
|
|
|
2009-06-17 13:51:40 -07:00
|
|
|
gfxRect clipRect =
|
2009-06-18 04:31:25 -07:00
|
|
|
nsSVGUtils::GetClipRectForFrame(this, 0.0f, 0.0f, width, height);
|
2010-01-30 11:28:02 -08:00
|
|
|
nsSVGUtils::SetClipRect(gfx, matrix, clipRect);
|
2007-04-30 02:02:38 -07:00
|
|
|
}
|
|
|
|
|
2010-01-30 11:28:02 -08:00
|
|
|
gfx->Multiply(matrixForChildren);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-10-14 18:03:45 -07:00
|
|
|
PRUint32 flags = nsLayoutUtils::PAINT_IN_TRANSFORM;
|
2012-03-02 00:28:59 -08:00
|
|
|
if (SVGAutoRenderState::IsPaintingToWindow(aContext)) {
|
2010-10-14 18:03:45 -07:00
|
|
|
flags |= nsLayoutUtils::PAINT_TO_WINDOW;
|
|
|
|
}
|
2012-03-02 00:28:59 -08:00
|
|
|
nsresult rv = nsLayoutUtils::PaintFrame(aContext, kid, nsRegion(kidDirtyRect),
|
2010-10-14 18:03:45 -07:00
|
|
|
NS_RGBA(0,0,0,0), flags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
gfx->Restore();
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2011-07-22 15:28:51 -07:00
|
|
|
gfx3DMatrix
|
2011-12-27 19:24:18 -08:00
|
|
|
nsSVGForeignObjectFrame::GetTransformMatrix(nsIFrame* aAncestor,
|
|
|
|
nsIFrame **aOutAncestor)
|
2008-09-13 02:42:11 -07:00
|
|
|
{
|
|
|
|
NS_PRECONDITION(aOutAncestor, "We need an ancestor to write to!");
|
|
|
|
|
|
|
|
/* Set the ancestor to be the outer frame. */
|
|
|
|
*aOutAncestor = nsSVGUtils::GetOuterSVGFrame(this);
|
|
|
|
NS_ASSERTION(*aOutAncestor, "How did we end up without an outer frame?");
|
|
|
|
|
2012-01-29 00:56:20 -08:00
|
|
|
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
|
|
|
return gfx3DMatrix::From2D(gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0));
|
|
|
|
}
|
|
|
|
|
2008-09-13 02:42:11 -07:00
|
|
|
/* Return the matrix back to the root, factoring in the x and y offsets. */
|
2011-07-22 15:28:51 -07:00
|
|
|
return gfx3DMatrix::From2D(GetCanvasTMForChildren());
|
2008-09-13 02:42:11 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-08-25 02:23:54 -07:00
|
|
|
NS_IMETHODIMP_(nsIFrame*)
|
|
|
|
nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2009-06-18 04:31:25 -07:00
|
|
|
if (IsDisabled() || (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD))
|
|
|
|
return nsnull;
|
2007-06-25 01:31:31 -07:00
|
|
|
|
2011-08-24 13:54:30 -07:00
|
|
|
nsIFrame* kid = GetFirstPrincipalChild();
|
2009-06-18 04:31:25 -07:00
|
|
|
if (!kid)
|
2008-08-25 02:23:54 -07:00
|
|
|
return nsnull;
|
2009-06-18 04:31:25 -07:00
|
|
|
|
|
|
|
float x, y, width, height;
|
|
|
|
static_cast<nsSVGElement*>(mContent)->
|
|
|
|
GetAnimatedLengthValues(&x, &y, &width, &height, nsnull);
|
|
|
|
|
|
|
|
gfxMatrix tm = GetCanvasTM().Invert();
|
|
|
|
if (tm.IsSingular())
|
2008-08-25 02:23:54 -07:00
|
|
|
return nsnull;
|
2009-06-18 04:31:25 -07:00
|
|
|
|
|
|
|
// Convert aPoint from app units in canvas space to user space:
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-06-18 04:31:25 -07:00
|
|
|
gfxPoint pt = gfxPoint(aPoint.x, aPoint.y) / PresContext()->AppUnitsPerDevPixel();
|
|
|
|
pt = tm.Transform(pt);
|
|
|
|
|
|
|
|
if (!gfxRect(0.0f, 0.0f, width, height).Contains(pt))
|
|
|
|
return nsnull;
|
|
|
|
|
|
|
|
// Convert pt to app units in *local* space:
|
|
|
|
|
|
|
|
pt = pt * nsPresContext::AppUnitsPerCSSPixel();
|
|
|
|
nsPoint point = nsPoint(NSToIntRound(pt.x), NSToIntRound(pt.y));
|
|
|
|
|
2010-07-15 01:10:59 -07:00
|
|
|
nsIFrame *frame = nsLayoutUtils::GetFrameForPoint(kid, point);
|
|
|
|
if (frame && nsSVGUtils::HitTestClip(this, aPoint))
|
|
|
|
return frame;
|
|
|
|
|
|
|
|
return nsnull;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP_(nsRect)
|
|
|
|
nsSVGForeignObjectFrame::GetCoveredRegion()
|
|
|
|
{
|
2012-02-10 04:33:49 -08:00
|
|
|
// See bug 614732 comment 32:
|
|
|
|
//return nsSVGUtils::TransformFrameRectToOuterSVG(mRect, GetCanvasTM(), PresContext());
|
|
|
|
return mCoveredRegion;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
void
|
|
|
|
nsSVGForeignObjectFrame::UpdateBounds()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-03-20 05:15:53 -07:00
|
|
|
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingUpdateBounds(this),
|
|
|
|
"This call is probaby a wasteful mistake");
|
|
|
|
|
|
|
|
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"UpdateBounds mechanism not designed for this");
|
|
|
|
|
|
|
|
if (!nsSVGUtils::NeedsUpdatedBounds(this)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// We update mRect before the DoReflow call so that DoReflow uses the
|
|
|
|
// correct dimensions:
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-06-21 16:01:10 -07:00
|
|
|
float x, y, w, h;
|
2007-07-08 00:08:04 -07:00
|
|
|
static_cast<nsSVGForeignObjectElement*>(mContent)->
|
2007-06-21 16:01:10 -07:00
|
|
|
GetAnimatedLengthValues(&x, &y, &w, &h, nsnull);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2007-06-25 01:31:31 -07:00
|
|
|
// If mRect's width or height are negative, reflow blows up! We must clamp!
|
|
|
|
if (w < 0.0f) w = 0.0f;
|
|
|
|
if (h < 0.0f) h = 0.0f;
|
|
|
|
|
2009-06-18 04:31:25 -07:00
|
|
|
// GetCanvasTM includes the x,y translation
|
2012-02-10 04:33:46 -08:00
|
|
|
mRect = nsLayoutUtils::RoundGfxRectToAppRect(
|
|
|
|
gfxRect(0.0, 0.0, w, h),
|
2012-02-16 22:07:51 -08:00
|
|
|
PresContext()->AppUnitsPerCSSPixel());
|
2012-02-10 04:33:49 -08:00
|
|
|
mCoveredRegion = ToCanvasBounds(gfxRect(0.0, 0.0, w, h), GetCanvasTM(), PresContext());
|
2012-02-10 04:33:46 -08:00
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
// Since we'll invalidate our entire area at the end of this method, we
|
|
|
|
// empty our cached dirty regions to prevent FlushDirtyRegion under DoReflow
|
|
|
|
// from wasting time invalidating:
|
|
|
|
mSameDocDirtyRegion.SetEmpty();
|
|
|
|
mSubDocDirtyRegion.SetEmpty();
|
2012-03-20 05:15:53 -07:00
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
// Fully mark our kid dirty so that it gets resized if necessary
|
|
|
|
// (NS_FRAME_HAS_DIRTY_CHILDREN isn't enough in that case):
|
|
|
|
nsIFrame* kid = GetFirstPrincipalChild();
|
|
|
|
kid->AddStateBits(NS_FRAME_IS_DIRTY);
|
2009-04-21 16:53:52 -07:00
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
// Make sure to not allow interrupts if we're not being reflown as a root:
|
2009-04-21 16:53:52 -07:00
|
|
|
nsPresContext::InterruptPreventer noInterrupts(PresContext());
|
2012-03-20 05:15:53 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
DoReflow();
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
// Now unset the various reflow bits:
|
2007-03-22 10:30:00 -07:00
|
|
|
mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
|
|
|
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
if (!(GetParent()->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
|
|
|
// We only invalidate if our outer-<svg> has already had its
|
|
|
|
// initial reflow (since if it hasn't, its entire area will be
|
|
|
|
// invalidated when it gets that initial reflow):
|
2012-03-20 05:15:53 -07:00
|
|
|
nsSVGUtils::InvalidateBounds(this, true);
|
2012-03-20 05:15:53 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2008-01-25 01:27:03 -08:00
|
|
|
void
|
|
|
|
nsSVGForeignObjectFrame::NotifySVGChanged(PRUint32 aFlags)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-03-11 08:53:36 -07:00
|
|
|
NS_ABORT_IF_FALSE(!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS) ||
|
|
|
|
(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Must be NS_STATE_SVG_NONDISPLAY_CHILD!");
|
|
|
|
|
|
|
|
NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED),
|
|
|
|
"Invalidation logic may need adjusting");
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
bool needNewBounds = false; // i.e. mRect or visual overflow rect
|
|
|
|
bool needReflow = false;
|
|
|
|
bool needNewCanvasTM = false;
|
2008-01-25 01:27:03 -08:00
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
if (aFlags & COORD_CONTEXT_CHANGED) {
|
2008-01-25 01:27:03 -08:00
|
|
|
nsSVGForeignObjectElement *fO =
|
|
|
|
static_cast<nsSVGForeignObjectElement*>(mContent);
|
2012-02-01 08:25:44 -08:00
|
|
|
// Coordinate context changes affect mCanvasTM if we have a
|
|
|
|
// percentage 'x' or 'y'
|
|
|
|
if (fO->mLengthAttributes[nsSVGForeignObjectElement::X].IsPercentage() ||
|
|
|
|
fO->mLengthAttributes[nsSVGForeignObjectElement::Y].IsPercentage()) {
|
2012-03-20 05:15:53 -07:00
|
|
|
needNewBounds = true;
|
|
|
|
needNewCanvasTM = true;
|
2012-02-01 08:25:44 -08:00
|
|
|
}
|
|
|
|
// Our coordinate context's width/height has changed. If we have a
|
|
|
|
// percentage width/height our dimensions will change so we must reflow.
|
2008-01-25 01:27:03 -08:00
|
|
|
if (fO->mLengthAttributes[nsSVGForeignObjectElement::WIDTH].IsPercentage() ||
|
|
|
|
fO->mLengthAttributes[nsSVGForeignObjectElement::HEIGHT].IsPercentage()) {
|
2012-03-20 05:15:53 -07:00
|
|
|
needNewBounds = true;
|
|
|
|
needReflow = true;
|
2008-01-25 01:27:03 -08:00
|
|
|
}
|
2007-11-20 01:10:18 -08:00
|
|
|
}
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
if (aFlags & TRANSFORM_CHANGED) {
|
|
|
|
needNewBounds = true; // needed if it was _our_ transform that changed
|
|
|
|
needNewCanvasTM = true;
|
|
|
|
// In an ideal world we would reflow when our CTM changes. This is because
|
|
|
|
// glyph metrics do not necessarily scale uniformly with change in scale
|
|
|
|
// and, as a result, CTM changes may require text to break at different
|
|
|
|
// points. The problem would be how to keep performance acceptable when
|
|
|
|
// e.g. the transform of an ancestor is animated.
|
|
|
|
// We also seem to get some sort of infinite loop post bug 421584 if we
|
|
|
|
// reflow.
|
|
|
|
}
|
|
|
|
|
|
|
|
if (needNewBounds &&
|
|
|
|
!(aFlags & DO_NOT_NOTIFY_RENDERING_OBSERVERS)) {
|
|
|
|
nsSVGUtils::InvalidateAndScheduleBoundsUpdate(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we're called while the PresShell is handling reflow events then we
|
|
|
|
// must have been called as a result of the NotifyViewportChange() call in
|
|
|
|
// our nsSVGOuterSVGFrame's Reflow() method. We must not call RequestReflow
|
|
|
|
// at this point (i.e. during reflow) because it could confuse the
|
|
|
|
// PresShell and prevent it from reflowing us properly in future. Besides
|
|
|
|
// that, nsSVGOuterSVGFrame::DidReflow will take care of reflowing us
|
|
|
|
// synchronously, so there's no need.
|
|
|
|
if (needReflow && !PresContext()->PresShell()->IsReflowLocked()) {
|
|
|
|
RequestReflow(nsIPresShell::eResize);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (needNewCanvasTM) {
|
|
|
|
// Do this after calling InvalidateAndScheduleBoundsUpdate in case we
|
|
|
|
// change the code and it needs to use it.
|
|
|
|
mCanvasTM = nsnull;
|
2008-01-25 01:27:03 -08:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2012-04-16 01:23:48 -07:00
|
|
|
SVGBBox
|
2011-09-30 02:25:37 -07:00
|
|
|
nsSVGForeignObjectFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
|
|
|
PRUint32 aFlags)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2009-04-28 21:31:34 -07:00
|
|
|
nsSVGForeignObjectElement *content =
|
|
|
|
static_cast<nsSVGForeignObjectElement*>(mContent);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
float x, y, w, h;
|
2009-04-28 21:31:34 -07:00
|
|
|
content->GetAnimatedLengthValues(&x, &y, &w, &h, nsnull);
|
2007-06-21 16:01:10 -07:00
|
|
|
|
2007-06-25 01:31:31 -07:00
|
|
|
if (w < 0.0f) w = 0.0f;
|
|
|
|
if (h < 0.0f) h = 0.0f;
|
|
|
|
|
2009-04-28 21:31:34 -07:00
|
|
|
if (aToBBoxUserspace.IsSingular()) {
|
|
|
|
// XXX ReportToConsole
|
2012-04-16 01:23:48 -07:00
|
|
|
return SVGBBox();
|
2009-04-28 21:31:34 -07:00
|
|
|
}
|
2009-06-18 04:31:25 -07:00
|
|
|
return aToBBoxUserspace.TransformBounds(gfxRect(0.0, 0.0, w, h));
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
2009-04-28 21:31:34 -07:00
|
|
|
gfxMatrix
|
2007-03-22 10:30:00 -07:00
|
|
|
nsSVGForeignObjectFrame::GetCanvasTM()
|
|
|
|
{
|
|
|
|
if (!mCanvasTM) {
|
|
|
|
NS_ASSERTION(mParent, "null parent");
|
|
|
|
|
2009-04-28 21:31:34 -07:00
|
|
|
nsSVGContainerFrame *parent = static_cast<nsSVGContainerFrame*>(mParent);
|
|
|
|
nsSVGForeignObjectElement *content =
|
|
|
|
static_cast<nsSVGForeignObjectElement*>(mContent);
|
|
|
|
|
2012-02-17 00:12:47 -08:00
|
|
|
gfxMatrix tm = content->PrependLocalTransformsTo(parent->GetCanvasTM());
|
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
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// Implementation helpers
|
|
|
|
|
2009-06-18 04:31:25 -07:00
|
|
|
gfxMatrix
|
|
|
|
nsSVGForeignObjectFrame::GetCanvasTMForChildren()
|
2009-03-29 06:58:09 -07:00
|
|
|
{
|
2009-06-18 04:31:25 -07:00
|
|
|
float cssPxPerDevPx = PresContext()->
|
|
|
|
AppUnitsToFloatCSSPixels(PresContext()->AppUnitsPerDevPixel());
|
2009-03-29 06:58:09 -07:00
|
|
|
|
2009-06-18 04:31:25 -07:00
|
|
|
return GetCanvasTM().Scale(cssPxPerDevPx, cssPxPerDevPx);
|
2009-03-29 06:58:09 -07:00
|
|
|
}
|
|
|
|
|
2007-05-05 04:11:07 -07:00
|
|
|
void nsSVGForeignObjectFrame::RequestReflow(nsIPresShell::IntrinsicDirty aType)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2007-05-05 04:11:07 -07:00
|
|
|
if (GetStateBits() & NS_FRAME_FIRST_REFLOW)
|
2012-03-20 05:15:53 -07:00
|
|
|
// If we haven't had a UpdateBounds yet, nothing to do.
|
2007-05-05 04:11:07 -07:00
|
|
|
return;
|
|
|
|
|
2011-08-24 13:54:30 -07:00
|
|
|
nsIFrame* kid = GetFirstPrincipalChild();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!kid)
|
|
|
|
return;
|
2007-05-05 04:11:07 -07:00
|
|
|
|
2007-05-06 12:16:51 -07:00
|
|
|
PresContext()->PresShell()->FrameNeedsReflow(kid, aType, NS_FRAME_IS_DIRTY);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
nsSVGForeignObjectFrame::DoReflow()
|
|
|
|
{
|
2011-02-17 16:33:30 -08:00
|
|
|
// Skip reflow if we're zero-sized, unless this is our first reflow.
|
|
|
|
if (IsDisabled() &&
|
|
|
|
!(GetStateBits() & NS_FRAME_FIRST_REFLOW))
|
2007-06-25 01:31:31 -07:00
|
|
|
return;
|
|
|
|
|
2007-03-30 14:11:41 -07:00
|
|
|
nsPresContext *presContext = PresContext();
|
2011-08-24 13:54:30 -07:00
|
|
|
nsIFrame* kid = GetFirstPrincipalChild();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!kid)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// initiate a synchronous reflow here and now:
|
|
|
|
nsIPresShell* presShell = presContext->PresShell();
|
|
|
|
NS_ASSERTION(presShell, "null presShell");
|
2011-04-07 18:04:40 -07:00
|
|
|
nsRefPtr<nsRenderingContext> renderingContext =
|
2010-08-20 12:29:01 -07:00
|
|
|
presShell->GetReferenceRenderingContext();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (!renderingContext)
|
|
|
|
return;
|
|
|
|
|
2012-04-16 15:32:12 -07:00
|
|
|
AutoRestore<nsIFrame*> restoreCurrentInflationContainer(
|
|
|
|
presContext->mCurrentInflationContainer);
|
|
|
|
AutoRestore<nscoord> restoreCurrentInflationContainerWidth(
|
|
|
|
presContext->mCurrentInflationContainerWidth);
|
|
|
|
|
|
|
|
presContext->mCurrentInflationContainer = this;
|
|
|
|
presContext->mCurrentInflationContainerWidth = mRect.width;
|
|
|
|
|
2011-10-17 07:59:28 -07:00
|
|
|
mInReflow = true;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsHTMLReflowState reflowState(presContext, kid,
|
|
|
|
renderingContext,
|
2012-03-20 05:15:53 -07:00
|
|
|
nsSize(mRect.width, NS_UNCONSTRAINEDSIZE));
|
2007-03-22 10:30:00 -07:00
|
|
|
nsHTMLReflowMetrics desiredSize;
|
|
|
|
nsReflowStatus status;
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
// We don't use mRect.height above because that tells the child to do
|
2007-03-22 10:30:00 -07:00
|
|
|
// page/column breaking at that height.
|
|
|
|
NS_ASSERTION(reflowState.mComputedBorderPadding == nsMargin(0, 0, 0, 0) &&
|
|
|
|
reflowState.mComputedMargin == nsMargin(0, 0, 0, 0),
|
2012-02-06 15:52:01 -08:00
|
|
|
"style system should ensure that :-moz-svg-foreign-content "
|
2007-03-22 10:30:00 -07:00
|
|
|
"does not get styled");
|
2012-03-20 05:15:53 -07:00
|
|
|
NS_ASSERTION(reflowState.ComputedWidth() == mRect.width,
|
2007-03-22 10:30:00 -07:00
|
|
|
"reflow state made child wrong size");
|
2012-03-20 05:15:53 -07:00
|
|
|
reflowState.SetComputedHeight(mRect.height);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
ReflowChild(kid, presContext, desiredSize, reflowState, 0, 0,
|
|
|
|
NS_FRAME_NO_MOVE_FRAME, status);
|
2012-03-20 05:15:53 -07:00
|
|
|
NS_ASSERTION(mRect.width == desiredSize.width &&
|
|
|
|
mRect.height == desiredSize.height, "unexpected size");
|
2007-03-22 10:30:00 -07:00
|
|
|
FinishReflowChild(kid, presContext, &reflowState, desiredSize, 0, 0,
|
|
|
|
NS_FRAME_NO_MOVE_FRAME);
|
|
|
|
|
2011-10-17 07:59:28 -07:00
|
|
|
mInReflow = false;
|
2012-03-20 05:15:53 -07:00
|
|
|
|
|
|
|
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
|
|
|
FlushDirtyRegion(0);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2008-09-18 02:47:21 -07:00
|
|
|
void
|
|
|
|
nsSVGForeignObjectFrame::InvalidateDirtyRect(nsSVGOuterSVGFrame* aOuter,
|
|
|
|
const nsRect& aRect, PRUint32 aFlags)
|
|
|
|
{
|
|
|
|
if (aRect.IsEmpty())
|
|
|
|
return;
|
|
|
|
|
2009-06-18 04:31:25 -07:00
|
|
|
// Don't invalidate areas outside our bounds:
|
2012-02-10 04:33:46 -08:00
|
|
|
nsRect rect = aRect.Intersect(mRect);
|
2009-06-11 08:23:43 -07:00
|
|
|
if (rect.IsEmpty())
|
|
|
|
return;
|
|
|
|
|
2012-02-10 04:33:46 -08:00
|
|
|
// The areas dirtied by children are in app units, relative to this frame.
|
|
|
|
// We need to convert the rect from app units in our userspace to app units
|
|
|
|
// relative to our nsSVGOuterSVGFrame's content rect.
|
|
|
|
|
|
|
|
gfxRect r(aRect.x, aRect.y, aRect.width, aRect.height);
|
|
|
|
r.Scale(1.0 / nsPresContext::AppUnitsPerCSSPixel());
|
|
|
|
rect = ToCanvasBounds(r, GetCanvasTM(), PresContext());
|
2008-09-18 02:47:21 -07:00
|
|
|
rect = nsSVGUtils::FindFilterInvalidation(this, rect);
|
|
|
|
aOuter->InvalidateWithFlags(rect, aFlags);
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
void
|
2010-10-14 18:03:45 -07:00
|
|
|
nsSVGForeignObjectFrame::FlushDirtyRegion(PRUint32 aFlags)
|
2007-06-21 16:01:10 -07:00
|
|
|
{
|
2012-03-20 05:15:53 -07:00
|
|
|
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Should not have been called");
|
|
|
|
|
2012-03-20 05:15:53 -07:00
|
|
|
NS_ASSERTION(!mInReflow,
|
|
|
|
"We shouldn't be flushing while we have a pending flush");
|
|
|
|
|
|
|
|
if (mSameDocDirtyRegion.IsEmpty() && mSubDocDirtyRegion.IsEmpty()) {
|
2007-03-22 10:30:00 -07:00
|
|
|
return;
|
2012-03-20 05:15:53 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsSVGOuterSVGFrame *outerSVGFrame = nsSVGUtils::GetOuterSVGFrame(this);
|
|
|
|
if (!outerSVGFrame) {
|
|
|
|
NS_ERROR("null outerSVGFrame");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2010-10-14 18:03:45 -07:00
|
|
|
InvalidateDirtyRect(outerSVGFrame, mSameDocDirtyRegion.GetBounds(), aFlags);
|
|
|
|
InvalidateDirtyRect(outerSVGFrame, mSubDocDirtyRegion.GetBounds(),
|
|
|
|
aFlags | INVALIDATE_CROSS_DOC);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2008-09-18 02:47:21 -07:00
|
|
|
mSameDocDirtyRegion.SetEmpty();
|
2009-06-11 08:23:43 -07:00
|
|
|
mSubDocDirtyRegion.SetEmpty();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|