Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1364 element.textElement.textContent = title; | 1364 element.textElement.textContent = title; |
| 1365 if (subtitle !== undefined) { | 1365 if (subtitle !== undefined) { |
| 1366 element.subtitleElement = element.textElement.createChild("div", "dt -checkbox-subtitle"); | 1366 element.subtitleElement = element.textElement.createChild("div", "dt -checkbox-subtitle"); |
| 1367 element.subtitleElement.textContent = subtitle; | 1367 element.subtitleElement.textContent = subtitle; |
| 1368 } | 1368 } |
| 1369 } | 1369 } |
| 1370 return element; | 1370 return element; |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 /** | 1373 /** |
| 1374 * @return {!Element} | |
| 1375 * @param {number} min | |
| 1376 * @param {number} max | |
| 1377 */ | |
| 1378 function createSliderLabel(min, max) | |
| 1379 { | |
| 1380 var element = createElement("label", "dt-slider"); | |
| 1381 element.sliderElement.min = min; | |
| 1382 element.sliderElement.max = max; | |
| 1383 element.sliderElement.step = 1; | |
| 1384 return element; | |
| 1385 } | |
| 1386 | |
| 1387 /** | |
| 1374 * @param {!Node} node | 1388 * @param {!Node} node |
| 1375 * @param {string} cssFile | 1389 * @param {string} cssFile |
| 1376 * @suppressGlobalPropertiesCheck | 1390 * @suppressGlobalPropertiesCheck |
| 1377 */ | 1391 */ |
| 1378 WebInspector.appendStyle = function(node, cssFile) | 1392 WebInspector.appendStyle = function(node, cssFile) |
| 1379 { | 1393 { |
| 1380 var content = Runtime.cachedResources[cssFile] || ""; | 1394 var content = Runtime.cachedResources[cssFile] || ""; |
| 1381 if (!content) | 1395 if (!content) |
| 1382 console.error(cssFile + " not preloaded. Check module.json"); | 1396 console.error(cssFile + " not preloaded. Check module.json"); |
| 1383 var styleElement = createElement("style"); | 1397 var styleElement = createElement("style"); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1513 }); | 1527 }); |
| 1514 | 1528 |
| 1515 registerCustomElement("label", "dt-icon-label", { | 1529 registerCustomElement("label", "dt-icon-label", { |
| 1516 /** | 1530 /** |
| 1517 * @this {Element} | 1531 * @this {Element} |
| 1518 */ | 1532 */ |
| 1519 createdCallback: function() | 1533 createdCallback: function() |
| 1520 { | 1534 { |
| 1521 var root = WebInspector.createShadowRootWithCoreStyles(this, "ui/sma llIcon.css"); | 1535 var root = WebInspector.createShadowRootWithCoreStyles(this, "ui/sma llIcon.css"); |
| 1522 this._iconElement = root.createChild("div"); | 1536 this._iconElement = root.createChild("div"); |
| 1523 root.createChild("content"); | 1537 root.createChild("content"); |
|
dgozman
2016/08/24 23:26:59
Removed content in wrong element.
flandy
2016/08/25 00:17:47
Sorry. Fixed.
| |
| 1524 }, | 1538 }, |
| 1525 | 1539 |
| 1526 /** | 1540 /** |
| 1527 * @param {string} type | 1541 * @param {string} type |
| 1528 * @this {Element} | 1542 * @this {Element} |
| 1529 */ | 1543 */ |
| 1530 set type(type) | 1544 set type(type) |
| 1531 { | 1545 { |
| 1532 this._iconElement.className = type; | 1546 this._iconElement.className = type; |
| 1533 }, | 1547 }, |
| 1534 | 1548 |
| 1535 __proto__: HTMLLabelElement.prototype | 1549 __proto__: HTMLLabelElement.prototype |
| 1536 }); | 1550 }); |
| 1537 | 1551 |
| 1552 registerCustomElement("label", "dt-slider", { | |
| 1553 /** | |
| 1554 * @this {Element} | |
| 1555 */ | |
| 1556 createdCallback: function() | |
| 1557 { | |
| 1558 var root = WebInspector.createShadowRootWithCoreStyles(this, "ui/sli der.css"); | |
| 1559 this.sliderElement = createElementWithClass("input", "dt-range-input "); | |
| 1560 this.sliderElement.type = "range"; | |
| 1561 root.createChild("content"); | |
|
dgozman
2016/08/24 19:18:31
You only need content if you append children (e.g.
flandy
2016/08/24 22:08:41
Removed.
| |
| 1562 root.appendChild(this.sliderElement); | |
| 1563 }, | |
| 1564 | |
| 1565 /** | |
| 1566 * @param {number} amount | |
| 1567 * @this {Element} | |
| 1568 */ | |
| 1569 set value(amount) | |
| 1570 { | |
| 1571 this.sliderElement.value = amount; | |
| 1572 }, | |
| 1573 | |
| 1574 /** | |
| 1575 * @this {Element} | |
| 1576 */ | |
| 1577 get value() | |
| 1578 { | |
| 1579 return this.sliderElement.value; | |
| 1580 }, | |
| 1581 | |
| 1582 __proto__: HTMLLabelElement.prototype | |
| 1583 }); | |
| 1584 | |
| 1538 registerCustomElement("div", "dt-close-button", { | 1585 registerCustomElement("div", "dt-close-button", { |
| 1539 /** | 1586 /** |
| 1540 * @this {Element} | 1587 * @this {Element} |
| 1541 */ | 1588 */ |
| 1542 createdCallback: function() | 1589 createdCallback: function() |
| 1543 { | 1590 { |
| 1544 var root = WebInspector.createShadowRootWithCoreStyles(this, "ui/clo seButton.css"); | 1591 var root = WebInspector.createShadowRootWithCoreStyles(this, "ui/clo seButton.css"); |
| 1545 this._buttonElement = root.createChild("div", "close-button"); | 1592 this._buttonElement = root.createChild("div", "close-button"); |
| 1546 }, | 1593 }, |
| 1547 | 1594 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1936 * @param {string} title | 1983 * @param {string} title |
| 1937 * @return {!Element} | 1984 * @return {!Element} |
| 1938 */ | 1985 */ |
| 1939 WebInspector.linkifyDocumentationURLAsNode = function(article, title) | 1986 WebInspector.linkifyDocumentationURLAsNode = function(article, title) |
| 1940 { | 1987 { |
| 1941 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true); | 1988 return WebInspector.linkifyURLAsNode("https://developers.google.com/web/tool s/chrome-devtools/" + article, title, undefined, true); |
| 1942 } | 1989 } |
| 1943 | 1990 |
| 1944 /** @type {!WebInspector.ThemeSupport} */ | 1991 /** @type {!WebInspector.ThemeSupport} */ |
| 1945 WebInspector.themeSupport; | 1992 WebInspector.themeSupport; |
| OLD | NEW |