Last modified: 2010-06-03 15:26:24 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 T25733, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23733 - Add IDs to messages used on css/js pages
Add IDs to messages used on css/js pages
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 22771
  Show dependency treegraph
 
Reported: 2010-05-31 16:34 UTC by Umherirrender
Modified: 2010-06-03 15:26 UTC (History)
3 users (show)

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


Attachments

Description Umherirrender 2010-05-31 16:34:32 UTC
Please add a class to:
* Usercssjsyoucanpreview
* Userjsyoucanpreview
* Usercssyoucanpreview
* Userinvalidcssjstitle
* Clearyourcache

So user can add styles to this information. Thanks.
Comment 1 Happy-melon 2010-05-31 17:01:21 UTC
Should be IDs, not classes, as these messages only appear once per page.
Comment 2 Raimond Spekking 2010-06-01 07:47:16 UTC
Why IDs? Mostly classes are used in core for $wgOut->wrapWikiMsg( "<div class=...

I would like to keep classes for consistency.
Comment 3 Happy-melon 2010-06-01 08:47:32 UTC
Just because we've been doing it badly in other places doesn't mean we should continue to do so in new code.  IDs should be used to identify individual objects; classes should be used where the same styles need to be applied to multiple places in a document or site.  That is the paradigm around which the scripts and browsers we use are based: an individual object identified by an ID can be accessed much more efficiently by JS using getElementById(), for instance, while there is no native implementation of getElementsByClass(); we have our own inefficient implementation, but it doesn't work particularly well or have good cross-browser support.
Comment 4 Raimond Spekking 2010-06-02 19:31:39 UTC
IDs added with r67230.
Comment 5 Niklas Laxström 2010-06-03 05:19:58 UTC
(In reply to comment #3)
> IDs should be used to identify individual objects;

In general yes, but how do you know what is going to appear only once in the future?
Comment 6 Happy-melon 2010-06-03 09:15:52 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > IDs should be used to identify individual objects;
> 
> In general yes, but how do you know what is going to appear only once in the
> future?

By making a common-sense judgement about what type of objects they are: namely, warnings which appear in one particular situation and have absolutely no reason to appear more than once per page.  In the very unlikely event it becomes multi-present in the future then it can be changed to a class; any scripts accessing it in the assumption that it's singular will need to be updated anyway.
Comment 7 Niklas Laxström 2010-06-03 11:52:37 UTC
Scripts like CSS styles? We are already having multiple edit-areas due to ajax and other stuff, so I wouldn't see it highly unlikely that some warnings may appear multiple times in one page.
Comment 8 Happy-melon 2010-06-03 15:26:24 UTC
If the style is "display:none because it annoys me when I see it in-situ", then yes, it probably is appropriate for that stance to be reevaluated if it starts appearing in places other than where it was previously expected.  If the script is "getElementById() so I can attach something else around it", then that process *definitely* needs to be reevaluated if we start displaying more than one.  We can't magically break things only when they're supposed to be broken, or we wouldn't call it breakage :D  Besides, what we're calling "breakage" here is, in most cases, the need to change a dot to a hash; hardly a fundamental rewrite...

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


Navigation
Links