This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 4342 - Revalidation form for Upload and Direct Input
Summary: Revalidation form for Upload and Direct Input
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: Templates (show other bugs)
Version: HEAD
Hardware: All All
: P3 enhancement
Target Milestone: 0.8.2
Assignee: Brett Bieber
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-22 04:14 UTC by Olivier Thereaux
Modified: 2008-12-01 03:03 UTC (History)
1 user (show)

See Also:


Attachments
template patch for bug 4342 (3.89 KB, patch)
2007-09-05 02:20 UTC, Brett Bieber
Details

Description Olivier Thereaux 2007-02-22 04:14:22 UTC
At the moment only the "By URI" validation method has, in the results page, a form to revalidate the document online.

It was suggested that:
- for "direct input", the form could be given too, with the textarea pre-filled with the given data (properly escaped)

- for "file upload", the form could be given, with an empty file field and a note that it has to be set again.
Comment 1 Olivier Thereaux 2007-04-04 04:08:07 UTC
Won't make it for 0.8.0.
Maybe for a 0.8.x
Comment 2 Brett Bieber 2007-09-05 02:20:00 UTC
Created attachment 484 [details]
template patch for bug 4342

A couple changes, always populate the file source, and always show the encoding and doctype dropdowns. One possible problem is the content within the textarea has an added newline character to the last line -- usually not a problem.
Comment 3 Olivier Thereaux 2007-09-05 08:30:03 UTC
(In reply to comment #2)
> Created an attachment (id=484) [edit]
> template patch for bug 4342

Excellent! Your patch looks good, I applied it a few minutes ago.
(I'm "giving" the bug to you ;) as a result)
 
> A couple changes, always populate the file source

I made a little patch to this, to not pass the file source to the template object if not needed (so as to save a bit of proc/memory footprint).

One thing that surprised me in your implementation is that you give the source as direct input even in the case of file upload. Was this a deliberate choice?

I guess it would make sense from usability perspective, since at least a textarea can be pre-filled with the content while a file upload control could not. It just might be a little surprising, and I can imagine some hairy issues (related to XML detection or charset), but this may be a good compromise nevertheless.

Working in this area could also be an opportunity to clean up the usage of $File->{'Is Upload'} and $File->{'Direct Input'}. I can't understand why the former is TRUE when the input mode actually is "Direct input". 
Comment 4 Brett Bieber 2007-09-05 20:00:43 UTC
(In reply to comment #3)
> I made a little patch to this, to not pass the file source to the template
> object if not needed (so as to save a bit of proc/memory footprint).

Ahh yes, very good.
 
> One thing that surprised me in your implementation is that you give the source
> as direct input even in the case of file upload. Was this a deliberate choice?

Not deliberate... but the 'File Upload' results page suffers from the same problem Alastair McKenzie noted, no easy way to re-validate the file.

> I guess it would make sense from usability perspective, since at least a
> textarea can be pre-filled with the content while a file upload control could
> not. It just might be a little surprising, and I can imagine some hairy issues
> (related to XML detection or charset), but this may be a good compromise
> nevertheless.

This may be the best compromise --- I find copying and pasting the content easier than a file choosing window, but I'm sure some will want the file upload interface again. We could provide a file input to choose the file again...? 

> Working in this area could also be an opportunity to clean up the usage of
> $File->{'Is Upload'} and $File->{'Direct Input'}. I can't understand why the
> former is TRUE when the input mode actually is "Direct input". 
> 

Right, this is somewhat confusing, and even now on file upload results the <th> left of the textarea states "Direct Input" instead of "File" (regression?).

Hard to predict what people will find more useful, a textarea populated with the content or a blank file input. I suspect most users would expect a input for file upload --- and then complain that it wasn't automatically populated with the file they chose in the previous screen.   :-)
Comment 5 Olivier Thereaux 2007-09-11 05:17:05 UTC
(In reply to comment #4)
> Not deliberate... but the 'File Upload' results page suffers from the same
> problem Alastair McKenzie noted, no easy way to re-validate the file.
> 
> Hard to predict what people will find more useful, a textarea populated with
> the content or a blank file input. I suspect most users would expect a input
> for file upload --- and then complain that it wasn't automatically populated
> with the file they chose in the previous screen.   :-)

Right. I actually think that most people would be happier with a pre-filled textarea than an empty file input, but I'm  always wary of pretending to know what people want. If people are using file upload in the first place, maybe they prefer file upload...

For now, I think I want to clean up the $File->{'Is Upload'} and $File->{'Direct Input'} mess, and survey the list for opinions (knowing full well that the list is not entirely representative of all the users, but that's a pool of users nonetheless). Then we can decide which way to go. 

Delaying the 0.8.2 release a few days for this won't be too much of an issue.
Comment 6 Olivier Thereaux 2007-09-11 05:19:10 UTC
I also modified the template to use the POST method when revalidating through the textarea. Doing this with GET would be problematic.
Comment 7 Olivier Thereaux 2007-09-12 06:16:13 UTC
(In reply to comment #5)
> For now, I think I want to clean up the $File->{'Is Upload'} and
> $File->{'Direct Input'} mess

Done in CVS. In Upload mode the form shows a file upload control, in direct input, it shows the source in a textarea. I'll post something to survey for opinions/ideas.
Comment 8 Brett Bieber 2007-09-12 13:37:04 UTC
Thanks Olivier.. everything looks great. Feel free to close when you're ready, otherwise I'll wait for feedback to your post on the list - then close when a consensus is reached.
Comment 9 Olivier Thereaux 2007-10-03 08:19:36 UTC
Seeing no objection (no opinion at all actually) for now on the mail thread, I'll close this. Let's revisit when/if the public release provides us with more feedback.