Skip to content

Make horizontal padding relative to device width#20093

Merged
calixteman merged 1 commit intomozilla:masterfrom
Aditi-1400:fix-horizontal-scroll
Aug 6, 2025
Merged

Make horizontal padding relative to device width#20093
calixteman merged 1 commit intomozilla:masterfrom
Aditi-1400:fix-horizontal-scroll

Conversation

@Aditi-1400
Copy link
Contributor

@Aditi-1400 Aditi-1400 commented Jul 15, 2025

The fixed -400px horizontal offset used by
scrollIntoView led to horizontal scroll only moving part-way right on narrow screens. The highlights near the right-edge remained party or completely off screen.

This centres the highlighted match on any viewport width while clamping the left margin to 20-400px. On very narrow screens the scrollbar now moves all the way to the right instead of stopping midway.

This change was previously added in #20047 and it was reverted because it caused the regression: #20075
This fixes the regression and also the horizontal scroll.

The test added to check for #20075 only checks for pinch zoom in Chrome since Firefox doesn't support Touch on non-touch devices, so we are just testing it on chrome for now.

I am open to ideas on better ways of testing this. :)

@calixteman
Copy link
Contributor

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/4375380d5de4019/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/0e0e163fb47af3b/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/0e0e163fb47af3b/output.txt

Total script time: 13.43 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/4375380d5de4019/output.txt

Total script time: 28.72 mins

  • Integration Tests: Passed

@calixteman
Copy link
Contributor

/botio-linux preview

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/6ad6660848e57f3/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/6ad6660848e57f3/output.txt

Total script time: 0.96 mins

Published

@Aditi-1400 Aditi-1400 force-pushed the fix-horizontal-scroll branch from 34b9d1b to dc6a573 Compare August 1, 2025 20:39
The fixed -400px horizontal offset used by
scrollIntoView led to horizontal scroll only moving
part-way right on narrow screens. The highlights near
the right-edge remained party or completely off
screen.

This centres the highlighted match on any viewport width while
clamping the left margin to 20-400px. On very narrow screens
the scrollbar now moves all the way to the right instead of
stopping midway.
@Aditi-1400 Aditi-1400 force-pushed the fix-horizontal-scroll branch from dc6a573 to 9babc14 Compare August 4, 2025 09:59
@calixteman
Copy link
Contributor

/botio integrationtest

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 1

Live output at: http://54.241.84.105:8877/d68c28b809a9d13/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @calixteman received. Current queue size: 1

Live output at: http://54.193.163.58:8877/906e67a82fe8b3a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/d68c28b809a9d13/output.txt

Total script time: 13.28 mins

  • Integration Tests: Passed

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/906e67a82fe8b3a/output.txt

Total script time: 33.14 mins

  • Integration Tests: FAILED

Copy link
Contributor

@calixteman calixteman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@calixteman calixteman merged commit fcf69d8 into mozilla:master Aug 6, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants