Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for mapping of width/height to aspect-ratio
This covers video, img and canvas. This is for whatwg/html#6032. See also #26010. R=masonfreed@chromium.org, yoavweiss@chromium.org Bug: 1137004 Change-Id: I38d690412af67836e4fdede11c5b4938e47f138f
- Loading branch information
1 parent
f6ace0d
commit cb3caf2
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...ng/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function test_computed_style_aspect_ratio(tag, attributes, expected) { | ||
var elem = document.createElement(tag); | ||
for (name in attributes) { | ||
let val = attributes[name]; | ||
if (val !== null) | ||
elem.setAttribute(name, val); | ||
} | ||
document.body.appendChild(elem); | ||
assert_equals(getComputedStyle(elem).aspectRatio, expected); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters