2006-06-01 15:31:15 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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/. */
|
2006-06-01 15:31:15 +00:00
|
|
|
|
2012-03-26 11:58:59 +00:00
|
|
|
// Main header first:
|
2006-06-01 15:31:15 +00:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-26 11:58:59 +00:00
|
|
|
|
|
|
|
// Keep others in (case-insensitive) order:
|
2012-05-17 04:05:09 +00:00
|
|
|
#include "nsSVGEffects.h"
|
2012-03-18 10:32:02 +00:00
|
|
|
#include "nsSVGElement.h"
|
2006-06-01 15:31:15 +00:00
|
|
|
#include "nsSVGUtils.h"
|
2012-05-17 04:05:09 +00:00
|
|
|
#include "SVGAnimatedTransformList.h"
|
|
|
|
|
|
|
|
using namespace mozilla;
|
2006-06-01 15:31:15 +00:00
|
|
|
|
2009-04-29 04:31:34 +00:00
|
|
|
NS_QUERYFRAME_HEAD(nsSVGContainerFrame)
|
|
|
|
NS_QUERYFRAME_ENTRY(nsSVGContainerFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsSVGContainerFrameBase)
|
|
|
|
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_QUERYFRAME_HEAD(nsSVGDisplayContainerFrame)
|
2009-04-24 23:17:43 +00:00
|
|
|
NS_QUERYFRAME_ENTRY(nsSVGDisplayContainerFrame)
|
2009-01-12 19:20:59 +00:00
|
|
|
NS_QUERYFRAME_ENTRY(nsISVGChildFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsSVGContainerFrame)
|
2006-06-01 15:31:15 +00:00
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext)
|
|
|
|
{
|
2012-03-10 19:28:06 +00:00
|
|
|
nsIFrame *frame = new (aPresShell) nsSVGContainerFrame(aContext);
|
|
|
|
// If we were called directly, then the frame is for a <defs> or
|
|
|
|
// an unknown element type. In both cases we prevent the content
|
|
|
|
// from displaying directly.
|
|
|
|
frame->AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
|
|
|
return frame;
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2009-09-12 16:49:24 +00:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGContainerFrame)
|
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGDisplayContainerFrame)
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
NS_IMETHODIMP
|
2011-08-24 20:54:30 +00:00
|
|
|
nsSVGContainerFrame::AppendFrames(ChildListID aListID,
|
2009-07-30 17:23:32 +00:00
|
|
|
nsFrameList& aFrameList)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2011-08-24 20:54:30 +00:00
|
|
|
return InsertFrames(aListID, mFrames.LastChild(), aFrameList);
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2011-08-24 20:54:30 +00:00
|
|
|
nsSVGContainerFrame::InsertFrames(ChildListID aListID,
|
2006-06-01 15:31:15 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
2009-07-30 17:23:32 +00:00
|
|
|
nsFrameList& aFrameList)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2011-08-24 20:54:30 +00:00
|
|
|
NS_ASSERTION(aListID == kPrincipalList, "unexpected child list");
|
2006-06-29 02:32:36 +00:00
|
|
|
NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
|
|
|
|
"inserting after sibling frame with different parent");
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2011-08-24 20:54:30 +00:00
|
|
|
nsSVGContainerFrame::RemoveFrame(ChildListID aListID,
|
2006-06-01 15:31:15 +00:00
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
2011-08-24 20:54:30 +00:00
|
|
|
NS_ASSERTION(aListID == kPrincipalList, "unexpected child list");
|
2006-06-29 02:32:36 +00:00
|
|
|
|
2009-09-18 11:09:36 +00:00
|
|
|
mFrames.DestroyFrame(aOldFrame);
|
|
|
|
return NS_OK;
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2012-05-17 04:05:09 +00:00
|
|
|
bool
|
|
|
|
nsSVGContainerFrame::UpdateOverflow()
|
|
|
|
{
|
|
|
|
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
|
|
|
// We don't maintain overflow rects.
|
|
|
|
// XXX It would have be better if the restyle request hadn't even happened.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return nsSVGContainerFrameBase::UpdateOverflow();
|
|
|
|
}
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
NS_IMETHODIMP
|
2007-08-30 17:01:37 +00:00
|
|
|
nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2008-06-22 15:59:48 +00:00
|
|
|
if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) {
|
2010-12-06 20:57:18 +00:00
|
|
|
AddStateBits(aParent->GetStateBits() &
|
2012-03-20 12:15:53 +00:00
|
|
|
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
|
2008-06-22 15:59:48 +00:00
|
|
|
}
|
2012-03-10 19:28:06 +00:00
|
|
|
nsresult rv = nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
2007-08-30 17:01:37 +00:00
|
|
|
return rv;
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2012-07-20 18:12:29 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsSVGDisplayContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists)
|
|
|
|
{
|
2012-11-16 17:59:52 +00:00
|
|
|
if (mContent->IsSVG() &&
|
|
|
|
!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
|
2012-07-20 18:12:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
return BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists);
|
|
|
|
}
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
NS_IMETHODIMP
|
2011-08-24 20:54:30 +00:00
|
|
|
nsSVGDisplayContainerFrame::InsertFrames(ChildListID aListID,
|
2006-06-01 15:31:15 +00:00
|
|
|
nsIFrame* aPrevFrame,
|
2009-07-30 17:23:32 +00:00
|
|
|
nsFrameList& aFrameList)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2009-07-30 17:23:32 +00:00
|
|
|
// memorize first old frame after insertion point
|
|
|
|
// XXXbz once again, this would work a lot better if the nsIFrame
|
|
|
|
// methods returned framelist iterators....
|
|
|
|
nsIFrame* firstOldFrame = aPrevFrame ?
|
2011-08-24 20:54:30 +00:00
|
|
|
aPrevFrame->GetNextSibling() : GetChildList(aListID).FirstChild();
|
2009-07-30 17:23:32 +00:00
|
|
|
nsIFrame* firstNewFrame = aFrameList.FirstChild();
|
2006-06-01 15:31:15 +00:00
|
|
|
|
|
|
|
// Insert the new frames
|
2011-08-24 20:54:30 +00:00
|
|
|
nsSVGContainerFrame::InsertFrames(aListID, aPrevFrame, aFrameList);
|
2006-06-01 15:31:15 +00:00
|
|
|
|
2012-03-20 12:15:53 +00:00
|
|
|
// If we are not a non-display SVG frame and we do not have a bounds update
|
|
|
|
// pending, then we need to schedule one for our new children:
|
|
|
|
if (!(GetStateBits() &
|
|
|
|
(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN |
|
|
|
|
NS_STATE_SVG_NONDISPLAY_CHILD))) {
|
2009-07-30 17:23:32 +00:00
|
|
|
for (nsIFrame* kid = firstNewFrame; kid != firstOldFrame;
|
2007-10-19 11:07:08 +00:00
|
|
|
kid = kid->GetNextSibling()) {
|
2009-01-12 19:20:59 +00:00
|
|
|
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
|
2007-10-19 11:07:08 +00:00
|
|
|
if (SVGFrame) {
|
2012-03-20 12:15:53 +00:00
|
|
|
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Check for this explicitly in the |if|, then");
|
2012-07-16 00:42:50 +00:00
|
|
|
bool isFirstReflow = (kid->GetStateBits() & NS_FRAME_FIRST_REFLOW);
|
2012-03-20 12:15:53 +00:00
|
|
|
// Remove bits so that ScheduleBoundsUpdate will work:
|
|
|
|
kid->RemoveStateBits(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
|
|
|
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
|
|
|
// No need to invalidate the new kid's old bounds, so we just use
|
|
|
|
// nsSVGUtils::ScheduleBoundsUpdate.
|
2012-07-22 00:01:44 +00:00
|
|
|
nsSVGUtils::ScheduleReflowSVG(kid);
|
2012-07-16 00:42:50 +00:00
|
|
|
if (isFirstReflow) {
|
|
|
|
// Add back the NS_FRAME_FIRST_REFLOW bit:
|
|
|
|
kid->AddStateBits(NS_FRAME_FIRST_REFLOW);
|
|
|
|
}
|
2007-10-19 11:07:08 +00:00
|
|
|
}
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
}
|
2007-10-19 11:07:08 +00:00
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2011-08-24 20:54:30 +00:00
|
|
|
nsSVGDisplayContainerFrame::RemoveFrame(ChildListID aListID,
|
2006-06-01 15:31:15 +00:00
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
2012-03-20 12:15:53 +00:00
|
|
|
nsSVGUtils::InvalidateBounds(aOldFrame);
|
2006-06-01 15:31:15 +00:00
|
|
|
|
2011-08-24 20:54:30 +00:00
|
|
|
nsresult rv = nsSVGContainerFrame::RemoveFrame(aListID, aOldFrame);
|
2006-06-01 15:31:15 +00:00
|
|
|
|
2012-02-04 13:58:46 +00:00
|
|
|
if (!(GetStateBits() & (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_IS_OUTER_SVG))) {
|
2008-03-19 21:27:33 +00:00
|
|
|
nsSVGUtils::NotifyAncestorsOfFilterRegionChange(this);
|
|
|
|
}
|
2006-06-01 15:31:15 +00:00
|
|
|
|
2006-07-06 15:45:44 +00:00
|
|
|
return rv;
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2012-05-17 04:05:09 +00:00
|
|
|
bool
|
|
|
|
nsSVGDisplayContainerFrame::IsSVGTransformed(gfxMatrix *aOwnTransform,
|
|
|
|
gfxMatrix *aFromParentTransform) const
|
|
|
|
{
|
|
|
|
bool foundTransform = false;
|
|
|
|
|
|
|
|
// Check if our parent has children-only transforms:
|
|
|
|
nsIFrame *parent = GetParent();
|
|
|
|
if (parent &&
|
|
|
|
parent->IsFrameOfType(nsIFrame::eSVG | nsIFrame::eSVGContainer)) {
|
|
|
|
foundTransform = static_cast<nsSVGContainerFrame*>(parent)->
|
|
|
|
HasChildrenOnlyTransform(aFromParentTransform);
|
|
|
|
}
|
|
|
|
|
2012-11-16 17:59:52 +00:00
|
|
|
if (mContent->IsSVG()) {
|
|
|
|
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
|
|
|
|
if (content->GetAnimatedTransformList() ||
|
|
|
|
content->GetAnimateMotionTransform()) {
|
|
|
|
if (aOwnTransform) {
|
|
|
|
*aOwnTransform = content->PrependLocalTransformsTo(gfxMatrix(),
|
|
|
|
nsSVGElement::eUserSpaceToParent);
|
|
|
|
}
|
|
|
|
foundTransform = true;
|
2012-05-17 04:05:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return foundTransform;
|
|
|
|
}
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGChildFrame methods
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-03-02 08:28:59 +00:00
|
|
|
nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext* aContext,
|
2008-10-20 08:42:03 +00:00
|
|
|
const nsIntRect *aDirtyRect)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2012-07-20 18:12:29 +00:00
|
|
|
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
2012-09-06 04:58:47 +00:00
|
|
|
(mState & NS_STATE_SVG_NONDISPLAY_CHILD) ||
|
|
|
|
PresContext()->IsGlyph(),
|
2012-07-20 18:12:29 +00:00
|
|
|
"If display lists are enabled, only painting of non-display "
|
|
|
|
"SVG should take this code path");
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
const nsStyleDisplay *display = mStyleContext->GetStyleDisplay();
|
|
|
|
if (display->mOpacity == 0.0)
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
|
|
|
kid = kid->GetNextSibling()) {
|
2008-10-20 08:42:03 +00:00
|
|
|
nsSVGUtils::PaintFrameWithEffects(aContext, aDirtyRect, kid);
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-08-25 09:23:54 +00:00
|
|
|
NS_IMETHODIMP_(nsIFrame*)
|
|
|
|
nsSVGDisplayContainerFrame::GetFrameForPoint(const nsPoint &aPoint)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2012-07-20 18:12:29 +00:00
|
|
|
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
|
|
|
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"If display lists are enabled, only hit-testing of a "
|
|
|
|
"clipPath's contents should take this code path");
|
2008-08-25 09:23:54 +00:00
|
|
|
return nsSVGUtils::HitTestChildren(this, aPoint);
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2006-06-09 18:08:33 +00:00
|
|
|
NS_IMETHODIMP_(nsRect)
|
2006-06-01 15:31:15 +00:00
|
|
|
nsSVGDisplayContainerFrame::GetCoveredRegion()
|
|
|
|
{
|
|
|
|
return nsSVGUtils::GetCoveredRegion(mFrames);
|
|
|
|
}
|
|
|
|
|
2012-03-20 12:15:53 +00:00
|
|
|
void
|
2012-07-22 00:01:44 +00:00
|
|
|
nsSVGDisplayContainerFrame::ReflowSVG()
|
2006-06-09 18:08:33 +00:00
|
|
|
{
|
2012-07-22 00:01:44 +00:00
|
|
|
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
|
|
|
"This call is probably a wasteful mistake");
|
2006-06-09 18:08:33 +00:00
|
|
|
|
2012-03-20 12:15:53 +00:00
|
|
|
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
2012-07-22 00:01:44 +00:00
|
|
|
"ReflowSVG mechanism not designed for this");
|
2012-03-20 12:15:53 +00:00
|
|
|
|
2012-05-17 04:05:09 +00:00
|
|
|
NS_ABORT_IF_FALSE(GetType() != nsGkAtoms::svgOuterSVGFrame,
|
|
|
|
"Do not call on outer-<svg>");
|
|
|
|
|
2012-07-22 00:01:44 +00:00
|
|
|
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
2012-03-20 12:15:53 +00:00
|
|
|
return;
|
|
|
|
}
|
2007-10-19 11:07:08 +00:00
|
|
|
|
2012-03-20 12:15:53 +00:00
|
|
|
// If the NS_FRAME_FIRST_REFLOW bit has been removed from our parent frame,
|
|
|
|
// then our outer-<svg> has previously had its initial reflow. In that case
|
|
|
|
// we need to make sure that that bit has been removed from ourself _before_
|
|
|
|
// recursing over our children to ensure that they know too. Otherwise, we
|
|
|
|
// need to remove it _after_ recursing over our children so that they know
|
|
|
|
// the initial reflow is currently underway.
|
|
|
|
|
|
|
|
bool outerSVGHasHadFirstReflow =
|
|
|
|
(GetParent()->GetStateBits() & NS_FRAME_FIRST_REFLOW) == 0;
|
|
|
|
|
|
|
|
if (outerSVGHasHadFirstReflow) {
|
|
|
|
mState &= ~NS_FRAME_FIRST_REFLOW; // tell our children
|
|
|
|
}
|
|
|
|
|
2012-05-17 04:05:09 +00:00
|
|
|
nsOverflowAreas overflowRects;
|
|
|
|
|
2006-06-01 15:31:15 +00:00
|
|
|
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
|
|
|
kid = kid->GetNextSibling()) {
|
2009-01-12 19:20:59 +00:00
|
|
|
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
|
2006-06-01 15:31:15 +00:00
|
|
|
if (SVGFrame) {
|
2012-03-20 12:15:53 +00:00
|
|
|
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Check for this explicitly in the |if|, then");
|
2012-07-22 00:01:44 +00:00
|
|
|
SVGFrame->ReflowSVG();
|
2012-05-17 04:05:09 +00:00
|
|
|
|
|
|
|
// We build up our child frame overflows here instead of using
|
|
|
|
// nsLayoutUtils::UnionChildOverflow since SVG frame's all use the same
|
|
|
|
// frame list, and we're iterating over that list now anyway.
|
|
|
|
ConsiderChildOverflow(overflowRects, kid);
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
}
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
|
2012-05-17 04:05:09 +00:00
|
|
|
// <svg> can create an SVG viewport with an offset due to its
|
|
|
|
// x/y/width/height attributes, and <use> can introduce an offset with an
|
|
|
|
// empty mRect (any width/height is copied to an anonymous <svg> child).
|
|
|
|
// Other than that containers should not set mRect since all other offsets
|
|
|
|
// come from transforms, which are accounted for by nsDisplayTransform.
|
|
|
|
// Note that we rely on |overflow:visible| to allow display list items to be
|
|
|
|
// created for our children.
|
|
|
|
NS_ABORT_IF_FALSE(mContent->Tag() == nsGkAtoms::svg ||
|
|
|
|
(mContent->Tag() == nsGkAtoms::use &&
|
|
|
|
mRect.Size() == nsSize(0,0)) ||
|
|
|
|
mRect.IsEqualEdges(nsRect()),
|
|
|
|
"Only inner-<svg>/<use> is expected to have mRect set");
|
|
|
|
|
|
|
|
if (mState & NS_FRAME_FIRST_REFLOW) {
|
|
|
|
// Make sure we have our filter property (if any) before calling
|
|
|
|
// FinishAndStoreOverflow (subsequent filter changes are handled off
|
|
|
|
// nsChangeHint_UpdateEffects):
|
|
|
|
nsSVGEffects::UpdateEffects(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
FinishAndStoreOverflow(overflowRects, mRect.Size());
|
|
|
|
|
|
|
|
// Remove state bits after FinishAndStoreOverflow so that it doesn't
|
|
|
|
// invalidate on first reflow:
|
Bug 300030: Move intrinsic width computation out of nsIFrame::Reflow and into its own methods on nsIFrame. Replace reflow reasons, types, and commands with dirty bits/notifications. Thanks to bzbarsky for almost all of the HTML form controls (mozilla/layout/forms) changes, and many others for help testing and patching. For detailed commit logs, see REFLOW_YYYYMMDD_BRANCH, where YYYYMMDD is one of 20061031, 20060830, 20060603, 20060302, 20060119, 20051011, 20050804, 20050429, 20050315, 20050111, and 20041213.
2006-12-08 05:38:33 +00:00
|
|
|
mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
|
|
|
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2008-01-25 09:27:03 +00:00
|
|
|
void
|
2012-08-22 15:56:38 +00:00
|
|
|
nsSVGDisplayContainerFrame::NotifySVGChanged(uint32_t aFlags)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2012-03-11 15:53:36 +00:00
|
|
|
NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED),
|
|
|
|
"Invalidation logic may need adjusting");
|
2008-01-25 09:27:03 +00:00
|
|
|
|
|
|
|
nsSVGUtils::NotifyChildrenOfSVGChange(this, aFlags);
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|
|
|
|
|
2012-04-16 08:23:48 +00:00
|
|
|
SVGBBox
|
2011-09-30 09:25:37 +00:00
|
|
|
nsSVGDisplayContainerFrame::GetBBoxContribution(
|
|
|
|
const gfxMatrix &aToBBoxUserspace,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aFlags)
|
2006-06-01 15:31:15 +00:00
|
|
|
{
|
2012-04-16 08:23:48 +00:00
|
|
|
SVGBBox bboxUnion;
|
2009-04-29 04:31:34 +00:00
|
|
|
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* svgKid = do_QueryFrame(kid);
|
|
|
|
if (svgKid) {
|
|
|
|
gfxMatrix transform = aToBBoxUserspace;
|
2010-08-07 09:38:11 +00:00
|
|
|
nsIContent *content = kid->GetContent();
|
2012-03-15 11:42:54 +00:00
|
|
|
if (content->IsSVG()) {
|
2010-08-07 09:38:11 +00:00
|
|
|
transform = static_cast<nsSVGElement*>(content)->
|
2012-02-17 08:12:47 +00:00
|
|
|
PrependLocalTransformsTo(aToBBoxUserspace);
|
2009-04-29 04:31:34 +00:00
|
|
|
}
|
2012-01-23 17:42:32 +00:00
|
|
|
// We need to include zero width/height vertical/horizontal lines, so we have
|
2012-04-16 08:23:48 +00:00
|
|
|
// to use UnionEdges.
|
|
|
|
bboxUnion.UnionEdges(svgKid->GetBBoxContribution(transform, aFlags));
|
2009-04-29 04:31:34 +00:00
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bboxUnion;
|
2006-06-01 15:31:15 +00:00
|
|
|
}
|