2006-06-01 19:31:15 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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 19:31:15 +04:00
|
|
|
|
2012-03-26 15:58:59 +04:00
|
|
|
// Main header first:
|
2006-06-01 19:31:15 +04:00
|
|
|
#include "nsSVGContainerFrame.h"
|
2012-03-26 15:58:59 +04:00
|
|
|
|
|
|
|
// Keep others in (case-insensitive) order:
|
2012-05-17 08:05:09 +04:00
|
|
|
#include "nsSVGEffects.h"
|
2012-03-18 14:32:02 +04:00
|
|
|
#include "nsSVGElement.h"
|
2006-06-01 19:31:15 +04:00
|
|
|
#include "nsSVGUtils.h"
|
2012-05-17 08:05:09 +04:00
|
|
|
#include "SVGAnimatedTransformList.h"
|
|
|
|
|
|
|
|
using namespace mozilla;
|
2006-06-01 19:31:15 +04:00
|
|
|
|
2009-04-29 08:31:34 +04:00
|
|
|
NS_QUERYFRAME_HEAD(nsSVGContainerFrame)
|
|
|
|
NS_QUERYFRAME_ENTRY(nsSVGContainerFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsSVGContainerFrameBase)
|
|
|
|
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_QUERYFRAME_HEAD(nsSVGDisplayContainerFrame)
|
2009-04-25 03:17:43 +04:00
|
|
|
NS_QUERYFRAME_ENTRY(nsSVGDisplayContainerFrame)
|
2009-01-12 22:20:59 +03:00
|
|
|
NS_QUERYFRAME_ENTRY(nsISVGChildFrame)
|
|
|
|
NS_QUERYFRAME_TAIL_INHERITING(nsSVGContainerFrame)
|
2006-06-01 19:31:15 +04:00
|
|
|
|
|
|
|
nsIFrame*
|
|
|
|
NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
|
|
|
|
nsStyleContext* aContext)
|
|
|
|
{
|
2012-03-10 23:28:06 +04: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 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2009-09-12 20:49:24 +04:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGContainerFrame)
|
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsSVGDisplayContainerFrame)
|
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
NS_IMETHODIMP
|
2011-08-25 00:54:30 +04:00
|
|
|
nsSVGContainerFrame::AppendFrames(ChildListID aListID,
|
2009-07-30 21:23:32 +04:00
|
|
|
nsFrameList& aFrameList)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2011-08-25 00:54:30 +04:00
|
|
|
return InsertFrames(aListID, mFrames.LastChild(), aFrameList);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2011-08-25 00:54:30 +04:00
|
|
|
nsSVGContainerFrame::InsertFrames(ChildListID aListID,
|
2006-06-01 19:31:15 +04:00
|
|
|
nsIFrame* aPrevFrame,
|
2009-07-30 21:23:32 +04:00
|
|
|
nsFrameList& aFrameList)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2011-08-25 00:54:30 +04:00
|
|
|
NS_ASSERTION(aListID == kPrincipalList, "unexpected child list");
|
2006-06-29 06:32:36 +04:00
|
|
|
NS_ASSERTION(!aPrevFrame || aPrevFrame->GetParent() == this,
|
|
|
|
"inserting after sibling frame with different parent");
|
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
mFrames.InsertFrames(this, aPrevFrame, aFrameList);
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2011-08-25 00:54:30 +04:00
|
|
|
nsSVGContainerFrame::RemoveFrame(ChildListID aListID,
|
2006-06-01 19:31:15 +04:00
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
2011-08-25 00:54:30 +04:00
|
|
|
NS_ASSERTION(aListID == kPrincipalList, "unexpected child list");
|
2006-06-29 06:32:36 +04:00
|
|
|
|
2009-09-18 15:09:36 +04:00
|
|
|
mFrames.DestroyFrame(aOldFrame);
|
|
|
|
return NS_OK;
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2012-05-17 08:05:09 +04: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();
|
|
|
|
}
|
|
|
|
|
2013-03-20 05:47:48 +04:00
|
|
|
void
|
2007-08-30 21:01:37 +04:00
|
|
|
nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2008-06-22 19:59:48 +04:00
|
|
|
if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) {
|
2010-12-06 23:57:18 +03:00
|
|
|
AddStateBits(aParent->GetStateBits() &
|
2012-03-20 16:15:53 +04:00
|
|
|
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
|
2008-06-22 19:59:48 +04:00
|
|
|
}
|
2013-03-20 05:47:48 +04:00
|
|
|
nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2013-02-14 15:12:27 +04:00
|
|
|
void
|
2012-07-20 22:12:29 +04:00
|
|
|
nsSVGDisplayContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists)
|
|
|
|
{
|
2012-11-16 21:59:52 +04:00
|
|
|
if (mContent->IsSVG() &&
|
|
|
|
!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
|
2013-02-14 15:12:27 +04:00
|
|
|
return;
|
2012-07-20 22:12:29 +04:00
|
|
|
}
|
|
|
|
return BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists);
|
|
|
|
}
|
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
NS_IMETHODIMP
|
2011-08-25 00:54:30 +04:00
|
|
|
nsSVGDisplayContainerFrame::InsertFrames(ChildListID aListID,
|
2006-06-01 19:31:15 +04:00
|
|
|
nsIFrame* aPrevFrame,
|
2009-07-30 21:23:32 +04:00
|
|
|
nsFrameList& aFrameList)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2009-07-30 21:23:32 +04: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-25 00:54:30 +04:00
|
|
|
aPrevFrame->GetNextSibling() : GetChildList(aListID).FirstChild();
|
2009-07-30 21:23:32 +04:00
|
|
|
nsIFrame* firstNewFrame = aFrameList.FirstChild();
|
2006-06-01 19:31:15 +04:00
|
|
|
|
|
|
|
// Insert the new frames
|
2011-08-25 00:54:30 +04:00
|
|
|
nsSVGContainerFrame::InsertFrames(aListID, aPrevFrame, aFrameList);
|
2006-06-01 19:31:15 +04:00
|
|
|
|
2012-03-20 16:15:53 +04: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 21:23:32 +04:00
|
|
|
for (nsIFrame* kid = firstNewFrame; kid != firstOldFrame;
|
2007-10-19 15:07:08 +04:00
|
|
|
kid = kid->GetNextSibling()) {
|
2009-01-12 22:20:59 +03:00
|
|
|
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
|
2007-10-19 15:07:08 +04:00
|
|
|
if (SVGFrame) {
|
2012-03-20 16:15:53 +04:00
|
|
|
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Check for this explicitly in the |if|, then");
|
2012-07-16 04:42:50 +04:00
|
|
|
bool isFirstReflow = (kid->GetStateBits() & NS_FRAME_FIRST_REFLOW);
|
2012-03-20 16:15:53 +04: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 04:01:44 +04:00
|
|
|
nsSVGUtils::ScheduleReflowSVG(kid);
|
2012-07-16 04:42:50 +04:00
|
|
|
if (isFirstReflow) {
|
|
|
|
// Add back the NS_FRAME_FIRST_REFLOW bit:
|
|
|
|
kid->AddStateBits(NS_FRAME_FIRST_REFLOW);
|
|
|
|
}
|
2007-10-19 15:07:08 +04:00
|
|
|
}
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
}
|
2007-10-19 15:07:08 +04:00
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2011-08-25 00:54:30 +04:00
|
|
|
nsSVGDisplayContainerFrame::RemoveFrame(ChildListID aListID,
|
2006-06-01 19:31:15 +04:00
|
|
|
nsIFrame* aOldFrame)
|
|
|
|
{
|
2012-03-20 16:15:53 +04:00
|
|
|
nsSVGUtils::InvalidateBounds(aOldFrame);
|
2006-06-01 19:31:15 +04:00
|
|
|
|
2011-08-25 00:54:30 +04:00
|
|
|
nsresult rv = nsSVGContainerFrame::RemoveFrame(aListID, aOldFrame);
|
2006-06-01 19:31:15 +04:00
|
|
|
|
2012-02-04 17:58:46 +04:00
|
|
|
if (!(GetStateBits() & (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_IS_OUTER_SVG))) {
|
2008-03-20 00:27:33 +03:00
|
|
|
nsSVGUtils::NotifyAncestorsOfFilterRegionChange(this);
|
|
|
|
}
|
2006-06-01 19:31:15 +04:00
|
|
|
|
2006-07-06 19:45:44 +04:00
|
|
|
return rv;
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2012-05-17 08:05:09 +04: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 21:59:52 +04: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 08:05:09 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return foundTransform;
|
|
|
|
}
|
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISVGChildFrame methods
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-03-02 12:28:59 +04:00
|
|
|
nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext* aContext,
|
2008-10-20 12:42:03 +04:00
|
|
|
const nsIntRect *aDirtyRect)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2012-07-20 22:12:29 +04:00
|
|
|
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
2012-09-06 08:58:47 +04:00
|
|
|
(mState & NS_STATE_SVG_NONDISPLAY_CHILD) ||
|
|
|
|
PresContext()->IsGlyph(),
|
2012-07-20 22:12:29 +04:00
|
|
|
"If display lists are enabled, only painting of non-display "
|
|
|
|
"SVG should take this code path");
|
|
|
|
|
2013-02-17 01:51:02 +04:00
|
|
|
const nsStyleDisplay *display = StyleDisplay();
|
2006-06-01 19:31:15 +04:00
|
|
|
if (display->mOpacity == 0.0)
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
|
|
|
kid = kid->GetNextSibling()) {
|
2008-10-20 12:42:03 +04:00
|
|
|
nsSVGUtils::PaintFrameWithEffects(aContext, aDirtyRect, kid);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-08-25 13:23:54 +04:00
|
|
|
NS_IMETHODIMP_(nsIFrame*)
|
|
|
|
nsSVGDisplayContainerFrame::GetFrameForPoint(const nsPoint &aPoint)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2012-07-20 22:12:29 +04: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 13:23:54 +04:00
|
|
|
return nsSVGUtils::HitTestChildren(this, aPoint);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2006-06-09 22:08:33 +04:00
|
|
|
NS_IMETHODIMP_(nsRect)
|
2006-06-01 19:31:15 +04:00
|
|
|
nsSVGDisplayContainerFrame::GetCoveredRegion()
|
|
|
|
{
|
|
|
|
return nsSVGUtils::GetCoveredRegion(mFrames);
|
|
|
|
}
|
|
|
|
|
2012-03-20 16:15:53 +04:00
|
|
|
void
|
2012-07-22 04:01:44 +04:00
|
|
|
nsSVGDisplayContainerFrame::ReflowSVG()
|
2006-06-09 22:08:33 +04:00
|
|
|
{
|
2012-07-22 04:01:44 +04:00
|
|
|
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
|
|
|
"This call is probably a wasteful mistake");
|
2006-06-09 22:08:33 +04:00
|
|
|
|
2012-03-20 16:15:53 +04:00
|
|
|
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
2012-07-22 04:01:44 +04:00
|
|
|
"ReflowSVG mechanism not designed for this");
|
2012-03-20 16:15:53 +04:00
|
|
|
|
2012-05-17 08:05:09 +04:00
|
|
|
NS_ABORT_IF_FALSE(GetType() != nsGkAtoms::svgOuterSVGFrame,
|
|
|
|
"Do not call on outer-<svg>");
|
|
|
|
|
2012-07-22 04:01:44 +04:00
|
|
|
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
2012-03-20 16:15:53 +04:00
|
|
|
return;
|
|
|
|
}
|
2007-10-19 15:07:08 +04:00
|
|
|
|
2012-03-20 16:15:53 +04: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 08:05:09 +04:00
|
|
|
nsOverflowAreas overflowRects;
|
|
|
|
|
2006-06-01 19:31:15 +04:00
|
|
|
for (nsIFrame* kid = mFrames.FirstChild(); kid;
|
|
|
|
kid = kid->GetNextSibling()) {
|
2009-01-12 22:20:59 +03:00
|
|
|
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
|
2006-06-01 19:31:15 +04:00
|
|
|
if (SVGFrame) {
|
2012-03-20 16:15:53 +04:00
|
|
|
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
|
|
|
"Check for this explicitly in the |if|, then");
|
2013-02-11 10:22:16 +04:00
|
|
|
kid->AddStateBits(mState & NS_FRAME_IS_DIRTY);
|
2012-07-22 04:01:44 +04:00
|
|
|
SVGFrame->ReflowSVG();
|
2012-05-17 08:05:09 +04: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 19:31:15 +04: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 08:38:33 +03:00
|
|
|
|
2012-05-17 08:05:09 +04: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 08:38:33 +03:00
|
|
|
mState &= ~(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
|
|
|
|
NS_FRAME_HAS_DIRTY_CHILDREN);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2008-01-25 12:27:03 +03:00
|
|
|
void
|
2012-08-22 19:56:38 +04:00
|
|
|
nsSVGDisplayContainerFrame::NotifySVGChanged(uint32_t aFlags)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2012-03-11 19:53:36 +04:00
|
|
|
NS_ABORT_IF_FALSE(aFlags & (TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED),
|
|
|
|
"Invalidation logic may need adjusting");
|
2008-01-25 12:27:03 +03:00
|
|
|
|
|
|
|
nsSVGUtils::NotifyChildrenOfSVGChange(this, aFlags);
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|
|
|
|
|
2012-04-16 12:23:48 +04:00
|
|
|
SVGBBox
|
2011-09-30 13:25:37 +04:00
|
|
|
nsSVGDisplayContainerFrame::GetBBoxContribution(
|
|
|
|
const gfxMatrix &aToBBoxUserspace,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t aFlags)
|
2006-06-01 19:31:15 +04:00
|
|
|
{
|
2012-04-16 12:23:48 +04:00
|
|
|
SVGBBox bboxUnion;
|
2009-04-29 08:31:34 +04:00
|
|
|
|
|
|
|
nsIFrame* kid = mFrames.FirstChild();
|
|
|
|
while (kid) {
|
|
|
|
nsISVGChildFrame* svgKid = do_QueryFrame(kid);
|
|
|
|
if (svgKid) {
|
|
|
|
gfxMatrix transform = aToBBoxUserspace;
|
2010-08-07 13:38:11 +04:00
|
|
|
nsIContent *content = kid->GetContent();
|
2012-03-15 15:42:54 +04:00
|
|
|
if (content->IsSVG()) {
|
2010-08-07 13:38:11 +04:00
|
|
|
transform = static_cast<nsSVGElement*>(content)->
|
2012-02-17 12:12:47 +04:00
|
|
|
PrependLocalTransformsTo(aToBBoxUserspace);
|
2009-04-29 08:31:34 +04:00
|
|
|
}
|
2012-01-23 21:42:32 +04:00
|
|
|
// We need to include zero width/height vertical/horizontal lines, so we have
|
2012-04-16 12:23:48 +04:00
|
|
|
// to use UnionEdges.
|
|
|
|
bboxUnion.UnionEdges(svgKid->GetBBoxContribution(transform, aFlags));
|
2009-04-29 08:31:34 +04:00
|
|
|
}
|
|
|
|
kid = kid->GetNextSibling();
|
|
|
|
}
|
|
|
|
|
|
|
|
return bboxUnion;
|
2006-06-01 19:31:15 +04:00
|
|
|
}
|