Commit Graph
2439 Commits
Author SHA1 Message Date
Aditya Bhatt 30d2d6dda6 Disable JSCoverage and it's building in OS X.
The development toolchain that comes with Mavericks
does not play well with compiling JSCoverage -- which is
unmaintained anyway.

Till we move to a better test coverage tool, we should
disable it therefore people on OS X can compile WebODF.
2013-11-20 00:42:47 +01:00
Aditya Bhatt 623284541e Merge pull request #196 from peitschie/annotation-selection-fix
Allow for sub-pixel rounding in client rects when detecting unscaled ranges
2013-11-19 15:40:58 -08:00
Philip Peitsch 272600d801 Allow for sub-pixel rounding in client rects when detecting unscaled ranges 2013-11-20 10:31:52 +11:00
Aditya Bhatt b7ef364a8c Merge pull request #193 from kossebau/renameAnnotationManager
Rename AnnotationManager to AnnotationController
2013-11-19 15:30:41 -08:00
Friedrich W. H. Kossebau 248e35ad8b Rename AnnotationManager to AnnotationController
also call do not call AnnotationViewManager objects not annotationManager
2013-11-19 19:56:15 +01:00
Aditya Bhatt a73cecc95d Merge pull request #190 from peitschie/undo-shadow-cursor
Re-add the shadow cursor's selection overlays on document undo
2013-11-19 04:43:34 -08:00
Philip Peitsch da9d6ac006 Re-add the shadow cursor's selection on document undo
This is an interm fix until a "grown-up" undo stack arrives.

The current undo implementation for single user replaces the document
content, which causes OdfCanvas to entirely clear and replace all
children in the parent element.

Most overlays are unaffected as they are re-added when the cursor is
redraw. The shadow cursor is not an added cursor however, and so after
an undo it stops functioning.
2013-11-19 23:36:52 +11:00
Philip Peitsch 6c7ef6a423 Add virtual selection overlays to the same parent as the annotations view
Virtual selection overlays were being added to the office:document
element. This is inconsistent with most other non-document UI overlays.
2013-11-19 23:35:49 +11:00
Friedrich f59edf5b6d Merge pull request #156 from peitschie/ie10-patchset3
More IE10 compatibility fixes
2013-11-19 04:10:23 -08:00
Philip Peitsch c1a8a41077 Hide range vs node BCR logic inside DomUtils 2013-11-19 20:25:17 +11:00
Philip Peitsch f0f30d0fab Use Range constants for START_TO_* and END_TO_* 2013-11-19 20:25:17 +11:00
Philip Peitsch d5e46b083b Ensure Node.insertBefore is called with null, not undefined (IE compatibility) 2013-11-19 20:25:17 +11:00
Philip Peitsch 381f622373 Detect IE10's buggy range client rects for an empty node
IE reports 0 client rects for an empty element, even if the
element has pre-specified fixed dimensions.

As part of this, a more advanced quirk detection system has been put in
place to make these easier to track.
2013-11-19 20:25:17 +11:00
Philip Peitsch 571bb6366e Bind window-related events on direct element as well (IE compatibility)
These events will not bubble up to the window if consumed by the canvas
element.
2013-11-19 20:25:17 +11:00
Philip Peitsch b5f848861e Restore focus to canvas without clearing selection in IE10
This also requires the next focus event to be suppressed after modifying
the selection
2013-11-19 20:25:17 +11:00
Philip Peitsch 02113bfcf9 Ensure all arguments are passed to the tree walker (IE compatibility) 2013-11-19 20:25:17 +11:00
Philip Peitsch 8bf0740bc3 Don't use text nodes as tree-walker roots (IE compatibility)
IE10 will throw an exception if the root passed
into a tree walker is a text node.
2013-11-19 20:25:17 +11:00
Philip Peitsch 7941fd3d2d Replace references to non-standard Range.comparePoint
Range.comparePoint is unsupported by IE10
2013-11-19 20:25:17 +11:00
Jos van den Oever b78b526e71 Merge pull request #184 from peitschie/cold-start-perf
Improve document loading and position iteration speeds
2013-11-19 01:23:13 -08:00
Philip Peitsch 35b7096697 Use local variables for commonly accessed globals
On Chrome & WebKit based browsers, looking up constants on
the Node and NodeFilter classes are extremely expensive. To
avoid this, these are cached for local use in places that have
very large, tight loops.

* Don’t ask for currentNode multiple times when possible
2013-11-18 23:41:16 +11:00
Philip Peitsch 3c7eabb1cd Reduce GC load by batching calls to String.fromCharCode
Though string concatenation is theoretically faster, in practice
the myriad of calls to String.fromCharCode still seems to create
a lot of waste and cause more GC cycles. Batching these up using
an array and String.fromCharCode.apply produces roughly a 30%
speed-up in most browsers when loading the 1000page.odt document.

Results from benchmark, 1000page.odt:

Chrome 31.0.1650.48
Before: 1953ms
After:	1450ms

Safari 6.1 (7537.71)
Before: 1670ms
After:	1374ms

