From 7adcb81e4f83f98c468889aaa5a85558ba88c770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 25 Jan 2016 17:45:33 +0100 Subject: Initial commit --- sources/core/dom/iterator.js | 565 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 565 insertions(+) create mode 100644 sources/core/dom/iterator.js (limited to 'sources/core/dom/iterator.js') diff --git a/sources/core/dom/iterator.js b/sources/core/dom/iterator.js new file mode 100644 index 00000000..99491218 --- /dev/null +++ b/sources/core/dom/iterator.js @@ -0,0 +1,565 @@ +/** + * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or http://ckeditor.com/license + */ + +/** + * @ignore + * File overview: DOM iterator which iterates over list items, lines and paragraphs. + */ + +'use strict'; + +( function() { + /** + * Represents the iterator class. It can be used to iterate + * over all elements (or even text nodes in case of {@link #enlargeBr} set to `false`) + * which establish "paragraph-like" spaces within the passed range. + * + * //

[foo

bar]

+ * var iterator = range.createIterator(); + * iterator.getNextParagraph(); // h1 element + * iterator.getNextParagraph(); // p element + * + * //