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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2259433005: DevTools: Add CSSShadowModel and CSSLength (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } else { 350 } else {
351 if (!element.__editing) 351 if (!element.__editing)
352 return false; 352 return false;
353 element.classList.remove("being-edited"); 353 element.classList.remove("being-edited");
354 delete element.__editing; 354 delete element.__editing;
355 --WebInspector.__editingCount; 355 --WebInspector.__editingCount;
356 } 356 }
357 return true; 357 return true;
358 } 358 }
359 359
360 WebInspector.CSSNumberRegex = /^(-?(?:\d+(?:\.\d+)?|\.\d+))$/;
361
362 WebInspector.StyleValueDelimiters = " \xA0\t\n\"':;,/()"; 360 WebInspector.StyleValueDelimiters = " \xA0\t\n\"':;,/()";
363 361
364
365 /** 362 /**
366 * @param {!Event} event 363 * @param {!Event} event
367 * @return {?string} 364 * @return {?string}
368 */ 365 */
369 WebInspector._valueModificationDirection = function(event) 366 WebInspector._valueModificationDirection = function(event)
370 { 367 {
371 var direction = null; 368 var direction = null;
372 if (event.type === "mousewheel") { 369 if (event.type === "mousewheel") {
373 // When shift is pressed while spinning mousewheel, delta comes as wheel DeltaX. 370 // When shift is pressed while spinning mousewheel, delta comes as wheel DeltaX.
374 if (event.wheelDeltaY > 0 || event.wheelDeltaX > 0) 371 if (event.wheelDeltaY > 0 || event.wheelDeltaX > 0)
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 delta = 10; 456 delta = 10;
460 else if (mouseEvent.altKey) 457 else if (mouseEvent.altKey)
461 delta = 0.1; 458 delta = 0.1;
462 459
463 if (direction === "Down") 460 if (direction === "Down")
464 delta *= -1; 461 delta *= -1;
465 462
466 // Make the new number and constrain it to a precision of 6, this matches nu mbers the engine returns. 463 // Make the new number and constrain it to a precision of 6, this matches nu mbers the engine returns.
467 // Use the Number constructor to forget the fixed precision, so 1.100000 wil l print as 1.1. 464 // Use the Number constructor to forget the fixed precision, so 1.100000 wil l print as 1.1.
468 var result = Number((number + delta).toFixed(6)); 465 var result = Number((number + delta).toFixed(6));
469 if (!String(result).match(WebInspector.CSSNumberRegex)) 466 if (!String(result).match(new RegExp("^(" + WebInspector.CSSNumberRegex.sour ce + ")$")))
470 return null; 467 return null;
471 468
472 return result; 469 return result;
473 } 470 }
474 471
475 /** 472 /**
476 * @param {string} wordString 473 * @param {string} wordString
477 * @param {!Event} event 474 * @param {!Event} event
478 * @param {function(string, number, string):string=} customNumberHandler 475 * @param {function(string, number, string):string=} customNumberHandler
479 * @return {?string} 476 * @return {?string}
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 * @param {string} title 1933 * @param {string} title
1937 * @return {!Element} 1934 * @return {!Element}
1938 */ 1935 */
1939 WebInspector.linkifyDocumentationURLAsNode = function(article, title) 1936 WebInspector.linkifyDocumentationURLAsNode = function(article, title)
1940 { 1937 {
1941 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true); 1938 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true);
1942 } 1939 }
1943 1940
1944 /** @type {!WebInspector.ThemeSupport} */ 1941 /** @type {!WebInspector.ThemeSupport} */
1945 WebInspector.themeSupport; 1942 WebInspector.themeSupport;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698