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

Side by Side Diff: Source/devtools/front_end/toolbox/MediaQueryInspector.js

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.View} 7 * @extends {WebInspector.View}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.MediaQueryInspector = function() 10 WebInspector.MediaQueryInspector = function()
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 _createElementFromMediaQueryModel: function(model) 314 _createElementFromMediaQueryModel: function(model)
315 { 315 {
316 var zoomFactor = this._zoomFactor(); 316 var zoomFactor = this._zoomFactor();
317 var minWidthValue = model.minWidthExpression() ? model.minWidthExpressio n().computedLength() : 0; 317 var minWidthValue = model.minWidthExpression() ? model.minWidthExpressio n().computedLength() : 0;
318 318
319 const styleClassPerSection = [ 319 const styleClassPerSection = [
320 "media-inspector-marker-max-width", 320 "media-inspector-marker-max-width",
321 "media-inspector-marker-min-max-width", 321 "media-inspector-marker-min-max-width",
322 "media-inspector-marker-min-width" 322 "media-inspector-marker-min-width"
323 ]; 323 ];
324 var markerElement = document.createElementWithClass("div", "media-inspec tor-marker"); 324 var markerElement = createElementWithClass("div", "media-inspector-marke r");
325 var leftPixelValue = minWidthValue ? (minWidthValue - this._offset) / zo omFactor : 0; 325 var leftPixelValue = minWidthValue ? (minWidthValue - this._offset) / zo omFactor : 0;
326 markerElement.style.left = leftPixelValue + "px"; 326 markerElement.style.left = leftPixelValue + "px";
327 markerElement.classList.add(styleClassPerSection[model.section()]); 327 markerElement.classList.add(styleClassPerSection[model.section()]);
328 var widthPixelValue = null; 328 var widthPixelValue = null;
329 if (model.maxWidthExpression() && model.minWidthExpression()) 329 if (model.maxWidthExpression() && model.minWidthExpression())
330 widthPixelValue = (model.maxWidthExpression().computedLength() - min WidthValue) / zoomFactor; 330 widthPixelValue = (model.maxWidthExpression().computedLength() - min WidthValue) / zoomFactor;
331 else if (model.maxWidthExpression()) 331 else if (model.maxWidthExpression())
332 widthPixelValue = (model.maxWidthExpression().computedLength() - thi s._offset) / zoomFactor; 332 widthPixelValue = (model.maxWidthExpression().computedLength() - thi s._offset) / zoomFactor;
333 else 333 else
334 markerElement.style.right = "0"; 334 markerElement.style.right = "0";
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 }, 499 },
500 500
501 /** 501 /**
502 * @return {boolean} 502 * @return {boolean}
503 */ 503 */
504 active: function() 504 active: function()
505 { 505 {
506 return this._active; 506 return this._active;
507 } 507 }
508 } 508 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TransformController.js ('k') | Source/devtools/front_end/toolbox/OverridesUI.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698