Open Bug 1885593 Opened 8 months ago Updated 6 months ago

[meta] Allow embedding feature callouts in system page content

Categories

(Firefox :: Messaging System, task, P1)

task

Tracking

()

People

(Reporter: aminomancer, Unassigned)

References

(Depends on 2 open bugs, Blocks 1 open bug)

Details

(Keywords: meta, Whiteboard: [omc])

Attachments

(1 file, 1 obsolete file)

We want to be able to embed feature callouts directly in the PDF.js viewer and the new tab/home page. It should be possible to do this by creating a new JSActor pair that imports and constructs a FeatureCallout. The module itself may need to be updated to work correctly in a content process.

The most important detail is making sure the callout is properly anchored to its anchor node. Right now, we do that in the chrome by wrapping the callout in a <panel> element, which is a XULPopupElement. That automatically gives it a lower level behavior ensuring it follows its anchor around and disappears when its anchor disappears. But the existing in-content FeatureCallout code (inherited from the original use of FeatureCallout in Firefox View) will not be able to follow its anchor around. It has an absolute position relative to the page, and it only updates its position on scroll and resize events. This won't work for upcoming purposes in about:newtab and PDF.js.

I propose that we rethink the in-content approach from the ground up. Webpages with similar anchored popups, dropdowns, etc. often approach this a bit differently: they make the callout a child of the anchor node, and they set CSS rules on both with the callout's position relative to the anchor (parent) rather than relative to the page:

anchor {
  overflow: visible;
  position: relative;
}

callout {
  position: absolute;
  bottom: ...
}

That way, if the anchor moves on layout (say its left sibling was hidden so it got moved to the left), the callout will follow along with it automatically.

Points: --- → 13
Whiteboard: [omc]
Depends on: 1885595
Depends on: 1885596
Points: 13 → ---
Keywords: meta
Priority: -- → P1
Summary: Allow embedding feature callouts in system page content → [meta] Allow embedding feature callouts in system page content
See Also: → 1892402

Comment on attachment 9400191 [details]
WIP: Bug 1885593 - Support triggered feature callouts in content. r=jprickett

Revision D209512 was moved to bug 1885595. Setting attachment 9400191 [details] to obsolete.

Attachment #9400191 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: