Closed Bug 1785759 Opened 7 months ago Closed 4 months ago

Action bar of selection is overlapped with text selection when using Fission


(GeckoView :: Sandboxing, defect, P2)



(firefox106 wontfix, firefox109 fixed)

109 Branch
Tracking Status
firefox106 --- wontfix
firefox109 --- fixed


(Reporter: m_kato, Assigned: m_kato)


(Blocks 1 open bug)


(Whiteboard: [fission:android:m2])


(4 files)

Attached image screenshot with fission


  1. set fission.autostart=true or ./mach run --enable-fission
  2. Browse
  3. Zoom content
  4. Select text in <textbox> into <iframe>


Action bar is overlapped with selected text.

Expected Result

Same as non-fission or non-xorigin content (

It appears that the _getFrameOffset function ( is written in such a way that it tries to traverse across process boundaries when running with Fission, and doesn't correctly respect the process-root

I don't know off the top of my head what the best solution is for this, though I know that coordinates in nested iframes are particularly fun (thanks to things like transforms on the frame element themselves). I'll ni? :emilio who probably has more context on this, but it might be possible to copy/share the logic which Select uses for this ( and get something which works cross-process.

Flags: needinfo?(emilio)

When writing tests for this, it might also be good to have a test where the cross-process iframe element is distorted using CSS or similar as well.

Severity: -- → S3
Priority: -- → P2
Whiteboard: [fission:android:m2]

Yes, this should just use the LayoutUtils code, probably refactored like:

getElementBoundingScreenRect(aElement) {
  return this.boundingRectToScreenRect(aElement.getBoundingClientRect(), aElement.ownerGlobal);

boundingRectToScreenRect(aRect, aGlobal) {
  // current code.

That would account for the layout to visual viewport offset in the parent process, which is what's not getting accounted for here... I can take this I think.

Assignee: nobody → emilio

So the attached patch works and gives consistent coordinates within fission / non-fission, but the coordinate space conversion in java is off, and I'm not familiar with the gazillion coordinate spaces there. Makoto, could you help with that?

Assignee: emilio → nobody
Flags: needinfo?(emilio) → needinfo?(m_kato)
Assignee: nobody → emilio
Assignee: emilio → nobody
Flags: needinfo?(m_kato)
Attachment #9291628 - Flags: feedback+
Assignee: nobody → emilio

Sorry for too late. As long as I test, it works well.

Also, when change API, we have to update the following files, too.

If you add utility methods (getElementBoundingScreenRect) in LayoutUtils.jsm, I can update other parts.

Assignee: emilio → nobody

emilio, do you continue to work on this?

Flags: needinfo?(emilio)

If you don't have more time to work this, I will take this since I need LayoutUtils's code in other bug to support fission on GV.

I'm a bit busy with other work so if you need it please go ahead. Happy to review or what not :)

Flags: needinfo?(emilio)

I take this.

Assignee: nobody → m_kato
Flags: needinfo?(m_kato)

I would like screen coordinate version by screen pixel for
getElementBoundingScreenRect for GeckoView to support fission since it
returns CSS pixel.

SelectionActionDelegate.Selection.clientRect isn't fission compatible. It is
better to use screen coordinate for selection data, instead of client
coordinate since it has no easy way to calculate client coordinate with

If we can have screenRect, mTempMatrix and mTempRect are unnecessary, so
we should be marked as deprecated too.

Depends on D161415

Flags: needinfo?(m_kato)
Blocks: 1801615
Pushed by
Part 1. Add LayoutUtils.rectToScreenRect. r=emilio
Part 2. Make BasicSelecitonDelegate fission compatible. r=geckoview-reviewers,calu
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 109 Branch

== Change summary for alert #36207 (as of Mon, 28 Nov 2022 18:42:19 GMT) ==


Ratio Test Platform Options Absolute values (old vs new)
15% microsoft loadtime macosx1015-64-shippable-qr cold fission webrender 317.46 -> 268.42
15% microsoft loadtime macosx1015-64-shippable-qr cold fission webrender 309.44 -> 261.75

For up to date results, see:

You need to log in before you can comment on or make changes to this bug.