Closed Bug 1624955 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 22447 - [layout] Perform replaced aspect-ratio calculation in LayoutUnits.

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 22447 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/22447
Details from upstream follow.

Ian Kilpatrick <ikilpatrick@chromium.org> wrote:

[layout] Perform replaced aspect-ratio calculation in LayoutUnits.

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 all be in LayoutUnits
this means we don't have the loss of precision when converting to/from
floats.

Bug: 1052370
Change-Id: Ic242c224fec17eeec8f1469c0a6c1fe2ed85c4d2

Reviewed-on: https://chromium-review.googlesource.com/2117464
WPT-Export-Revision: 351530e532b2e50fbdb9a306cc79c2bcc9e64168

Component: web-platform-tests → Layout
Product: Testing → Core
Test result changes from PR not available.
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e64a1e911180
[wpt PR 22447] - [layout] Perform replaced aspect-ratio calculation with doubles., a=testonly
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.