LibreOffice does not recognize px dimensions for image frames,
despite the spec allowing it. To play safe, always convert the
dimensions into centimeters before inserting the image.
This patch comes with a new ImageControllerTests.js.
This prevents the user from clicking on URIs starting with `javascript:` or `data:`. The reason behind this is that this may be used to trick users in executing dangerous JS when viewing an untrusted document. (which is the case in our deployment for ownCloud)
I'm not absolutely happy with that patch since it uses a blacklisting instead a whitelisting approach, but I consider it a feasible approach. Especially, considering all the possible values. (`mailto:foo@bar.com`, `ftp://`, `skype://`, etc...)
Conflicts:
ChangeLog.md
As per design discussed in issue #816. Extracting this into a separate
view makes it optional for consumers to use (or potentially further
customize).
Fixes#816.
Adjusting the selected range in the event trap can trigger a new focus
event under some conditions. Prevent this from going into an infinite
loop by ignoring new focus events that arise while currently processing
a focus event.
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.
Transformed all read-only uses to use node.getElements*. Any loop that
immediately modifies the nodes in the list has been updated to use the
DomUtils.getElements* version.
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.
The internal state is reset immediately so any external calls to disabled
features will be correctly disabled. Delaying the signal however ensures
processing of groups of operations remains performant.
Line ending detection was relying on wrapping occurring near or in a block
of collapsed whitespace. When wrapping occurs between two elements, both
previous and next rectangles may be defined, though the vertical overlap
will be absent.
This function only redirected to the OdfUtils version and many callers
already had an existing instance of OdfUtils to use. Any callers who did
not have an instance of OdfUtils now create one to continue using the
function.
Removing layers of timeouts in the CaretManager mean the caret no longer
flickers badly when transitioning between large and small sizes.
See PR #369 for details about why this workaround was put in originally.
The Caret itself already has logic to only perform expensive updates once
per redraw. There is no performance gained by CaretManager duplicating
this logic as well.
In addition, bind to any processing batch end. This is because any
type of edit may cause the caret to be pushed off screen including
adding annotations, splitting paragraphs, deleting text, modifying a
paragraph style etc. the most straightforward way to ensure the caret is
up-to-date is to check it's visibility on every edit operation.
Fixes#765
Though the caret visibility may be set to hidden, the caret still has
a client rectangle that can be accessed. It is important to keep this
up-to-date so the scrollIntoView logic works on a range selection even
when blinkOnRangeSelect is false.
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.
This removes the option to provide a rounding predicate to decide whether
to round up or down from the convertDomPointToCursorStep method. It is replaced
with an enum that specifies whether to round up or down. The predicate was
removed as all callers supplied the same function to indicate they wanted
round up behaviour and this predicate was being duplicated.
The rounding parameter is optional and defaults to rounding down to the
previous step which is the same as before this commit.
Simplifies the caret class, and allows more exotic view configurations
to be inserted without breaking core code.
As a bonus, the new Viewport class is able to scroll arbitrary
rectangles into view.