Make ZoomToFocusedInput fission-friendly
Categories
(Core :: Panning and Zooming, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox119 | --- | fixed |
People
(Reporter: kats, Assigned: hiro)
References
(Blocks 3 open bugs, )
Details
(Whiteboard: [fission:android:m4])
Attachments
(5 files)
nsDOMWindowUtils::ZoomToFocusedInput
uses APZCCallbackHelper::GetRootContentDocumentPresShellForContent
which in turn uses nsPresContext::GetToplevelContentDocumentPresContext
which is not fission-friendly. This means that if you have an input element inside an OOP iframe and tap on it, the "zoom to focused input" behaviour will probably not take effect.
HOWEVER, this API is only used in geckoview, which AFAIK is not going to be getting fission in the initial release, so this is not that urgent for Fission.
There are different potential solutions. One involves detecting that ZoomToFocusedInput
method was called in an OOP iframe, and sending a message to the process with the root content document so that it can do the zooming action.
The other is to modify the message that gets sent to APZ so that it doesn't need to take an explicit view id for the root content document's document element but instead just asks APZ to zoom the rootmost zoomable thing.
Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 1•4 years ago
|
||
nsDOMWindowUtils::ZoomToFocusedInput
also includes a call to GetCrossDocParentFrame
, which is not fission-friendly.
Comment 2•4 years ago
|
||
I've got a testcase for this behavior at https://danielholbert.com/input-iframe.html (which includes an oop iframe served from dholbert.org).
STR:
- View that^ URL in Firefox for Android, with fission enabled.
- Tap the first textfield (the one inside of the iframe)
EXPECTED RESULTS: When the textfield gains focus, Firefox should zoom in to feature the textfield.
ACTUAL RESULTS: No zooming happens.
This works properly (i.e. I get expected results) for the second textfield (the one that's in the outer document); but it doesn't work for the textfield in the out-of-process iframe.
Updated•4 years ago
|
Updated•3 years ago
|
Comment 3•3 years ago
|
||
There is some issues before kats' comment.
- https://searchfox.org/mozilla-central/rev/dc323d0d9a3b722ca8ff0d1b2b752e5bd00dab9b/mobile/android/modules/geckoview/GeckoViewContent.jsm#97-117 doens't send
GeckoView:ZoomToInput
to OOP iframe now. - When calling
ZoomToFocusedInput
on content root process, since focused element is null (focus is into OOP iframe),ZoomToFocusedInput
does nothing.
Also, if we call ZoomToFocusedInput
in OOP iframe process, AsyncPanZoomController::ZoomToRect
will hit the assertion of MOZ_ASSERT(Metrics().IsRootContent())
. (The reason is that kat's comment?).
Assignee | ||
Comment 4•1 year ago
|
||
Updated•1 year ago
|
Assignee | ||
Comment 5•1 year ago
|
||
With specifying the flag for ZoomToFocusedInput works in OOP iframes.
Depends on D184439
Updated•1 year ago
|
Assignee | ||
Comment 6•1 year ago
|
||
With these changes, I think ZoomToFocusedInput works in OOP iframes. Though I just tested it on the example in comment 2. Thank you Daniel for keeping it working as expected!
I wasn't sure there's any automated test cases for ZoomToFocusedInput, but now I found test_group_zoomToFocusedInput.html. I will add an OOP iframe case there.
Updated•1 year ago
|
Assignee | ||
Comment 7•1 year ago
|
||
With SpecialPowers.spawn we can easily make the the test work in OOP iframes.
Depends on D184440
Assignee | ||
Comment 8•1 year ago
|
||
Depends on D184446
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 9•1 year ago
|
||
We'd like to use SpecialPowers.spawn to do something in cross-origin iframes in reftests.
Without moving the file calling SpecialPowers.spawn in reftests raises an exception
at here [1] in SpecialPowersChild.sys.mjs.
Depends on D184439
Updated•1 year ago
|
Assignee | ||
Comment 10•1 year ago
|
||
Adding bug 1827330 into the dependency list since one of the changes here depends bug 1827330.
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
Backed out for causing reftest failures in zoom-to-focus-input-oopif.html
- Backout link
- Push with failures
- Failure Log
- Failure line: REFTEST TEST-UNEXPECTED-FAIL | gfx/layers/apz/test/reftest/zoom-to-focus-input-oopif.html == gfx/layers/apz/test/reftest/zoom-to-focus-input-oopif-ref.html | load failed: timed out waiting for reftest-wait to be removed
Assignee | ||
Comment 13•1 year ago
|
||
needs-focus
was necessary for the reftest. I don't know why the test passed on other platforms without it.
Comment 14•1 year ago
|
||
Comment 15•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9d276bd75cbb
https://hg.mozilla.org/mozilla-central/rev/5aa7f43e3cdc
https://hg.mozilla.org/mozilla-central/rev/b5536df01db7
https://hg.mozilla.org/mozilla-central/rev/a56fcdc3931e
https://hg.mozilla.org/mozilla-central/rev/91f2928497ba
Description
•