Commit Graph
3073 Commits
Author SHA1 Message Date
Aditya Bhatt e50bc588ff Merge pull request #443 from adityab/cAF-warning
Remove unnecessary @param declaration from cancelAnimationFrame
2014-03-04 14:10:19 +01:00
Aditya Bhatt cd4a39b9d6 Remove unnecessary @param declaration from
the Rhino runtime's cancelAnimationFrame.
2014-03-04 13:56:33 +01:00
Aditya Bhatt 7f32dd25c1 Merge pull request #441 from adityab/center-slider
Normalize zoom slider's position for the zoom range
2014-03-04 12:58:57 +01:00
Aditya Bhatt 887e248b9a Do not fire the zoom slider's onChange
event when programmatically setting the
slider position.
2014-03-04 02:13:12 +01:00
Aditya Bhatt 40158417a7 Make the zoom slider's zoomLevel=1
position centered.
2014-03-04 02:12:56 +01:00
Aditya Bhatt 3b5b8e0268 Merge pull request #433 from adityab/enable-pinchzoom
Fast Pinch-Zoom-Pan support on the canvas sizer
2014-03-04 00:45:15 +01:00
Aditya Bhatt 91106ab95e Make ZoomHelper be able to switch the element
at runtime. Useful for undo support.
2014-03-03 22:56:42 +01:00
Aditya Bhatt f428ff008f Link the zoom slider to the current zoom level
of the ZoomHelper.
2014-03-03 22:46:51 +01:00
Aditya Bhatt e60be56431 Implement runtime.requestAnimationFrame()
which abstracts away browser prefixes
and simply executes the callback if it is
not supported by the browser.

Also adds cancelAnimationFrame() similarly.
2014-03-03 22:46:51 +01:00
Aditya Bhatt 86d28fb008 Show custom scrollbars in touch mode.
This is required because webkit on mobile
does not seem to show any scrollbars if
`-webkit-overflow-scrolling: touch` is not
enabled -- and we cannot enable that because
it's kinetic scrolling is not controllable
or trackable.

Enable virtual scrollbars when in scroll mode,
othwerwise disable them. This is done because
the scrollbar size/position makes no sense
immediately after a removeScroll() call, because
the perceived panning is done through CSS.
2014-03-03 22:46:51 +01:00
Aditya Bhatt 58cef6ac9d Fast Pinch-Zoom support on the sizer.
This patch adds a new class ZoomHelper that
is used to control the zooming of the document
by API and/or touch gestures. CSS3D transforms
are used to do extremely fast bitmap scaling
of the sizer.
2014-03-03 22:46:51 +01:00
Philip Peitsch 6d876b8aa0 Merge pull request #438 from peitschie/more-win-fixes
Fix compile error using Qt 4.8.5 on Windows
2014-03-04 01:21:21 +11:00
Philip Peitsch 64e46afca9 Fix compile error using Qt 4.8.5 on Windows 2014-03-04 00:25:44 +11:00
Philip Peitsch 4a6cd690db Merge pull request #436 from peitschie/cut-ff
Fix cut & paste support for Firefox & IE
2014-03-03 00:19:59 +11:00
Philip Peitsch 976fc3f0db Fix cut & copy in Internet Explorer
IE11 throws an exception when attempting to set an unsupported key such
as "text/plain". Could have done browser sniffing to detect IE instead,
but this approach seems equally valid.
2014-03-02 14:27:35 +11:00
Philip Peitsch dea6196929 Don't rely on boolean value being returned from DataTransfer.setData
According to the current specifications, this is a void return type.
Chrome is the only browser that returns a boolean value for this.

See http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dom-datatransfer-setdata
2014-03-02 14:27:35 +11:00
Philip Peitsch e8b6db7881 Fix reselection of the eventTrap in IE11 & Firefox
Changing to an input element (1038583) affected how text ranges are
created in IE and Firefox. This stopped cut/paste from functioning.

setSelectionRange is supported on all major browsers.
2014-03-02 14:27:34 +11:00
Philip Peitsch d56180e1bc Unbreak display of IME text during composition
The text was not appearing when composing via the IME. It would not show
in the document until after the composition was complete.
2014-03-02 14:27:34 +11:00
Friedrich b122af0b4e Merge pull request #434 from kossebau/updateDemosLink
Update link to demos in README.md
2014-03-01 17:23:14 +01:00
Friedrich W. H. Kossebau 71dffda9f1 Update link to demos in README.md 2014-03-01 17:18:01 +01:00
Aditya Bhatt d64d89d82e Merge pull request #432 from adityab/eventtrap-clickungrab
Do not grab click events on the eventTrap.
2014-02-28 15:11:24 +00:00
Aditya Bhatt e8a3643b28 Do not grab click events on the eventTrap.
Fixes an issue where clicking on the middle of
the character to the right of the caret would
cause the cursor to move to the start or end
of the document.
2014-02-28 15:29:52 +01:00
Philip Peitsch ac7ff99146 Merge pull request #421 from peitschie/delete-roots-fix-2
Rework how StepsCache responds to step updates to improve robustness
2014-03-01 01:02:32 +11:00
Philip Peitsch 120dc48cc3 Clarified some comments based on PR feedback 2014-03-01 00:59:02 +11:00
Philip Peitsch 451663110e Modify the damageCacheAfterStep to cope with negative values
If a negative value is passed in as the inflection point to the cache,
it is treated as if it were 0 and the cache is effectively cleared.
2014-03-01 00:59:02 +11:00
Philip Peitsch f6adc2c867 Enable StepsCache verification in tests
The StepsCache verification feature verifies the cache after every
modification to ensure it does not contain any bad data. This is quite
slow to do in practice, but is very helpful for debugging, and for
tests.
2014-03-01 00:59:02 +11:00
Philip Peitsch 93fe54aee7 Ensure damaged bookmarks are never leaked outside of the cache
Converting the cache to a damage-based approach improves the per-update
efficiency immensely, but carries some additional risk as invalid
bookmarks are deliberately left behind for performance reasons.

