W3C home > Mailing lists > Public > www-validator@w3.org > March 2007

Re: Feature request: validation by snippet

From: olivier Thereaux <ot@w3.org>
Date: Fri, 23 Mar 2007 11:38:59 +0900
Message-Id: <BBF6C416-758F-4105-B3D8-A4229FD21AE4@w3.org>
Cc: www-validator@w3.org
To: Stephanie Troeth <steph@unadorned.org>

Hi Steph,

On Mar 22, 2007, at 05:05 , Stephanie Troeth wrote:
> Working with some folks familiar with CMS issues, the point was  
> raised that it would make it easier on developers to continually  
> check if they are creating valid markup if validators allow  
> validation by snippet rather than a full document. As a developer  
> myself, I know my own team and I would find this very useful.

This is an interesting suggestion, because it brings back the history  
of the "direct input" feature. Those who have used the validator for  
many years may remember (better than I do) that it originally had a  
"fragment upload" feature, which was marked as highly experimental,  
and actually, didn't quite worked.

The feature was abandoned (it wasn't advertized any more, at least  
since early 2002) then brought back in 2005 with a twist: the only  
way to make it work was to copy-paste full documents.

I agree that there would be indeed a "social" benefit in making the  
fragment (or snippet) feature eventually happen:  it would make it  
easier for developers to check chunks of code. I don't know if it  
would be useful for people who create web pages, but it would for  
developers of libraries, frameworks, CMS, dynamic sites etc - and I  
reckon this is the way most of the "profesional" web is being  
authored today.

David made an interesting point: validity is indeed not just a matter  
of syntax, it's also a matter of context. It doesn't make the feature  
a bad idea, it just makes it harder to do well.

> Perhaps what is required for validation of snippets, is to  
> automatically wrap the contents of the input with a Doctype (that  
> the user chooses), dummy head content, <html> and <body> wrapper  
> tags for this option?

... and a <div>...</div> to accomodate for snippets with just inline  
elements. If the usage of the snippet feature were to trigger "show  
source" systematically, the validator could say: Ťok, I took your  
snippet and put it in the document shown below, and that document  
validatesť. side benefit: even someone with no understanding  
whatsoever of doctypes could just copy-paste the resulting markup,  
and have a perfectly valid document.

David's worry that [[
> I also suspect that this will lead to questions such as "these two  
> snippets validate fine, but when I put them together it doesn't  
> validate anymore. Is the validator broken??!?1".
]] is a valid one, but that just means that the output will have to  
make it clear that the snippet is not a valid document.


> I'm including a wireframe of a possible layout to facilitate this.  
> I'm not convinced it's the best layout, but it's probably a  
> workable one.

Thanks, it helps. A note on your notes:
> "make triangles toggle options just as the text label does"

Done.. somehow. After talking with a number of people, we decided  
that the toggling of options via scripting had too many usability  
issues to justify its inclusion. Notably: can't bookmark the view  
with options visible, arrow wasn't clickable, etc. We could probably  
have tweaked the toggle script further, but for now, going back to a  
two-page setup works just fine.

> Just one more small comment on the dev version: just by sight, the  
> blue link text on blue background and the white/blue combination of  
> the selected "tab" for each validation type may not pass contrast  
> tests for accessibility - but I'm sure you are already aware of this.

Yes, it was reported a couple of times already. I've made another  
attempt at making the UI more contrasty yesterday:
* made the text of the active tab dark gray (same text color as  
hovered tab)
   not really my taste, but easier to read
* tried using bold white text for links on the blue background
   is it better?

> I can't donate coding time for the moment, but if this feature is  
> implemented, I'm sure I can round up some testing effort.

I think the feature request is a good one, and I will record it in  
bugzilla, with a pointer to this thread. Its development, however, is  
a trickier question: the current dev version of the validator goes  
into feature freeze within a few days, with a few bugs left to fix  
before a beta testing.
so if someone wants to take this on now, or if all my bug fixes are  
done and I have a chance to have a go at it early next week, then it  
will go in 0.8.0, otherwise it will remain as an RFE up for the  
taking for the time being.

Thank you,
-- 
olivier
Received on Friday, 23 March 2007 02:39:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:24 GMT