mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 890782 - Part 2: Make NS_STATE_SVG_NONDISPLAY_CHILD a global state bit and rename it. r=jwatt
This commit is contained in:
parent
cda789eda2
commit
4d5eacea09
@ -694,7 +694,7 @@ SVGSVGElement::ChildrenOnlyTransformChanged(uint32_t aFlags)
|
||||
{
|
||||
// Avoid wasteful calls:
|
||||
NS_ABORT_IF_FALSE(!(GetPrimaryFrame()->GetStateBits() &
|
||||
NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_FRAME_IS_NONDISPLAY),
|
||||
"Non-display SVG frames don't maintain overflow rects");
|
||||
|
||||
nsChangeHint changeHint;
|
||||
|
@ -56,7 +56,7 @@ SVGTransformableElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
// will be called on us and our ancestors.
|
||||
nsIFrame* frame =
|
||||
const_cast<SVGTransformableElement*>(this)->GetPrimaryFrame();
|
||||
if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
return retval; // no change
|
||||
}
|
||||
if (aModType == nsIDOMMutationEvent::ADDITION ||
|
||||
@ -172,7 +172,7 @@ SVGTransformableElement::GetBBox(ErrorResult& rv)
|
||||
{
|
||||
nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
|
||||
|
||||
if (!frame || (frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
rv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -8194,7 +8194,7 @@ nsCSSFrameConstructor::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
|
||||
NS_ASSERTION(frame, "This shouldn't happen");
|
||||
|
||||
if ((frame->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
|
||||
(frame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
(frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
// frame does not maintain overflow rects, so avoid calling
|
||||
// FinishAndStoreOverflow on it:
|
||||
hint = NS_SubtractHint(hint,
|
||||
|
@ -5107,7 +5107,7 @@ nsIFrame::GetPreEffectsVisualOverflowRect() const
|
||||
nsFrame::UpdateOverflow()
|
||||
{
|
||||
MOZ_ASSERT(!(mState & NS_FRAME_SVG_LAYOUT) ||
|
||||
!(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
!(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"Non-display SVG do not maintain visual overflow rects");
|
||||
|
||||
nsRect rect(nsPoint(0, 0), GetSize());
|
||||
@ -6774,7 +6774,7 @@ nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas,
|
||||
nsSize aNewSize, nsSize* aOldSize)
|
||||
{
|
||||
NS_ASSERTION(!((GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
|
||||
(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)),
|
||||
(GetStateBits() & NS_FRAME_IS_NONDISPLAY)),
|
||||
"Don't call - overflow rects not maintained on these SVG frames");
|
||||
|
||||
nsRect bounds(nsPoint(0, 0), aNewSize);
|
||||
@ -6921,7 +6921,7 @@ nsIFrame::RecomputePerspectiveChildrenOverflow(const nsStyleContext* aStartStyle
|
||||
for (; !childFrames.AtEnd(); childFrames.Next()) {
|
||||
nsIFrame* child = childFrames.get();
|
||||
if ((child->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
|
||||
(child->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
(child->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
continue; // frame does not maintain overflow rects
|
||||
}
|
||||
if (child->HasPerspective()) {
|
||||
@ -6971,7 +6971,7 @@ RecomputePreserve3DChildrenOverflow(nsIFrame* aFrame, const nsRect* aBounds)
|
||||
for (; !childFrames.AtEnd(); childFrames.Next()) {
|
||||
nsIFrame* child = childFrames.get();
|
||||
if ((child->GetStateBits() & NS_FRAME_SVG_LAYOUT) &&
|
||||
(child->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
(child->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
continue; // frame does not maintain overflow rects
|
||||
}
|
||||
if (child->Preserves3DChildren()) {
|
||||
|
@ -321,6 +321,10 @@ typedef uint64_t nsFrameState;
|
||||
// rect stored to invalidate.
|
||||
#define NS_FRAME_HAS_INVALID_RECT NS_FRAME_STATE_BIT(52)
|
||||
|
||||
// Frame is not displayed directly due to it being, or being under, an SVG
|
||||
// <defs> element or an SVG resource element (<mask>, <pattern>, etc.)
|
||||
#define NS_FRAME_IS_NONDISPLAY NS_FRAME_STATE_BIT(53)
|
||||
|
||||
// Box layout bits
|
||||
#define NS_STATE_IS_HORIZONTAL NS_FRAME_STATE_BIT(22)
|
||||
#define NS_STATE_IS_DIRECTION_NORMAL NS_FRAME_STATE_BIT(31)
|
||||
|
@ -25,7 +25,7 @@ protected:
|
||||
SVGFEContainerFrame(nsStyleContext* aContext)
|
||||
: SVGFEContainerFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -25,7 +25,7 @@ protected:
|
||||
SVGFEImageFrame(nsStyleContext* aContext)
|
||||
: SVGFEImageFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -23,7 +23,7 @@ protected:
|
||||
SVGFELeafFrame(nsStyleContext* aContext)
|
||||
: SVGFELeafFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -19,7 +19,7 @@ protected:
|
||||
SVGFEUnstyledLeafFrame(nsStyleContext* aContext)
|
||||
: SVGFEUnstyledLeafFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -28,7 +28,7 @@ protected:
|
||||
SVGViewFrame(nsStyleContext* aContext)
|
||||
: SVGViewFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -57,7 +57,7 @@ public:
|
||||
// Get bounds in our gfxContext's coordinates space (in app units)
|
||||
NS_IMETHOD_(nsRect) GetCoveredRegion()=0;
|
||||
|
||||
// Called on SVG child frames (except NS_STATE_SVG_NONDISPLAY_CHILD frames)
|
||||
// Called on SVG child frames (except NS_FRAME_IS_NONDISPLAY frames)
|
||||
// to update and then invalidate their cached bounds. This method is not
|
||||
// called until after the nsSVGOuterSVGFrame has had its initial reflow
|
||||
// (i.e. once the SVG viewport dimensions are known). It should also only
|
||||
@ -81,7 +81,7 @@ public:
|
||||
// DO_NOT_NOTIFY_RENDERING_OBSERVERS - this should only be used when
|
||||
// updating the descendant frames of a clipPath,
|
||||
// mask, pattern or marker frame (or other similar
|
||||
// NS_STATE_SVG_NONDISPLAY_CHILD frame) immediately
|
||||
// NS_FRAME_IS_NONDISPLAY frame) immediately
|
||||
// prior to painting that frame's descendants.
|
||||
// TRANSFORM_CHANGED - the current transform matrix for this frame has changed
|
||||
// COORD_CONTEXT_CHANGED - the dimensions of this frame's coordinate context has
|
||||
|
@ -145,7 +145,7 @@ nsSVGAFrame::NotifySVGChanged(uint32_t aFlags)
|
||||
gfxMatrix
|
||||
nsSVGAFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -25,7 +25,7 @@ protected:
|
||||
: nsSVGClipPathFrameBase(aContext)
|
||||
, mInUse(false)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -33,7 +33,7 @@ NS_NewSVGContainerFrame(nsIPresShell* aPresShell,
|
||||
// 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);
|
||||
frame->AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
return frame;
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ nsSVGContainerFrame::RemoveFrame(ChildListID aListID,
|
||||
bool
|
||||
nsSVGContainerFrame::UpdateOverflow()
|
||||
{
|
||||
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// We don't maintain overflow rects.
|
||||
// XXX It would have be better if the restyle request hadn't even happened.
|
||||
return false;
|
||||
@ -89,7 +89,7 @@ nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) {
|
||||
AddStateBits(aParent->GetStateBits() &
|
||||
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
|
||||
(NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD));
|
||||
}
|
||||
nsSVGContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
}
|
||||
@ -125,12 +125,12 @@ nsSVGDisplayContainerFrame::InsertFrames(ChildListID aListID,
|
||||
// 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))) {
|
||||
NS_FRAME_IS_NONDISPLAY))) {
|
||||
for (nsIFrame* kid = firstNewFrame; kid != firstOldFrame;
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
|
||||
if (SVGFrame) {
|
||||
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"Check for this explicitly in the |if|, then");
|
||||
bool isFirstReflow = (kid->GetStateBits() & NS_FRAME_FIRST_REFLOW);
|
||||
// Remove bits so that ScheduleBoundsUpdate will work:
|
||||
@ -165,7 +165,7 @@ nsSVGDisplayContainerFrame::RemoveFrame(ChildListID aListID,
|
||||
|
||||
nsresult rv = nsSVGContainerFrame::RemoveFrame(aListID, aOldFrame);
|
||||
|
||||
if (!(GetStateBits() & (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_IS_OUTER_SVG))) {
|
||||
if (!(GetStateBits() & (NS_FRAME_IS_NONDISPLAY | NS_STATE_IS_OUTER_SVG))) {
|
||||
nsSVGUtils::NotifyAncestorsOfFilterRegionChange(this);
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext* aContext,
|
||||
const nsIntRect *aDirtyRect)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD) ||
|
||||
(mState & NS_FRAME_IS_NONDISPLAY) ||
|
||||
PresContext()->IsGlyph(),
|
||||
"If display lists are enabled, only painting of non-display "
|
||||
"SVG should take this code path");
|
||||
@ -231,7 +231,7 @@ NS_IMETHODIMP_(nsIFrame*)
|
||||
nsSVGDisplayContainerFrame::GetFrameForPoint(const nsPoint &aPoint)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only hit-testing of a "
|
||||
"clipPath's contents should take this code path");
|
||||
return nsSVGUtils::HitTestChildren(this, aPoint);
|
||||
@ -249,7 +249,7 @@ nsSVGDisplayContainerFrame::GetCoveredRegion()
|
||||
*
|
||||
* The reason that this helper exists is because nsSVGTextFrame2 is special.
|
||||
* None of the other SVG frames ever need to be reflowed when they have the
|
||||
* NS_STATE_SVG_NONDISPLAY_CHILD bit set on them because their PaintSVG methods
|
||||
* NS_FRAME_IS_NONDISPLAY bit set on them because their PaintSVG methods
|
||||
* (and those of any containers that they can validly be contained within) do
|
||||
* not make use of mRect or overflow rects. "em" lengths, etc., are resolved
|
||||
* as those elements are painted.
|
||||
@ -261,7 +261,7 @@ nsSVGDisplayContainerFrame::GetCoveredRegion()
|
||||
*
|
||||
* We assume that any change that requires the anonymous kid of an
|
||||
* nsSVGTextFrame2 to reflow will result in an NS_FRAME_IS_DIRTY reflow. When
|
||||
* that reflow reaches an NS_STATE_SVG_NONDISPLAY_CHILD frame it would normally
|
||||
* that reflow reaches an NS_FRAME_IS_NONDISPLAY frame it would normally
|
||||
* stop, but this helper looks for any nsSVGTextFrame2 descendants of such
|
||||
* frames and marks them NS_FRAME_IS_DIRTY so that the next time that they are
|
||||
* painted their anonymous kid will first get the necessary reflow.
|
||||
@ -271,9 +271,9 @@ ReflowSVGNonDisplayText(nsSVGContainerFrame* aContainer)
|
||||
{
|
||||
NS_ASSERTION(aContainer->GetStateBits() & NS_FRAME_IS_DIRTY,
|
||||
"expected aContainer to be NS_FRAME_IS_DIRTY");
|
||||
NS_ASSERTION(aContainer->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD,
|
||||
NS_ASSERTION(aContainer->GetStateBits() & NS_FRAME_IS_NONDISPLAY,
|
||||
"it is wasteful to call ReflowSVGNonDisplayText on a container "
|
||||
"frame that is not NS_STATE_SVG_NONDISPLAY_CHILD");
|
||||
"frame that is not NS_FRAME_IS_NONDISPLAY");
|
||||
for (nsIFrame* kid = aContainer->GetFirstPrincipalChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
if (kid->GetType() == nsGkAtoms::svgTextFrame2) {
|
||||
@ -293,7 +293,7 @@ nsSVGDisplayContainerFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
NS_ABORT_IF_FALSE(GetType() != nsGkAtoms::svgOuterSVGFrame,
|
||||
@ -323,7 +323,7 @@ nsSVGDisplayContainerFrame::ReflowSVG()
|
||||
kid = kid->GetNextSibling()) {
|
||||
nsISVGChildFrame* SVGFrame = do_QueryFrame(kid);
|
||||
if (SVGFrame) {
|
||||
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"Check for this explicitly in the |if|, then");
|
||||
kid->AddStateBits(mState & NS_FRAME_IS_DIRTY);
|
||||
SVGFrame->ReflowSVG();
|
||||
@ -336,8 +336,8 @@ nsSVGDisplayContainerFrame::ReflowSVG()
|
||||
// Inside a non-display container frame, we might have some
|
||||
// nsSVGTextFrame2s. We need to cause those to get reflowed in
|
||||
// case they are the target of a rendering observer.
|
||||
NS_ASSERTION(kid->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD,
|
||||
"expected kid to be a NS_STATE_SVG_NONDISPLAY_CHILD frame");
|
||||
NS_ASSERTION(kid->GetStateBits() & NS_FRAME_IS_NONDISPLAY,
|
||||
"expected kid to be a NS_FRAME_IS_NONDISPLAY frame");
|
||||
if (kid->GetStateBits() & NS_FRAME_IS_DIRTY) {
|
||||
nsSVGContainerFrame* container = do_QueryFrame(kid);
|
||||
if (container && container->GetContent()->IsSVG()) {
|
||||
|
@ -507,7 +507,7 @@ nsSVGFilterFrame::GetPostFilterBounds(nsIFrame *aFilteredFrame,
|
||||
const nsRect *aPreFilterBounds)
|
||||
{
|
||||
MOZ_ASSERT(!(aFilteredFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) ||
|
||||
!(aFilteredFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
!(aFilteredFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"Non-display SVG do not maintain visual overflow rects");
|
||||
|
||||
nsAutoFilterInstance instance(aFilteredFrame, this, nullptr, nullptr,
|
||||
|
@ -41,7 +41,7 @@ protected:
|
||||
mLoopFlag(false),
|
||||
mNoHRefURI(false)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -62,10 +62,10 @@ nsSVGForeignObjectFrame::Init(nsIContent* aContent,
|
||||
|
||||
nsSVGForeignObjectFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
AddStateBits(aParent->GetStateBits() &
|
||||
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
|
||||
(NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD));
|
||||
AddStateBits(NS_FRAME_FONT_INFLATION_CONTAINER |
|
||||
NS_FRAME_FONT_INFLATION_FLOW_ROOT);
|
||||
if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
|
||||
nsSVGUtils::GetOuterSVGFrame(this)->RegisterForeignObject(this);
|
||||
}
|
||||
}
|
||||
@ -73,7 +73,7 @@ nsSVGForeignObjectFrame::Init(nsIContent* aContent,
|
||||
void nsSVGForeignObjectFrame::DestroyFrom(nsIFrame* aDestructRoot)
|
||||
{
|
||||
// Only unregister if we registered in the first place:
|
||||
if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
|
||||
nsSVGUtils::GetOuterSVGFrame(this)->UnregisterForeignObject(this);
|
||||
}
|
||||
nsSVGForeignObjectFrameBase::DestroyFrom(aDestructRoot);
|
||||
@ -124,7 +124,7 @@ nsSVGForeignObjectFrame::Reflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"Should not have been called");
|
||||
|
||||
// Only InvalidateAndScheduleBoundsUpdate marks us with NS_FRAME_IS_DIRTY,
|
||||
@ -198,7 +198,7 @@ nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext,
|
||||
const nsIntRect *aDirtyRect)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only painting of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -221,7 +221,7 @@ nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext,
|
||||
/* Check if we need to draw anything. */
|
||||
if (aDirtyRect) {
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"Display lists handle dirty rect intersection test");
|
||||
// Transform the dirty rect into app units in our userspace.
|
||||
gfxMatrix invmatrix = canvasTM;
|
||||
@ -285,11 +285,11 @@ NS_IMETHODIMP_(nsIFrame*)
|
||||
nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only hit-testing of a "
|
||||
"clipPath's contents should take this code path");
|
||||
|
||||
if (IsDisabled() || (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD))
|
||||
if (IsDisabled() || (GetStateBits() & NS_FRAME_IS_NONDISPLAY))
|
||||
return nullptr;
|
||||
|
||||
nsIFrame* kid = GetFirstPrincipalChild();
|
||||
@ -344,7 +344,7 @@ nsSVGForeignObjectFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
||||
@ -489,7 +489,7 @@ nsSVGForeignObjectFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
gfxMatrix
|
||||
nsSVGForeignObjectFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -67,7 +67,7 @@ nsSVGGFrame::NotifySVGChanged(uint32_t aFlags)
|
||||
gfxMatrix
|
||||
nsSVGGFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -48,7 +48,7 @@ nsSVGGenericContainerFrame::GetType() const
|
||||
gfxMatrix
|
||||
nsSVGGenericContainerFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -25,7 +25,7 @@ nsSVGGeometryFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
AddStateBits(aParent->GetStateBits() &
|
||||
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
|
||||
(NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD));
|
||||
nsSVGGeometryFrameBase::Init(aContent, aParent, aPrevInFlow);
|
||||
}
|
||||
|
||||
|
@ -307,7 +307,7 @@ nsSVGGlyphFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
nsSVGGlyphFrameBase::DidSetStyleContext(aOldStyleContext);
|
||||
|
||||
if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW) ||
|
||||
(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
ClearTextRun();
|
||||
NotifyGlyphMetricsChange();
|
||||
}
|
||||
@ -499,7 +499,7 @@ nsSVGGlyphFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
mRect.SetEmpty();
|
||||
@ -677,7 +677,7 @@ nsSVGGlyphFrame::GetCanvasTM(uint32_t aFor)
|
||||
if (mOverrideCanvasTM) {
|
||||
return *mOverrideCanvasTM;
|
||||
}
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
@ -1679,7 +1679,7 @@ nsSVGGlyphFrame::EnsureTextRun(float *aDrawScale, float *aMetricsScale,
|
||||
|
||||
gfxMatrix m;
|
||||
if (aForceGlobalTransform ||
|
||||
!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
m = GetCanvasTM(mGetCanvasTMForFlag);
|
||||
if (m.IsSingular())
|
||||
return false;
|
||||
|
@ -323,7 +323,7 @@ nsSVGImageFrame::PaintSVG(nsRenderingContext *aContext,
|
||||
nsRect dirtyRect; // only used if aDirtyRect is non-null
|
||||
if (aDirtyRect) {
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"Display lists handle dirty rect intersection test");
|
||||
dirtyRect = aDirtyRect->ToAppUnits(appUnitsPerDevPx);
|
||||
// Adjust dirtyRect to match our local coordinate system.
|
||||
@ -432,7 +432,7 @@ nsSVGImageFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
||||
|
@ -62,7 +62,7 @@ nsSVGInnerSVGFrame::PaintSVG(nsRenderingContext *aContext,
|
||||
const nsIntRect *aDirtyRect)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only painting of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -167,7 +167,7 @@ nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
int32_t aModType)
|
||||
{
|
||||
if (aNameSpaceID == kNameSpaceID_None &&
|
||||
!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
|
||||
SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
|
||||
|
||||
@ -228,7 +228,7 @@ NS_IMETHODIMP_(nsIFrame*)
|
||||
nsSVGInnerSVGFrame::GetFrameForPoint(const nsPoint &aPoint)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only hit-testing of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -270,7 +270,7 @@ nsSVGInnerSVGFrame::NotifyViewportOrTransformChanged(uint32_t aFlags)
|
||||
gfxMatrix
|
||||
nsSVGInnerSVGFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -402,7 +402,7 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(nsRenderingContext* aCtx,
|
||||
#ifdef DEBUG
|
||||
NS_ASSERTION(!(aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT) ||
|
||||
(NS_SVGDisplayListPaintingEnabled() &&
|
||||
!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)),
|
||||
!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)),
|
||||
"Should not use nsSVGIntegrationUtils on this SVG frame");
|
||||
#endif
|
||||
|
||||
|
@ -44,7 +44,7 @@ protected:
|
||||
, mInUse(false)
|
||||
, mInUse2(false)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -26,7 +26,7 @@ protected:
|
||||
: nsSVGMaskFrameBase(aContext)
|
||||
, mInUse(false)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -161,22 +161,22 @@ nsSVGOuterSVGFrame::Init(nsIContent* aContent,
|
||||
// simply giving failing outer <svg> elements an nsSVGContainerFrame.
|
||||
// We don't create other SVG frames if PassesConditionalProcessingTests
|
||||
// returns false, but since we do create nsSVGOuterSVGFrame frames we
|
||||
// prevent them from painting by [ab]use NS_STATE_SVG_NONDISPLAY_CHILD. The
|
||||
// prevent them from painting by [ab]use NS_FRAME_IS_NONDISPLAY. The
|
||||
// frame will be recreated via an nsChangeHint_ReconstructFrame restyle if
|
||||
// the value returned by PassesConditionalProcessingTests changes.
|
||||
SVGSVGElement *svg = static_cast<SVGSVGElement*>(aContent);
|
||||
if (!svg->PassesConditionalProcessingTests()) {
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
} else {
|
||||
// If this outer <svg> element is the child of a <foreignObject> that
|
||||
// is non-display, or is the child of a frame for HTML content that
|
||||
// itself is a descendant of a non-display SVG frame, then we want to
|
||||
// it non-display also. The second case is not as simple to handle
|
||||
// as copying a state bit from the parent, since non-SVG frames do
|
||||
// not use NS_STATE_SVG_NONDISPLAY_CHILD.
|
||||
// not use NS_FRAME_IS_NONDISPLAY.
|
||||
for (nsIFrame* f = aParent; f; f = f->GetParent()) {
|
||||
if (f->IsFrameOfType(eSVG)) {
|
||||
AddStateBits(f->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(f->GetStateBits() & NS_FRAME_IS_NONDISPLAY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -476,7 +476,7 @@ nsSVGOuterSVGFrame::Reflow(nsPresContext* aPresContext,
|
||||
}
|
||||
mViewportInitialized = true;
|
||||
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
// Now that we've marked the necessary children as dirty, call
|
||||
// ReflowSVG() on them:
|
||||
|
||||
@ -721,7 +721,7 @@ nsSVGOuterSVGFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
int32_t aModType)
|
||||
{
|
||||
if (aNameSpaceID == kNameSpaceID_None &&
|
||||
!(GetStateBits() & (NS_FRAME_FIRST_REFLOW | NS_STATE_SVG_NONDISPLAY_CHILD))) {
|
||||
!(GetStateBits() & (NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_NONDISPLAY))) {
|
||||
if (aAttribute == nsGkAtoms::viewBox ||
|
||||
aAttribute == nsGkAtoms::preserveAspectRatio ||
|
||||
aAttribute == nsGkAtoms::transform) {
|
||||
@ -772,7 +772,7 @@ nsSVGOuterSVGFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists)
|
||||
{
|
||||
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -863,7 +863,7 @@ nsSVGOuterSVGFrame::NotifyViewportOrTransformChanged(uint32_t aFlags)
|
||||
mCanvasTM = nullptr;
|
||||
|
||||
if (haveNonFulLZoomTransformChange &&
|
||||
!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
!(mState & NS_FRAME_IS_NONDISPLAY)) {
|
||||
uint32_t flags = (mState & NS_FRAME_IN_REFLOW) ?
|
||||
SVGSVGElement::eDuringReflow : 0;
|
||||
content->ChildrenOnlyTransformChanged(flags);
|
||||
@ -910,7 +910,7 @@ nsSVGOuterSVGFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
gfxMatrix
|
||||
nsSVGOuterSVGFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -29,7 +29,7 @@ protected:
|
||||
nsSVGPaintServerFrame(nsStyleContext* aContext)
|
||||
: nsSVGPaintServerFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -271,7 +271,7 @@ nsSVGPathGeometryFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
||||
@ -482,7 +482,7 @@ nsSVGPathGeometryFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
gfxMatrix
|
||||
nsSVGPathGeometryFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -23,7 +23,7 @@ protected:
|
||||
nsSVGStopFrame(nsStyleContext* aContext)
|
||||
: nsSVGStopFrameBase(aContext)
|
||||
{
|
||||
AddStateBits(NS_STATE_SVG_NONDISPLAY_CHILD);
|
||||
AddStateBits(NS_FRAME_IS_NONDISPLAY);
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -108,7 +108,7 @@ nsSVGSwitchFrame::PaintSVG(nsRenderingContext* aContext,
|
||||
const nsIntRect *aDirtyRect)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only painting of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -127,7 +127,7 @@ NS_IMETHODIMP_(nsIFrame*)
|
||||
nsSVGSwitchFrame::GetFrameForPoint(const nsPoint &aPoint)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only hit-testing of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -163,7 +163,7 @@ nsSVGSwitchFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
||||
@ -190,7 +190,7 @@ nsSVGSwitchFrame::ReflowSVG()
|
||||
if (child) {
|
||||
nsISVGChildFrame* svgChild = do_QueryFrame(child);
|
||||
if (svgChild) {
|
||||
NS_ABORT_IF_FALSE(!(child->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(child->GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"Check for this explicitly in the |if|, then");
|
||||
svgChild->ReflowSVG();
|
||||
|
||||
|
@ -93,7 +93,7 @@ nsSVGTSpanFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
gfxMatrix
|
||||
nsSVGTSpanFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -206,7 +206,7 @@ nsSVGTextFrame::PaintSVG(nsRenderingContext* aContext,
|
||||
const nsIntRect *aDirtyRect)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only painting of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -219,7 +219,7 @@ NS_IMETHODIMP_(nsIFrame*)
|
||||
nsSVGTextFrame::GetFrameForPoint(const nsPoint &aPoint)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"If display lists are enabled, only hit-testing of non-display "
|
||||
"SVG should take this code path");
|
||||
|
||||
@ -234,7 +234,7 @@ nsSVGTextFrame::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probably a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
||||
@ -270,7 +270,7 @@ nsSVGTextFrame::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
gfxMatrix
|
||||
nsSVGTextFrame::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
|
@ -3024,7 +3024,7 @@ nsSVGTextFrame2::Init(nsIContent* aContent,
|
||||
|
||||
nsSVGTextFrame2Base::Init(aContent, aParent, aPrevInFlow);
|
||||
AddStateBits((aParent->GetStateBits() &
|
||||
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD)) |
|
||||
(NS_FRAME_IS_NONDISPLAY | NS_STATE_SVG_CLIPPATH_CHILD)) |
|
||||
NS_FRAME_SVG_LAYOUT | NS_FRAME_IS_SVG_TEXT);
|
||||
|
||||
mMutationObserver.StartObserving(this);
|
||||
@ -3083,7 +3083,7 @@ nsSVGTextFrame2::GetType() const
|
||||
void
|
||||
nsSVGTextFrame2::DidSetStyleContext(nsStyleContext* aOldStyleContext)
|
||||
{
|
||||
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// We need this DidSetStyleContext override to handle cases like this:
|
||||
//
|
||||
// <defs>
|
||||
@ -3114,9 +3114,9 @@ nsSVGTextFrame2::ReflowSVGNonDisplayText()
|
||||
MOZ_ASSERT(nsSVGUtils::AnyOuterSVGIsCallingReflowSVG(this),
|
||||
"only call ReflowSVGNonDisplayText when an outer SVG frame is "
|
||||
"under ReflowSVG");
|
||||
MOZ_ASSERT(mState & NS_STATE_SVG_NONDISPLAY_CHILD,
|
||||
MOZ_ASSERT(mState & NS_FRAME_IS_NONDISPLAY,
|
||||
"only call ReflowSVGNonDisplayText if the frame is "
|
||||
"NS_STATE_SVG_NONDISPLAY_CHILD");
|
||||
"NS_FRAME_IS_NONDISPLAY");
|
||||
|
||||
// We had a style change, so we mark this frame as dirty so that the next
|
||||
// time it is painted, we reflow the anonymous block frame.
|
||||
@ -3150,7 +3150,7 @@ nsSVGTextFrame2::ScheduleReflowSVGNonDisplayText()
|
||||
outerSVGFrame = static_cast<nsSVGOuterSVGFrame*>(f);
|
||||
break;
|
||||
}
|
||||
if (!(f->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(f->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
// We don't need to set NS_FRAME_HAS_DIRTY_CHILDREN on non-display
|
||||
// children in the path from the dirty nsSVGTextFrame2 up to the
|
||||
// first display container frame, since ReflowSVGNonDisplayText
|
||||
@ -3260,7 +3260,7 @@ nsSVGTextFrame2::FindCloserFrameForSelection(
|
||||
nsPoint aPoint,
|
||||
nsIFrame::FrameWithDistance* aCurrentBestFrame)
|
||||
{
|
||||
if (GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3412,7 +3412,7 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
||||
gfxContext *gfx = aContext->ThebesContext();
|
||||
gfxMatrix initialMatrix = gfx->CurrentMatrix();
|
||||
|
||||
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// If we are in a canvas DrawWindow call that used the
|
||||
// DRAWWINDOW_DO_NOT_FLUSH flag, then we may still have out
|
||||
// of date frames. Just don't paint anything if they are
|
||||
@ -3443,7 +3443,7 @@ nsSVGTextFrame2::PaintSVG(nsRenderingContext* aContext,
|
||||
// Check if we need to draw anything.
|
||||
if (aDirtyRect) {
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(mState & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
(mState & NS_FRAME_IS_NONDISPLAY),
|
||||
"Display lists handle dirty rect intersection test");
|
||||
nsRect dirtyRect(aDirtyRect->x, aDirtyRect->y,
|
||||
aDirtyRect->width, aDirtyRect->height);
|
||||
@ -3533,7 +3533,7 @@ nsSVGTextFrame2::GetFrameForPoint(const nsPoint& aPoint)
|
||||
{
|
||||
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
|
||||
|
||||
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// Text frames inside <clipPath> will never have had ReflowSVG called on
|
||||
// them, so call UpdateGlyphPositioning to do this now. (Text frames
|
||||
// inside <mask> and other non-display containers will never need to
|
||||
@ -3585,7 +3585,7 @@ nsSVGTextFrame2::ReflowSVG()
|
||||
NS_ASSERTION(nsSVGUtils::OuterSVGIsCallingReflowSVG(this),
|
||||
"This call is probaby a wasteful mistake");
|
||||
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD),
|
||||
NS_ABORT_IF_FALSE(!(GetStateBits() & NS_FRAME_IS_NONDISPLAY),
|
||||
"ReflowSVG mechanism not designed for this");
|
||||
|
||||
if (!nsSVGUtils::NeedsReflowSVG(this)) {
|
||||
@ -3697,7 +3697,7 @@ nsSVGTextFrame2::GetBBoxContribution(const gfxMatrix &aToBBoxUserspace,
|
||||
gfxMatrix
|
||||
nsSVGTextFrame2::GetCanvasTM(uint32_t aFor)
|
||||
{
|
||||
if (!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == FOR_PAINTING && NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == FOR_HIT_TESTING && NS_SVGDisplayListHitTestingEnabled())) {
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(this);
|
||||
@ -4911,7 +4911,7 @@ nsSVGTextFrame2::ShouldRenderAsPath(nsRenderingContext* aContext,
|
||||
void
|
||||
nsSVGTextFrame2::ScheduleReflowSVG()
|
||||
{
|
||||
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
ScheduleReflowSVGNonDisplayText();
|
||||
} else {
|
||||
nsSVGUtils::ScheduleReflowSVG(this);
|
||||
@ -4971,7 +4971,7 @@ nsSVGTextFrame2::DoReflow()
|
||||
// need to update mPositions.
|
||||
AddStateBits(NS_STATE_SVG_POSITIONING_DIRTY);
|
||||
|
||||
if (mState & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (mState & NS_FRAME_IS_NONDISPLAY) {
|
||||
// Normally, these dirty flags would be cleared in ReflowSVG(), but that
|
||||
// doesn't get called for non-display frames. We don't want to reflow our
|
||||
// descendants every time nsSVGTextFrame2::PaintSVG makes sure that we have
|
||||
@ -5077,7 +5077,7 @@ nsSVGTextFrame2::UpdateFontSizeScaleFactor()
|
||||
// get stuck with a font size scale factor based on whichever referencing
|
||||
// frame happens to reflow first.
|
||||
double contextScale = 1.0;
|
||||
if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
|
||||
gfxMatrix m(GetCanvasTM(FOR_OUTERSVG_TM));
|
||||
if (!m.IsSingular()) {
|
||||
contextScale = GetContextScale(m);
|
||||
|
@ -481,7 +481,7 @@ nsSVGUtils::ScheduleReflowSVG(nsIFrame *aFrame)
|
||||
// calls InvalidateBounds) or nsSVGDisplayContainerFrame::InsertFrames
|
||||
// (at which point the frame has no observers).
|
||||
|
||||
if (aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) {
|
||||
if (aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -624,7 +624,7 @@ nsSVGUtils::GetOuterSVGFrameAndCoveredRegion(nsIFrame* aFrame, nsRect* aRect)
|
||||
nsISVGChildFrame* svg = do_QueryFrame(aFrame);
|
||||
if (!svg)
|
||||
return nullptr;
|
||||
*aRect = (aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) ?
|
||||
*aRect = (aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ?
|
||||
nsRect(0, 0, 0, 0) : svg->GetCoveredRegion();
|
||||
return GetOuterSVGFrame(aFrame);
|
||||
}
|
||||
@ -638,7 +638,7 @@ nsSVGUtils::GetCanvasTM(nsIFrame *aFrame, uint32_t aFor)
|
||||
return nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aFrame);
|
||||
}
|
||||
|
||||
if (!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
if ((aFor == nsISVGChildFrame::FOR_PAINTING &&
|
||||
NS_SVGDisplayListPaintingEnabled()) ||
|
||||
(aFor == nsISVGChildFrame::FOR_HIT_TESTING &&
|
||||
@ -744,7 +744,7 @@ nsSVGUtils::PaintFrameWithEffects(nsRenderingContext *aContext,
|
||||
nsIFrame *aFrame)
|
||||
{
|
||||
NS_ASSERTION(!NS_SVGDisplayListPaintingEnabled() ||
|
||||
(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD) ||
|
||||
(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY) ||
|
||||
aFrame->PresContext()->IsGlyph(),
|
||||
"If display lists are enabled, only painting of non-display "
|
||||
"SVG should take this code path");
|
||||
@ -773,7 +773,7 @@ nsSVGUtils::PaintFrameWithEffects(nsRenderingContext *aContext,
|
||||
nsSVGFilterFrame *filterFrame = effectProperties.GetFilterFrame(&isOK);
|
||||
|
||||
if (aDirtyRect &&
|
||||
!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
// Here we convert aFrame's paint bounds to outer-<svg> device space,
|
||||
// compare it to aDirtyRect, and return early if they don't intersect.
|
||||
// We don't do this optimization for nondisplay SVG since nondisplay
|
||||
@ -844,7 +844,7 @@ nsSVGUtils::PaintFrameWithEffects(nsRenderingContext *aContext,
|
||||
if (opacity != 1.0f || maskFrame || (clipPathFrame && !isTrivialClip)) {
|
||||
complexEffects = true;
|
||||
gfx->Save();
|
||||
if (!(aFrame->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
|
||||
if (!(aFrame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
|
||||
// aFrame has a valid visual overflow rect, so clip to it before calling
|
||||
// PushGroup() to minimize the size of the surfaces we'll composite:
|
||||
gfxContextMatrixAutoSaveRestore matrixAutoSaveRestore(gfx);
|
||||
|
@ -63,11 +63,8 @@ class Element;
|
||||
// SVG Frame state bits
|
||||
#define NS_STATE_IS_OUTER_SVG NS_FRAME_STATE_BIT(20)
|
||||
|
||||
/* are we the child of a non-display container? */
|
||||
#define NS_STATE_SVG_NONDISPLAY_CHILD NS_FRAME_STATE_BIT(21)
|
||||
|
||||
// If this bit is set, we are a <clipPath> element or descendant.
|
||||
#define NS_STATE_SVG_CLIPPATH_CHILD NS_FRAME_STATE_BIT(22)
|
||||
#define NS_STATE_SVG_CLIPPATH_CHILD NS_FRAME_STATE_BIT(21)
|
||||
|
||||
/**
|
||||
* For text, the NS_FRAME_IS_DIRTY and NS_FRAME_HAS_DIRTY_CHILDREN bits indicate
|
||||
@ -79,7 +76,7 @@ class Element;
|
||||
* to allow us to avoid reflowing the anonymous block when it is not
|
||||
* necessary.
|
||||
*/
|
||||
#define NS_STATE_SVG_POSITIONING_DIRTY NS_FRAME_STATE_BIT(23)
|
||||
#define NS_STATE_SVG_POSITIONING_DIRTY NS_FRAME_STATE_BIT(22)
|
||||
|
||||
/**
|
||||
* For text, whether the values from x/y/dx/dy attributes have any percentage values
|
||||
@ -104,7 +101,7 @@ class Element;
|
||||
* NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES would require extra work that is
|
||||
* probably not worth it.
|
||||
*/
|
||||
#define NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES NS_FRAME_STATE_BIT(24)
|
||||
#define NS_STATE_SVG_POSITIONING_MAY_USE_PERCENTAGES NS_FRAME_STATE_BIT(23)
|
||||
|
||||
/**
|
||||
* Byte offsets of channels in a native packed gfxColor or cairo image surface.
|
||||
@ -319,7 +316,7 @@ public:
|
||||
* Schedules an update of the frame's bounds (which will in turn invalidate
|
||||
* the new area that the frame should paint to).
|
||||
*
|
||||
* This does nothing when passed an NS_STATE_SVG_NONDISPLAY_CHILD frame.
|
||||
* This does nothing when passed an NS_FRAME_IS_NONDISPLAY frame.
|
||||
* In future we may want to allow ReflowSVG to be called on such frames,
|
||||
* but that would be better implemented as a ForceReflowSVG function to
|
||||
* be called synchronously while painting them without marking or paying
|
||||
@ -341,7 +338,7 @@ public:
|
||||
* mark descendants dirty would cause it to descend through
|
||||
* nsSVGForeignObjectFrame frames to mark their children dirty, but we want to
|
||||
* handle nsSVGForeignObjectFrame specially. It would also do unnecessary work
|
||||
* descending into NS_STATE_SVG_NONDISPLAY_CHILD frames.
|
||||
* descending into NS_FRAME_IS_NONDISPLAY frames.
|
||||
*/
|
||||
static void ScheduleReflowSVG(nsIFrame *aFrame);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user