Revert merge request GNOME/geary!374 for now since the shared process
model breaks old-style WebProcess message handler IPC.
This can be un-reverted when out JS is ported to the new Messages API
that is landing in WebKitGTK 2.28.
This reverts commit e4a5b85698, reversing
changes made to 66f6525480.
The only reason it was in the engine was so it could be used by both
the client and the web extension, without worrying about the
webkit2gtk and webkit2gtk_web_extension packages conflicting. However
it didn't really belong there, and added a dependency for the engine
on javascriptcoregtk which doesn't belong. So this fixes all that.
JSC is WebKitGTK's supported API going forward and is more
straight-forward than the old JS API, so this simplifies the code and
removes a number of deprecated calls.
This allows people with dark themes to apply style to the cmoposer's
body editor as well as to conversation bodies. Note that this CSS does
not get sent, so WYSIWYG will break if people choose to do this.
Also renames the user CSS file from user-message.css to user-style.css,
but still looks for the old name for now.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=714129
If the common ancestor of the quoted text is the plain-text-message DIV
itself, the isDescendant test fails and the style to preserve new lines
is not maintained. This adds a non-strict check to isDescendant and
enables that when checking the common ancestor node and a test case for
it.
Use uppercase since that is what the DOM for HTML defaults to, use
nodeName rather than tagName for cases when there the check is false and
ancestor is the document element, add unit tests.
* test/client/components/client-web-view-test.vala: New explicit tests
for init'ing the WebContext and loading default resources.
* test/client/components/client-web-view-test-case.vala:
Init the WebContext and load resources in the constructor rather than
fixture setup, so it only happens once per suite, not once per
test. Update subclasses to do same.
* test/client/composer/composer-web-view-test.vala: Add an explicit test
for loading ComposerWebView resources.
* bindings/vapi/javascriptcore-4.0.vapi (Object::get_property): Fix
return type.
* src/client/conversation-viewer/conversation-message.vala (GtkTemplate):
Hook up to new deceptive_link_clicked signal, remove old DOM-based
implementation.
* src/client/conversation-viewer/conversation-web-view.vala
(ConversationWebView): Add new deceptive_link_clicked signal and
DeceptiveText enum, listen for deceptiveLinkClicked JS message and fire
signal when received.
* src/client/util/util-webkit.vala (WebKitUtil): Add to_object util function.
* src/engine/util/util-js.vala (Geary.JS): Add to_object and get_property
util functions.
* ui/conversation-web-view.js (ConversationPageState) Listen for link
clicks, check for deceptive text and send message if found. Add unit
tests for deceptive text check.
* test/js/composer-page-state-test.vala: Move ::run_javascript to parent
class so new ConversationPageStateTest class can use it, adapt call
sites to different parent signature.