Closed Bug 1550800 Opened 6 years ago Closed 5 years ago

make PuppetWidget::WidgetToScreenOffset work in OOP-iframes

Categories

(Core :: Layout, task, P2)

task

Tracking

()

RESOLVED FIXED
mozilla75
Fission Milestone M5
Tracking Status
firefox75 --- fixed

People

(Reporter: enndeakin, Assigned: hiro)

References

(Blocks 2 open bugs, Regressed 1 open bug)

Details

Attachments

(3 files)

I think it is returning the coordinates of the toplevel window + the child iframe without accounting for any of the intervening frames.

My testing on WidgetToTopLevelWidgetTransform().TransformPoint() seems to return the extra offset that should be applied, at least in the one case I'm testing, but I'm not sure how or where it should be applied.

This is affecting drag and drop in out-of-process frames, which use GetScreenRectInAppUnits to calculate the placement of the drag feedback image, so the image appears in the wrong place.

Fission Milestone: --- → ?
Priority: -- → P3
Blocks: 1555138

This is also a problem for accessibility. Accessibility tools such as screen readers and magnifiers need screen coordinates for mouse routing, visual highlighting, etc. nsFrame::GetScreenRectInAppUnits is used by Accessible::BoundsInAppUnits, which is called by Accessible::Bounds, which is what gets called by OS specific accessibility code.

Flags: needinfo?(jwatt)
Blocks: a11y-fission
Fission Milestone: ? → M4
Blocks: 1560627

We probably need to audit the callers of GetScreenRectInAppUnits to determine which would want to cross OOP-iframe boundaries, and which wouldn't.

Priority: P3 → P2

Roll some unfixed bugs from Fission Milestone M4 to M5

0ee3c76a-bc79-4eb2-8d12-05dc0b68e732

Fission Milestone: M4 → M5

Jamie, can you assign someone to look into auditing the callers of GetScreenRectInAppUnits?

Flags: needinfo?(jteh)
Type: defect → task
Summary: nsFrame::GetScreenRectInAppUnits returns the wrong coordinates in OOP frames → Audit GetScreenRectInAppUnits callers to determine which must cross OOP-iframe boundaries

(In reply to Neha Kochar [:neha] from comment #4)

Jamie, can you assign someone to look into auditing the callers of GetScreenRectInAppUnits?

I think this needs to be assigned to someone in layout. From the a11y side, I can say that our calls to GetScreenRectInAppUnits definitely need to cross OOP-iframe boundaries.

Flags: needinfo?(jteh)

Filed new bug 1602987 for the a11y issue noted in comment 1.

No longer blocks: a11y-fission, 1598016

Would someone mind providing an example (a mochitest would be preferable) to make sure nsIFrame::GetScreenRectInAppUnits works in OOP iframes? I can probably fix the function to work in OOP iframes, but writing automated tests in unfamiliar areas takes too much time for me. I am currently working on a similar issue for fission (bug 1599795), so my memory about coordinate system in fission world is pretty fresh now. After a while later, I definitely need to re-learn it. :)

We can't do automated tests for drag and drop, so I don't have a test for that specifically. You can test manually at https://hsivonen.fi/fission-host.html with fission enabled, then enter some text in one of the child frame textboxes and try to drag it. The drag feedback image will appear in the wrong place.

Attached file selecttest.js (deleted) —

The attached is a test for the <select> element which has a similar issue with the dropdown popup appearing offset at the wrong place. I don't recall whether it uses GetScreenRectInAppUnits though, but the issue is similar.

Thank you Neil. I can start with the drag and drop case, and I will see whether the test works with the fix GetScreenRectInAppUnits in comment 9.

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED
Flags: needinfo?(jwatt)

In this bug I am not going to just make GetScreenRectInAppUnits in fission world.

Summary: Audit GetScreenRectInAppUnits callers to determine which must cross OOP-iframe boundaries → make nsIFrame::GetScreenRectInAppUnits work in OOP-iframes

I happened to know there is an issue on SetFocus in OOP iframes (bug 1556627). The bug is (probably) the reason why Element.focus() call in the test in comment 9 doesn't work in fission. Though without the focus call the test passed on a try run, I am going to defer the test into a follow up bug.

Blocks: 1614268

The client offset, browser window title bar and window decorated frame width,
is necessary to get element positions in OOP iframes in screen coordinates
for drag-and-drop etc.

This change also fixes event.screen{X,Y}. A mochitest in this commit fails
without this change at least on Linux. Note that in the mochitest we have to use
nsIDOMWindowUtils.synthesizeNativeMouseClick instead of
nsIDOMWindowUtils.sendMouseEvent since sendMouseEvent doesn't work in fission
world (bug 1528935).

A mochitest for this change will be landed in bug 1550800 which needs
a work to make Element.focus() work in OOP iframes (bug 1556627).

Depends on D62190

Attachment #9125399 - Attachment description: Bug 1550800 - Make nsIFrame::GetScreenRectInAppUnits work in out-of-process iframes. r?nika!,hsivonen! → Bug 1550800 - Make PuppetWidget::WidgetToScreenOffset work in out-of-process iframes. r?nika!,hsivonen!,emilio!

This bug will cover wider area than we initially planned.

Summary: make nsIFrame::GetScreenRectInAppUnits work in OOP-iframes → make PuppetWidget::WidgetToScreenOffset work in OOP-iframes
Blocks: 1609746
Attachment #9125398 - Attachment description: Bug 1550800 - Propagate client offset into OOP iframe. r?nika!,hsivonen! → Bug 1550800 - Call BrowserParent::UpdateDimensions() in BrowserBridgeParent::RecvUpdateDimensions. r?nika!,hsivonen!
Depends on: 1565786
Blocks: 1565786
No longer depends on: 1565786
Pushed by hikezoe.birchill@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d46719614943 Call BrowserParent::UpdateDimensions() in BrowserBridgeParent::RecvUpdateDimensions. r=nika,hsivonen https://hg.mozilla.org/integration/autoland/rev/238df84a23d4 Make PuppetWidget::WidgetToScreenOffset work in out-of-process iframes. r=hsivonen,emilio
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Blocks: 1577601
Regressions: 1615802
Blocks: 1602987
Blocks: 1540674
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: