Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(950)

Side by Side Diff: LayoutTests/inspector-protocol/css-get-platform-fonts.html

Issue 22923010: DevTools: Add CSS.getPlatformFontsForNode in protocol.json (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use HFONT instead of SKTypeface on Win Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css-get-platform-fonts-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../http/tests/inspector-protocol/resources/p rotocol-test.js"></script>
4 <script type="text/javascript">
5
6 function test()
7 {
8 function sendCommand(command, properties, callback) {
9 InspectorTest.sendCommand(command, properties || {}, commandCallback);
10 function commandCallback(msg)
11 {
12 if (msg.error) {
13 InspectorTest.log(msg.error.message);
14 InspectorTest.completeTest();
15 return;
16 }
17 callback(msg.result);
18 }
19 }
20 sendCommand("DOM.getDocument", {}, onGotDocument);
21
22 function onGotDocument(result)
23 {
24 var root = result.root;
25 sendCommand("DOM.querySelector", { "nodeId": root.nodeId , "selector": " #fancy" }, onGotNode);
26 }
27
28 function onGotNode(node)
29 {
30 sendCommand("CSS.getPlatformFontsForNode", { "nodeId": node.nodeId }, on GotComputedFonts);
31 }
32
33 function onGotComputedFonts(response)
34 {
35 var fonts = response.fonts;
36 fonts.sort(function(a, b) {
37 return b.glyphCount - a.glyphCount;
38 });
39 for (var i = 0; i < fonts.length; ++i)
40 fonts[i].familyName = "<Some-family-name-" + i + ">";
41 InspectorTest.log(JSON.stringify(fonts));
42 InspectorTest.completeTest();
43 }
44 };
45
46 window.addEventListener("DOMContentLoaded", function () {
47 runTest();
48 }, false);
49
50 </script>
51 <style>
52 #fancy {
53 font-family: 'Arial';
54 background-color: gray;
55 }
56 #fancy:first-letter {
57 font-family: 'Times New Roman';
58 font-size: 400%;
59 background-color: blue;
60 }
61
62 #fancy:first-line {
63 font-family: 'Courier New';
64 background-color: yellow;
65 }
66 </style>
67 </head>
68 <body>
69
70 <div id="fancy">
71 First line.
72 <br>
73 Second line.
74 </div>
75
76 </body>
77 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/css-get-platform-fonts-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698