Skip to content

Commit 553bdd2

Browse files
committed
Test case for html fragment, which should not have margin of a body element applied. cburgmer#78
1 parent 730bd94 commit 553bdd2

File tree

2 files changed

+58
-2
lines changed

2 files changed

+58
-2
lines changed

test/fixtures/testFragment.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<div class="teST">
2+
<style type="text/css">
3+
@font-face {
4+
font-family: "RaphaelIcons";
5+
src: url('raphaelicons-webfont.woff');
6+
}
7+
8+
.bgimage:active {
9+
background-image: url("rednblue.png");
10+
background-size: 100%;
11+
}
12+
.webfont {
13+
font-family: 'RaphaelIcons';
14+
font-size: 10rem;
15+
line-height: 100px;
16+
color: black;
17+
}
18+
.webfont:hover {
19+
color: #f52887;
20+
}
21+
22+
.teST {
23+
margin: 0;
24+
padding: 0;
25+
vertical-align: top;
26+
}
27+
div.teST {
28+
font-size: 10px;
29+
}
30+
span.teST {
31+
float: left;
32+
width: 100px;
33+
height: 100px;
34+
}
35+
</style>
36+
<span class="teST">
37+
<img class="teST" src="green.png" width="100" height="100" alt="green image"/>
38+
</span>
39+
<span class="bgimage webfont teST">
40+
A
41+
</span>
42+
</div>

test/manualIntegrationTestForWebkit.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<iframe src="fixtures/testScaled50PercentWithJs.html" style="width: 200px; height: 100px;"></iframe>
3838
</p>
3939

40-
<p>All five canvases below should show the following image:<br><img src="fixtures/testResult.png" alt="reference image"></p>
40+
<p>All six canvases below should show the following image:<br><img src="fixtures/testResult.png" alt="reference image"></p>
4141

4242
<h3>Test cases</h3>
4343

@@ -125,5 +125,19 @@ <h3>Test cases</h3>
125125
});
126126
</script>
127127
</div>
128-
</body>
128+
129+
<div>
130+
<canvas id="htmlFragmentTest" width="200" height="100"></canvas>
131+
<script type="text/javascript">
132+
testHelper.readHTMLFixture("testFragment.html").then(function (htmlFragment) {
133+
rasterizeHTML.drawHTML(htmlFragment, htmlFragmentTest, {
134+
baseUrl: "fixtures/",
135+
cache: false,
136+
active: '.bgimage',
137+
hover: '.webfont'
138+
});
139+
});
140+
</script>
141+
</div>
142+
</body>
129143
</html>

0 commit comments

Comments
 (0)