BTW, in case anyone is interested the BookView webpath is generated by this file written in Javascript in Sigil tree:
book_view_current_location.js
And the problem is that JQuery's function to check where the text node is in its parents contents:
...
return first_part + jQuery.inArray( this, $( this ).parent().contents() );
varies depending on whether you have styled and unstyled that node or not in BookView.
So when live DOM editing is done in BookView the tree is getting nodes added and removed that are not really there once you dump out the xhtml from the webkit widget so it returns the wrong index of the text node in its parent.
This causes our cursor position to be wrong and sometimes even return something from out in the weeds which causes the segfault/crash.
There is no real way for me to detect what is going on inside BookView's DOM tree in webkit when live editing is done and how that edited DOM tree is then serialized back to text.
All I can do is guess.
So I would really stay away from doing any editing in BookView at all, at least until I can figure out some sane way to get consistent results from the DOM tree to locate the cursor.
Last edited by KevinH; 06-08-2018 at 04:43 PM.
|