Internet explorer will only trigger mouse events at the window level. If
the handler is bound to both window and canvas however, the event will
be processed twice in every other browser.
A solution to this is to track manually (without affecting the bubble or
other features on the event) that an event has been processed, and don't
process it a second time.
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.
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.
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.
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
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
Useful for ApplyDirectStyling vs. ApplyDirectStyling, as that in the current
simple implementation will result in inconsistent DOMs (e.g. names of automatic styles)
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.
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.
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).