Bug 1869904 - Use range based for loops more r=TYLin

Differential Revision: https://phabricator.services.mozilla.com/D196370
This commit is contained in:
Robert Longson 2023-12-18 16:24:11 +00:00
Родитель 084cffcd52
Коммит 90527695c6
5 изменённых файлов: 10 добавлений и 13 удалений

Просмотреть файл

@ -120,7 +120,7 @@ void SVGClipPathFrame::PaintChildren(gfxContext& aMaskContext,
}
// Paint our children into the mask:
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
PaintFrameIntoMask(kid, aClippedFrame, aMaskContext);
}
@ -276,7 +276,7 @@ bool SVGClipPathFrame::PointIsInsideClipPath(nsIFrame* aClippedFrame,
return false;
}
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
ISVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
if (SVGFrame) {
gfxPoint pointForChild = point;
@ -310,7 +310,7 @@ bool SVGClipPathFrame::IsTrivial(ISVGDisplayableFrame** aSingleChild) {
ISVGDisplayableFrame* foundChild = nullptr;
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
ISVGDisplayableFrame* svgChild = do_QueryFrame(kid);
if (svgChild) {
// We consider a non-trivial clipPath to be one containing
@ -340,7 +340,7 @@ bool SVGClipPathFrame::IsValid() {
return false;
}
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
LayoutFrameType kidType = kid->Type();
if (kidType == LayoutFrameType::SVGUse) {

Просмотреть файл

@ -223,7 +223,7 @@ void SVGDisplayContainerFrame::PaintSVG(gfxContext& aContext,
}
}
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
gfxMatrix m = matrix;
// PaintFrameWithEffects() expects the transform that is passed to it to
// include the transform to the passed frame's user space, so add it:
@ -330,7 +330,7 @@ void SVGDisplayContainerFrame::ReflowSVG() {
OverflowAreas overflowRects;
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
ISVGDisplayableFrame* SVGFrame = do_QueryFrame(kid);
if (SVGFrame) {
MOZ_ASSERT(!kid->HasAnyStateBits(NS_FRAME_IS_NONDISPLAY),

Просмотреть файл

@ -83,7 +83,7 @@ already_AddRefed<SourceSurface> SVGMaskFrame::GetMaskForMaskedFrame(
mMatrixForChildren =
GetMaskTransform(aParams.maskedFrame) * aParams.toUserSpace;
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
gfxMatrix m = mMatrixForChildren;
// The CTM of each frame referencing us can be different

Просмотреть файл

@ -212,8 +212,6 @@ void SVGPatternFrame::PaintChildren(DrawTarget* aDrawTarget,
SVGPatternFrame* aPatternWithChildren,
nsIFrame* aSource, float aGraphicOpacity,
imgDrawingParams& aImgParams) {
nsIFrame* firstKid = aPatternWithChildren->mFrames.FirstChild();
gfxContext ctx(aDrawTarget);
gfxGroupForBlendAutoSaveRestore autoGroupForBlend(&ctx);
@ -235,7 +233,7 @@ void SVGPatternFrame::PaintChildren(DrawTarget* aDrawTarget,
// give back a clear surface if there's a loop
if (!aPatternWithChildren->HasAnyStateBits(NS_FRAME_DRAWING_AS_PAINTSERVER)) {
AutoSetRestorePaintServerState paintServer(aPatternWithChildren);
for (nsIFrame* kid = firstKid; kid; kid = kid->GetNextSibling()) {
for (auto* kid : aPatternWithChildren->mFrames) {
gfxMatrix tm = *(aPatternWithChildren->mCTM);
// The CTM of each frame referencing us can be different

Просмотреть файл

@ -153,7 +153,7 @@ void SVGSwitchFrame::AlwaysReflowSVGTextFrameDoForOneKid(nsIFrame* aKid) {
void SVGSwitchFrame::ReflowAllSVGTextFramesInsideNonActiveChildren(
nsIFrame* aActiveChild) {
for (nsIFrame* kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
if (aActiveChild == kid) {
continue;
}
@ -248,8 +248,7 @@ nsIFrame* SVGSwitchFrame::GetActiveChildFrame() {
static_cast<dom::SVGSwitchElement*>(GetContent())->GetActiveChild();
if (activeChild) {
for (nsIFrame* kid = mFrames.FirstChild(); kid;
kid = kid->GetNextSibling()) {
for (auto* kid : mFrames) {
if (activeChild == kid->GetContent()) {
return kid;
}