| 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 /** | 513 /** |
| 514 * @override | 514 * @override |
| 515 */ | 515 */ |
| 516 onFrameResizedThrottled: function() | 516 onFrameResizedThrottled: function() |
| 517 { | 517 { |
| 518 this.onCSSModelChanged(); | 518 this.onCSSModelChanged(); |
| 519 }, | 519 }, |
| 520 | 520 |
| 521 /** | 521 /** |
| 522 * @override | 522 * @override |
| 523 * @param {!WebInspector.DOMNode} changedNode | |
| 524 */ | 523 */ |
| 525 onDOMNodeChanged: function(changedNode) | 524 onDOMModelChanged: function() |
| 526 { | 525 { |
| 527 // Any attribute removal or modification can affect the styles of "relat
ed" nodes. | 526 // Any attribute removal or modification can affect the styles of "relat
ed" nodes. |
| 528 // Do not touch the styles if they are being edited. | 527 // Do not touch the styles if they are being edited. |
| 529 if (this._isEditingStyle || this._userOperation) | 528 if (this._isEditingStyle || this._userOperation) |
| 530 return; | 529 return; |
| 531 | 530 |
| 532 if (!this._canAffectCurrentStyles(changedNode)) | |
| 533 return; | |
| 534 | |
| 535 this._resetCache(); | 531 this._resetCache(); |
| 536 this.update(); | 532 this.update(); |
| 537 }, | 533 }, |
| 538 | 534 |
| 539 /** | 535 /** |
| 540 * @param {?WebInspector.DOMNode} node | |
| 541 */ | |
| 542 _canAffectCurrentStyles: function(node) | |
| 543 { | |
| 544 var currentNode = this.node(); | |
| 545 return currentNode && (currentNode === node || node.parentNode === curre
ntNode.parentNode || node.isAncestor(currentNode)); | |
| 546 }, | |
| 547 | |
| 548 /** | |
| 549 * @param {?{matched: !WebInspector.SectionCascade, pseudo: !Map.<number, !W
ebInspector.SectionCascade>}} cascades | 536 * @param {?{matched: !WebInspector.SectionCascade, pseudo: !Map.<number, !W
ebInspector.SectionCascade>}} cascades |
| 550 */ | 537 */ |
| 551 _innerRebuildUpdate: function(cascades) | 538 _innerRebuildUpdate: function(cascades) |
| 552 { | 539 { |
| 553 this._linkifier.reset(); | 540 this._linkifier.reset(); |
| 554 this._sectionsContainer.removeChildren(); | 541 this._sectionsContainer.removeChildren(); |
| 555 this._sectionBlocks = []; | 542 this._sectionBlocks = []; |
| 556 | 543 |
| 557 var node = this.node(); | 544 var node = this.node(); |
| 558 if (!cascades || !node) | 545 if (!cascades || !node) |
| (...skipping 2709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3268 | 3255 |
| 3269 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { | 3256 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { |
| 3270 /** | 3257 /** |
| 3271 * @return {boolean} | 3258 * @return {boolean} |
| 3272 */ | 3259 */ |
| 3273 fulfilled: function() | 3260 fulfilled: function() |
| 3274 { | 3261 { |
| 3275 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited)
; | 3262 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited)
; |
| 3276 } | 3263 } |
| 3277 } | 3264 } |
| OLD | NEW |