diff options
Diffstat (limited to 'testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js')
-rw-r--r-- | testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js new file mode 100644 index 0000000000..c6826f271a --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/resources/aspect-ratio.js @@ -0,0 +1,14 @@ +function test_computed_style_aspect_ratio(tag, attributes, expected) { + test(function() { + var elem = document.createElement(tag); + for (name in attributes) { + let val = attributes[name]; + if (val !== null) + elem.setAttribute(name, val); + } + document.body.appendChild(elem); + let aspectRatio = getComputedStyle(elem).aspectRatio; + assert_equals(aspectRatio, expected); + elem.remove(); + }, `Computed style test: ${tag} with ${JSON.stringify(attributes)}`); +} |