r101542 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101541‎ | r101542 | r101543 >
Date:22:13, 1 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added some comments about expected behavior for prepareRemoval
Modified paths:
  • /trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/lib/hype/models/es.DocumentModel.js
@@ -908,6 +908,16 @@
909909 /**
910910 * Generates a transaction which removes data from a given range.
911911 *
 912+ * When removing data inside an element, the data is simply discarded and the node's length is
 913+ * adjusted accordingly. When removing data across elements, there are two situations that can cause
 914+ * added complexity:
 915+ * 1. A range spans between nodes of different levels or types
 916+ * 2. A range only partially covers one or two nodes
 917+ *
 918+ * To resolve these issues in a predictable way the following rules must be obeyed:
 919+ * 1. Structural elements are retained unless the range being removed covers the entire element
 920+ * 2. Elements can only be merged if they are of the same time and share a common parent
 921+ *
912922 * @method
913923 * @param {es.Range} range
914924 * @returns {es.Transaction}

Status & tagging log