Commit 6c3f4045 authored by Erik Luo's avatar Erik Luo Committed by Commit Bot

DevTools: update empty style text on inspected node change

Style sidebar's empty text updates visibility when the filter changes.
It should also update when the inspected node changes.

Bug: 849208
Change-Id: I1f5e2eeb12deecef312fbc9b50f69afd3317ab06
Reviewed-on: https://chromium-review.googlesource.com/1132348Reviewed-by: default avatarAndrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575541}
parent f5b382ea
......@@ -144,8 +144,10 @@ Elements.ComputedStyleWidget = class extends UI.ThrottledWidget {
this._propertiesOutline.removeChildren();
this._linkifier.reset();
const cssModel = this._computedStyleModel.cssModel();
if (!nodeStyle || !matchedStyles || !cssModel)
if (!nodeStyle || !matchedStyles || !cssModel) {
this._noMatchesElement.classList.remove('hidden');
return;
}
const uniqueProperties = nodeStyle.computedStyle.keysArray();
uniqueProperties.sort(propertySorter);
......
......@@ -432,8 +432,10 @@ Elements.StylesSidebarPane = class extends Elements.ElementsSidebarPane {
this._sectionBlocks = [];
const node = this.node();
if (!matchedStyles || !node)
if (!matchedStyles || !node) {
this._noMatchesElement.classList.remove('hidden');
return;
}
this._sectionBlocks =
await this._rebuildSectionsForMatchedStyleRules(/** @type {!SDK.CSSMatchedStyles} */ (matchedStyles));
......@@ -476,6 +478,8 @@ Elements.StylesSidebarPane = class extends Elements.ElementsSidebarPane {
if (this._filterRegex)
this._updateFilter();
else
this._noMatchesElement.classList.toggle('hidden', this._sectionBlocks.length > 0);
this._nodeStylesUpdatedForTest(/** @type {!SDK.DOMNode} */ (node), true);
if (this._decorator) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment