diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/html/rendering/replaced-elements/tools | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/rendering/replaced-elements/tools')
-rw-r--r-- | testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py b/testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py new file mode 100644 index 0000000000..5ba69f8ab5 --- /dev/null +++ b/testing/web-platform/tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py @@ -0,0 +1,55 @@ +from string import Template +import os +import sys + +template = Template("""<!DOCTYPE html> +<!-- This file is generated by $generator --> +<html> + <head> + <title>SVG sizing: <$placeholder></title> + <meta name=timeout content=long> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="../resources/svg-sizing.js"></script> + <style> + #testContainer { + position: absolute; + left: 0; + top: 0; + width: 800px; + height: 600px + } + iframe { border: 0 } + </style> + <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width"> + <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replaced-height"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elements"> + <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-width"> + <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace"> + </head> + <body> + <div id="log"></div> + <div id="testContainer"></div> + <div id="demo"></div> + <script src="svg-embedded-sizing.js"></script> + <script>testPlaceholderWithHeight("$placeholder", $placeholderHeightAttr)</script> + </body> +</html> +""") + +placeholders = [ "object", "iframe", "img" ] +placeholderHeightAttrs = [ "null", "'100px'", "'100%'" ] +placeholderHeightAttrsDescriptions = [ "auto", "fixed", "percentage" ] + +try: + os.makedirs("../svg-embedded-sizing") +except OSError: + pass + +for placeholder in placeholders: + for i, placeholderHeightAttr in enumerate(placeholderHeightAttrs): + testContent = template.substitute(placeholder=placeholder, placeholderHeightAttr=placeholderHeightAttr, generator=sys.argv[0]) + filename = "../svg-embedded-sizing/svg-in-%s-%s.html" % (placeholder, placeholderHeightAttrsDescriptions[i]) + f = open(filename, "w") + f.write(testContent) + f.close() |