This reverts commit 43341cd3e3, reversing
changes made to ffb4befdd8.
This is causing segfault in Geary.JS.to_string_released() when running
client tests, so reverting until a solution is found.
* 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.
* bindings/vapi/javascriptcore-4.0.vapi: Don't pretend JS.String will
be unreff'ed by vala, it wont. Add JS.GlobalContext.retain, in case it
wants to be used.
* src/client/components/client-web-view.vala
(ClientWebView::ClientWebView): JavascriptResult instances are unref'ed
when unowned.
* bindings/vapi/javascriptcore-4.0.vapi: Make JS objects match their JSC
definitions: move JSValueFoo methods to JS.Value, etc. Update call
sites.
* src/client/util/util-webkit.vala: Move WebKit-specific common methods
from ClientWebView here. Update call sites.
* src/engine/util/util-js.vala: Move JSC-specific common methods from
ClientWebView and ComposerPageStateTest here. Update call sites.
* src/client/web-process/web-process-extension.vala: Check for and handle
exceptions when calling JS code.
* src/CMakeLists.txt: Add new source files, make WebKit VAPI generation
and engine compilation depend on JSC.
* 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/conversation-viewer/conversation-web-view.vala
(ConversationWebView): Remove has_selection method since we are
using the signal to specify if a selection was found or not. Update
call sites to use that.
(ConversationWebView::get_selection_for_find,
ConversationWebView::get_selection_for_quoting): Implement using calls
to web process JS methods.
* src/client/application/geary-controller.vala
(GearyController::create_reply_forward_widget): If we have a possible
message view to quote from, handle constructing the compser widget
asynchronously, when we know if we have a quote or not.
* src/client/conversation-viewer/conversation-viewer.vala:
(ConversationViewer::on_find_mode_changed): Handle getting text
selection for finds asynchonously.
* src/client/components/client-web-view.vala
(ClientWebView::get_string_result): New helper for getting string
values from JS calls.
* src/client/conversation-viewer/conversation-email.vala
(ConversationEmail::get_selection_for_quoting,
ConversationEmail::get_selection_for_find): Handxle errors when
obtaining selections from a message view.
* src/client/conversation-viewer/conversation-message.vala: Remove
methods that were simply passed through to the web view anyway. Update
call sies.
* src/client/web-process/util-conversation.vala: Port all remaining
functions to JS, remove.
* bindings/vapi/javascriptcore-4.0.vapi: Add methods needed to get
strings out of WebKit.JavascriptResult instances.
* ui/conversation-web-view.js: Implement selection functions in JS, minor
cleanup.
* src/CMakeLists.txt: Also generate a custom Also generate a custom
webkit2gtk-web-extension-4.0 VAPI that re-includes javascriptcore
objects, so they can be access from the web extension.
* bindings/metadata/WebKit2WebExtension-4.0-custom.vala,
bindings/metadata/WebKit2WebExtension-4.0.metadata: Include in-tree
metadata for web extension VAPI, update to all access to JS obejcts.
* bindings/vapi/javascriptcore-4.0.vapi: Add a bunch of useful additional
objects and method.
* bindings/vapi/javascriptcore-4.0.vapi: Add some methods to
GlobalContext for accessing JSValues as ints.
* src/client/components/client-web-view.vala
(ClientWebView): Hook up UserContentManager script messages handler and
handler implementation for "preferredHeightChanged", update the new
preferred_height prop on the class, and queue a resize. Hook those
values up to the GTK allocation machinery.
(ClientWebView::get_int_result): Convenience method for getting an int
from a JavascriptResult.
(ClientWebView::get_preferred_height): Report back values as reported
by messages from the script handler.
(ClientWebView::register_message_handler): Convenience method for
registering script messages handlers.
* src/client/conversation-viewer/conversation-web-view.vala
(ConversationWebView): Remove now-redundant GTK allocation machinery.
* ui/client-web-view.js: Post a message to preferredHeightChanged when
the page is sorta-kinda loaded.
This gives us a means of using JS objects returned by UserContentManager
script messages directly from Vala.
* bindings/metadata/WebKit2-4.0.metadata: Tweak standard webkit2 VAPI to
re-include methods that return javascriptcore objects.
* bindings/vapi/javascriptcore-4.0.vapi: Copy generated VAPI file into
the tree, customise it so that it actually works.
* src/CMakeLists.txt: Generate the custom webkit2 VAPI, depend on
javascriptcore and include in-tree javascriptcore VAPI in the client
build.
* bindings/metadata/JSCore-3.0.metadata: Remove obsolete file.