<!-- Valid src descriptor rules. -->
<style>
@font-face {
    src: url(font.ttf);
}
@font-face {
    src: url(http://foo/bar/font.ttf);
}
@font-face {
    src: url(font.svg#id);
}
@font-face {
    src: url(font.ttf) format("truetype");
}
@font-face {
    src: url(font.woff) format("woff"), local(font2);
}
@font-face {
    src: url(font.ttf) format("truetype"), url(font2.ttf);
}
@font-face {
    src: url(font.ttf), url(font2.ttf) format("truetype");
}
@font-face {
    src: url(font.ttf), local(font2), url(font3.otf) format("opentype"), local(foo bar);
}
@font-face {
    src: local(foo);
}
@font-face {
    src: local(font), local(foo bar);
}
@font-face {
    src: local("foo");
}
@font-face {
    src: local("foo bar");
}
@font-face {
    src: url(font.ttf),;
}
@font-face {
    src: url(font.ttf), local(font2),;
}
@font-face {
    src: ,local(font);
}
@font-face {
    src: url(font.ttf), invalid();
}
@font-face {
    src: url(foo.ttf), invalid;
}
</style>

<!-- Invalid src descriptor rules. -->
<style>
@font-face {
    src: url(font.ttf invalid);
}
@font-face {
    src: url(foo.ttf) invalid;
}
@font-face {
    src: url(foo.ttf) "invalid";
}
</style>
<p>Test parsing the src descriptor of @font-face.</p>

<p>Valid rules from the stylesheet:</p>
<div id="validResult"></div>

<p>Invalid rules from the stylesheet:</p>
<pre id="invalidResult"></pre>

<script>
if (window.testRunner)
    testRunner.dumpAsText();

var validRules = document.styleSheets[0].cssRules;
var result = '';
for (var i = 0; i < validRules.length; ++i) {
    var itemText = validRules.item(i).cssText.replace(/file:.*LayoutTests\/fast\/css\//, '');
    result += itemText + '\n';
}
document.getElementById('validResult').innerText = result;

var invalidRules = document.styleSheets[1].cssRules;
result = '';
for (var i = 0; i < invalidRules.length; ++i) {
    var itemText = invalidRules.item(i).cssText;
    result += itemText + '\n';
}
document.getElementById('invalidResult').innerText = result;
</script>
