OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 "-webkit-media-controls-time-remaining-display", "-webkit-media-controls-ful lscreen-button", | 86 "-webkit-media-controls-time-remaining-display", "-webkit-media-controls-ful lscreen-button", |
87 "-webkit-media-controls-toggle-closed-captions-button", "-webkit-media-contr ols-status-display", "-webkit-scrollbar-thumb", | 87 "-webkit-media-controls-toggle-closed-captions-button", "-webkit-media-contr ols-status-display", "-webkit-scrollbar-thumb", |
88 "-webkit-scrollbar-button", "-webkit-scrollbar-track", "-webkit-scrollbar-tr ack-piece", "-webkit-scrollbar-corner", | 88 "-webkit-scrollbar-button", "-webkit-scrollbar-track", "-webkit-scrollbar-tr ack-piece", "-webkit-scrollbar-corner", |
89 "-webkit-resizer", "-webkit-inner-spin-button", "-webkit-outer-spin-button" | 89 "-webkit-resizer", "-webkit-inner-spin-button", "-webkit-outer-spin-button" |
90 ]; | 90 ]; |
91 | 91 |
92 WebInspector.StylesSidebarPane._colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA- F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g; | 92 WebInspector.StylesSidebarPane._colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA- F]{6}|#[0-9a-fA-F]{3}|\b\w+\b(?!-))/g; |
93 | 93 |
94 /** | 94 /** |
95 * @param {!WebInspector.CSSProperty} property | 95 * @param {!WebInspector.CSSProperty} property |
96 * @return {!Element} | |
96 */ | 97 */ |
97 WebInspector.StylesSidebarPane.createExclamationMark = function(property) | 98 WebInspector.StylesSidebarPane.createExclamationMark = function(property) |
98 { | 99 { |
99 var exclamationElement = document.createElement("div"); | 100 var exclamationElement = document.createElement("div"); |
100 exclamationElement.className = "exclamation-mark" + (WebInspector.StylesSide barPane._ignoreErrorsForProperty(property) ? "" : " warning-icon-small"); | 101 exclamationElement.className = "exclamation-mark" + (WebInspector.StylesSide barPane._ignoreErrorsForProperty(property) ? "" : " warning-icon-small"); |
101 exclamationElement.title = WebInspector.CSSMetadata.cssPropertiesMetainfo.ke ySet()[property.name.toLowerCase()] ? WebInspector.UIString("Invalid property va lue.") : WebInspector.UIString("Unknown property name."); | 102 exclamationElement.title = WebInspector.CSSMetadata.cssPropertiesMetainfo.ke ySet()[property.name.toLowerCase()] ? WebInspector.UIString("Invalid property va lue.") : WebInspector.UIString("Unknown property name."); |
102 return exclamationElement; | 103 return exclamationElement; |
103 } | 104 } |
104 | 105 |
105 /** | 106 /** |
(...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2681 | 2682 |
2682 /** | 2683 /** |
2683 * @param {!Element} element | 2684 * @param {!Element} element |
2684 */ | 2685 */ |
2685 _isValueElement: function(element) | 2686 _isValueElement: function(element) |
2686 { | 2687 { |
2687 return !!element.enclosingNodeOrSelfWithClass("value"); | 2688 return !!element.enclosingNodeOrSelfWithClass("value"); |
2688 }, | 2689 }, |
2689 | 2690 |
2690 /** | 2691 /** |
2691 * @param {!Element=} selectElement | 2692 * @param {?Element=} selectElement |
2692 */ | 2693 */ |
2693 startEditing: function(selectElement) | 2694 startEditing: function(selectElement) |
2694 { | 2695 { |
2695 // FIXME: we don't allow editing of longhand properties under a shorthan d right now. | 2696 // FIXME: we don't allow editing of longhand properties under a shorthan d right now. |
2696 if (this.parent.isShorthand) | 2697 if (this.parent.isShorthand) |
2697 return; | 2698 return; |
2698 | 2699 |
2699 if (selectElement === this._expandElement) | 2700 if (selectElement === this._expandElement) |
2700 return; | 2701 return; |
2701 | 2702 |
2702 var section = this.section(); | 2703 var section = this.section(); |
2703 if (section && !section.editable) | 2704 if (section && !section.editable) |
2704 return; | 2705 return; |
2705 | 2706 |
2706 if (!selectElement) | 2707 if (!selectElement) |
2707 selectElement = this.nameElement; // No arguments passed in - edit t he name element by default. | 2708 selectElement = this.nameElement; // No arguments passed in - edit t he name element by default. |
2708 else | 2709 else |
2709 selectElement = selectElement.enclosingNodeOrSelfWithClass("webkit-c ss-property") || selectElement.enclosingNodeOrSelfWithClass("value"); | 2710 selectElement = /** @type {?Element} */ (selectElement.enclosingNode OrSelfWithClass("webkit-css-property") || selectElement.enclosingNodeOrSelfWithC lass("value")); |
aandrey
2014/06/17 11:33:54
why this cast?
apavlov
2014/06/17 12:46:03
Thanks, refined the return type
| |
2710 | 2711 |
2711 if (WebInspector.isBeingEdited(selectElement)) | 2712 if (WebInspector.isBeingEdited(selectElement)) |
2712 return; | 2713 return; |
2713 | 2714 |
2714 var isEditingName = selectElement === this.nameElement; | 2715 var isEditingName = selectElement === this.nameElement; |
2715 if (!isEditingName) | 2716 if (!isEditingName) |
2716 this.valueElement.textContent = restoreURLs(this.valueElement.textCo ntent, this.value); | 2717 this.valueElement.textContent = restoreURLs(this.valueElement.textCo ntent, this.value); |
2717 | 2718 |
2718 /** | 2719 /** |
2719 * @param {string} fieldValue | 2720 * @param {string} fieldValue |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3317 return; | 3318 return; |
3318 } | 3319 } |
3319 | 3320 |
3320 var results = this._cssCompletions.startsWith(prefix); | 3321 var results = this._cssCompletions.startsWith(prefix); |
3321 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 3322 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
3322 completionsReadyCallback(results, selectedIndex); | 3323 completionsReadyCallback(results, selectedIndex); |
3323 }, | 3324 }, |
3324 | 3325 |
3325 __proto__: WebInspector.TextPrompt.prototype | 3326 __proto__: WebInspector.TextPrompt.prototype |
3326 } | 3327 } |
OLD | NEW |