Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-17646

Small HTML validation issue with letter avatar placeholder in phpBB 4.0.0-a2

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • None
    • 4.0.0-a2
    • None
    • None

      Small HTML validation issue with letter avatar placeholder in phpBB 4.0.0-a2
       
      I noticed a small HTML validation issue in phpBB 4.0.0-a2 with the new letter/avatar placeholder.
       
      When a user has no uploaded avatar and the placeholder avatar is displayed without an avatar link, the generated markup can place a [c]<div class="avatar-placeholder ...">[/c] inside a [c]<span class="avatar">[/c].
       
      This causes the following validator warning:
       

       
      Element div not allowed as child of element span in this context.
      

       
      Example output:
       

      <span class="avatar">
      <div class="avatar-placeholder avatar-color-2">
      <div class="avatar-initials">S</div>
      </div>
      </span>
      

       
      Changing the placeholder markup from [c]div[/c] to [c]span[/c] fixes the validation issue while keeping the same classes and CSS behaviour:
       

      <span class="avatar-placeholder \{{ color_class }}">
      ...
      <span class="avatar-initials">...</span>
      </span>
      

       
      This seems to be only a markup/validation issue; visually the avatar still displays correctly in browsers.
       
      https://www.phpbb.com/community/viewtopic.php?p=16112023&sid=241f9a0da8c0b0eb358d29c1aeb8b203

            Unassigned Unassigned
            bennybernaer bennybernaer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: