Repository navigation
fix: keep the zoom level of file: and other host-less pages across fragment navigations - #54381
Merged
Merged
Conversation
…agment navigations HostZoomMap keys zoom levels for URLs without a host by their full spec, including the fragment, so on a file: page a location.hash change moved the page to a new key: getZoomLevel() dropped to the default while the page kept its zoom, and the next zoom in/out was computed from the default. Carry the upstream fix (https://chromium-review.googlesource.com/c/chromium/src/+/8467669), which strips the fragment from the keying URL.
|
Release note looks good now. |
deepak1556
approved these changes
Sep 25, 2026
|
Release Notes Persisted
|
This was referenced Sep 26, 2026
Merged
Contributor
|
I have automatically backported this PR to "43-x-y", please check out #54440 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #54441 |
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #54442 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Fixes #44526.
After this change a
loadFile()page (or any URL without a host) keeps its zoom level acrosslocation.hashchanges; today the nextzoomIn/zoomOutafter a hash change starts over from 100%.HostZoomMapkeys zoom levels by host, and by the full URL spec, fragment included, when there is no host. A hash change therefore moved the page to a new key:getZoomLevel()fell back to the default while the renderer kept the old zoom, and the next step was computed from the default. Pages with a host were never affected.This carries the upstream fix, https://chromium-review.googlesource.com/c/chromium/src/+/8467669 (https://crbug.com/565900884), as a patch until it rolls in: the keying URL drops its fragment in the one helper every zoom call site uses, including Electron's
WebContentsZoomController. A spec loads a file page, sets level 2, changes the hash and expects 2; main reads 0.Checklist
Release Notes
Notes: Fixed the zoom level resetting on
file:and other host-less pages after alocation.hashchange.