Closed Bug 1618579 Opened 5 years ago Closed 5 years ago

Text selection caret is misplaced with dynamic toolbar

Categories

(GeckoView :: General, defect, P1)

Unspecified
All
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1618582

People

(Reporter: agi, Unassigned)

Details

(Whiteboard: [geckoview:m75])

Attachments

(2 files)

Attached file testcase.html

Load minimal example in Fenix Nightly, make sure the url bar is not visible and select text, observe text selection carets are shifted up from where they normally should be.

This is a screenshot of what happens.

:tylin can you take a look?

Flags: needinfo?(aethanyc)
Whiteboard: [geckoview:m75]

CC more people that might know more about mobile viewport.

make sure the url bar is not visible and select text

This step in comment 0 can be reproduced by

  1. Long tap to select any word in the test case.
  2. Swipe up to make the dynamic urlbar disappear.

The text in the test case is in a position:fixed; bottom: 20px; element, so this looks similar to bug 1611032.

I've set a string pref logging.AccessibleCaret="verbose" to dump AccessibleCaret's log in adb logcat to see what AccessibleCaret can observe when the dynamic urlbar is being hidden, but there was only TouchStart, TouchMove, and TouchEnd events. No scroll or apz related callbacks are observed, so AccessibleCaret doesn't aware of something being changed, and it needs to update its position.

Hiro or Botond,
Is there any callback that AccessibleCaret can observe when the dynamic urlbar is changing?

Flags: needinfo?(hikezoe.birchill)
Flags: needinfo?(botond)
Flags: needinfo?(aethanyc)

There is. nsPresContext::UpdateDynamicToolbarOffset for the root prescontext gets called during the dynamic toolbar transitions. But please make sure the change for the AccessibleCaret doesn't cause any reflows.

Flags: needinfo?(hikezoe.birchill)
Flags: needinfo?(botond)

I am curious how Chrome handles AccessibleCaret.

I don't quite follow AccessibleCaret issue on position:fixed elements, but it's not fixed yet?

Thanks Hiro! I'll take a look into nsPresContext::UpdateDynamicToolbarOffset, and maybe AccessibleCaret needs to be a resize event observer.

I don't quite follow AccessibleCaret issue on position:fixed elements, but it's not fixed yet?

Bug 1526268 fixed AccessibleCaret's position on position:fixed elements when scrolling the page. But in this bug, when the dynamic urlbar is changing, no scrolling is involved.

That's good to know. It's probably fixed by bug 1618582. In such cases, the dynamic toolbar should not move in the first place, right? :snorp your patch didn't fix this?

Flags: needinfo?(snorp)

(In reply to Hiroyuki Ikezoe (:hiro) from comment #8)

That's good to know. It's probably fixed by bug 1618582. In such cases, the dynamic toolbar should not move in the first place, right? :snorp your patch didn't fix this?

Yeah, Fenix has to do some stuff on their end: https://github.com/mozilla-mobile/fenix/issues/8768#issuecomment-592718468

Flags: needinfo?(snorp)

Thank you snorp! I am going to mark this bug as a dup of bug 1618582.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

Moving toolbar bugs to the new GeckoView::Toolbar component.

Component: General → Toolbar
Component: Toolbar → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: