Repository navigation
fix(html): probe the text size adjustment in a document of its own - #1252
Merged
Merged
Conversation
andiwand
force-pushed
the
feat/lazy-layout-switch
branch
from
October 24, 2026 20:13
ad29921 to
769f539
Compare
andiwand
force-pushed
the
fix/viewport-zoom-probe
branch
from
October 24, 2026 20:13
a98c698 to
80909a2
Compare
`viewport.js` found at load whether the browser adjusts the text size. It set the zoom of the body twice and `text-size-adjust` on the root. Both are inherited, so each set made the browser compute the style and the layout of the whole page again. On the sheet of 500 K cells in `efficiency-big-1.ods`, that cost 1.8 s of a 4.0 s first frame. The probe now runs the same steps in an `about:blank` iframe, which holds only the probe. The sheet paints its first frame after 2.2 s. The same page without its scripts takes 2.0 s. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017QtawyvLP2SCnoBtnVfFed
The doc said that "the 1.8 s between them" was `viewport.js`, after it named 2.2 s and 2.0 s. The 1.8 s lies between 4.0 s, the page with chunks before the fix, and 2.2 s. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHNzLmVv1mFWfPitHASucN
andiwand
force-pushed
the
fix/viewport-zoom-probe
branch
from
October 24, 2026 20:16
80909a2 to
f98b383
Compare
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.
🤖 Generated with Claude Code
Refs #764.
Summary
At load,
viewport.jsfinds whether the browser adjusts the text size (textAdjustHolds). It set the zoom ofbodyto 1 and then to 0.5, andtext-size-adjuston the root. Both are inherited properties, so each set made the browser compute the style and the layout of the whole page again. A CPU profile of the 500 K-cell sheet ofefficiency-big-1.odsshowed about 2 s inratioand in theelementFromPointcall that follows.The probe now runs the same steps in a hidden
about:blankiframe that holds only the probe. Where the iframe has no document, the probe answersfalse, which leaves the text adjustment alone.efficiency-big-1.ods, sheet 7Test
trueon desktop andfalsewith mobile emulation, which is the case the probe exists for.test/browser/viewport: 17 checks, 0 failed. All 2,530 tests pass.text-size-adjust, so the case that counts is iOS: the iOS app should check that the text keeps its size under a zoom.The reference output changes only in
resources/viewport.js. Pins: public 1ae5868, private 32f5ee7.Review fixes
viewport.js, after it named 2.2 s and 2.0 s. It now says that the page with chunks took 4.0 s before, and 1.8 s of that wasviewport.js.test/browser/viewportgives 17 checks, 0 failed, in two runs. Both new pins descend from the pins on main.