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

[layout] Perform replaced aspect-ratio calculation with doubles. #22447

Merged
merged 1 commit into from Mar 28, 2020

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Mar 25, 2020

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2117464 branch from f72468b to f8e1b39 Mar 26, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot changed the title [layout] Perform replaced aspect-ratio calculation in LayoutUnits. [layout] Perform replaced aspect-ratio calculation with doubles. Mar 26, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2117464 branch from f8e1b39 to 75de97d Mar 26, 2020
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}
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2117464 branch from 75de97d to 0251f1e Mar 28, 2020
@chromium-wpt-export-bot chromium-wpt-export-bot merged commit 7667269 into master Mar 28, 2020
13 checks passed
13 checks passed
Azure Pipelines Build #20200328.7 succeeded
Details
Azure Pipelines (./wpt test-jobs) ./wpt test-jobs succeeded
Details
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
Community-TC (pull_request) TaskGroup: success
Details
staging.wpt.fyi - chrome[experimental] Chrome results
Details
staging.wpt.fyi - firefox[experimental] Firefox results
Details
staging.wpt.fyi - safari[experimental] Safari results
Details
wpt.fyi - chrome[experimental] Chrome results
Details
wpt.fyi - firefox[experimental] Firefox results
Details
wpt.fyi - safari[experimental] Safari results
Details
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-2117464 branch Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.