W3C: Trailing slash on void elements

Discussion of non-phpBB related topics with other phpBB.com users.
Forum rules
General Discussion is a bonus forum for discussion of non-phpBB related topics with other phpBB.com users. All site rules apply.
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

W3C: Trailing slash on void elements

Post by bennybernaer »

A month ago the W3C validator gave no comments or errors. But at check today 40, and all the same

"Trailing slash on void elements has no effect and interacts badly with unquoted attribute values."
What can we do about this, is the intention to remove it / everywhere or what?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26822
Joined: Fri Aug 29, 2008 9:49 am

Re: W3C: Trailing slash on void elements

Post by Mick »

Surely W3C would be the first port of call?
  • "The more connected we get the more alone we become” - Kyle Broflovski© 🇬🇧
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: W3C: Trailing slash on void elements

Post by bennybernaer »

Mick wrote: Sat Oct 15, 2022 4:24 pm Surely W3C would be the first port of call?
How do you mean ?

I don't know, that's why I'm asking here. I don't know if it's important, and if we can just ignore this.
User avatar
Gumboots
Registered User
Posts: 800
Joined: Fri Oct 11, 2019 1:59 am

Re: W3C: Trailing slash on void elements

Post by Gumboots »

My 2c: if it doesn't break anything, ignore it. Attribute values are usually quoted anyway, so no problem with those. In less common cases, where you happen to have an unquoted attribute, removing the trailing slash is probably a good idea.

Obviously when writing new code the trailing slash should be left out, but I don't think there's any need to rewrite everything immediately. The web is full of trailing slashes on void elements and it still seems to work.
User avatar
GTI
Registered User
Posts: 300
Joined: Mon Aug 24, 2020 4:59 pm
Location: West Sussex
Name: Laura

Re: W3C: Trailing slash on void elements

Post by GTI »

This was reported over at Area 51 2 weeks ago.

Whether a bug ticket has been submitted or not I don't know.
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: W3C: Trailing slash on void elements

Post by bennybernaer »

Ok thanks guys! I have been able to remove most / already.

<meta charset="utf-8"> & <input type="checkbox" name="viewonline" id="viewonline" tabindex="5" > etc. etc.

But where should I change in the below? In those css files there are no /

Code: Select all

<link href="./ext/bb3mobi/lastpostavatar/styles/all/theme/lastpostavatar.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/dmzx/donation/styles/prosilver/theme/donation.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/dmzx/memberprofileviews/styles/prosilver/theme/memberprofileviews.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/dmzx/privatemessageinfo/styles/prosilver/theme/privatemessageinfo.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/dmzx/progressbar/styles/prosilver/theme/progressbar.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/dmzx/whovisitedthistopic/styles/prosilver/theme/whovisitedthistopic.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/dmzx/youtubegallery/styles/prosilver/theme/video.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/hifikabin/attachmentfluffbuster/styles/all/theme/attachmentfluffbuster.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/hifikabin/headerbanner/styles/prosilver/theme/headerbanner.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/hifikabin/headerbanner/styles/prosilver/theme/headerbanner_background.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/hifikabin/navbarsearch/styles/prosilver/theme/navbarsearch.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/paul999/mention/styles/all/theme/mention.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/phpbb/boardannouncements/styles/all/theme/boardannouncements.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/phpbb/collapsiblecategories/styles/all/theme/collapsiblecategories.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/phpbb/pages/styles/prosilver/theme/pages_common.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/rmcgirr83/contactadmin/styles/prosilver/theme/imageset.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/rmcgirr83/sfpo/styles/prosilver/theme/sfpo.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/steve/postreactions/styles/prosilver/theme/reactions.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/vse/abbc3/styles/all/theme/abbc3_common.min.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/phpbb/boardannouncements/styles/all/theme/boardannouncements.css?assets_version=8253" rel="stylesheet" media="screen" />↩
<link href="./ext/vse/scrollpage/styles/all/theme/scrollpage.min.css?assets_version=8253" rel="stylesheet" media="screen" />↩
User avatar
Mannix_
Registered User
Posts: 2003
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: W3C: Trailing slash on void elements

