Previously only simple links were shown in the echo area when the mouse was hovered over the link. Now image links and links containing formatting will also be shown. ---
An example where this makes a difference is at the conkeror webgit http://repo.or.cz/w/conkeror.git. The git image in the top right corner is clickable but without this patch it doesn't show the link on mouseover. This patch copies the parent chasing code from element_get_load_spec(). That's more expensive than the previous code, but I don't notice any performance degradation on my box. My main concern with the approach though, is that I want a guarantee that the link I see when I hover is what I'll get when I click. But the current code has seperate implementations for these two cases, so the result may differ. I considered calling element_get_load_spec() from the event handler, but it seems rather heavy weight. I wonder if it's possible to hook in while the DOM is being constructed and attach the href from an anchor element to its bottom level child. And do some of the other cases handled by element_get_load_spec() at that time too. Then the simplified element_get_load_spec() and the mouseover event handler need only check the element for a href; they will get the same result. modules/content-buffer.js | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/content-buffer.js b/modules/content-buffer.js index 1cd28a4..a80ef13 100644 --- a/modules/content-buffer.js +++ b/modules/content-buffer.js @@ -51,8 +51,11 @@ function content_buffer(window, element) }, true /* capture */, false /* ignore untrusted events */); this.browser.addEventListener("mouseover", function (event) { - if (event.target instanceof Ci.nsIDOMHTMLAnchorElement) { - content_buffer_overlink_change_hook.run(buffer, event.target.href); + var node = event.target; + while (node && !(node instanceof Ci.nsIDOMHTMLAnchorElement)) + node = node.parentNode; + if (node) { + content_buffer_overlink_change_hook.run(buffer, node.href); buffer.current_overlink = event.target; } }, true, false); -- David Kettler IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. _______________________________________________ Conkeror mailing list [email protected] https://www.mozdev.org/mailman/listinfo/conkeror
