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

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1104163003: Devtools: [ElementsPanel] Add dom listeners in sidebars (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@move-force-state
Patch Set: Address offline comments Created 5 years, 7 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) 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
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 536 * @param {?WebInspector.DOMNode} node
541 */ 537 */
542 _canAffectCurrentStyles: function(node) 538 _canAffectCurrentStyles: function(node)
lushnikov 2015/05/26 18:24:30 you can remove this
sergeyv 2015/05/26 21:09:06 Done.
543 { 539 {
544 var currentNode = this.node(); 540 var currentNode = this.node();
545 return currentNode && (currentNode === node || node.parentNode === curre ntNode.parentNode || node.isAncestor(currentNode)); 541 return currentNode && (currentNode === node || node.parentNode === curre ntNode.parentNode || node.isAncestor(currentNode));
546 }, 542 },
547 543
548 /** 544 /**
549 * @param {?{matched: !WebInspector.SectionCascade, pseudo: !Map.<number, !W ebInspector.SectionCascade>}} cascades 545 * @param {?{matched: !WebInspector.SectionCascade, pseudo: !Map.<number, !W ebInspector.SectionCascade>}} cascades
550 */ 546 */
551 _innerRebuildUpdate: function(cascades) 547 _innerRebuildUpdate: function(cascades)
552 { 548 {
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after
3268 3264
3269 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { 3265 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = {
3270 /** 3266 /**
3271 * @return {boolean} 3267 * @return {boolean}
3272 */ 3268 */
3273 fulfilled: function() 3269 fulfilled: function()
3274 { 3270 {
3275 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited) ; 3271 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited) ;
3276 } 3272 }
3277 } 3273 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698