Page MenuHomePhabricator

Link tag generated for modules loading bottom fails HTML validation service
Closed, ResolvedPublic


A check using just about any wiki-page against's HTML Validator (new Alternative site) reports an error for the <link> tag being generated for what appears to be any position: bottom loaded module(s).

For Example: verifying against reports

Error: Element <link> is missing required attribute - property.

From line 184, column 1; to line 184, column 159

<link rel="stylesheet" href="//;lang=en&amp;modules=ext.wikimediaBadges&amp;only=styles&amp;skin=vector&amp;*" />

Going by the specs for the link element, it seems rel= needs to be replaced by itemprop= when the link element in question appears outside of the HEAD element where it is typically found but is generated somewhere in the BODY element instead.

Event Timeline

GOIII created this task.Jul 10 2015, 2:40 AM
GOIII raised the priority of this task from to Needs Triage.
GOIII updated the task description. (Show Details)
GOIII added subscribers: GOIII, Krinkle, matmarex and 2 others.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 10 2015, 2:40 AM
matmarex set Security to None.
matmarex removed a subscriber: matmarex.
He7d3r added a subscriber: He7d3r.Jul 10 2015, 11:21 AM

There are many different kinds of elements implement through the <link> tag. The itemprop kind is allowed in the body by the HTML5 spec. The rel=stylesheet is restricted to the head by the spec.

We don't write for validators, we write for real consumers, browsers. It is not indeed not in the standard yet (maybe it'll be standardised in HTML6). But in the real world, browsers support this just fine. Unless there is research indicating this does not work or produce some kind of bug, I suggest we decline this task.

Changing it to itemprop wouldn't make sense because that is an entirely different kind of element and would not result in the browser actually loading the stylesheet.

Krinkle triaged this task as Low priority.Jul 13 2015, 2:47 PM
Krinkle moved this task from Inbox to Backlog on the MediaWiki-ResourceLoader board.
Krinkle closed this task as Resolved.Aug 5 2016, 2:43 AM
Krinkle claimed this task.

This is no longer an issue since the queue separation for stylesheets was removed as part of T109837.