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

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/text_measure.js

Issue 39123003: [Files.app] Split the JavaScript files into subdirectories: common, background, and foreground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test failure. Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 /** 7 /**
8 * TextMeasure constructor. 8 * TextMeasure constructor.
9 * 9 *
10 * TextMeasure is a measure for text that returns the width of text. This 10 * TextMeasure is a measure for text that returns the width of text. This
(...skipping 30 matching lines...) Expand all
41 * Measures the width of text. 41 * Measures the width of text.
42 * 42 *
43 * @param {string} text Text that is measured the width. 43 * @param {string} text Text that is measured the width.
44 * @return {number} Width of the specified text. 44 * @return {number} Width of the specified text.
45 */ 45 */
46 TextMeasure.prototype.getWidth = function(text) { 46 TextMeasure.prototype.getWidth = function(text) {
47 this.dummySpan_.innerText = text; 47 this.dummySpan_.innerText = text;
48 var rect = this.dummySpan_.getBoundingClientRect(); 48 var rect = this.dummySpan_.getBoundingClientRect();
49 return rect ? rect.width : 0; 49 return rect ? rect.width : 0;
50 }; 50 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698