The returned object from the applied styles calculation did not have
specific type information for Closure Compiler so I have added some
typedefs that describe the returned object.
* 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
When first created, the text style applicator used to move nodes around
within the first while loop, often modifying the limiting range in ways
that were not expected.
In 5a86bdd, this behaviour was re-written to gather all the relevant
nodes and migrate them once all siblings in the container were checked.
With this change, it is now best to use the range once again, as this
avoids additional problems (see the modified test) with new children
being added within the range if new styling containers are inserted.
When direct formatting, often extremely similar (if not identical) style
hierarchies are being continually retrieved. Allowing external consumers
to provide a limited-life cache vastly speeds up the lookup for this data.
- moved getAllStyleNames from Formatting to ObjectNameGenerator
- renamed StyleNameGeneratorTest to ObjectNameGeneratorTest and added a couple of more unit tests
If the text node being considered was the 3rd child node (or later)
and the 1st node in the container was an unstyled text node, the
domUtils.rangeContainsNode check could incorrectly report the
parent container as suitable for re-use.
Usually the limits for a selection reference the first or last
text nodes. When the first text node is migrated to a new styled span,
the range limits will suddenly not include the following siblings that
should also be migrated. This causes moveToNewSpan to produce more
spans than necessary.
This ensures if the text node is within a non-stylable
element, the applicator first wraps the text in a container that can be
styled. This change will have no impact if the text is already in a
text:span as it usually is. This also ensures text properly styles
text:a content.
Note, the styling behaviour within text:a differs from LO significantly.
LibreOffice actually splits the bar text:a into multiple elements.
e.g.,:
<text:a>http://</text:a><text:span><text:a>webodf.org</text:a></text:span>
This patch will perform this styling as:
<text:a>http://<text:span>webodf.org</text:span></text:a>
* Add a highlighting and therefore a connector regardless of the
presence of annotation-end.
* Some :before css to render an arrowhead of the connector
via CSS
*Refactoring: Move common functions from TextStyleApplicator to DomUtils
and OdfUtils.
*Allow application of 'gui' style (with an annotation: namespace) in
TextStyleApplicator and Formatting.
*More CSS for annotations.
*Make OdfCanvas handle annotations.
Add an annotation:connector element to the highlight span for a dotted
line
OpApplyStyle was incorrectly assuming the common ancestor of
the selection range was a container, and could never be a text
node
* Added support for office:automatic-styles to operation tests
Applying a direct style to a range will result in new
automatic styles being created for each unique style
block with the desired text properties.
Formatted text is contained within a span element just
above each text node that is within an ODF container
element.
TODO
* Styles should be validated before being applied
* Empty spans should be removed when modifying styles