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

Side by Side Diff: tools/cc-frame-viewer/src/ui.js

Issue 12287014: [cc-frame-viewer] Show layers and levels of detail (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 base.exportTo('ui', function() { 5 base.exportTo('ui', function() {
6 6
7 /** 7 /**
8 * Decorates elements as an instance of a class. 8 * Decorates elements as an instance of a class.
9 * @param {string|!Element} source The way to find the element(s) to decorate. 9 * @param {string|!Element} source The way to find the element(s) to decorate.
10 * If this is a string then {@code querySeletorAll} is used to find the 10 * If this is a string then {@code querySeletorAll} is used to find the
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 return Math.round(pixels) + 'px'; 165 return Math.round(pixels) + 'px';
166 } 166 }
167 167
168 function createSpan(opt_text) { 168 function createSpan(opt_text) {
169 var spanEl = document.createElement('span'); 169 var spanEl = document.createElement('span');
170 if (opt_text) 170 if (opt_text)
171 spanEl.textContent = opt_text; 171 spanEl.textContent = opt_text;
172 return spanEl; 172 return spanEl;
173 }; 173 };
174 174
175 function createLabel(text, child) {
176 var labelEl = document.createElement('label');
177 labelEl.textContent = text;
178 labelEl.appendChild(child);
179 return labelEl;
180 };
181
175 return { 182 return {
176 decorate: decorate, 183 decorate: decorate,
177 define: define, 184 define: define,
178 limitInputWidth: limitInputWidth, 185 limitInputWidth: limitInputWidth,
179 toCssPx: toCssPx, 186 toCssPx: toCssPx,
180 createSpan: createSpan 187 createSpan: createSpan,
188 createLabel: createLabel
181 }; 189 };
182 }); 190 });
OLDNEW
« no previous file with comments | « tools/cc-frame-viewer/src/tests.html ('k') | tools/cc-frame-viewer/unittest_data/one_frame_with_layers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698