/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
void SVGSwitchFrame::PaintSVG(gfxContext& aContext, const gfxMatrix& aTransform,
imgDrawingParams& aImgParams) {
NS_ASSERTION(HasAnyStateBits(NS_FRAME_IS_NONDISPLAY), "Only painting of non-display SVG should take this code path");
void SVGSwitchFrame::AlwaysReflowSVGTextFrameDoForOneKid(nsIFrame* aKid) { if (!aKid->IsSubtreeDirty()) { return;
}
if (aKid->IsSVGTextFrame()) {
MOZ_ASSERT(!aKid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY), "A non-display SVGTextFrame directly contained in a display " "container?"); static_cast<SVGTextFrame*>(aKid)->ReflowSVG();
} elseif (ShouldReflowSVGTextFrameInside(aKid)) { if (!aKid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) { for (nsIFrame* kid : aKid->PrincipalChildList()) {
AlwaysReflowSVGTextFrameDoForOneKid(kid);
}
} else { // This child is in a nondisplay context, something like: // <switch> // ... // <g><mask><text></text></mask></g> // </switch> // We should not call ReflowSVG on it.
SVGContainerFrame::ReflowSVGNonDisplayText(aKid);
}
}
}
void SVGSwitchFrame::ReflowAllSVGTextFramesInsideNonActiveChildren(
nsIFrame* aActiveChild) { for (auto* kid : mFrames) { if (aActiveChild == kid) { continue;
}
AlwaysReflowSVGTextFrameDoForOneKid(kid);
}
}
void SVGSwitchFrame::ReflowSVG() {
NS_ASSERTION(SVGUtils::OuterSVGIsCallingReflowSVG(this), "This call is probably a wasteful mistake");
MOZ_ASSERT(!HasAnyStateBits(NS_FRAME_IS_NONDISPLAY), "ReflowSVG mechanism not designed for this");
if (!SVGUtils::NeedsReflowSVG(this)) { return;
}
// 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.
ISVGDisplayableFrame* svgChild = do_QueryFrame(child); if (svgChild && !child->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY)) {
svgChild->ReflowSVG();
// 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, child);
} elseif (child && ShouldReflowSVGTextFrameInside(child)) {
MOZ_ASSERT(
child->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY) || !child->IsSVGFrame(), "Check for this explicitly in the |if|, then");
ReflowSVGNonDisplayText(child);
}
if (isFirstReflow) { // Make sure we have our filter property (if any) before calling // FinishAndStoreOverflow (subsequent filter changes are handled off // nsChangeHint_UpdateEffects):
SVGObserverUtils::UpdateEffects(this);
}
// Remove state bits after FinishAndStoreOverflow so that it doesn't // invalidate on first reflow:
RemoveStateBits(NS_FRAME_FIRST_REFLOW | NS_FRAME_IS_DIRTY |
NS_FRAME_HAS_DIRTY_CHILDREN);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.