Last modified: 2013-06-05 16:01:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T35274, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33274 - Inputs miss type="text" attribute
Inputs miss type="text" attribute
Status: NEW
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.18.x
All All
: Normal normal with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-20 14:50 UTC by Subfader
Modified: 2013-06-05 16:01 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Subfader 2011-12-20 14:50:44 UTC
Text inputs on special pages miss the type="text" attribute.

I didn't search for all special pages with text inputs, but here some examples:

* http://www.mediawiki.org/wiki/Special:FilePath
* http://www.mediawiki.org/wiki/Special:AllPages
* http://www.mediawiki.org/wiki/Special:ExpandTemplates

This is bad as soon as you want to style text inputs with CSS (e.g. border, padding font/size) since you'd have to exclude all other inputs in forms and fieldsets (submit, cancel, search etc.).
Comment 1 Subfader 2011-12-20 14:51:37 UTC
Same for text inputs in the user preferences!
Comment 2 Bawolff (Brian Wolff) 2011-12-21 06:40:57 UTC
At the moment our HTML class intentionally strips out type="text" if specified (So if you see type="text" anywhere, you're looking at something generated by legacy code)  I suppose it could be changed to force use of type="text" when type is unspecified.
Comment 3 Krinkle 2011-12-29 10:17:36 UTC
Too bad CSS selects based on the given attributes not the interpreted values. (since type defaults to "text" in browsers).
Comment 4 Krinkle 2011-12-29 10:18:28 UTC
Sounds like a good idea to normalize the type attribute to always be specified in HTML. Why was the HTML class stripping it out, to save a pair of bytes in output ?
Comment 5 Bawolff (Brian Wolff) 2011-12-29 11:00:04 UTC
>Why was the HTML class stripping it out, to save a pair of bytes in
>output ?
Looks like. (For reference, its r55905). It removes the default attributes for many elements, not just input.
Comment 6 Subfader 2011-12-29 14:51:25 UTC
Feel free to rename this bug report
Comment 7 Aryeh Gregor (not reading bugmail, please e-mail directly) 2012-01-01 15:25:16 UTC
You can use "input[type=text], input:not([type])" to find text inputs even if the type attribute is omitted.  This doesn't work in IE7 or IE8, though, which input[type=text] does, and that's 25% of Wikimedia's traffic <http://stats.wikimedia.org/archive/squid_reports/2011-10/SquidReportClients.htm>.  Both forms do work in IE9 and higher, and any interesting version of any other browser.

Given IE's plummeting market share (<35% on Wikimedia!), I don't think we need to re-add the attributes for this use-case.  But if people do want to, it would be simple enough to change the class so that they're always present instead of never present.
Comment 8 Krinkle 2012-01-01 15:48:01 UTC
(In reply to comment #7)
> You can use "input[type=text], input:not([type])" to find text inputs even if
> the type attribute is omitted.  This doesn't work in IE7 or IE8, though, which
> input[type=text] does, and that's 25% of Wikimedia's traffic
> <http://stats.wikimedia.org/archive/squid_reports/2011-10/SquidReportClients.htm>.
>  Both forms do work in IE9 and higher, and any interesting version of any other
> browser.
> 
> Given IE's plummeting market share (<35% on Wikimedia!), I don't think we need
> to re-add the attributes for this use-case.  But if people do want to, it would
> be simple enough to change the class so that they're always present instead of
> never present.

I disagree, this makes stylesheets more unreadable and ugly. Leaving parts out of the HTML just to save a little bit of bandwidth, only to make styling the parts counter intuitive.
Comment 9 Krinkle 2012-01-01 15:48:24 UTC
Not to mention that there is no fallback for < IE9.
Comment 10 Subfader 2012-01-01 15:49:16 UTC
Agreed. Dirty workarounds should be avoided, esp. for such trivial things.
MW should output proper HTML instead.
Comment 11 Subfader 2012-01-01 15:50:16 UTC
And it doesn't save much ressources with standard gzip html compression
Comment 12 Krinkle 2012-01-01 15:55:36 UTC
On the other hand, we should really be using classes for styling. For example, Smartere and GitHub use classes somewhat like the following:
* button (any button, can be used in JS env on a <div> as well as on <a>, <input>, <button>)
* button-row
* button-primaryAction (emphasized in a group of buttons)
* button-positiveAction (add, save, publish, ..)
* button-negativeAction (delete, remove, ..)

Anyway, that's for later.
Comment 13 Jamie Thingelstad 2013-06-05 16:01:31 UTC
We recently hit this bug in some work creating a custom skin and working with Semantic Forms. The text attribute being stripped out caused a lot of confusion until we tracked it down in the code. This behavior should be changed to help out skin developers, especially when adapting existing CSS frameworks (like Foundation) to work well with MediaWiki.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links