This ensures that non-breaking space chars (not HTML entities) are
removed from text obtainined from the composer, and moves the F=F text
formatting from JS back to Vala, to minimimse the JS footprint and return
to using the old (working) version again.
* src/client/composer/composer-web-view.vala (ClientWebView::get_text):
Restore the old F=F formatting code previously in webkit-util, apply it
to plain text obtained from the composer.
* test/client/components/client-web-view-test-case.vala: New base class
for tests involving ClientWebView.
* test/client/composer/composer-web-view-test.vala: New tests for
ComposerWebView::get_html and ::get_text.
* test/js/composer-page-state-test.vala: Reworked to use
ClientWebViewTestCase, updated tests now that JS is returning
QUOTE_MARKER-delinated text, not F=F text.
* test/testcase.vala (TestCase): Move ::async_complete and ::async_result
from ComposerPageStateTest so all test cases can test async code.
* test/CMakeLists.txt: Add new source files.
* test/main.vala (main): Add new test.
* ui/composer-web-view.js: Update doc comments, remove F=F code, break
out non-breaking space replacement so it can be tested.
* ui/composer-web-view.js (ComposerPageState::resolveNesting): Apply JS
RegExp globally, to match default GLib RegEx behaviour.
* test/js/composer-page-state-test.vala: New tests covering generation of
HTML and F=F text from JS ComposerPageState object.
* test/CMakeLists.txt: Add the new test.
* test/main.vala (main): Add a test suite for JS tests, add the new test
to it.
* src/client/components/client-web-view.vala (ClientWebView): Add a
reason to the JSError domain for when a JS exception is thrown.
* bindings/vapi/javascriptcore-4.0.vapi (JS::Context): Add JS.Type and
some additional methods needed for the unit tests. Move most
GlobalContext methods to Context so we can pass the lowest common
demominator around.
* src/client/composer/composer-web-view.vala (ComposerWebView): Implement
both ::get_html and ::get_text as async JS calls, make the methods
async and update cal sites to handle that.
* src/client/composer/composer-widget.vala: Make saving deafts and
sending message async, to handle editor returning message body text
async. Remove uneeded ::get_html and ::get_text functions, update call
sites to call same directly on the on editor instead.
* src/client/web-process/util-composer.vala: Remove obsolete ::get_html
and ::get_text functions.
* ui/composer-web-view.js (ComposerPageState): Initial implementation of
getHtml and getText methods.
* src/client/application/geary-controller.vala (GearyController::open_async):
Load ComposerWebView resources.
* src/client/composer/composer-web-view.vala (ComposerWebView): Move
HTML/CSS template here from ComposerWidget. Load composer-web-view.js
on app init and add it to the web view's user content manager.
(ComposerWebView::load_html): Overridden to require HTML body and
signature, assemble complete HTML as appropriate before chaining up to
the default impl.
(ComposerWebView::load_finished_and_realised): Remove redundant method.
* src/client/composer/composer-widget.vala (ComposerWidget):
Remove 'message' prop since it is unused and onerous. Cache current
account's signature as a field so it can be passed through to the
editor as needed. Port on_link_clicked to composer-web-view.js.
* src/client/web-process/util-composer.vala: Remove function ported to JS
in composer-web-view.js
* ui/CMakeLists.txt: Include new ComposerWebView JS resource.
* ui/composer-web-view.js: Port composer HTML sanitisation methods to JS,
add to a custom subclass of PageState. Instantiate it and hook it up to
onload.