Skip to content

Tolerate lazy-loaded thumbnails in the image modal tests - #128

Merged
malberts merged 1 commit into
masterfrom
fix/thumbnail-lazy-loading-tests
Oct 8, 2026
Merged

malberts merged 1 commit into
masterfrom
fix/thumbnail-lazy-loading-tests

Conversation

@malberts

@malberts malberts commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

MediaWiki master now defaults $wgNativeImageLazyLoading to true (false through REL1_46, changed for T148047), so thumbnails carry loading="lazy" and the image modal tests' thumbnail regexes fail on the MW master CI leg. Make the attribute optional, as the patterns already do for alt="" and /: loading is MediaWiki's markup, which this extension never emits, so the tests accept either form rather than pin the setting.

Considered, omitted:

  • A MediaWiki version check: the attribute follows $wgNativeImageLazyLoading, not the version, so any setup that sets the flag explicitly would break it.
  • Reading the flag to expect the attribute exactly when it is on: that would assert MediaWiki's behaviour rather than this extension's.
  • The patterns still pin the rest of core's <img> attribute list, so a future core change can break them again; loosening them to what this extension controls is a larger rewrite.

AI-authored — Claude Code, Opus 5.5; follow-up proposed in session after @malberts flagged the red MW master leg, approach changed twice (optional group, then reading the flag, then back to the optional group after checking the suite's precedent); approach discussed in session with @malberts, no GitHub review yet; failure reproduced locally with the flag on, full unit suite run with it off, and the new patterns checked against MW master's actual output from CI.

MediaWiki master now defaults `$wgNativeImageLazyLoading` to true (false
through REL1_46, changed for T148047), so thumbnails carry `loading="lazy"`
and the image modal tests' thumbnail regexes fail on the MW master CI leg.
Make the attribute optional, as the patterns already do for `alt=""` and
` /`: `loading` is MediaWiki's markup, which this extension never emits,
so the tests accept either form rather than pin the setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@malberts
malberts marked this pull request as ready for review October 8, 2026 14:45
@malberts
malberts merged commit bb138ce into master Oct 8, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant