Closed Bug 1605889 Opened 6 years ago Closed 6 years ago

Reset address bar scroll position on blur to show LTR origins

Categories

(Firefox :: Address Bar, defect, P3)

defect
Points:
3

Tracking

()

VERIFIED FIXED
Firefox 74
Tracking Status
firefox-esr68 --- unaffected
firefox72 --- unaffected
firefox73 --- verified
firefox74 --- verified

People

(Reporter: itiel_yn8, Assigned: mak)

References

(Regressed 1 open bug, Regression)

Details

(Keywords: parity-chrome, parity-edge, regression)

Attachments

(1 file)

STR:

  1. Overflow the urlbar with a long url, hit enter
  2. Click the urlbar, hit End
  3. Unfocus the urlbar

AR:
URL is scrolled to the end, and the domain part is hidden

ER:
URL gets scrolled back to the origin, and the domain part is displayed.

Regressed by bug 1593964, mozregression claims part 3 is the exact regressor.

Can you reproduce with the megabar disabled?

Flags: needinfo?(itiel_yn8)

(In reply to Dão Gottwald [::dao] from comment #1)

Can you reproduce with the megabar disabled?

By toggling browser.urlbar.update1 to false and restarting? Yes.

Flags: needinfo?(itiel_yn8)

(In reply to Itiel from comment #0)

Regressed by bug 1593964, mozregression claims part 3 is the exact regressor.

Marco, can you take a look?

Flags: needinfo?(mak)

Sorry, missed that comment 2 suggests this reproduces with megabar disabled too.

I'll have a look, but I can't reproduce atm, unless AR and ER are inverted or I missed something.

Is this with an RTL build, with an RTL domain?

Assignee: nobody → mak
Status: NEW → ASSIGNED
Points: --- → 3
Flags: needinfo?(mak) → needinfo?(itiel_yn8)
Priority: -- → P3

(In reply to Marco Bonardo [:mak] from comment #5)

unless AR and ER are inverted or I missed something.

Ah yes, that was the case. Fixed now.

Is this with an RTL build, with an RTL domain?

Doesn't matter if the domain is RTL.
IIRC this is an issue regardless of RTL/LTR directionality.

Flags: needinfo?(itiel_yn8)

I'm still investigating reasons, but I must specify that it was not part 3 regressing this, it was part 1... That makes sense, I moved some selection code there, the reasons that code was added were not related, but it looks like it ended up supporting this case. I'll revise those changes and find a better call point for them.

Ok, I didn't technically regress this, what happened is that Bug 1571018 inadvertenly made us set the selection to zero on blur, with the scope of clearing an existing selection, not certainly to ensure the origin stays visible. That ended up "fixing" this bug. When I moved that code to a better position for its scope, in bug 1593964, I removed the accidental fix for this bug.
I went back to a version in May 2019 and even then we didn't use to move the selection.

I don't know what's the expected behavior here, we surely care that the origin is visible at least once, and that already happens on load.
I suspect we didn't change the selection on blur to avoid too much visual jumping, though while this was in the tree nobody really complained so... I guess we could fix it properly.

I think the current behavior makes sense for people who might want to edit, blur, and then continue to edit for whatever reason. There doesn't seem to be a strong case for resetting the scroll position on blur so I think we could just wontfix this.

(In reply to Dão Gottwald [::dao] from comment #9)

I think the current behavior makes sense for people who might want to edit, blur, and then continue to edit for whatever reason. There doesn't seem to be a strong case for resetting the scroll position on blur so I think we could just wontfix this.

Bug 1593964 comment 9 claims there's a security issue but I'm not sure I'd frame it that way.

(In reply to Dão Gottwald [::dao] from comment #9)

I think the current behavior makes sense for people who might want to edit, blur, and then continue to edit for whatever reason. There doesn't seem to be a strong case for resetting the scroll position on blur so I think we could just wontfix this.

Both sides have their pro and cons. I thought about the "continue editing" case, but if you use the keyboard shortcut we select the whole url (resetting the selection) and if you click on the urlbar, we either select all (still losing your position) or put the cursor where you click. The latter case happens only on Linux (provided we're not going to clickSelectsAll there, as discussed many times) or profiles with disabled clickSelectsAll, plus this would only affect cases where you are editing a long url at the end. So it's an edge case.

Moreover, for urls with RTL domains the formatter already ensures that the domain stays visible, so fixing this would make the behavior more coherent.
Considered that this new behavior has been in the product for months without negative feedback, it slightly improves security by keeping the origin visible, and it's coherent with RTL domains mode, I think we should fix this. There seems to be a little bit more benefits than downsides.

I also checked what other browsers do, both Edge and Chrome seem to act like it's requested here (reset scroll position on blur).

Summary: Domain part of the url gets hidden → Restore scroll position to show LTR origins on blur
Summary: Restore scroll position to show LTR origins on blur → Reset address bar scroll position on blur to show LTR origins
Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/c95e424797ec Ensure LTR origins stay visible on urlbar blur. r=dao
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 74
Status: RESOLVED → VERIFIED

Thanks for verifying this, Itiel. Mak, please nominate this for Beta approval when you get a chance.

Flags: needinfo?(mak)
Flags: in-testsuite+

Comment on attachment 9121293 [details]
Bug 1605889 - Ensure LTR origins stay visible on urlbar blur. r=dao

Beta/Release Uplift Approval Request

  • User impact if declined: On blur we don't reset the urlbar input field scroll position to keep the origin in sight.
    This patch reverts that behavior (reset scroll position) that we already had "by accident" in previous version, and that is on parity with other browsers
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0 has steps
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): it's mirroring what we already do for RTL domains, single line code change with test.
  • String changes made/needed:
Flags: needinfo?(mak)
Attachment #9121293 - Flags: approval-mozilla-beta?
Flags: qe-verify+

Comment on attachment 9121293 [details]
Bug 1605889 - Ensure LTR origins stay visible on urlbar blur. r=dao

Fixes an accidental change in behavior with the location bar and provides more consistent behavior with other browsers. Approved for 73.0b8.

Attachment #9121293 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-triaged]

Steps to reproduce are vague. I have noticed the difference between the affected and fixed builds and I have used these steps:

  1. Open the browser and load this test page:
    'http://chart.apis.google.com/chart?chs=500x500&chma=0,0,100,100&cht=p&chco=FF0000%2CFFFF00%7CFF8000%2C00FF00%7C00FF00%2C0000FF&chd=t%3A122%2C42%2C17%2C10%2C8%2C7%2C7%2C7%2C7%2C6%2C6%2C6%2C6%2C5%2C5&chl=122%7C42%7C17%7C10%7C8%7C7%7C7%7C7%7C7%7C6%7C6%7C6%7C6%7C5%7C5&chdl=android%7Cjava%7Cstack-trace%7Cbroadcastreceiver%7Candroid-ndk%7Cuser-agent%7Candroid-webview%7Cwebview%7Cbackground%7Cmultithreading%7Candroid-source%7Csms%7Cadb%7Csollections%7Cactivity|Chart'
  2. Click the link in the address bar to select it whole.
  3. Tap the right arrow key from the keyboard to go to the end of the link.
  4. Deselect the link/address bar by chicking anywhere else on the content area of the page.
    Affected: The link will remain displayed alligned to the right.
    Fixed: The link will reset to the normal left allignment.

With these steps I have verified this fix in Nightly v74.0a1 from 2020-01-20 and Beta v73.0b8 on Windows 10 and Mac OS 10.14.
Please confirm that these steps are valid to verify the fix!

Flags: qe-verify+

Yep, looks good to me. Thank you.

Regressions: 1614689
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: