r91926 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91925‎ | r91926 | r91927 >
Date:23:40, 11 July 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Prevent re-measuring in cases where the content has not changed since last measurement.
Modified paths:
  • /trunk/parsers/wikidom/lib/es/es.TextFlow.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js
@@ -355,10 +355,12 @@
356356 start = middle;
357357 }
358358 } while ( start < end );
359 - // Final measurment
360 - ruler.innerHTML = this.escape(
361 - this.content.substring( this.boundaries[offset], this.boundaries[start] )
362 - );
 359+ // Final measurement if start isn't at middle
 360+ if ( start !== middle ) {
 361+ ruler.innerHTML = this.escape(
 362+ this.content.substring( this.boundaries[offset], this.boundaries[start] )
 363+ );
 364+ }
363365 return { 'end': start, 'width': ruler.clientWidth };
364366 };
365367
@@ -397,7 +399,9 @@
398400 start = middle;
399401 }
400402 } while ( start < end );
401 - // Final measurement
402 - ruler.innerHTML = this.escape( this.content.substring( offset, start ) );
 403+ // Final measurement if start isn't at middle
 404+ if ( start !== middle ) {
 405+ ruler.innerHTML = this.escape( this.content.substring( offset, start ) );
 406+ }
403407 return { 'end': start, 'width': ruler.clientWidth };
404408 };

Status & tagging log