Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/rendering/replaced-elements/tools/gen-svgsizing-tests.py

Issue 1157863007: W3C Test: import web-platform-tests/html/rendering (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/imported/web-platform-tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 from string import Template
jsbell 2015/06/03 16:43:26 Following https://codereview.chromium.org/11677230
tkent 2015/06/05 01:38:06 Done.
2 import os
3 import sys
4
5 template = Template("""<!DOCTYPE html>
6 <!-- This file is generated by $generator -->
7 <html>
8 <head>
9 <title>SVG sizing: &lt;$placeholder></title>
10 <meta name=timeout content=long>
11 <script src="/resources/testharness.js"></script>
12 <script src="/resources/testharnessreport.js"></script>
13 <script src="../resources/svg-sizing.js"></script>
14 <style>
15 #testContainer {
16 position: absolute;
17 left: 0;
18 top: 0;
19 width: 800px;
20 height: 600px
21 }
22 iframe { border: 0 }
23 </style>
24 <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replace d-width">
25 <link rel="help" href="http://www.w3.org/TR/CSS2/visudet.html#inline-replace d-height">
26 <link rel="help" href="https://html.spec.whatwg.org/multipage/#replaced-elem ents">
27 <link rel="help" href="https://html.spec.whatwg.org/multipage/#attr-dim-widt h">
28 <link rel="help" href="http://www.w3.org/TR/SVG/coords.html#ViewportSpace">
29 </head>
30 <body>
31 <div id="log"></div>
32 <div id="testContainer"></div>
33 <div id="demo"></div>
34 <script src="svg-embedded-sizing.js"></script>
35 <script>testPlaceholderWithHeight("$placeholder", $placeholderHeightAttr)</s cript>
36 </body>
37 </html>
38 """)
39
40 placeholders = [ "object", "iframe", "img" ]
41 placeholderHeightAttrs = [ "null", "'100px'", "'100%'" ]
42 placeholderHeightAttrsDescriptions = [ "auto", "fixed", "percentage" ]
43
44 try:
45 os.makedirs("../svg-embedded-sizing")
46 except OSError:
47 pass
48
49 for placeholder in placeholders:
50 for i, placeholderHeightAttr in enumerate(placeholderHeightAttrs):
51 testContent = template.substitute(placeholder=placeholder, placeholderHe ightAttr=placeholderHeightAttr, generator=sys.argv[0])
52 filename = "../svg-embedded-sizing/svg-in-%s-%s.html" % (placeholder, pl aceholderHeightAttrsDescriptions[i])
53 f = open(filename, "w")
54 f.write(testContent)
55 f.close()
OLDNEW
« no previous file with comments | « LayoutTests/imported/web-platform-tests/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698