| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 this._requestShowCallback = requestShowCallback; | 61 this._requestShowCallback = requestShowCallback; |
| 62 | 62 |
| 63 this._createElementStatePane(); | 63 this._createElementStatePane(); |
| 64 this.bodyElement.appendChild(this._elementStatePane); | 64 this.bodyElement.appendChild(this._elementStatePane); |
| 65 this._animationsControlPane = new WebInspector.AnimationControlPane(); | 65 this._animationsControlPane = new WebInspector.AnimationControlPane(); |
| 66 this.bodyElement.appendChild(this._animationsControlPane.element); | 66 this.bodyElement.appendChild(this._animationsControlPane.element); |
| 67 this._sectionsContainer = createElement("div"); | 67 this._sectionsContainer = createElement("div"); |
| 68 this.bodyElement.appendChild(this._sectionsContainer); | 68 this.bodyElement.appendChild(this._sectionsContainer); |
| 69 | 69 |
| 70 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper(); | 70 this._editorPopoverHelper = new WebInspector.EditorPopoverHelper(); |
| 71 | 71 |
| 72 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa
ultCSSFormatter()); | 72 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa
ultCSSFormatter()); |
| 73 | 73 |
| 74 this.element.classList.add("styles-pane"); | 74 this.element.classList.add("styles-pane"); |
| 75 this.element.addEventListener("mousemove", this._mouseMovedOverElement.bind(
this), false); | 75 this.element.addEventListener("mousemove", this._mouseMovedOverElement.bind(
this), false); |
| 76 this._keyDownBound = this._keyDown.bind(this); | 76 this._keyDownBound = this._keyDown.bind(this); |
| 77 this._keyUpBound = this._keyUp.bind(this); | 77 this._keyUpBound = this._keyUp.bind(this); |
| 78 } | 78 } |
| 79 | 79 |
| 80 /** | 80 /** |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // We should update SSP on main frame navigation only. | 356 // We should update SSP on main frame navigation only. |
| 357 var mainFrameNavigated = node && this.node() && node.ownerDocument !== t
his.node().ownerDocument; | 357 var mainFrameNavigated = node && this.node() && node.ownerDocument !== t
his.node().ownerDocument; |
| 358 if (!mainFrameNavigated && node !== this.node()) { | 358 if (!mainFrameNavigated && node !== this.node()) { |
| 359 this.element.classList.toggle("no-affect", this._isEditingStyle); | 359 this.element.classList.toggle("no-affect", this._isEditingStyle); |
| 360 if (this._isEditingStyle) { | 360 if (this._isEditingStyle) { |
| 361 this._pendingNode = node; | 361 this._pendingNode = node; |
| 362 return; | 362 return; |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 | 365 |
| 366 this._stylesPopoverHelper.hide(); | 366 this._editorPopoverHelper.hide(); |
| 367 node = WebInspector.StylesSidebarPane.normalizeNode(node); | 367 node = WebInspector.StylesSidebarPane.normalizeNode(node); |
| 368 | 368 |
| 369 this._resetCache(); | 369 this._resetCache(); |
| 370 this._animationsControlPane.setNode(node); | 370 this._animationsControlPane.setNode(node); |
| 371 if (this._animationTimeline) | 371 if (this._animationTimeline) |
| 372 this._animationTimeline.setNode(node); | 372 this._animationTimeline.setNode(node); |
| 373 WebInspector.ElementsSidebarPane.prototype.setNode.call(this, node); | 373 WebInspector.ElementsSidebarPane.prototype.setNode.call(this, node); |
| 374 }, | 374 }, |
| 375 | 375 |
| 376 /** | 376 /** |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 this.element.ownerDocument.body.addEventListener("keyup", this._keyUpBou
nd, false); | 893 this.element.ownerDocument.body.addEventListener("keyup", this._keyUpBou
nd, false); |
| 894 }, | 894 }, |
| 895 | 895 |
| 896 /** | 896 /** |
| 897 * @override | 897 * @override |
| 898 */ | 898 */ |
| 899 willHide: function() | 899 willHide: function() |
| 900 { | 900 { |
| 901 this.element.ownerDocument.body.removeEventListener("keydown", this._key
DownBound, false); | 901 this.element.ownerDocument.body.removeEventListener("keydown", this._key
DownBound, false); |
| 902 this.element.ownerDocument.body.removeEventListener("keyup", this._keyUp
Bound, false); | 902 this.element.ownerDocument.body.removeEventListener("keyup", this._keyUp
Bound, false); |
| 903 this._stylesPopoverHelper.hide(); | 903 this._editorPopoverHelper.hide(); |
| 904 this._discardElementUnderMouse(); | 904 this._discardElementUnderMouse(); |
| 905 WebInspector.ElementsSidebarPane.prototype.willHide.call(this); | 905 WebInspector.ElementsSidebarPane.prototype.willHide.call(this); |
| 906 }, | 906 }, |
| 907 | 907 |
| 908 _discardElementUnderMouse: function() | 908 _discardElementUnderMouse: function() |
| 909 { | 909 { |
| 910 if (this._elementUnderMouse) | 910 if (this._elementUnderMouse) |
| 911 this._elementUnderMouse.classList.remove("styles-panel-hovered"); | 911 this._elementUnderMouse.classList.remove("styles-panel-hovered"); |
| 912 delete this._elementUnderMouse; | 912 delete this._elementUnderMouse; |
| 913 }, | 913 }, |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2162 var color = WebInspector.Color.parse(text); | 2162 var color = WebInspector.Color.parse(text); |
| 2163 if (!color) | 2163 if (!color) |
| 2164 return createTextNode(text); | 2164 return createTextNode(text); |
| 2165 | 2165 |
| 2166 if (!this._styleRule.editable()) { | 2166 if (!this._styleRule.editable()) { |
| 2167 var swatch = WebInspector.ColorSwatch.create(); | 2167 var swatch = WebInspector.ColorSwatch.create(); |
| 2168 swatch.setColorText(text); | 2168 swatch.setColorText(text); |
| 2169 return swatch; | 2169 return swatch; |
| 2170 } | 2170 } |
| 2171 | 2171 |
| 2172 var stylesPopoverHelper = this._parentPane._stylesPopoverHelper; | 2172 var editorPopoverHelper = this._parentPane._editorPopoverHelper; |
| 2173 return new WebInspector.ColowSwatchPopoverIcon(this, stylesPopoverHelper
, text).element(); | 2173 return new WebInspector.ColorSwatchPopoverIcon(this, editorPopoverHelper
, text).element(); |
| 2174 }, | 2174 }, |
| 2175 | 2175 |
| 2176 /** | 2176 /** |
| 2177 * @return {string} | 2177 * @return {string} |
| 2178 */ | 2178 */ |
| 2179 renderedPropertyText: function() | 2179 renderedPropertyText: function() |
| 2180 { | 2180 { |
| 2181 return this.nameElement.textContent + ": " + this.valueElement.textConte
nt; | 2181 return this.nameElement.textContent + ": " + this.valueElement.textConte
nt; |
| 2182 }, | 2182 }, |
| 2183 | 2183 |
| 2184 /** | 2184 /** |
| 2185 * @param {string} text | 2185 * @param {string} text |
| 2186 * @return {!Node} | 2186 * @return {!Node} |
| 2187 */ | 2187 */ |
| 2188 _processBezier: function(text) | 2188 _processBezier: function(text) |
| 2189 { | 2189 { |
| 2190 var geometry = WebInspector.Geometry.CubicBezier.parse(text); | 2190 var geometry = WebInspector.Geometry.CubicBezier.parse(text); |
| 2191 if (!geometry || !this._styleRule.editable()) | 2191 if (!geometry || !this._styleRule.editable()) |
| 2192 return createTextNode(text); | 2192 return createTextNode(text); |
| 2193 var stylesPopoverHelper = this._parentPane._stylesPopoverHelper; | 2193 var editorPopoverHelper = this._parentPane._editorPopoverHelper; |
| 2194 return new WebInspector.BezierPopoverIcon(this, stylesPopoverHelper, tex
t).element(); | 2194 return new WebInspector.BezierPopoverIcon(this, editorPopoverHelper, tex
t).element(); |
| 2195 }, | 2195 }, |
| 2196 | 2196 |
| 2197 _updateState: function() | 2197 _updateState: function() |
| 2198 { | 2198 { |
| 2199 if (!this.listItemElement) | 2199 if (!this.listItemElement) |
| 2200 return; | 2200 return; |
| 2201 | 2201 |
| 2202 if (this.style().isPropertyImplicit(this.name)) | 2202 if (this.style().isPropertyImplicit(this.name)) |
| 2203 this.listItemElement.classList.add("implicit"); | 2203 this.listItemElement.classList.add("implicit"); |
| 2204 else | 2204 else |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3255 | 3255 |
| 3256 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { | 3256 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { |
| 3257 /** | 3257 /** |
| 3258 * @return {boolean} | 3258 * @return {boolean} |
| 3259 */ | 3259 */ |
| 3260 fulfilled: function() | 3260 fulfilled: function() |
| 3261 { | 3261 { |
| 3262 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited)
; | 3262 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited)
; |
| 3263 } | 3263 } |
| 3264 } | 3264 } |
| OLD | NEW |