https://bugs.webkit.org/show_bug.cgi?id=78780
Reviewed by Vsevolod Vlasov.
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylePropertiesSection):
(WebInspector.StylePropertiesSection.prototype._handleSelectorDoubleClick):
(WebInspector.StylePropertyTreeElement.prototype):
* inspector/front-end/elementsPanel.css:
(.styles-section.matched-styles .properties):
(.styles-section.matched-styles .properties li):
(.styles-section .properties li.parent::before):
(.styles-section .properties li.parent.expanded::before):
(.styles-section.matched-styles .properties li.parent .expand-element):
(.styles-section.matched-styles .properties li.parent.expanded .expand-element):
(.styles-section.computed-style .properties li.parent::before):
(.styles-section.computed-style .properties li.parent.expanded::before):
(.styles-section.matched-styles:not(.read-only):hover .properties .enabled-button):
(.styles-section.matched-styles:not(.read-only) .properties li.disabled .enabled-button):
(.styles-section .properties .enabled-button):
(.styles-section.matched-styles .properties ol.expanded):
* inspector/front-end/treeoutline.js:
(TreeElement.treeElementDoubleClicked):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107933
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-16 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: move style disable checkboxes to the left
+ https://bugs.webkit.org/show_bug.cgi?id=78780
+
+ Reviewed by Vsevolod Vlasov.
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertiesSection):
+ (WebInspector.StylePropertiesSection.prototype._handleSelectorDoubleClick):
+ (WebInspector.StylePropertyTreeElement.prototype):
+ * inspector/front-end/elementsPanel.css:
+ (.styles-section.matched-styles .properties):
+ (.styles-section.matched-styles .properties li):
+ (.styles-section .properties li.parent::before):
+ (.styles-section .properties li.parent.expanded::before):
+ (.styles-section.matched-styles .properties li.parent .expand-element):
+ (.styles-section.matched-styles .properties li.parent.expanded .expand-element):
+ (.styles-section.computed-style .properties li.parent::before):
+ (.styles-section.computed-style .properties li.parent.expanded::before):
+ (.styles-section.matched-styles:not(.read-only):hover .properties .enabled-button):
+ (.styles-section.matched-styles:not(.read-only) .properties li.disabled .enabled-button):
+ (.styles-section .properties .enabled-button):
+ (.styles-section.matched-styles .properties ol.expanded):
+ * inspector/front-end/treeoutline.js:
+ (TreeElement.treeElementDoubleClicked):
+
2012-02-16 Yury Semikhatsky <yurys@chromium.org>
Web Inspector: show memory counter graphics when switching to memory view
WebInspector.StylePropertiesSection = function(parentPane, styleRule, editable, isInherited, isFirstSection)
{
WebInspector.PropertiesSection.call(this, "");
- this.element.className = "styles-section monospace" + (isFirstSection ? " first-styles-section" : "");
+ this.element.className = "styles-section matched-styles monospace" + (isFirstSection ? " first-styles-section" : "");
if (styleRule.media) {
for (var i = styleRule.media.length - 1; i >= 0; --i) {
{
this._startEditingOnMouseEvent();
event.stopPropagation();
+ event.preventDefault();
},
_startEditingOnMouseEvent: function()
nameElement.title = this.property.propertyText;
this.nameElement = nameElement;
+ this._expandElement = document.createElement("span");
+ this._expandElement.className = "expand-element";
+
var valueElement = document.createElement("span");
valueElement.className = "value";
this.valueElement = valueElement;
return;
// Append the checkbox for root elements of an editable section.
- if (enabledCheckboxElement && this.treeOutline.section && this.treeOutline.section.editable && this.parent.root)
+ if (enabledCheckboxElement && this.treeOutline.section && this.parent.root && !this.section.computedStyle)
this.listItemElement.appendChild(enabledCheckboxElement);
this.listItemElement.appendChild(nameElement);
this.listItemElement.appendChild(document.createTextNode(": "));
+ this.listItemElement.appendChild(this._expandElement);
this.listItemElement.appendChild(valueElement);
this.listItemElement.appendChild(document.createTextNode(";"));
{
this.startEditing(event.target);
event.stopPropagation();
+ event.preventDefault();
},
_isNameElement: function(element)
if (this.parent.shorthand)
return;
+ if (selectElement === this._expandElement)
+ return;
+
if (this.treeOutline.section && !this.treeOutline.section.editable)
return;
if (styleText.length && !/;\s*$/.test(styleText))
styleText += ";";
this.property.setText(styleText, majorChange, callback.bind(this, userOperationFinishedCallback.bind(null, this._parentPane, updateInterface), this.originalPropertyText));
+ },
+
+ ondblclick: function()
+ {
+ return true; // handled
+ },
+
+ isEventWithinDisclosureTriangle: function(event)
+ {
+ if (!this.section.computedStyle)
+ return event.target === this._expandElement;
+ return TreeElement.prototype.isEventWithinDisclosureTriangle.call(this, event);
}
}
.styles-section .properties {
display: none;
margin: 0;
- padding: 2px 4px 0 8px;
+ padding: 2px 4px 0 6px;
list-style: none;
clear: both;
}
+.styles-section.matched-styles .properties {
+ padding-left: 0;
+}
+
.styles-section.no-affect .properties li {
opacity: 0.5;
}
overflow: hidden;
cursor: auto;
}
-
-.styles-section .properties li.parent {
- margin-left: 1px;
+.styles-section.matched-styles .properties li {
+ margin-left: 0 !important;
}
.styles-section .properties li.child-editing {
}
.styles-section .properties li.parent::before {
+ content: none;
+}
+
+.styles-section .properties li.parent.expanded::before {
+ content: none;
+}
+
+.styles-section.matched-styles .properties li.parent .expand-element {
+ content: url(Images/treeRightTriangleBlack.png);
+ margin-right: 1px;
+ margin-left: -5px;
+ opacity: 0.6;
+}
+
+.styles-section.matched-styles .properties li.parent.expanded .expand-element {
+ content: url(Images/treeDownTriangleBlack.png);
+}
+
+.styles-section.computed-style .properties li.parent::before {
content: url(Images/treeRightTriangleBlack.png);
opacity: 0.75;
float: left;
cursor: default;
}
-.styles-section .properties li.parent.expanded::before {
+.styles-section.computed-style .properties li.parent.expanded::before {
content: url(Images/treeDownTriangleBlack.png);
margin-top: 1px;
}
padding-bottom: 3px;
}
-.styles-section:hover .properties .enabled-button {
- display: block;
+.styles-section.matched-styles:not(.read-only):hover .properties .enabled-button {
+ visibility: visible;
}
-.styles-section .properties li.disabled .enabled-button {
- display: block;
+.styles-section.matched-styles:not(.read-only) .properties li.disabled .enabled-button {
+ visibility: visible;
}
.styles-section .properties .enabled-button {
- display: none;
- float: right;
+ visibility: hidden;
+ float: left;
font-size: 10px;
- margin: 0 0 0 4px;
+ margin: 0 5px 0 0;
vertical-align: top;
position: relative;
z-index: 1;
}
+.styles-section.matched-styles .properties ol.expanded {
+ margin-left: 16px;
+}
+
.styles-section .properties .overloaded, .styles-section .properties .inactive, .styles-section .properties .disabled {
text-decoration: line-through;
}
if (!element || !element.treeElement)
return;
- if (element.treeElement.ondblclick)
- element.treeElement.ondblclick.call(element.treeElement, event);
- else if (element.treeElement.hasChildren && !element.treeElement.expanded)
+ if (element.treeElement.ondblclick) {
+ var handled = element.treeElement.ondblclick.call(element.treeElement, event);
+ if (handled)
+ return;
+ } else if (element.treeElement.hasChildren && !element.treeElement.expanded)
element.treeElement.expand();
}