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

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: Created 5 years, 8 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 _updateTarget: function(target) 370 _updateTarget: function(target)
371 { 371 {
372 if (this._target === target) 372 if (this._target === target)
373 return; 373 return;
374 if (this._target) { 374 if (this._target) {
375 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetAdded, this._styleSheetOrMediaQueryResultChanged, this); 375 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetAdded, this._styleSheetOrMediaQueryResultChanged, this);
376 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetRemoved, this._styleSheetOrMediaQueryResultChanged, this); 376 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetRemoved, this._styleSheetOrMediaQueryResultChanged, this);
377 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetChanged, this._styleSheetOrMediaQueryResultChanged, this); 377 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetChanged, this._styleSheetOrMediaQueryResultChanged, this);
378 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .MediaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this); 378 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .MediaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this);
379 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .PseudoStateForced, this._styleSheetOrMediaQueryResultChanged, this); 379 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .PseudoStateForced, this._styleSheetOrMediaQueryResultChanged, this);
380 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Node Inserted, this._styleSheetOrMediaQueryResultChanged, this);
381 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Node Removed, this._styleSheetOrMediaQueryResultChanged, this);
382 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Dist ributedNodesChanged, this._styleSheetOrMediaQueryResultChanged, this);
380 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Modified, this._attributeChanged, this); 383 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Modified, this._attributeChanged, this);
381 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Removed, this._attributeChanged, this); 384 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Removed, this._attributeChanged, this);
382 this._target.resourceTreeModel.removeEventListener(WebInspector.Reso urceTreeModel.EventTypes.FrameResized, this._frameResized, this); 385 this._target.resourceTreeModel.removeEventListener(WebInspector.Reso urceTreeModel.EventTypes.FrameResized, this._frameResized, this);
383 } 386 }
384 this._target = target; 387 this._target = target;
385 if (target) { 388 if (target) {
386 this._domModel = WebInspector.DOMModel.fromTarget(target); 389 this._domModel = WebInspector.DOMModel.fromTarget(target);
387 this._cssModel = WebInspector.CSSStyleModel.fromTarget(target); 390 this._cssModel = WebInspector.CSSStyleModel.fromTarget(target);
388 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetAdded, this._styleSheetOrMediaQueryResultChanged, this); 391 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetAdded, this._styleSheetOrMediaQueryResultChanged, this);
389 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetRemoved, this._styleSheetOrMediaQueryResultChanged, this); 392 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetRemoved, this._styleSheetOrMediaQueryResultChanged, this);
390 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetChanged, this._styleSheetOrMediaQueryResultChanged, this); 393 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetChanged, this._styleSheetOrMediaQueryResultChanged, this);
391 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Me diaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this); 394 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Me diaQueryResultChanged, this._styleSheetOrMediaQueryResultChanged, this);
392 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Ps eudoStateForced, this._styleSheetOrMediaQueryResultChanged, this); 395 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Ps eudoStateForced, this._styleSheetOrMediaQueryResultChanged, this);
396 this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeIns erted, this._styleSheetOrMediaQueryResultChanged, this);
397 this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeRem oved, this._styleSheetOrMediaQueryResultChanged, this);
398 this._domModel.addEventListener(WebInspector.DOMModel.Events.Distrib utedNodesChanged, this._styleSheetOrMediaQueryResultChanged, this);
393 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrMod ified, this._attributeChanged, this); 399 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrMod ified, this._attributeChanged, this);
394 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrRem oved, this._attributeChanged, this); 400 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrRem oved, this._attributeChanged, this);
395 this._target.resourceTreeModel.addEventListener(WebInspector.Resourc eTreeModel.EventTypes.FrameResized, this._frameResized, this); 401 this._target.resourceTreeModel.addEventListener(WebInspector.Resourc eTreeModel.EventTypes.FrameResized, this._frameResized, this);
396 } 402 }
397 }, 403 },
398 404
399 /** 405 /**
400 * @param {!WebInspector.StylePropertiesSection=} editedSection 406 * @param {!WebInspector.StylePropertiesSection=} editedSection
401 */ 407 */
402 _refreshUpdate: function(editedSection) 408 _refreshUpdate: function(editedSection)
(...skipping 3039 matching lines...) Expand 10 before | Expand all | Expand 10 after
3442 3448
3443 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = { 3449 WebInspector.StylesSidebarPane.MatchedRulesPayload.prototype = {
3444 /** 3450 /**
3445 * @return {boolean} 3451 * @return {boolean}
3446 */ 3452 */
3447 fulfilled: function() 3453 fulfilled: function()
3448 { 3454 {
3449 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited) ; 3455 return !!(this.matchedCSSRules && this.pseudoElements && this.inherited) ;
3450 } 3456 }
3451 } 3457 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698