Firefox 25.0
Before: 2056ms
After:	1722ms
2013-11-18 23:37:27 +11:00
Jos van den Oever 8e35d5f002 Add more documentation to PositionIterator. 2013-11-18 09:43:17 +01:00
Jos van den Oever d4607cf63c Add documentation to PositionIterator. 2013-11-18 01:13:02 +01:00
Friedrich W. H. Kossebau 09520a0c3c change "shadowed"/"shadowing" to "overruled"/"overruling"
as proposed by Aditya offline
2013-11-16 00:25:05 +01:00
Aditya Bhatt 1875ef27bc Merge pull request #183 from kossebau/fixOtOnMoveCursorWithNegativeSelectionLength
Fix OT with MoveCursor op with negative selection length
2013-11-15 09:32:28 -08:00
Friedrich W. H. Kossebau a2a30ab455 Log more details on errors in core.UnitTestRunner.areNodesEqual 2013-11-15 18:15:38 +01:00
Friedrich W. H. Kossebau 69b8fe23d5 Fix lots of OT for MoveCursor (semantics of position & length were misunderstood) 2013-11-15 18:15:38 +01:00
Aditya Bhatt cbb1bb4eaf Merge pull request #181 from kossebau/supportDirectTextStylingOT
Support direct text styling in collab mode
2013-11-15 06:51:14 -08:00
Friedrich W. H. Kossebau 7ed71d4825 Add TransformerTests (to test directly resulting opspecs, not execution consistency)
Useful for ApplyDirectStyling vs. ApplyDirectStyling, as that in the current
simple implementation will result in inconsistent DOMs (e.g. names of automatic styles)
2013-11-15 15:30:32 +01:00
Friedrich W. H. Kossebau db0ecac6ee Make directTextStyler no longer optional, now that it works also in collab mode 2013-11-15 15:30:32 +01:00
Friedrich W. H. Kossebau c75c407c56 Extend OT matrix with methods for op "ApplyDirectStyling" 2013-11-15 15:30:32 +01:00
Friedrich W. H. Kossebau 25fc86e12f In OperationTransformMatrix.js move all utility methods before the real transformation methods 2013-11-15 15:30:32 +01:00
Friedrich W. H. Kossebau 6b1b2bcbcb Fix encoding mistake: \ does not need extra encoding in regexp terms in javascript 2013-11-15 15:28:55 +01:00
Friedrich fdd09528ca Merge pull request #169 from peitschie/insert-fragment
Add support for pasting plain text with line breaks
2013-11-15 06:16:13 -08:00
Philip Peitsch 50b7c42b07 Clean up any carriage returns in pasted plain text
Most applications won’t put this on the clipboard in the first place,
but some Windows ones appear to. Stripping them out before insertion is
the safest way to handle these right now.
2013-11-15 18:42:17 +11:00
Philip Peitsch 1679bfbeef Plain text for the clipboard will now (correctly) discard the last new line
By the serializing logic, the selection  <p>text</p> would generate "text\n”.
This is slightly unexpected though, as partially selecting two paragraphs
(e.g., <p>p1</p><p>p2</p>) the user would expect the text to be "p1\np2”.
Easiest way to meet this expectation is to throw away the last new line
if it’s present.
2013-11-15 18:42:17 +11:00
Philip Peitsch cc0613754d Clarified Pasteboard.paste to Pasteboard.createPasteOps to be indicate behaviour 2013-11-15 18:42:17 +11:00
Philip Peitsch c942f0e5cb Fix copyright headers on PlainTextPasteboard 2013-11-15 18:42:17 +11:00
Philip Peitsch 440fc87774 Renamed large clipboard READMEs to be markdown 2013-11-15 18:42:17 +11:00
Philip Peitsch 05252933fd Add some additional comments about FF’s funny behaviour to the clipboard harness 2013-11-15 18:42:17 +11:00
Philip Peitsch 13cd41b018 Pasting data will replace the currently selected content 2013-11-15 18:42:17 +11:00
Philip Peitsch 9f93032a4e Add support for pasting plain text with line breaks
Pasting plain text with line breaks allows intelligent
merging into lists as well as multiple paragraphs.

Currently does not do the right thing on undo/redo,
as the undo manager does not respect operation groups
(yet).
2013-11-15 18:42:17 +11:00
Philip Peitsch 51e3c75a3c Added technical information regarding clipboard support
Also includes fixes and improvements to the clipboard test harness to
provide more information and work with later versions of FF.
2013-11-15 18:42:16 +11:00
Friedrich 58320d45b9 Merge pull request #182 from adityab/edit-close
Have dedicated Editor.closeDocument and Editor.closeSession
2013-11-14 12:57:32 -08:00
Aditya Bhatt 2dcd55205b Have dedicated Editor.closeDocument and Editor.closeSession
methods to correspond to openDocument and openSession.
Remove unused EditorSession.close method, not sure what it was
used for.
2013-11-14 21:47:26 +01:00
Jos van den Oever 860f1699da Merge pull request #180 from peitschie/performance
Improve performance by adding a step to DOM point conversion cache
2013-11-14 10:09:45 -08:00
Philip Peitsch bc7fee0189 Correct the reported steps removed when deleting an annotation
The reported position is the first walkable step inside the annotation.
This step will be removed entirely when the annotation is deleted, so
the stable step is just before.
2013-11-14 20:28:38 +11:00
Philip Peitsch 2dd6875705 Ensure reported step changes are accurate when splitting paragraphs
Paragraph splitting carried a very slight optimisation that would insert
the new paragraph before the current one if the current paragraph was
empty. This would cause the reported step position start to be incorrect
as the actual step that changed was position−1.

This alternate code path has been removed to ensure the reported step
changes are always correct.
2013-11-14 20:28:37 +11:00
Philip Peitsch 80980cd33c Improved API dox for the steps cache implementation 2013-11-14 20:28:37 +11:00
Philip Peitsch 0e0fc111e6 Use cached step translator in the annotation manager to speed up performance 2013-11-14 20:28:36 +11:00