37 Commits
Author SHA1 Message Date
Jos van den Oever b8ad5b3889 Upgrade to Closure Compiler 20150505.
We are now using our own copy of the externs to deal with differences
of opinion on best typing of types.
2015-06-01 08:53:35 +02:00
Philip Peitsch ad14efa800 Fix PositionIteration bug when first position is a rejected text node 2014-09-12 09:21:22 +10:00
Philip Peitsch e8ea129623 Fix setUnfilteredPosition to escape child text nodes of rejected parents
setUnfilteredPosition was incorrectly leaving the walker's currentNode
inside a rejected parent if the target node was a TEXT_NODE. Adjusted
branching logic to ensure the walker always moves to a valid position
if the specified position is not accepted by the current filters.

Fixes #797
2014-09-08 10:01:53 +10:00
Friedrich W. H. Kossebau 7f80e8e163 Normalize license headers of editor/benchmark/tests/firefox-addon/viewer source files
* remove @license tag, for consistency with library source files
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released stuff
* separate license header by empty line from following content
2014-06-02 17:49:46 +02:00
Friedrich W. H. Kossebau fa62c38767 remove no more needed returning of the class constructor at end of class files
runtime.loadClass(...) no longer expects that eval(fileContent) yields
the constructor, and a few loaded files rely on that (e.g. all singletons/namespaces),
so let's be consistent
2014-05-22 13:31:51 +02:00
Friedrich W. H. Kossebau 46d8dd224f Workaround for DOMParser.parseFromString problem on CI system 2014-05-13 19:07:58 +02:00
Philip Peitsch 06bf81c8c7 Start iteration after highest rejected parent in PositionIterator
New logic will move to the next accepted node after the highest
rejected parent rather than the lowest rejected parent.
2014-02-20 21:25:45 +11:00
Philip Peitsch 36f3e4f89f Avoid slow calls when updating StepsTranslator cache
unfilteredDomOffset is extremely slow under certain conditions, greatly
limiting the iteration speed. This patch eliminates all calls that would
trigger this slow call, improving iteration performance.

An additional advantage of this is that the adjusted logic now avoids
the somewhat messy logic that involved diving into the the container
and offset just in case the container's child was a paragraph as
well. By using isBeforeNode, the bookmark creator now knows that
the current node is fetched by getCurrentNode.
2014-02-20 21:24:41 +11:00
Jos van den Oever ed7270442f Remove loadClass calls from class files. The load system reads the dependencies from the manifest.json files now. 2014-02-07 15:38:09 +01:00
Friedrich W. H. Kossebau 6d099688fb Use NodeFilter.SHOW_ALL instead of value constant everywhere 2014-01-16 15:56:08 +01:00
Jos van den Oever 545c15fedb Add more type information to class UnitTester.
The names of the test functions are now passed separately from the function in
a structure. The reason for this is that Closure Compiler does not allow adding
additional fields to functions.
2013-11-26 16:55:00 +01:00
Jos van den Oever d4607cf63c Add documentation to PositionIterator. 2013-11-18 01:13:02 +01:00
Philip Peitsch 9ba2ac64cb Ensure all args are specified for createNodeIterator
IE10 considers all of these arguments required and will throw if any are
undefined.
2013-10-25 20:39:05 +11:00
Friedrich W. H. Kossebau c2a795e668 Update link to repo: now https://github.com/kogmbh/WebODF/ 2013-10-23 18:20:30 +02:00
Friedrich W. H. Kossebau 508570dab8 Add copy of the AGPL3 to sources (+ add to created zip files) 2013-10-21 17:55:16 +02:00
Philip Peitsch 4ba4eaf312 Ensure PositionIterator.setUnfilteredPosition has round-trip stability
Calling setUnfilteredPosition with a result previously obtained from the
iterator should effectively resume iteration at exactly this position.
As added tests demonstrated, specifying a node with no children and an
offset of 0 was incorrectly causing currentPos to be restored to the value
of 0. This meant calls to iterator.container() would return the a different
value.
2013-10-08 01:30:32 +11:00
Philip Peitsch 0727acf238 Jump to next valid position when setUnfilteredPosition is passed a child of an invalid parent
PositionIterator.setUnfilteredPosition API doc report that when given
a forbidden position, the iterator jumps to the next visible position.
Add code to cover a missed corner case if the container was a child of
a forbidden parent (or grand parent) node.
2013-09-24 18:10:31 +10:00
Jos van den Oever 64d57c96cf Fix issues exposed by latest JSLint. 2013-07-24 21:41:56 +02:00
Philip Peitsch f7cd9fe437 Allow position iterator to complete even if root is never reached 2013-07-15 09:40:50 +02:00
Philip Peitsch 402ae2a023 Removed PositionIterator.setPosition
PositionIterator.setPosition has been superseded by the unfiltered
variant for all use cases.
2013-07-03 21:52:40 +10:00
Philip Peitsch 84e79a983a Fix case where setUnfilteredPosition is passed an offset to a non-visible child
PositionIterator.setUnfilteredPosition must always set the current node to a
visible node.
2013-07-03 21:40:12 +10:00
Friedrich W. H. Kossebau 09b5d43f97 let's use NodeFilter.XXX constants instead of magic values 2013-07-02 22:31:02 +02:00
Philip Peitsch 4e0f4a0df4 Removed PositionIterator.offset and all references
PositionIterator exposes a myriad of confusing offsets. These are being
slowly retired where possible in an effort to reduce possible mis-use
and confusion.
2013-07-02 21:31:29 +02:00
Philip Peitsch ea8c135546 PositionIterator.setUnfilteredPosition automatically advances to the next valid position
This makes the result of next & previous always a node that will pass
the filter. Previous implementations could return entirely unexpected
nodes

* Corrected module load order for tests
2013-06-19 16:58:13 +02:00
Philip Peitsch 4ab30523c0 Modified cursor movement to remove the need to adapt position iterators 2013-06-19 13:43:46 +02:00
Friedrich W. H. Kossebau 55fc7ab9c6 Switch code to use Node.${XXX}_NODE instead of magic values 2013-06-17 13:49:07 +02:00
Philip Peitsch ff4033be4b OdtDocument.getDistanceFromCursor expects filtered offsets
* Fixed api comments incorrectly claiming unfiltered offsets
2013-06-12 11:00:01 +02:00
Jos van den Oever 0b08f50e1b Split text nodes completely. 2012-11-09 18:12:22 +01:00
Jos van den Oever a26ceb6fb9 Add test that checks iterating over a DOM with neighboring text nodes. 2012-11-09 18:02:30 +01:00
Tobias Hintze 758333d210 update "@source:" references to gitorious.org/webodf
(as in master: de1a79c36f)
2012-10-21 12:18:15 +02:00
Jos van den Oever 3e3de5be29 Fix failing PositionIteratorTests. 2012-10-03 15:28:01 +02:00
Jos van den Oever 566749728e Get avatar to move somewhat along with the caret. 2012-08-28 22:19:58 +02:00
Jos van den Oever 98bc24d7bc Fix PositionIterator to handle empty text nodes. 2012-08-26 17:59:15 +02:00
Jos van den Oever e6611afe38 Fix more tests. 2012-08-25 00:04:58 +02:00
Jos van den Oever 7c2540fa61 Add more tests. 2012-08-24 22:44:37 +02:00
Jos van den Oever 27a0c2a614 Adapt tests in PositionIteratorTests and fix PositionIterator so they pass. 2012-08-24 21:52:24 +02:00
Jos van den Oever a75a4432a3 Change to use PositionIterator instead of PointWalker.
This class still needs to be implemented.
2012-08-24 18:05:20 +02:00