Bug #1896
closedWT GIT violating XHTML compliance
Description
I recently upgraded my install of WT from 3.2 to 3.3.0/GIT (both versions exhibit this error) using WINST, and both my programs and the examples broke, due to an XHTML compliance error due to a lack of double quotes around the src attribute in tags.
This proved to be quite frustrating, as both FireFox and Chrome threw explicit errors (while IE accepted this breach of compliance in stride), however the fix is quite simple:
@
void WebRenderer::renderStyleSheet(WStringStream& out,
const WCssStyleSheet& sheet,
WApplication *app, bool xhtml)
{
out << "<link href=\"";
DomElement::htmlAttributeValue(out, sheet.link().resolveUrl(app));
out << "\" rel=\"stylesheet\\" type=\"text/css\"\";
if (!sheet.media().empty() && sheet.media() != "all")
out << \" media=\"" << sheet.media() << '\"';
closeSpecial(out, xhtml);
}
@
Fix is in bold; it merely adds back in the quotes that were in the 3.2.2 version of WebRequest. I see that between 3.2.2-p1 and 3.3.0 you changed how WebRenderer works (probably to accomodate Bootstrap?), and this small but catastrophic change occurred!
To reproduce, merely try literally any of the examples from GIT or 3.3.0, and a new version of Chrome or Firefox; IE silently ignores this issue. Perhaps recently these browsers became more strict, allowing this to slip through?
Updated by Alice Margatroid over 11 years ago
For whatever reason, that failed. Let me try again:
@void WebRenderer::renderStyleSheet(WStringStream& out,
const WCssStyleSheet& sheet,
WApplication *app, bool xhtml)
{
out << "<link href=\"";
DomElement::htmlAttributeValue(out, sheet.link().resolveUrl(app));
out << "\\" rel=\"stylesheet\" type=\"text/css\"\";
if (!sheet.media().empty() && sheet.media() != "all")
out << \" media=\"" << sheet.media() << '\"';
closeSpecial(out, xhtml);
}@
Updated by Alice Margatroid over 11 years ago
void WebRenderer::renderStyleSheet(WStringStream& out,
const WCssStyleSheet& sheet,
WApplication *app, bool xhtml)
{
out << "<link href=\"";
DomElement::htmlAttributeValue(out, sheet.link().resolveUrl(app));
out << "\\" rel=\"stylesheet\" type=\"text/css\"\";
if (!sheet.media().empty() && sheet.media() != "all")
out << \" media=\"" << sheet.media() << '\"';
closeSpecial(out, xhtml);
}
Updated by Wim Dumon over 11 years ago
- Status changed from New to Resolved
- Target version set to 3.3.1
Can reproduce with progressive bootstrap true and xhtml mode.
Proposed fix will be in git (and next release) soon.
Thank you for reporting! (Put code inside the html pre tags for proper formatting)
Wim.
Updated by Alice Margatroid over 11 years ago
Thanks, I'll pull from GIT right away! (and thanks, was hoping HTML would work).
Updated by Koen Deforche over 11 years ago
- Status changed from Resolved to Closed