Closed Bug 1642603 Opened 4 years ago Closed 4 years ago

Screen jumping while typing in an input field inside a css transformed element with perspective

Categories

(Core :: Layout, defect)

76 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla79
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- verified
firefox77 --- wontfix
firefox78 --- wontfix
firefox79 --- verified
firefox80 --- verified

People

(Reporter: georgekuttya, Assigned: mstange)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36

Steps to reproduce:

Please see the following codepen https://codepen.io/qburst-george/pen/XWXrQLJ, please scroll down and type something in the input field

Actual results:

The page went to top and resulted in a jumping effect

Expected results:

Should not scroll to top

Hi,

Thanks for the details. I was able to reproduce on (OS), on the following versions, on win 10 pro, macOs 10.14 and ubuntu 18.04

I've tried Release 77.0 (64-bit),
Beta 78.0b5 (64-bit) (64-bit) and
Firefox Nightly 79.0a1 (2020-06-11) (64-bit)

This won't occur in chrome.

I will move this over to a component so developers can take a look over it. If is not the correct component please feel free to change it to an appropriate one.

Thanks for the report.

Status: UNCONFIRMED → NEW
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
Product: Firefox → Core

I think that's the code that tries to scroll something into view getting confused.

Component: CSS Parsing and Computation → Layout

Regression window:https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=55a4c8d1591a4131ff318de7e887c37e5c0a1ef9&tochange=b38e8adb53185e985e3006c96a357abeef380a67

:mstange,
Your bunch of patch seems to cause the issue. Can you please look into this?

Flags: needinfo?(mstange)
Has Regression Range: --- → yes
Has STR: --- → yes

Interesting!

Assignee: nobody → mstange
Status: NEW → ASSIGNED
Flags: needinfo?(mstange)

Aha! Well-hidden inside PresShell::ScrollFrameRectIntoView there's a comment that says "This function needs to work even if rect has a width or height of 0."

This patch made it so that for empty rects, the rect's position is considered meaningless. That's not what this caller expects.

The rectangle in this case is the text insertion rectangle for the caret in the textbox, which has a width of zero.

See Also: → 1646361
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/239dea266763
Make TransformAndClipBounds stop discarding the corner positions of empty rectangles. r=kip
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79

Is this something we should consider uplifting to ESR78?

Flags: needinfo?(mstange.moz)

Yes, definitely.

Flags: needinfo?(mstange.moz)

Comment on attachment 9156463 [details]
Bug 1642603 - Make TransformAndClipBounds stop discarding the corner positions of empty rectangles. r=kip

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Annoying regression compared to the previous ESR
  • User impact if declined: Things can scroll to unexpected places when a text field is focused.
  • Fix Landed on Version: 79
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Has tests and has baked on Nightly
  • String or UUID changes made by this patch: none
Attachment #9156463 - Flags: approval-mozilla-esr78?

Comment on attachment 9156463 [details]
Bug 1642603 - Make TransformAndClipBounds stop discarding the corner positions of empty rectangles. r=kip

Sounds like a pretty noticeable issue for users updating to the new ESR release. Approved for 78.1esr.

Attachment #9156463 - Flags: approval-mozilla-esr78? → approval-mozilla-esr78+
Flags: qe-verify+

I managed to reproduce this issue using an older version of Nightly from 2020-06-02 on Windows 10x64.
I verified the fix on Windows 10x64, Ubuntu 18.04x64 and macOS 10.12 using Firefox 78.1 esr, Firefox 79.0 and Firefox 80.0a1. The issue is not reproducing anymore.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: