Bug 1965560 part 3: Swap the declaration order of two variables in nsImageLoadingContent::GetWidthHeightForImage(). a=RyanVM

No behavior-change.

This moves the 'const nsAttrValue* value' decl to its first use where it
belongs; and moves the 'CSSIntSize size' decl a bit earlier, where we'll need
it to be in the next patch.

Original Revision: https://phabricator.services.mozilla.com/D251987

Differential Revision: https://phabricator.services.mozilla.com/D267127
This commit is contained in:
Daniel Holbert
2025-10-02 00:59:27 +00:00
committed by rvandermeulen@mozilla.com
parent 45c4fe8584
commit 0a2d3789fb

View File

@@ -1344,13 +1344,14 @@ CSSIntSize nsImageLoadingContent::GetWidthHeightForImage() {
if (nsIFrame* frame = element->GetPrimaryFrame(FlushType::Layout)) {
return CSSIntSize::FromAppUnitsRounded(frame->GetContentRect().Size());
}
const nsAttrValue* value;
CSSIntSize size;
nsCOMPtr<imgIContainer> image;
if (mCurrentRequest) {
mCurrentRequest->GetImage(getter_AddRefs(image));
}
CSSIntSize size;
const nsAttrValue* value;
if ((value = element->GetParsedAttr(nsGkAtoms::width)) &&
value->Type() == nsAttrValue::eInteger) {
size.width = value->GetIntegerValue();