Open Bug 1126215 Opened 9 years ago Updated 2 years ago

Browser API: Make it possible to display a statusbar when a link is hovered (href preview)

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect

Tracking

()

People

(Reporter: paul, Unassigned)

References

Details

Attachments

(1 file)

In Firefox, hovering a link shows a floating status bar. We'd like to be able to reproduce this behavior with the Browser API.

This could be done using anonymousContent.

This could be an attribute on the iframe, or maybe a method.
You mean the alt attribute or the title attribute right?
(In reply to Kan-Ru Chen [:kanru] from comment #1)
> You mean the alt attribute or the title attribute right?

No. The href.
Summary: Browser API: Make it possible to display a statusbar when a link is hovered → Browser API: Make it possible to display a statusbar when a link is hovered (href preview)
It's actually TabParent::RecvSetStatus().
Attached patch graphene.patchSplinter Review
Here a WIP. It covers just OOP.
Attachment #8565486 - Flags: feedback?(fabrice)
Andrea, how would I use this from the Browser API? What will it look like?
Flags: needinfo?(amarchesini)
Paul, with this patch the parent app, controlling the mozbrowser iframe, you can do:

iframe.onstatuschanged = function(e) { ... e is a GrapheneStatusEvent:
iframe.onhidetooltip = function(e) { ... e is a GrapheneShowTooltipEvent
iframe.onshowtooltip = function(e) { ... e is a normal event.

a GrapheneStatusEvent is this:

interface GrapheneStatusEvent : Event
{
  readonly attribute GrapheneStatusType type; // "script" or "link"
  readonly attribute DOMString status;
};

and a GrapheneShowTooltipEvent is:

interface GrapheneShowTooltipEvent : Event
{
  readonly attribute unsigned long x;
  readonly attribute unsigned long y;
  readonly attribute DOMString tooltip;
};
Flags: needinfo?(amarchesini)
(In reply to Paul Rouget [:paul] from comment #2)
> (In reply to Kan-Ru Chen [:kanru] from comment #1)
> > You mean the alt attribute or the title attribute right?
> 
> No. The href.

The API in comment 7 looks fairly generic - does this also work, or could it work for element title attributes?
Comment on attachment 8565486 [details] [diff] [review]
graphene.patch

Review of attachment 8565486 [details] [diff] [review]:
-----------------------------------------------------------------

I think Fabrice is on vacation until the 25th. Forwarding to  Paul as my best guess as to who can provide feedback.
Attachment #8565486 - Flags: feedback?(fabrice) → feedback?(paul)
Comment on attachment 8565486 [details] [diff] [review]
graphene.patch

Review of attachment 8565486 [details] [diff] [review]:
-----------------------------------------------------------------

Trying to switch back to Fabrice since this wasn't looked into yet.
Attachment #8565486 - Flags: feedback?(paul) → feedback?(fabrice)
Comment on attachment 8565486 [details] [diff] [review]
graphene.patch

Review of attachment 8565486 [details] [diff] [review]:
-----------------------------------------------------------------

- That should not be graphene-specific. Let's expose that to any consumer of the mozbrowser api.
- We need something that also works in-process.
Attachment #8565486 - Flags: feedback?(fabrice) → feedback+
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: