Bug 1727047 [wpt PR 30121] - Fix aspect-ratio mapping for <canvas>, a=testonly
commit26786d22454551e047476c6d75e36c5b6780777a
authorFredrik Söderqvist <fs@opera.com>
Wed, 1 Sep 2021 14:03:13 +0000 (1 14:03 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 2 Sep 2021 10:30:06 +0000 (2 10:30 +0000)
treebeaba6e727a46f5de0a11e6311bba993bb1831c7
parent2f89c4313454a87704da5eea7c496eb4f0d65700
Bug 1727047 [wpt PR 30121] - Fix aspect-ratio mapping for <canvas>, a=testonly

Automatic update from web-platform-tests
Fix aspect-ratio mapping for <canvas>

'width' and 'height' on a <canvas> element should be mapped to
'aspect-ratio' per the 'map to the aspect-ratio property' rule - which
uses the rules for parsing non-negative integers rather than those for
dimensions values (as implemented by ApplyAspectRatioToStyle() on
HTMLElement).

Split out the CSSValue creation and actual style application from
ApplyAspectRatioToStyle() and then add ApplyIntegerAspectRatioToStyle()
that follows the rule mentioned above.

Bug: 989839, 1209223
Change-Id: I996208c1f5d5fd29a90ef6ed0af716ed8027b7c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3109968
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Cr-Commit-Position: refs/heads/main@{#914260}

--

wpt-commits: caebb4680217da6689803d142afbd2224ec3bae3
wpt-pr: 30121
testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio.html