A common use-case for UI components is to only update the UI state just
before the next frame is rendered, irrespective of how many times a
signal is fired within a given batch of operations.
The event subscriptions object allows these to be easily created and
tracked, and also makes it easier to ensure all subscriptions are cleaned
up at the end.
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
In order to improve the OT-ability of text and paragraph removal
with other operations, the merge behaviour has been extracted.
The logic for building up the necessary remove operations has
been encapsulated in TextController for now as all uses pass
through this point still.
* 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
Fixes a regression introduced in 8b742ee. The currentNode was being
incorrectly added to the results array before it was checked to see if
it was contained inside the supplied range.
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
When the supplied range is started within a rejected node, this
function will now start iteration just after the highest rejected
node. This brings the getNodeInRange filter behaviour inline with
existing PositionIterator logic.
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.
Oops. Empty objects were incorrectly being set as attributes with the
value "[object Object]", which would cause updateStyles to crash in
rather spectacular ways when setting the same text alignment multiple
times on a paragraph style that had an empty text properties obj.
By changing how boundaries are being checked, iteration
performance is boosted quite significantly for text node
retrieval.
* Replace @returns with @return in affected files
splitting boundaries.
Given the following selection <p>a[bcd]<span>efg</span></p> calling the
splitBoundaries at the moment moves the end point of selection to immediately after opening span <p>a[bcd<span>]efg</span></p>
this causes getTextElements (passing includePartial = true) to return
both "bcd" and "efg" which is incorrect.
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.
The type Runtime.ByteArray is removed. Uint8Array is used instead.
The more rigorous type checking is enabled by the flag --jscomp_error reportUnknownTypes.
To compile with this flag, build the target typecheck-target.
DomUtils.rangeIntersectsNode by using
DomUtils.rangesIntersect.
* Similarly clean up DomUtils.rangeContainsNode
using DomUtils.containsRange.
* Added various tests for range intersection.
This fixes issue #200 because now OpApplyDirectStyling
knows for which paragraphs it should fire
signalParagraphChanged.
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.
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.
testRead runs fine on Unix-like/Mac OS but not on Windows. Offset 27
returns 'e>Web' on Windows because line ending is changed by git to \r\n, thus 2 characters.
When splitting text nodes, a more stable point will need to be found
for the end point if the start point is split, as DOM modifications
can potentially cause the end point to be lost