r87938 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87937‎ | r87938 | r87939 >
Date:23:03, 12 May 2011
Author:krinkle
Status:resolved
Tags:
Comment:
Remove unneeded parens in $.compareObject; Fix addCSS QUnit test for IE6 which puts spaces between commas..
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)
  • /trunk/phase3/resources/test/unit/mediawiki.util/mediawiki.util.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/test/unit/mediawiki.util/mediawiki.util.js
@@ -25,7 +25,9 @@
2626 same( a.disabled, false, 'property "disabled" is available and set to false' );
2727
2828 var $b = $('#bodyContent');
29 - equals( $b.css('background-color'), 'rgb(170, 255, 170)', 'Style color matches.' );
 29+ var match = $b.css('background-color').match(/rgb\(170,\s*255,\s*170\)/);
 30+ ok( match && match.length === 1, 'Style color matches.' );
 31+
3032
3133 });
3234
Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -57,10 +57,10 @@
5858 compareObject : function( objectA, objectB ) {
5959
6060 // Do a simple check if the types match
61 - if ( typeof( objectA ) == typeof( objectB ) ) {
 61+ if ( typeof objectA == typeof objectB ) {
6262
6363 // Only loop over the contents if it really is an object
64 - if ( typeof( objectA ) == 'object' ) {
 64+ if ( typeof objectA == 'object' ) {
6565 // If they are aliases of the same object (ie. mw and mediaWiki) return now
6666 if ( objectA === objectB ) {
6767 return true;
@@ -71,8 +71,8 @@
7272 // Check if this property is also present in the other object
7373 if ( prop in objectB ) {
7474 // Compare the types of the properties
75 - var type = typeof( objectA[prop] );
76 - if ( type == typeof( objectB[prop] ) ) {
 75+ var type = typeof objectA[prop];
 76+ if ( type == typeof objectB[prop] ) {
7777 // Recursively check objects inside this one
7878 switch ( type ) {
7979 case 'object' :

Follow-up revisions

RevisionCommit summaryAuthorDate
r87970comparing colors cross-browser is Aweful. Turns out Opera normalizes to hexid...krinkle12:43, 13 May 2011
r87988Looks like even margin-top isn't save due to box model differences (ie. becom...krinkle15:28, 13 May 2011

Status & tagging log