Post by Mannix_ »

those links are added by the extensions. So I would look in there. To be precise in the ext/extName/styles/styleNameThatYouUse/template/event
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: W3C: Trailing slash on void elements

Post by bennybernaer »

Mannix_ wrote: Sun Oct 16, 2022 10:20 am those links are added by the extensions. So I would look in there. To be precise in the ext/extName/styles/styleNameThatYouUse/template/event
When I look in those style events, I don't see any / at all. To give the example below.
{% INCLUDECSS '@dmzx_donation/donation.css' %}


Fixed 35 notifications (no errors)

Only those extensions remain

And two that I can't find or understand well:

Code: Select all

		<input type="hidden" name="redirect" value="./index.php?sid=55c8d0ec88bb0e7410023d936a2f7d91" />↩
<input type="hidden" name="creation_time" value="1665918767" />↩
<input type="hidden" name="form_token" value="21d1cde972fe6186b4554b8aaeb3dcac08d3bfa0" />

Code: Select all

<dd><input type="hidden" name="sid" value="55c8d0ec88bb0e7410023d936a2f7d91" />

Code: Select all

		{S_LOGIN_REDIRECT}
		{S_FORM_TOKEN_LOGIN}
		<dl>
			<dt>&nbsp;</dt>
			<dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1"></dd>
		</dl>
		</fieldset>
	</div>
User avatar
Mannix_
Registered User
Posts: 2003
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: W3C: Trailing slash on void elements

Post by Mannix_ »

bennybernaer wrote: Sun Oct 16, 2022 11:28 am
Look through the rest of the html files of that extension
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: W3C: Trailing slash on void elements

Post by bennybernaer »

Mannix_ wrote: Sun Oct 16, 2022 11:55 am
bennybernaer wrote: Sun Oct 16, 2022 11:28 am
Look through the rest of the html files of that extension

I did, but it doesn't contain anything other than including css files.

Is it 100% sure that I should search in extensions?
User avatar
Mannix_
Registered User
Posts: 2003
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: W3C: Trailing slash on void elements

Post by Mannix_ »

Well if it's not in any of the html files of an extension then it's in a html files of a style you use. There is no way to guess that by just a little snipet you posted
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: W3C: Trailing slash on void elements

Post by bennybernaer »

Mannix_ wrote: Sun Oct 16, 2022 4:06 pm Well if it's not in any of the html files of an extension then it's in a html files of a style you use. There is no way to guess that by just a little snipet you posted
I actually don't have any more information... The W3C indicates this... And actually it's on every phpBB forum
User avatar
Mannix_
Registered User
Posts: 2003
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: W3C: Trailing slash on void elements

Post by Mannix_ »

if you use editor like notepad++ you can search through directory (Find if Files) for parts of codes you posted above.
User avatar
bennybernaer
Registered User
Posts: 674
Joined: Tue Mar 22, 2011 9:53 pm

Re: W3C: Trailing slash on void elements

Post by bennybernaer »

I gave up and reported it on the bugtrager.

Here on phpbb.com you get exactly the same:
Trailing slash on void elements has no effect and interacts badly with unquoted attribute values.
User avatar
Gumboots
Registered User
Posts: 800
Joined: Fri Oct 11, 2019 1:59 am

Re: W3C: Trailing slash on void elements

Post by Gumboots »

I did a bit of looking around today, and apparently this is only an issue if the unquoted attribute is directly preceding the trailing slash (IOW, no space between attribute and slash). As long as there is a space between the unquoted attribute and the slash, no problem.

There's a whole lot of shiznit about it here: https://mathiasbynens.be/notes/unquoted ... ute-values
And a bit more here: https://developer.mozilla.org/en-US/doc ... id_element

Return to “General Discussion”