<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193118] branches/safari-601-branch/Source/WebInspectorUI</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193118">193118</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 10:48:31 -0800 (Thu, 03 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188572">r188572</a>. rdar://problem/23221163</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceWebInspectorUIChangeLog">branches/safari-601-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleDetailsPaneljs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleNumberInputBoxjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorTreeItemcss">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.css</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorTreeItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/ChangeLog (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2015-12-02 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r188572. rdar://problem/23221163
+
+ 2015-08-17 Devin Rousso <drousso@apple.com>
+
+ Web Inspector: Style changes to Visual sidebar selector items
+ https://bugs.webkit.org/show_bug.cgi?id=148114
+
+ Reviewed by Timothy Hatcher.
+
+ * Localizations/en.lproj/localizedStrings.js:
+ * UserInterface/Views/GeneralTreeElement.js:
+ (WebInspector.GeneralTreeElement.prototype._updateTitleElements):
+ (WebInspector.GeneralTreeElement.prototype._updateTitleTooltip):
+ Moved the code to update the item tooltip to its own function.
+
+ * UserInterface/Views/VisualStyleDetailsPanel.js:
+ (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.editorMouseover):
+ (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.editorMouseout):
+ (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners):
+ (WebInspector.VisualStyleDetailsPanel.prototype._generateMetricSectionRows):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populateMarginSection):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populatePaddingSection):
+ (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.onEditorMouseover): Deleted.
+ (WebInspector.VisualStyleDetailsPanel.prototype._addMetricsMouseListeners.onEditorMouseout): Deleted.
+ Added on-hover node/selector highlighting to margin and padding editor links.
+
+ * UserInterface/Views/VisualStyleNumberInputBox.js:
+ (WebInspector.VisualStyleNumberInputBox):
+ Replaced "No Units" with "Number" for better clarity.
+
+ * UserInterface/Views/VisualStyleSelectorTreeItem.css:
+ (body:not(.window-inactive, .window-docked-inactive) .item.visual-style-selector-item.selected > input[type="checkbox"]:checked::before):
+ (.item.visual-style-selector-item.selected > input[type="checkbox"]::before): Deleted.
+ Removes the white border when the window is inactive and when the checkbox is unchecked.
+
+ * UserInterface/Views/VisualStyleSelectorTreeItem.js:
+ (WebInspector.VisualStyleSelectorTreeItem.prototype._commitSelector):
+ Now updates the title of the item when the selector changes.
+
+2015-12-02 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r188571. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-08-17 Devin Rousso <drousso@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -397,13 +397,13 @@
</span><span class="cx"> localizedStrings["No Response Headers"] = "No Response Headers";
</span><span class="cx"> localizedStrings["No Results Found"] = "No Results Found";
</span><span class="cx"> localizedStrings["No Search Results"] = "No Search Results";
</span><del>-localizedStrings["No Units"] = "No Units";
</del><span class="cx"> localizedStrings["No Watch Expressions"] = "No Watch Expressions";
</span><span class="cx"> localizedStrings["No exact ARIA role match."] = "No exact ARIA role match.";
</span><span class="cx"> localizedStrings["No message"] = "No message";
</span><span class="cx"> localizedStrings["No properties."] = "No properties.";
</span><span class="cx"> localizedStrings["Node"] = "Node";
</span><span class="cx"> localizedStrings["Not found"] = "Not found";
</span><ins>+localizedStrings["Number"] = "Number";
</ins><span class="cx"> localizedStrings["Offset"] = "Offset";
</span><span class="cx"> localizedStrings["Online"] = "Online";
</span><span class="cx"> localizedStrings["Opacity"] = "Opacity";
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -342,21 +342,26 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Set a default tooltip if there isn't a custom one already assigned.
</span><del>- if (!this.tooltip && !this._tooltipHandledSeparately) {
- console.assert(this._listItemNode);
</del><ins>+ if (!this.tooltip && !this._tooltipHandledSeparately)
+ this._updateTitleTooltip();
+ }
</ins><span class="cx">
</span><del>- // Get the textContent for the elements since they can contain other nodes,
- // and the tool tip only cares about the text.
- var mainTitleText = this._mainTitleElement.textContent;
- var subtitleText = this._subtitleElement ? this._subtitleElement.textContent : "";
</del><ins>+ _updateTitleTooltip()
+ {
+ console.assert(this._listItemNode);
+ if (!this._listItemNode)
+ return;
</ins><span class="cx">
</span><del>- if (mainTitleText && subtitleText)
- this._listItemNode.title = mainTitleText + (this._small && !this._twoLine ? " \u2014 " : "\n") + subtitleText;
- else if (mainTitleText)
- this._listItemNode.title = mainTitleText;
- else
- this._listItemNode.title = subtitleText;
- }
</del><ins>+ // Get the textContent for the elements since they can contain other nodes,
+ // and the tool tip only cares about the text.
+ var mainTitleText = this._mainTitleElement.textContent;
+ var subtitleText = this._subtitleElement ? this._subtitleElement.textContent : "";
+ if (mainTitleText && subtitleText)
+ this._listItemNode.title = mainTitleText + (this._small && !this._twoLine ? " \u2014 " : "\n") + subtitleText;
+ else if (mainTitleText)
+ this._listItemNode.title = mainTitleText;
+ else
+ this._listItemNode.title = subtitleText;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _updateStatusElement()
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleDetailsPaneljs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -328,8 +328,30 @@
</span><span class="cx"> this._populateSection(group, [displayGroup]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- _generateMetricSectionRows(group, prefix, allowNegatives)
</del><ins>+ _addMetricsMouseListeners(editor, mode)
</ins><span class="cx"> {
</span><ins>+ function editorMouseover() {
+ if (!this._currentStyle)
+ return;
+
+ if (!this._currentStyle.ownerRule) {
+ WebInspector.domTreeManager.highlightDOMNode(this._currentStyle.node.id, mode);
+ return;
+ }
+
+ WebInspector.domTreeManager.highlightSelector(this._currentStyle.ownerRule.selectorText, this._currentStyle.node.ownerDocument.frameIdentifier, mode);
+ }
+
+ function editorMouseout() {
+ WebInspector.domTreeManager.hideDOMNodeHighlight();
+ }
+
+ editor.element.addEventListener("mouseover", editorMouseover.bind(this));
+ editor.element.addEventListener("mouseout", editorMouseout);
+ }
+
+ _generateMetricSectionRows(group, prefix, allowNegatives, highlightOnHover)
+ {
</ins><span class="cx"> var properties = group.properties;
</span><span class="cx">
</span><span class="cx"> var hasPrefix = prefix && prefix.length;
</span><span class="lines">@@ -364,6 +386,16 @@
</span><span class="cx"> var allLink = new WebInspector.VisualStylePropertyEditorLink([properties[top], properties[bottom], properties[left], properties[right]], "link-all", [verticalLink, horizontalLink]);
</span><span class="cx"> allLinkRow.element.appendChild(allLink.element);
</span><span class="cx">
</span><ins>+ if (highlightOnHover) {
+ this._addMetricsMouseListeners(properties[top], prefix);
+ this._addMetricsMouseListeners(verticalLink, prefix);
+ this._addMetricsMouseListeners(properties[bottom], prefix);
+ this._addMetricsMouseListeners(allLink, prefix);
+ this._addMetricsMouseListeners(properties[left], prefix);
+ this._addMetricsMouseListeners(horizontalLink, prefix);
+ this._addMetricsMouseListeners(properties[right], prefix);
+ }
+
</ins><span class="cx"> return [vertical, allLinkRow, horizontal];
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -410,28 +442,6 @@
</span><span class="cx"> this._populateSection(group, [floatGroup]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- _addMetricsMouseListeners(editor, mode)
- {
- function onEditorMouseover() {
- if (!this._style)
- return;
-
- if (!this._style.ownerRule) {
- WebInspector.domTreeManager.highlightDOMNode(this._style.node.id, mode);
- return;
- }
-
- WebInspector.domTreeManager.highlightSelector(this._style.ownerRule.selectorText, this._style.node.ownerDocument.frameIdentifier, mode);
- }
-
- function onEditorMouseout() {
- WebInspector.domTreeManager.hideDOMNodeHighlight();
- }
-
- editor.element.addEventListener("mouseover", onEditorMouseover.bind(editor));
- editor.element.addEventListener("mouseout", onEditorMouseout.bind(editor));
- }
-
</del><span class="cx"> _populateDimensionsSection()
</span><span class="cx"> {
</span><span class="cx"> var group = this._groups.dimensions;
</span><span class="lines">@@ -504,14 +514,7 @@
</span><span class="cx"> _populateMarginSection()
</span><span class="cx"> {
</span><span class="cx"> var group = this._groups.margin;
</span><del>- var rows = this._generateMetricSectionRows(group, "margin", true);
-
- var highlightMode = "margin";
- this._addMetricsMouseListeners(group.properties.marginTop, highlightMode);
- this._addMetricsMouseListeners(group.properties.marginBottom, highlightMode);
- this._addMetricsMouseListeners(group.properties.marginLeft, highlightMode);
- this._addMetricsMouseListeners(group.properties.marginRight, highlightMode);
-
</del><ins>+ var rows = this._generateMetricSectionRows(group, "margin", true, true);
</ins><span class="cx"> var marginGroup = new WebInspector.DetailsSectionGroup(rows);
</span><span class="cx"> this._populateSection(group, [marginGroup]);
</span><span class="cx"> }
</span><span class="lines">@@ -519,14 +522,7 @@
</span><span class="cx"> _populatePaddingSection()
</span><span class="cx"> {
</span><span class="cx"> var group = this._groups.padding;
</span><del>- var rows = this._generateMetricSectionRows(group, "padding");
-
- var highlightMode = "padding";
- this._addMetricsMouseListeners(group.properties.paddingTop, highlightMode);
- this._addMetricsMouseListeners(group.properties.paddingBottom, highlightMode);
- this._addMetricsMouseListeners(group.properties.paddingLeft, highlightMode);
- this._addMetricsMouseListeners(group.properties.paddingRight, highlightMode);
-
</del><ins>+ var rows = this._generateMetricSectionRows(group, "padding", false, true);
</ins><span class="cx"> var paddingGroup = new WebInspector.DetailsSectionGroup(rows);
</span><span class="cx"> this._populateSection(group, [paddingGroup]);
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleNumberInputBoxjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleNumberInputBox.js        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> {
</span><span class="cx"> constructor(propertyNames, text, possibleValues, possibleUnits, allowNegativeValues, layoutReversed)
</span><span class="cx"> {
</span><del>- super(propertyNames, text, possibleValues, possibleUnits || [WebInspector.UIString("No Units")], "number-input-box", layoutReversed);
</del><ins>+ super(propertyNames, text, possibleValues, possibleUnits || [WebInspector.UIString("Number")], "number-input-box", layoutReversed);
</ins><span class="cx">
</span><span class="cx"> this._hasUnits = !!possibleUnits;
</span><span class="cx"> this._allowNegativeValues = !!allowNegativeValues || false;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorTreeItemcss"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.css (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.css        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.css        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> margin: 4.5px 0 4px 5px;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-.item.visual-style-selector-item.selected > input[type="checkbox"]::before {
</del><ins>+body:not(.window-inactive, .window-docked-inactive) .item.visual-style-selector-item.selected > input[type="checkbox"]:checked::before {
</ins><span class="cx"> position: absolute;
</span><span class="cx"> top: 0;
</span><span class="cx"> right: 0;
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleSelectorTreeItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js (193117 => 193118)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js        2015-12-03 18:48:25 UTC (rev 193117)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleSelectorTreeItem.js        2015-12-03 18:48:31 UTC (rev 193118)
</span><span class="lines">@@ -191,6 +191,7 @@
</span><span class="cx"> {
</span><span class="cx"> this._hideDOMNodeHighlight();
</span><span class="cx"> this._listItemNode.classList.remove("editable");
</span><ins>+ this._updateTitleTooltip();
</ins><span class="cx">
</span><span class="cx"> var value = this.selectorText;
</span><span class="cx"> if (value === this._lastValue && this._valid)
</span></span></pre>
</div>
</div>
</body>
</html>