[layout] Perform replaced aspect-ratio calculation with doubles. #22447
Conversation
The review process for this patch is being conducted in the Chromium project. |
f72468b
to
f8e1b39
f8e1b39
to
75de97d
See bug for more detailed information. Basically the site in the bug had images all with an aspect ratio of 1/1. With browser zoom, we hit a situation where the width != height due to a loss of precision in the conversion from: LayoutUnit -> float -> LayoutUnit. Resulting in a LayoutUnit(1) difference in the width and height. This patch changes the aspect-ratio calculation to use doubles meaning we retain some precision in the: LayoutUnit -> double -> LayoutUnit conversion. Bug: 1052370 Change-Id: Ic242c224fec17eeec8f1469c0a6c1fe2ed85c4d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117464 Reviewed-by: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: Christian Biesinger <cbiesinger@chromium.org> Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/master@{#754238}
75de97d
to
0251f1e
7667269
into
master
13 checks passed
13 checks passed
Azure Pipelines (affected tests without changes: Safari Technology Preview)
affected tests without changes: Safari Technology Preview succeeded
Details
Azure Pipelines (affected tests: Safari Technology Preview)
affected tests: Safari Technology Preview succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests)
wpt.fyi hook: safari-preview-affected-tests succeeded
Details
Azure Pipelines (wpt.fyi hook: safari-preview-affected-tests-without-changes)
wpt.fyi hook: safari-preview-affected-tests-without-changes succeeded
Details
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.
See bug for more detailed information.
Basically the site in the bug had images all with an aspect ratio of 1/1.
With browser zoom, we hit a situation where the width != height due to
a loss of precision in the conversion from:
LayoutUnit -> float -> LayoutUnit.
Resulting in a LayoutUnit(1) difference in the width and height.
This patch changes the aspect-ratio calculation to use doubles meaning
we retain some precision in the:
LayoutUnit -> double -> LayoutUnit conversion.
Bug: 1052370
Change-Id: Ic242c224fec17eeec8f1469c0a6c1fe2ed85c4d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2117464
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Christian Biesinger <cbiesinger@chromium.org>
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754238}