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

Side by Side Diff: Source/core/xml/DocumentXMLTreeViewer.js

Issue 757963002: [Blink-in-JS] 'Import' function to load sub-modules and other resources for private scripts (Part-3) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implementing privateScriptController.import Created 6 years 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
« no previous file with comments | « Source/bindings/core/v8/PrivateScriptRunner.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 var xmlTreeViewerCSS = privateScriptController.import("DocumentXMLTreeViewer.css ");
8
7 privateScriptController.installClass("Document", function(DocumentPrototype) { 9 privateScriptController.installClass("Document", function(DocumentPrototype) {
8 // FIXME: The stylesheet should be defined in a separate css file
9 var styleSheet = [
10 "div.header {",
11 " border-bottom: 2px solid black;",
12 " padding-bottom: 5px;",
13 " margin: 10px;",
14 "}",
15 "",
16 "div.collapsible > div.hidden {",
17 " display:none;",
18 "}",
19 "",
20 ".pretty-print {",
21 " margin-top: 1em;",
22 " margin-left: 20px;",
23 " font-family: monospace;",
24 " font-size: 13px;",
25 "}",
26 "",
27 "#webkit-xml-viewer-source-xml {",
28 " display: none;",
29 "}",
30 "",
31 ".collapsible-content {",
32 " margin-left: 1em;",
33 "}",
34 ".comment {",
35 " white-space: pre;",
36 "}",
37 "",
38 ".button {",
39 " -webkit-user-select: none;",
40 " cursor: pointer;",
41 " display: inline-block;",
42 " margin-left: -10px;",
43 " width: 10px;",
44 " background-repeat: no-repeat;",
45 " background-position: left top;",
46 " vertical-align: bottom;",
47 "}",
48 "",
49 ".collapse-button {",
50 " background-image: -webkit-canvas(arrowDown);",
51 " height: 10px;",
52 "}",
53 "",
54 ".expand-button {",
55 " background-image: -webkit-canvas(arrowRight);",
56 " height: 11px;",
57 "}"].join('');
58 var nodeParentPairs = []; 10 var nodeParentPairs = [];
59 var tree; 11 var tree;
60 12
61 function prepareWebKitXMLViewer(noStyleMessage) 13 function prepareWebKitXMLViewer(noStyleMessage)
62 { 14 {
63 var html = createHTMLElement('html'); 15 var html = createHTMLElement('html');
64 var head = createHTMLElement('head'); 16 var head = createHTMLElement('head');
65 html.appendChild(head); 17 html.appendChild(head);
66 var style = createHTMLElement('style'); 18 var style = createHTMLElement('style');
67 style.id = 'xml-viewer-style'; 19 style.id = 'xml-viewer-style';
68 style.appendChild(document.createTextNode(styleSheet)); 20 style.appendChild(document.createTextNode(xmlTreeViewerCSS));
69 head.appendChild(style); 21 head.appendChild(style);
70 var body = createHTMLElement('body'); 22 var body = createHTMLElement('body');
71 html.appendChild(body); 23 html.appendChild(body);
72 var sourceXML = createHTMLElement('div'); 24 var sourceXML = createHTMLElement('div');
73 sourceXML.id = 'webkit-xml-viewer-source-xml'; 25 sourceXML.id = 'webkit-xml-viewer-source-xml';
74 body.appendChild(sourceXML); 26 body.appendChild(sourceXML);
75 27
76 var child; 28 var child;
77 while (child = document.firstChild) { 29 while (child = document.firstChild) {
78 document.removeChild(child); 30 document.removeChild(child);
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 { 409 {
458 // To prevent selection on double click 410 // To prevent selection on double click
459 e.preventDefault(); 411 e.preventDefault();
460 } 412 }
461 413
462 DocumentPrototype.transformDocumentToTreeView = function(noStyleMessage) { 414 DocumentPrototype.transformDocumentToTreeView = function(noStyleMessage) {
463 prepareWebKitXMLViewer(noStyleMessage); 415 prepareWebKitXMLViewer(noStyleMessage);
464 } 416 }
465 }); 417 });
466 418
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/PrivateScriptRunner.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698