Commit 23eca3d6 authored by luoe's avatar luoe Committed by Commit Bot

DevTools: migrate PropertiesWidget to shadow

BUG=726972

Review-Url: https://codereview.chromium.org/2978713002
Cr-Commit-Position: refs/heads/master@{#488482}
parent 42d2353c
......@@ -32,7 +32,8 @@
*/
Elements.PropertiesWidget = class extends UI.ThrottledWidget {
constructor() {
super();
super(true /* isWebComponent */);
this.registerRequiredCSS('elements/propertiesWidget.css');
SDK.targetManager.addModelListener(SDK.DOMModel, SDK.DOMModel.Events.AttrModified, this._onNodeChange, this);
SDK.targetManager.addModelListener(SDK.DOMModel, SDK.DOMModel.Events.AttrRemoved, this._onNodeChange, this);
......@@ -65,7 +66,7 @@ Elements.PropertiesWidget = class extends UI.ThrottledWidget {
}
if (!this._node) {
this.element.removeChildren();
this.contentElement.removeChildren();
this.sections = [];
return Promise.resolve();
}
......@@ -127,7 +128,7 @@ Elements.PropertiesWidget = class extends UI.ThrottledWidget {
for (var i = 0; i < sections.length; ++i)
expanded.push(sections[i].expanded);
this.element.removeChildren();
this.contentElement.removeChildren();
this.sections = [];
// Get array of property user-friendly names.
......@@ -140,7 +141,7 @@ Elements.PropertiesWidget = class extends UI.ThrottledWidget {
var section = new ObjectUI.ObjectPropertiesSection(property, title);
section.element.classList.add('properties-widget-section');
this.sections.push(section);
this.element.appendChild(section.element);
this.contentElement.appendChild(section.element);
if (expanded[this.sections.length - 1])
section.expand();
section.addEventListener(UI.TreeOutline.Events.ElementExpanded, this._propertyExpanded, this);
......
......@@ -59,11 +59,6 @@
border-top: 1px solid #ccc;
}
.properties-widget-section {
padding: 2px 0px 2px 5px;
flex: none;
}
.elements-tree-header {
height: 24px;
border-top: 1px solid #eee;
......
......@@ -279,6 +279,7 @@
"elementsTreeOutline.css",
"metricsSidebarPane.css",
"platformFontsWidget.css",
"propertiesWidget.css",
"stylesSectionTree.css",
"stylesSidebarPane.css"
]
......
/*
* Copyright (c) 2017 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
.properties-widget-section {
padding: 2px 0px 2px 5px;
flex: none;
}
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