Skip to content

[ticket/17646] Use phrasing elements for the avatar placeholder#6997

Open
ECYaz wants to merge 1 commit into
phpbb:masterfrom
ECYaz:ticket/17646
Open

[ticket/17646] Use phrasing elements for the avatar placeholder#6997
ECYaz wants to merge 1 commit into
phpbb:masterfrom
ECYaz:ticket/17646

Conversation

@ECYaz

@ECYaz ECYaz commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Checklist:

  • Correct branch: master for 4.x fixes
  • Tests pass
  • Code follows coding guidelines
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17646

The markup reported in the ticket, with the placeholder inside <span class="avatar">, cannot be produced by current core, as that span only ever wraps image avatars. The real instance is the group view page, where the placeholder divs render inside a paragraph. Browsers eject the invalid divs from the paragraph while parsing, so the DOM no longer matches the delivered markup and validators reject the page.

The placeholder now renders as spans. Its styling addresses the classes with explicit display values and the initials element keeps its layout as a flex item, so rendering is identical everywhere. Verified on a live board, including the avatar cropper page where the show and hide cycle still restores the flex display.

The letter avatar placeholder is rendered as nested divs, which is
invalid inside phrasing contexts such as the paragraph on the group
view page. Browsers eject the placeholder from the paragraph while
parsing, so the DOM no longer matches the markup, and validators
reject the page. Render the placeholder as spans instead; all of its
styling addresses the classes and sets explicit display values, and
as a flex item the initials element is blockified either way, so the
rendering is unchanged.

The functional test framework reads the logged in username from the
first span inside the header profile link that is not the avatar, so
the placeholder span must be excluded there as well.

PHPBB-17646
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