3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/css-protocol-test.js"></script>
5 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/dom-protocol-test.js"></script>
6 <script type=
"text/javascript">
12 InspectorTest
.requestDocumentNodeId(onDocumentNodeId
);
14 function onDocumentNodeId(nodeId
)
16 documentNodeId
= nodeId
;
17 InspectorTest
.runTestSuite([
18 function testFirstLetterPseudoClass(next
)
20 platformFontsForElementWithSelector("#fancy", next
);
23 function testSelectElementPlatformFonts(next
)
25 platformFontsForElementWithSelector("select", next
);
31 function platformFontsForElementWithSelector(selector
, callback
)
33 InspectorTest
.requestNodeId(documentNodeId
, selector
, onNodeId
);
35 function onNodeId(nodeId
)
37 InspectorTest
.sendCommandOrDie("CSS.getPlatformFontsForNode", { nodeId
: nodeId
}, onGotComputedFonts
);
40 function onGotComputedFonts(response
)
42 dumpComputedFonts(response
);
47 function dumpComputedFonts(response
)
49 var fonts
= response
.fonts
;
50 fonts
.sort(function(a
, b
) {
51 return b
.glyphCount
- a
.glyphCount
;
53 for (var i
= 0; i
< fonts
.length
; ++i
)
54 fonts
[i
].familyName
= "<Some-family-name-" + i
+ ">";
55 InspectorTest
.log(JSON
.stringify(fonts
));
59 window
.addEventListener("DOMContentLoaded", function () {
67 background-color: gray;
70 font-family: 'Times New Roman';
72 background-color: blue;
76 font-family: 'Courier New';
77 background-color: yellow;
85 Some line with
29 characters.
88 <option>Short
</option>
89 <option selected
>Option with a lot of chars.
</option>