This patch specifically fixes an issue where bookmarks between the
undamaged step and the current iterator position were being treated as
repaired bookmarks, when in fact they were still damaged (as they had
never been seen during iteration in the document). The new logic will
ensure these bookmarks stay in the damaged region until they are
eventually iterated over in an updateCache call.

A happy side effect of this is that all query functions now only ever
return undamaged bookmarks, making the class itself easier to use and
understand.
2014-03-01 00:59:02 +11:00
Philip Peitsch a25b70ad9e Add a cache verification function to ensure cache integrity
Cache integrity checks are very slow, so this should only be enabled
when troubleshooting cache problems.
2014-02-28 21:19:49 +11:00
Philip Peitsch 388e4acd89 Rework how StepsCache responds to step updates to improve robustness
Calculating exact changes in a document can be extremely difficult to
do properly, as such, StepsCache ideally will not rely on them.

In this new approach, modifications to the step cache only require the
last known unmodified step. As iteration across the document occurs,
damaged regions of the cache are repaired and updated, and dead nodes
are removed from the system.

This improves the performance of local edits immensely, at the expense
of "long jump" type operations (e.g., add text then move immediately
to the document end).

Fixes issue #417
2014-02-28 21:19:49 +11:00
Philip Peitsch 20afe0e263 Fix cache-update issue that was causing watchdog overflow errors 2014-02-28 21:19:49 +11:00
Philip Peitsch 5b35bdf412 Improve navigation speed across StepCache items
The StepsCache is built on the concept that nodes are not re-ordered in
the document during updates. This means the only operations that need to
be supported is adding or removing a node. By maintaining a double
linked list, nearby bookmarks can be very quickly found for any step.
2014-02-28 21:19:49 +11:00
Philip Peitsch b1b48d5fa4 Split StepsCache out of StepsTranslator into it's own file 2014-02-28 21:19:49 +11:00
Friedrich W. H. Kossebau 13068db6d8 Add op tests reproducing issue #417 2014-02-28 21:19:49 +11:00
Philip Peitsch 91371d0ef3 Merge pull request #430 from peitschie/empty-text-nodes
Reduce the number of places that create empty text nodes
2014-02-28 21:03:34 +11:00
Philip Peitsch e05974ef21 Stop whitespace upgrade logic from creating empty text nodes 2014-02-28 20:59:45 +11:00
Philip Peitsch ff6e83e6a1 Add checks for empty text nodes in OperationTests
Empty text nodes should never be left behind by an operation. Adding
these extra checks have caused some operations to fail.
2014-02-28 19:00:34 +11:00
Philip Peitsch d00d29e453 Merge pull request #418 from peitschie/benchmark-units
Improve benchmark appearance slightly and add km/h & pages/h units
2014-02-28 01:37:40 +11:00
Philip Peitsch 4c87f29a0b Make element variable names more consistent 2014-02-28 01:33:32 +11:00
Philip Peitsch 4f0d00e868 Make benchmark UI slightly more colourful 2014-02-28 01:32:12 +11:00
Philip Peitsch 8c68d5d121 Output the webodf version the benchmark is running against 2014-02-28 01:32:11 +11:00
Philip Peitsch 22877e576f Add pages per hour and kilometres per hour as benchmark units 2014-02-28 01:32:11 +11:00
Philip Peitsch 0545f86dc4 Add benchmark hooks for calculating document distance travelled 2014-02-28 01:30:45 +11:00
Jos van den Oever 7b20494ee7 Merge pull request #425 from vandenoever/async
Respect the "test" parameter in the web based testing also for asynchron...
2014-02-27 14:56:48 +01:00
Jos van den Oever de93292c1d Respect the "test" parameter in the web based testing also for asynchronous tests. 2014-02-27 14:51:49 +01:00
Philip Peitsch 0ed44758f0 Merge pull request #429 from peitschie/win-editor-fixes
Fix compilation of dojo resources on Windows
2014-02-28 00:24:41 +11:00
Philip Peitsch aa09552e6e Fix compilation of dojo resources on Windows 2014-02-28 00:21:21 +11:00
Philip Peitsch bfc9160049 Merge pull request #427 from peitschie/undo-fix
Fix edit breakage after performing an undo
2014-02-27 23:15:11 +11:00
Philip Peitsch 29dd19fdf6 Restore proper shadow cursor operation on FF
Firefox throws an exception if the SVG shape is rendered while the
polygon node is disconnected from the document (e.g., after an undo).
2014-02-27 23:01:29 +11:00
Philip Peitsch 59c7af14c5 Subscribe to canvas events rather than sizer element in EventManager
The sizer element is replaced when an undo is performed, causing no
mouse move events to be reported after an undo. This breaks the shadow
cursor display.

There is no particular reason 67c1c23 changed the event binding to use
the sizer rather than the canvas element other than for consistency
with where the event trap was being added, so it is safe to revert
this particular modification.
2014-02-27 13:33:23 +11:00
Philip Peitsch c0d8d41ea2 Expose the SessionController's undo/redo interfaces for the editor
Undo has additional logic to ensure the event trap is restored after
an undo is performed. At some point, this will need to split out of
the SessionController, but for now it is simplest to expose this to
the EditorSession for use.

Fixes remaining problems causing issue #426.
2014-02-27 13:33:23 +11:00