Moving these checks into a node filter ensures it is only required
once per node, rather than once per node-position.
This results in a 60% improvement in position iteration speed.
The zip code has been refactored to ensure only a single GET request is
needed by the browser to load a document. This makes webodf slightly more
robust when loading documents as it avoids problems with the prior HEAD
request returning different file sizes, or even being unsupported by the
browser/server completely.
The current Zip implementation attempts to lazily load parts of the zip
file during decompression which is a good concept to preserve to allow
memory usage to be reduced in future. For now however, robustness of
file loading is more important.
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.
JSLint cannot parse this line:
l = 3 * l - [0, 0, 2, 1][padlen];
so, i've move [0, 0, 2, 1] to variable a and changed the line to
l = 3 * l - a[padlen];
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
The rounding direction constants in OdtStepsTranslator overlap with the
existing enum in core.StepsDirection. It makes sense to use that enum here
to specify rounding behaviour in converting DOM points to steps so the
constants have been removed and the enum has been substituted for all
usages.
Improves upon the existing reported string of "[Object object]". If the
object being serialised has recursive structures, the report string will
fall back to the previous implementation.
When navigating vi the up/down arrow keys, the user often wants to move
multiple lines in sequence (e.g., to visually place the caret in one of
the following lines). To stop the caret suddenly jumping to the left
side of the page when crossing an empty paragraph, the caret's X position
will be stored and re-used by subsequent up/down movement for up to 2s
after navigating by line.
Any other operations performed by the local user (e.g., cursor movement
to the left or right), or edit operations by collaborative users will
immediately clear the stored X position.
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.
Operation batches that modify a large number of paragraphs (or repeatedly
modify the same paragraph) can cause numerous unnecessary style change
events to be triggered. Rather than reporting these instantly, track them
as they occur and emit the style change summary on batch end.
Related to #610.
Deleting the caret before calling ensures there is no way for any external
sources to get access to the soon-to-be destroyed caret.
As part of tracking this down, scheduled tasks will now throw an error
if an attempt is made to trigger the task (either delayed or immediate)
after the particular instance has been destroyed.
This then showed that functions bound to browser events swallow errors
quietly, so additional logging was added to the EventManager delegation
code to ensure errors generated when processing an event are logged.
* remove @license tag (to prevent Closure compiler keeping the comment)
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released webodf.js
* separate license header by empty line from following content
Output from the headless Qt test runner is difficult to parse and
generally flows off screen very quickly. Appending the failed test names
makes it easier to troubleshoot which tests are problematic.
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
Having the caret and avatar display inside the cursor node causes text
wrapping and other element shifts to occur in some browsers (mainly FF)
due to there being layout impacts from the almost-but-not-quite 0-width
cursor element.
Moving to non-inline overlays for these bits of chrome allows the cursor
to be hidden completely.
TODO
This commit introduces a regression when composing text using an IME
as the overlay doesn't advance properly during composition.
Fixes#86
Manually processing the redraw tasks vastly affects the current benchmark
results, dwarfing impacts from most other subsystems. Disabling this for
now to aid tuning of non-UI components.
FF doesn't execute requestAnimationFrame requests before it's next
repaint, causing flickering when performing some types of updates
(e.g., recomputing Style2CSS). To workaround this, sometimes we force
animation callbacks to redraw ourselves at certain points.
This fixes issue #491 on Firefox
Using requestAnimationFrame ensures the callback is executed prior to
the next redraw, eliminating undesirable & highly visible flickers for
UI updates.
Fixes issue #491.
Style-related operations are slowly being moved towards px as the
default unit to improve consistency. Standardising getContentSize to
work in px rather than cm provides better re-use of CSSUnits as well.