summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/csstext-of-content-string.html
blob: 8295da96250bcb17898502878d3c5bef6d6a9063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!doctype html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
<style id='style'>
#A::after { content: 'A'; }
#B::after { content: '\'B\''; }
#C::after { content: '\'C\''; }
#D::after { content: '\'D\'' url(http://example.com/) 'EFG'; }
</style>
</head>
<body>
  <div id='A'></div>
  <div id='B'></div>
  <div id='C'></div>
  <div id='D'></div>
  <pre id='console'></pre>
</body>
<script>
description('Tests if a css text of content value is quoted when the value is string.');

var style = document.getElementById('style');
shouldBeEqualToString("style.sheet.cssRules[0].cssText", "#A::after { content: \"A\"; }");
shouldBeEqualToString("style.sheet.cssRules[1].cssText", "#B::after { content: \"'B'\"; }");
shouldBeEqualToString("style.sheet.cssRules[2].cssText", "#C::after { content: \"'C\\8 '\"; }");
shouldBeEqualToString("style.sheet.cssRules[3].cssText", "#D::after { content: \"'D'\" url(\"http://example.com/\") \"EFG\"; }");
</script>
</html>