Page MenuHomePhabricator

Special:Import sets unused attribute in form input
Closed, InvalidPublic

Description

Author: jowens.wiki

Description:
I noticed that in the Special:Import page, the input for the file looks like this:

<input type='file' name='xmlimport' value='' size='30' />

but according to the HTML specs (
http://www.w3.org/TR/html401/interact/forms.html#adef-size-INPUT ), the size
attribute only applies to the text and password input types.
If there's some particular buggy browser out there that requires a size for a
file input, I suppose this should stay, since decent browsers will ignore it
anyway. But if it's not needed by any browser, it should go away.
It's in includes/SpecialImport.php, line 85 (as of 1.5beta4).


Version: 1.5.x
Severity: minor
OS: FreeBSD
Platform: PC

Details

Reference
bz3125

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 8:47 PM
bzimport set Reference to bz3125.
bzimport added a subscriber: Unknown Object (MLST).

Reread the spec. size attribute is valid for any type of <input> element.

jowens.wiki wrote:

So we really want a tiny 30 pixel wide filename input? I know on my Firefox
1.0.6 I get an input 110px wide anyway, and that's not enough really.

avarab wrote:

(In reply to comment #2)

So we really want a tiny 30 pixel wide filename input?

The report was that the size attribute was invalid and shouldn't be used, the
value of that attribute is another issue.

Most probably the w3c spec forgot the that <input> with the 'file'
type also 'almost' use character size for the width.

Sample test:
1width:<input type='file' size='1' /><br>
2width:<input type='file' size='2' /><br>
30width:<input type='file' size='30' /><br>
31width:<input type='file' size='31' /><br>
800width:<input type='file' size='800' />

Render the same under linux firefox and win32 ie6.

Now if you find that the W3C is wrong or that browser does not render
stuff correctly send them a bug report.

Closing bug.