Skip to content

Commit

Permalink
Add ARIA, MathML, SVG, XHTML tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 19, 2018
1 parent 3841f38 commit 108c177
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/fixtures/aria/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en"><meta charset="utf-8"><title>ARIA</title>
<form>
<fieldset><legend>Login</legend>
<div>
<label for="username">Username</label>
<input id="username" aria-describedby="username-tip" required>
<div role="tooltip" id="username-tip">Your username is your email address</div>
</div>
<div>
<label for="password">Password</label>
<input id="password" aria-describedby="password-tip" required>
<div role="tooltip" id="password-tip">Was emailed to you when you signed up</div>
</div>
</fieldset>
</form>
24 changes: 24 additions & 0 deletions test/fixtures/aria/output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>ARIA</title>
</head>
<body>
<form>
<fieldset>
<legend>Login</legend>
<div>
<label for="username">Username</label>
<input id="username" aria-describedby="username-tip" required>
<div role="tooltip" id="username-tip">Your username is your email address</div>
</div>
<div>
<label for="password">Password</label>
<input id="password" aria-describedby="password-tip" required>
<div role="tooltip" id="password-tip">Was emailed to you when you signed up</div>
</div>
</fieldset>
</form>
</body>
</html>
9 changes: 9 additions & 0 deletions test/fixtures/html-in-svg-in-html/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!doctype html>
<meta charset="utf-8"><title>SVG</title>
<h1>HTML in SVG in HTML</h1>
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300">
<switch>
<foreignObject width="200" height="100" requiredExtensions="http://www.w3.org/1999/xhtml"><p xmlns="http://www.w3.org/1999/xhtml">Here is an HTML paragraph that requires word wrap</p></foreignObject>
<text font-size="16"><tspan x="0" y="14">Here is an SVG paragraph</tspan><tspan x="0" y="32">that requires word wrap.</tspan></text>
</switch>
</svg>
21 changes: 21 additions & 0 deletions test/fixtures/html-in-svg-in-html/output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>SVG</title>
</head>
<body>
<h1>HTML in SVG in HTML</h1>
<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300">
<switch>
<foreignObject width="200" height="100" requiredExtensions="http://www.w3.org/1999/xhtml">
<p xmlns="http://www.w3.org/1999/xhtml">Here is an HTML paragraph that requires word wrap</p>
</foreignObject>
<text font-size="16">
<tspan x="0" y="14">Here is an SVG paragraph</tspan>
<tspan x="0" y="32">that requires word wrap.</tspan>
</text>
</switch>
</svg>
</body>
</html>
23 changes: 23 additions & 0 deletions test/fixtures/mathml/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<title>MathML</title>
<h1>The quadratic formula</h1>
<p>
<math>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo form="prefix"></mo> <mi>b</mi>
<mo>±</mo>
<msqrt>
<msup> <mi>b</mi> <mn>2</mn> </msup>
<mo></mo>
<mn>4</mn> <mo></mo> <mi>a</mi> <mo></mo> <mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mn>2</mn> <mo></mo> <mi>a</mi>
</mrow>
</mfrac>
</math>
</p>
39 changes: 39 additions & 0 deletions test/fixtures/mathml/output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!doctype html>
<html>
<head>
<title>MathML</title>
</head>
<body>
<h1>The quadratic formula</h1>
<p>
<math>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo form="prefix"></mo>
<mi>b</mi>
<mo>±</mo>
<msqrt>
<msup>
<mi>b</mi>
<mn>2</mn>
</msup>
<mo></mo>
<mn>4</mn>
<mo></mo>
<mi>a</mi>
<mo></mo>
<mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mn>2</mn>
<mo></mo>
<mi>a</mi>
</mrow>
</mfrac>
</math>
</p>
</body>
</html>
7 changes: 7 additions & 0 deletions test/fixtures/svg/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 200">
<title>Variable: shape</title>
<rect x="55" y="35" width="40" height="40"/>
<circle cx="75" cy="110" r="25"/>
<path d="M 50 145 L 100 145 L 75 185 z"/>
</svg>
12 changes: 12 additions & 0 deletions test/fixtures/svg/output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head></head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 200">
<title>Variable: shape</title>
<rect x="55" y="35" width="40" height="40"></rect>
<circle cx="75" cy="110" r="25"></circle>
<path d="M 50 145 L 100 145 L 75 185 z"></path>
</svg>
</body>
</html>
4 changes: 4 additions & 0 deletions test/fixtures/xhtml/input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<title>Example document</title>
<p>Example paragraph</p>
9 changes: 9 additions & 0 deletions test/fixtures/xhtml/output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!--?xml version="1.0" encoding="UTF-8"?-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Example document</title>
</head>
<body>
<p>Example paragraph</p>
</body>
</html>

0 comments on commit 108c177

Please sign in to comment.