r105212 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105211‎ | r105212 | r105213 >
Date:20:08, 5 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed misnamed method, and off by one issue when getting content data from a document
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js
@@ -618,7 +618,7 @@
619619 * @method
620620 * @param {es.DocumentModelNode} node Node to get element data for
621621 */
622 -es.DocumentModel.prototype.getContentDataFromNode = function( node ) {
 622+es.DocumentModel.prototype.getElementDataFromNode = function( node ) {
623623 var length = node.getElementLength();
624624 var offset = this.getOffsetFromNode( node );
625625 if ( offset !== -1 ) {
@@ -652,7 +652,9 @@
653653 }
654654 var offset = this.getOffsetFromNode( node );
655655 if ( offset !== -1 ) {
656 - offset++;
 656+ if ( node.type !== 'document' ) {
 657+ offset++;
 658+ }
657659 return this.data.slice( offset + range.start, offset + range.end );
658660 }
659661 return null;

Status & tagging log