You are here: Foswiki>Tasks Web>Item8998 (22 May 2010, ArthurClemens)Edit Attach

Item8998: Item8956 breaks XHTML validation

pencil
Priority: Urgent
Current State: No Action Required
Released In:
Target Release: minor
Applies To: Extension
Component: JQueryPlugin, KupuContrib, SlionSkin, SoftSkin, NatSkin, QuickMenuSkin, default skin, PatternSkin, MoveableTypeSkin, TigerSkinPlugin, BioKbPlugin
Branches:
Reported By: PaulHarvey
Waiting For: Main.MichaelDaum, Main.PaulHarvey
Last Change By: ArthurClemens
Re: Item8956

Stripping attributes "as per HTML5" should be sensitive to the DOCTYPE being used, otherwise we are rendering broken markup.

This is the sort of thing I was talking about with ADDTOZONE being an incomplete solution to adding CSS and JS to a page.

How script/css files are rendered into a page should be configurable, also to potentially decorate filenames with ETAGs or other caching improvements.

For now, we just need our default Foswiki to ship in a way that produces XHTML that validates as best we can. Unnecessary pollution of XHTML errors makes those validation reports less useful and our devs are less likely to check validation, leading us to a situation where we are more likely to stumble along with unclosed tags etc, which foswiki.org is doing atm.

Which I suspect is the cause of Item8995

-- PaulHarvey - 10 May 2010

Xhtml is a dead standard. Use a simplified html5 conform doctype <!DOCTYPE html>. Same holds for <meta charset="%CHARSET%" /> and a couple of more things that you can do today in all of your web projects. This includs that you can safely leave out any type attributes from script and style attributes. All major browsers can cope with this even though they are not 100% html5-ready.

Paul, have you got any example where things misbehave?

-- MichaelDaum - 10 May 2010

The misbehaviour is that for the sake of a few bytes, it makes skins that were perfectly validating in Foswiki 1.0.9, non-validating. Even NatSkin is still using an inappropriate DOCTYPE.

Noisy error logs and reports mean less attention to those logs and reports, which leads to neglected and silently broken, rotting code.

Am I really so out of touch with best practices in web development?

-- PaulHarvey - 10 May 2010

I am really peeved that we want to allow Foswiki 1.1 to ship in such a way that it is impossible to have a validating site.

It is my belief that this change has nothing to do with HTML5. You claim to be ignoring "old standards" but actually, all you are doing is ignoring validation.

Especially when this change is just there for the sake of it and actually provides zero benefit to anyone, except apparently that you can say you did some html5 "stuff".

We use jslint and perlcritic and until now, w3 validator tools as one of our defences against crappy code.

Solutions:
  • Configurable (template-based?) <script> etc. tag rendering.
  • JQueryPlugin renders <script> etc. tags appropriate for the DOCTYPE that is declared.
  • Update all skins in trunk to use a HTML5 friendly DOCTYPE

I have upgraded this to Urgent, because it is a situation where the site admin must choose between a validating site or the ability to use a core, default plugin. This is unacceptable.

  • Many of us are under contract to produce conformant output where there exist validation tools for the standards we are applying.
  • Some of us are working for organisations where this QA metric is a measure for the performance of our teams as a whole.
  • Some of us would like to waste less time fixing weird rendering issues that stem in part from invalid markup, such as unclosed or overlapping tags.
  • It is embarrassing that we declare DOCTYPE XHTML-Transitional, an embarrassingly easy standard to adhere to, and yet produce inappropriate markup.

Finally, I will not be upset if you lower my urgent bug back to "low", but this time please explain why.

-- PaulHarvey - 11 May 2010

Is it possible to take a bit of steam out of this discussion, please?

That said, I am sorry to have cause so much grief for you. I like your proposed solutions, i.e. the latter, a one-line fix.

-- MichaelDaum - 11 May 2010

I should have used calmer language, this is true. But I am surprised by your attitude to this problem, and so now I am not even sure if my own priorities here are normal for the average Foswiki user/developer (am I really in a minority when it comes to caring about validation?)

I have grepped all occurances of DOCTYPE and made them components to this task.

-- PaulHarvey - 11 May 2010

Addressed in Item9004

-- PaulHarvey - 22 May 2010

I think it is important to produce valid html, and I am pleased that joint effort is being done on this.

-- ArthurClemens - 22 May 2010
 
Topic revision: r8 - 22 May 2010, ArthurClemens
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy