blob: 7aa4d5967d9ac8394529196e4534fee05ad0ba53 (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
|
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<style>
@font-face {
font-feature-settings:'smcp' 1;
}
@font-face {
-webkit-font-feature-settings:'smcp' 1;
}
</style>
<div style="font-feature-settings:'smcp' 1"></div>
<div style="-webkit-font-feature-settings:'smcp' 1"></div>
<script>
var expected = "'smcp' 1";
var style = document.createElement("foo").style;
test(function () {
assert_true("fontFeatureSettings" in style);
}, "'fontFeatureSettings' in style");
test(function () {
assert_true("webkitFontFeatureSettings" in style);
}, "'webkitFontFeatureSettings' in style");
Array.prototype.forEach.call(document.styleSheets[0].cssRules, function (fontFaceRule) {
testFontFeatureSettings(fontFaceRule.style, fontFaceRule.cssText);
});
Array.prototype.forEach.call(document.querySelectorAll("div[style]"), function (element) {
testFontFeatureSettings(getComputedStyle(element), element.getAttribute("style"));
});
function testFontFeatureSettings(style, title) {
test(function () {
assert_equals(style.fontFeatureSettings, expected);
}, "fontFeatureSettings of '" + title + "' should be '" + expected + "'");
test(function () {
assert_equals(style.webkitFontFeatureSettings, expected);
}, "webkitFontFeatureSettings of '" + title + "' should be '" + expected + "'");
}
</script>
|