Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add a new implementation of text-size-adjust #46288

Closed
wants to merge 1 commit into from

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented May 15, 2024

This patch adds a new implementation of text-size-adjust,
implemented as an alternative property behind a flag. The major
difference of the new property is that it applies as a multiplier to
the font-size and line-height properties purely via computed style,
similar to zoom. The previous implementation applied this multiplier
during layout which had instability bugs due to a cyclic dependency
where the layout size both depended on the font size and changed the
font size (see: crbug.com/40225874#comment4).

Text-size-adjust should only apply on small devices. To ensure there
are no changes in which devices apply text-size-adjust, the new
implementation only applies when the textAutosizingEnabled setting is
enabled.

Additional fixes:

  • A major usecase for text-size-adjust is disabling text autosizing.
    The new implementation contains a fix to match the spec and fully
    disable text autosizing for non-auto values. This is tested with
    text-size-adjust-none.html.
  • Text-size-adjust should apply regardless of whether the text
    autosizer kicks in. Because the new implementation does not use the
    text autosizer, it now matches the spec and does not depend on the
    heuristics of the text autosizer. This is tested with
    text-size-adjust-affects-font-size-with-narrow-page.html.

Bug: 340389272
Change-Id: Ifaa70076bda4d04e7d2a06bca73e002197295163

Reviewed-on: https://chromium-review.googlesource.com/5540222
WPT-Export-Revision: 8b5b9b3c17fac1908b1d4bf443f6963147a9e11b

This patch adds a new implementation of text-size-adjust,
implemented as an alternative property behind a flag. The major
difference of the new property is that it applies as a multiplier to
the font-size and line-height properties purely via computed style,
similar to zoom. The previous implementation applied this multiplier
during layout which had instability bugs due to a cyclic dependency
where the layout size both depended on the font size and changed the
font size (see: crbug.com/40225874#comment4).

Text-size-adjust should only apply on small devices. To ensure there
are no changes in which devices apply text-size-adjust, the new
implementation only applies when the textAutosizingEnabled setting is
enabled.

Additional fixes:
* A major usecase for text-size-adjust is disabling text autosizing.
  The new implementation contains a fix to match the spec and fully
  disable text autosizing for non-auto values. This is tested with
  `text-size-adjust-none.html`.
* Text-size-adjust should apply regardless of whether the text
  autosizer kicks in. Because the new implementation does not use the
  text autosizer, it now matches the spec and does not depend on the
  heuristics of the text autosizer. This is tested with
  `text-size-adjust-affects-font-size-with-narrow-page.html`.

Bug: 340389272
Change-Id: Ifaa70076bda4d04e7d2a06bca73e002197295163
@chromium-wpt-export-bot
Copy link
Collaborator Author

Close this PR because the Chromium CL does not have exportable changes.

@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-5540222 branch May 21, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants