<!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>[204758] trunk/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/204758">204758</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-08-22 22:56:45 -0700 (Mon, 22 Aug 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Visual styles sidebar should do something sane for SVG elements
https://bugs.webkit.org/show_bug.cgi?id=148269
Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-08-22
Reviewed by Joseph Pecoraro.
* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode.prototype.get ownerSVGElement):
(WebInspector.DOMNode.prototype.isSVGElement):
Climbs ancestor tree to determine if node is an SVG node.
* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel.prototype.initialLayout):
(WebInspector.VisualStyleDetailsPanel.prototype._updateSections):
(WebInspector.VisualStyleDetailsPanel.prototype._populatePositionSection):
(WebInspector.VisualStyleDetailsPanel.prototype._populateDimensionsSection):
(WebInspector.VisualStyleDetailsPanel.prototype._populateContentSection):
(WebInspector.VisualStyleDetailsPanel.prototype._populateFillSection):
(WebInspector.VisualStyleDetailsPanel.prototype._populateStrokeSection):
* UserInterface/Views/VisualStylePropertyEditor.css:
(.visual-style-property-container.inactive):
(.visual-style-property-container > *:first-child:matches(.visual-style-property-value-container)):
* UserInterface/Views/VisualStyleRelativeNumberSlider.css:
(.visual-style-property-container.number-input-box.relative-number-slider > .relative-slider):
* UserInterface/Views/VisualStyleUnitSlider.css:
(.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider):
(.visual-style-property-container.unit-slider.opacity > .visual-style-property-value-container > .slider): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs">trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleDetailsPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStylePropertyEditorcss">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStylePropertyEditor.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleRelativeNumberSlidercss">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleRelativeNumberSlider.css</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleUnitSlidercss">trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/ChangeLog        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -1,5 +1,39 @@
</span><span class="cx"> 2016-08-22 Devin Rousso <dcrousso+webkit@gmail.com>
</span><span class="cx">
</span><ins>+ Web Inspector: Visual styles sidebar should do something sane for SVG elements
+ https://bugs.webkit.org/show_bug.cgi?id=148269
+
+ Reviewed by Joseph Pecoraro.
+
+ * Localizations/en.lproj/localizedStrings.js:
+
+ * UserInterface/Models/DOMNode.js:
+ (WebInspector.DOMNode.prototype.get ownerSVGElement):
+ (WebInspector.DOMNode.prototype.isSVGElement):
+ Climbs ancestor tree to determine if node is an SVG node.
+
+ * UserInterface/Views/VisualStyleDetailsPanel.js:
+ (WebInspector.VisualStyleDetailsPanel.prototype.initialLayout):
+ (WebInspector.VisualStyleDetailsPanel.prototype._updateSections):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populatePositionSection):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populateDimensionsSection):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populateContentSection):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populateFillSection):
+ (WebInspector.VisualStyleDetailsPanel.prototype._populateStrokeSection):
+
+ * UserInterface/Views/VisualStylePropertyEditor.css:
+ (.visual-style-property-container.inactive):
+ (.visual-style-property-container > *:first-child:matches(.visual-style-property-value-container)):
+
+ * UserInterface/Views/VisualStyleRelativeNumberSlider.css:
+ (.visual-style-property-container.number-input-box.relative-number-slider > .relative-slider):
+
+ * UserInterface/Views/VisualStyleUnitSlider.css:
+ (.visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider):
+ (.visual-style-property-container.unit-slider.opacity > .visual-style-property-value-container > .slider): Deleted.
+
+2016-08-22 Devin Rousso <dcrousso+webkit@gmail.com>
+
</ins><span class="cx"> Web Inspector: Visual Styles: "Text -> Content" section should only be visible for pseudo-element
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=158272
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -122,10 +122,13 @@
</span><span class="cx"> localizedStrings["Calls"] = "Calls";
</span><span class="cx"> localizedStrings["Cancel Automatic Continue"] = "Cancel Automatic Continue";
</span><span class="cx"> localizedStrings["Cancel comparison"] = "Cancel comparison";
</span><ins>+localizedStrings["Cap"] = "Cap";
</ins><span class="cx"> localizedStrings["Caps"] = "Caps";
</span><span class="cx"> localizedStrings["Capturing"] = "Capturing";
</span><span class="cx"> localizedStrings["Catch Variables"] = "Catch Variables";
</span><span class="cx"> localizedStrings["Categories"] = "Categories";
</span><ins>+localizedStrings["Center X"] = "Center X";
+localizedStrings["Center Y"] = "Center Y";
</ins><span class="cx"> localizedStrings["Character Data"] = "Character Data";
</span><span class="cx"> localizedStrings["Charge %s to Callers"] = "Charge %s to Callers";
</span><span class="cx"> localizedStrings["Checked"] = "Checked";
</span><span class="lines">@@ -207,6 +210,7 @@
</span><span class="cx"> localizedStrings["Cursor"] = "Cursor";
</span><span class="cx"> localizedStrings["Custom"] = "Custom";
</span><span class="cx"> localizedStrings["DOM Content Loaded \u2014 %s"] = "DOM Content Loaded \u2014 %s";
</span><ins>+localizedStrings["Dash Array"] = "Dash Array";
</ins><span class="cx"> localizedStrings["Data"] = "Data";
</span><span class="cx"> localizedStrings["Data returned from the database is too large."] = "Data returned from the database is too large.";
</span><span class="cx"> localizedStrings["Database no longer has expected version."] = "Database no longer has expected version.";
</span><span class="lines">@@ -300,6 +304,7 @@
</span><span class="cx"> localizedStrings["Enter a Gradient"] = "Enter a Gradient";
</span><span class="cx"> localizedStrings["Enter a URL"] = "Enter a URL";
</span><span class="cx"> localizedStrings["Enter a name."] = "Enter a name.";
</span><ins>+localizedStrings["Enter an array value"] = "Enter an array value";
</ins><span class="cx"> localizedStrings["Enter the name of a Keyframe"] = "Enter the name of a Keyframe";
</span><span class="cx"> localizedStrings["Enter value"] = "Enter value";
</span><span class="cx"> localizedStrings["Entire Recording"] = "Entire Recording";
</span><span class="lines">@@ -409,6 +414,7 @@
</span><span class="cx"> localizedStrings["JavaScript"] = "JavaScript";
</span><span class="cx"> localizedStrings["JavaScript & Events"] = "JavaScript & Events";
</span><span class="cx"> localizedStrings["JavaScript Allocations"] = "JavaScript Allocations";
</span><ins>+localizedStrings["Join"] = "Join";
</ins><span class="cx"> localizedStrings["Jump to Definition"] = "Jump to Definition";
</span><span class="cx"> localizedStrings["Keep Log on Navigation"] = "Keep Log on Navigation";
</span><span class="cx"> localizedStrings["Key"] = "Key";
</span><span class="lines">@@ -461,6 +467,7 @@
</span><span class="cx"> localizedStrings["Microtask Dispatched"] = "Microtask Dispatched";
</span><span class="cx"> localizedStrings["Min"] = "Min";
</span><span class="cx"> localizedStrings["Missing Dependencies:%s"] = "Missing Dependencies:%s";
</span><ins>+localizedStrings["Miter"] = "Miter";
</ins><span class="cx"> localizedStrings["Mixed"] = "Mixed";
</span><span class="cx"> localizedStrings["Module Code"] = "Module Code";
</span><span class="cx"> localizedStrings["Name"] = "Name";
</span><span class="lines">@@ -556,6 +563,8 @@
</span><span class="cx"> localizedStrings["Query returned no results."] = "Query returned no results.";
</span><span class="cx"> localizedStrings["Radial Gradient"] = "Radial Gradient";
</span><span class="cx"> localizedStrings["Radius"] = "Radius";
</span><ins>+localizedStrings["Radius X"] = "Radius X";
+localizedStrings["Radius Y"] = "Radius Y";
</ins><span class="cx"> localizedStrings["Range Issue"] = "Range Issue";
</span><span class="cx"> localizedStrings["Readonly"] = "Readonly";
</span><span class="cx"> localizedStrings["Reasons for compositing:"] = "Reasons for compositing:";
</span><span class="lines">@@ -595,6 +604,7 @@
</span><span class="cx"> localizedStrings["Reveal in Original Resource"] = "Reveal in Original Resource";
</span><span class="cx"> localizedStrings["Right"] = "Right";
</span><span class="cx"> localizedStrings["Role"] = "Role";
</span><ins>+localizedStrings["Rule"] = "Rule";
</ins><span class="cx"> localizedStrings["Samples"] = "Samples";
</span><span class="cx"> localizedStrings["Save configuration"] = "Save configuration";
</span><span class="cx"> localizedStrings["Scheme"] = "Scheme";
</span><span class="lines">@@ -680,6 +690,7 @@
</span><span class="cx"> localizedStrings["Stop recording (%s)"] = "Stop recording (%s)";
</span><span class="cx"> localizedStrings["Stop recording."] = "Stop recording.";
</span><span class="cx"> localizedStrings["Storage"] = "Storage";
</span><ins>+localizedStrings["Stroke"] = "Stroke";
</ins><span class="cx"> localizedStrings["Style"] = "Style";
</span><span class="cx"> localizedStrings["Style Attribute"] = "Style Attribute";
</span><span class="cx"> localizedStrings["Style Rules"] = "Style Rules";
</span><span class="lines">@@ -763,8 +774,14 @@
</span><span class="cx"> localizedStrings["Word"] = "Word";
</span><span class="cx"> localizedStrings["Working Copy"] = "Working Copy";
</span><span class="cx"> localizedStrings["Wrap"] = "Wrap";
</span><ins>+localizedStrings["X"] = "X";
+localizedStrings["X1"] = "X1";
+localizedStrings["X2"] = "X2";
</ins><span class="cx"> localizedStrings["XHR"] = "XHR";
</span><span class="cx"> localizedStrings["XHRs"] = "XHRs";
</span><ins>+localizedStrings["Y"] = "Y";
+localizedStrings["Y1"] = "Y1";
+localizedStrings["Y2"] = "Y2";
</ins><span class="cx"> localizedStrings["Yes"] = "Yes";
</span><span class="cx"> localizedStrings["Z-Index"] = "Z-Index";
</span><span class="cx"> localizedStrings["key"] = "key";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsDOMNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNode.js        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -568,6 +568,22 @@
</span><span class="cx"> return descendant !== null && descendant.isAncestor(this);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ get ownerSVGElement()
+ {
+ if (this._nodeName === "svg")
+ return this;
+
+ if (!this.parentNode)
+ return null;
+
+ return this.parentNode.ownerSVGElement;
+ }
+
+ isSVGElement()
+ {
+ return !!this.ownerSVGElement;
+ }
+
</ins><span class="cx"> _setAttributesPayload(attrs)
</span><span class="cx"> {
</span><span class="cx"> this._attributes = [];
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleDetailsPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleDetailsPanel.js        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -102,6 +102,8 @@
</span><span class="cx"> this.element.appendChild(this._sections.text.element);
</span><span class="cx">
</span><span class="cx"> // Background Section
</span><ins>+ this._generateSection("fill", WebInspector.UIString("Fill"));
+ this._generateSection("stroke", WebInspector.UIString("Stroke"));
</ins><span class="cx"> this._generateSection("background-style", WebInspector.UIString("Style"));
</span><span class="cx"> this._generateSection("border", WebInspector.UIString("Border"));
</span><span class="cx"> this._generateSection("outline", WebInspector.UIString("Outline"));
</span><span class="lines">@@ -108,7 +110,7 @@
</span><span class="cx"> this._generateSection("box-shadow", WebInspector.UIString("Box Shadow"));
</span><span class="cx"> this._generateSection("list-style", WebInspector.UIString("List Styles"));
</span><span class="cx">
</span><del>- this._sections.background = new WebInspector.DetailsSection("background", WebInspector.UIString("Background"), [this._groups.backgroundStyle.section, this._groups.border.section, this._groups.outline.section, this._groups.boxShadow.section, this._groups.listStyle.section]);
</del><ins>+ this._sections.background = new WebInspector.DetailsSection("background", WebInspector.UIString("Background"), [this._groups.fill.section, this._groups.stroke.section, this._groups.backgroundStyle.section, this._groups.border.section, this._groups.outline.section, this._groups.boxShadow.section, this._groups.listStyle.section]);
</ins><span class="cx"> this.element.appendChild(this._sections.background.element);
</span><span class="cx">
</span><span class="cx"> // Effects Section
</span><span class="lines">@@ -192,6 +194,57 @@
</span><span class="cx"> let hasMatchedElementPseudoSelector = this._currentStyle.ownerRule && this._currentStyle.ownerRule.hasMatchedPseudoElementSelector();
</span><span class="cx"> this._groups.content.section.element.classList.toggle("inactive", !hasMatchedElementPseudoSelector);
</span><span class="cx"> this._groups.listStyle.section.element.classList.toggle("inactive", hasMatchedElementPseudoSelector);
</span><ins>+
+ let node = this._nodeStyles.node;
+ let isSVGElement = node.isSVGElement();
+
+ this._groups.float.section.element.classList.toggle("inactive", isSVGElement);
+ this._groups.border.section.element.classList.toggle("inactive", isSVGElement);
+ this._groups.boxShadow.section.element.classList.toggle("inactive", isSVGElement);
+ this._groups.listStyle.section.element.classList.toggle("inactive", isSVGElement);
+
+ this._groups.fill.section.element.classList.toggle("inactive", !isSVGElement);
+ this._groups.stroke.section.element.classList.toggle("inactive", !isSVGElement);
+
+ let isSVGCircle = node.nodeName() === "circle";
+ let isSVGEllipse = node.nodeName() === "ellipse";
+ let isSVGRadialGradient = node.nodeName() === "radialGradient";
+ let isSVGRect = node.nodeName() === "rect";
+ let isSVGLine = node.nodeName() === "line";
+ let isSVGLinearGradient = node.nodeName() === "linearGradient";
+
+ // Only show the dimensions section if the current element is not an SVG element or is <ellipse>, <rect>, <circle>, or <radialGradient>.
+ this._groups.dimensions.section.element.classList.toggle("inactive", !(!isSVGElement || isSVGEllipse || isSVGRect || isSVGCircle || isSVGRadialGradient));
+
+ // Only show the non-SVG dimensions group if the current element is not an SVG element or is <rect>.
+ this._groups.dimensions.defaultGroup.element.classList.toggle("inactive", !(!isSVGElement || isSVGRect));
+
+ // Only show the SVG dimensions group if the current element is an SVG element, <rect>, <circle>, or <radialGradient>.
+ this._groups.dimensions.svgGroup.element.classList.toggle("inactive", !(isSVGEllipse || isSVGRect || isSVGCircle || isSVGRadialGradient));
+
+ // Only show editor for "r" if the current element is <circle> or <radialGradient>.
+ this._groups.dimensions.properties.r.element.classList.toggle("inactive", !(isSVGCircle || isSVGRadialGradient));
+
+ // Only show editors for "rx" and "ry" if the current element is <ellipse> or <rect>.
+ this._groups.dimensions.properties.rx.element.classList.toggle("inactive", !(isSVGEllipse || isSVGRect));
+ this._groups.dimensions.properties.ry.element.classList.toggle("inactive", !(isSVGEllipse || isSVGRect));
+
+ // Only show the SVG position group if the current element is <rect>, <circle>, <ellipse>, <line>, <radialGradient>, or <linearGradient>.
+ this._groups.position.svgGroup.element.classList.toggle("inactive", !(isSVGRect || isSVGCircle || isSVGEllipse || isSVGLine || isSVGRadialGradient || isSVGLinearGradient));
+
+ // Only show editors for "x" and "y" if the current element is <rect>.
+ this._groups.position.properties.x.element.classList.toggle("inactive", !isSVGRect);
+ this._groups.position.properties.y.element.classList.toggle("inactive", !isSVGRect);
+
+ // Only show editors for "x1", "y1", "x2", and "y2" if the current element is <line> or <linearGradient>.
+ this._groups.position.properties.x1.element.classList.toggle("inactive", !(isSVGLine || isSVGLinearGradient));
+ this._groups.position.properties.y1.element.classList.toggle("inactive", !(isSVGLine || isSVGLinearGradient));
+ this._groups.position.properties.x2.element.classList.toggle("inactive", !(isSVGLine || isSVGLinearGradient));
+ this._groups.position.properties.y2.element.classList.toggle("inactive", !(isSVGLine || isSVGLinearGradient));
+
+ // Only show editors for "cx" and "cy" if the current element is <circle>, <ellipse>, or <radialGradient>.
+ this._groups.position.properties.cx.element.classList.toggle("inactive", !(isSVGCircle || isSVGEllipse || isSVGRadialGradient));
+ this._groups.position.properties.cy.element.classList.toggle("inactive", !(isSVGCircle || isSVGEllipse || isSVGRadialGradient));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _updateProperties(group, forceStyleUpdate)
</span><span class="lines">@@ -459,11 +512,46 @@
</span><span class="cx"> positionType.element.appendChild(properties.zIndex.element);
</span><span class="cx"> positionType.element.classList.add("visual-style-separated-row");
</span><span class="cx">
</span><del>- rows.unshift(positionType)
</del><ins>+ rows.unshift(positionType);
</ins><span class="cx">
</span><del>- let positionGroup = new WebInspector.DetailsSectionGroup(rows);
- this._populateSection(group, [positionGroup]);
</del><ins>+ group.defaultGroup = new WebInspector.DetailsSectionGroup(rows);
</ins><span class="cx">
</span><ins>+ let xyRow = new WebInspector.DetailsSectionRow;
+
+ properties.x = new WebInspector.VisualStyleNumberInputBox("x", WebInspector.UIString("X"), this._keywords.boxModel, this._units.defaults, true);
+ properties.y = new WebInspector.VisualStyleNumberInputBox("y", WebInspector.UIString("Y"), this._keywords.boxModel, this._units.defaults, true);
+
+ xyRow.element.appendChild(properties.x.element);
+ xyRow.element.appendChild(properties.y.element);
+
+ let x1y1Row = new WebInspector.DetailsSectionRow;
+
+ properties.x1 = new WebInspector.VisualStyleNumberInputBox("x1", WebInspector.UIString("X1"), this._keywords.boxModel, this._units.defaults, true);
+ properties.y1 = new WebInspector.VisualStyleNumberInputBox("y1", WebInspector.UIString("Y1"), this._keywords.boxModel, this._units.defaults, true);
+
+ x1y1Row.element.appendChild(properties.x1.element);
+ x1y1Row.element.appendChild(properties.y1.element);
+
+ let x2y2Row = new WebInspector.DetailsSectionRow;
+
+ properties.x2 = new WebInspector.VisualStyleNumberInputBox("x2", WebInspector.UIString("X2"), this._keywords.boxModel, this._units.defaults, true);
+ properties.y2 = new WebInspector.VisualStyleNumberInputBox("y2", WebInspector.UIString("Y2"), this._keywords.boxModel, this._units.defaults, true);
+
+ x2y2Row.element.appendChild(properties.x2.element);
+ x2y2Row.element.appendChild(properties.y2.element);
+
+ let cxcyRow = new WebInspector.DetailsSectionRow;
+
+ properties.cx = new WebInspector.VisualStyleNumberInputBox("cx", WebInspector.UIString("Center X"), this._keywords.boxModel, this._units.defaults, true);
+ properties.cy = new WebInspector.VisualStyleNumberInputBox("cy", WebInspector.UIString("Center Y"), this._keywords.boxModel, this._units.defaults, true);
+
+ cxcyRow.element.appendChild(properties.cx.element);
+ cxcyRow.element.appendChild(properties.cy.element);
+
+ group.svgGroup = new WebInspector.DetailsSectionGroup([xyRow, x1y1Row, x2y2Row, cxcyRow]);
+
+ this._populateSection(group, [group.defaultGroup, group.svgGroup]);
+
</ins><span class="cx"> let allowedPositionValues = ["relative", "absolute", "fixed", "-webkit-sticky"];
</span><span class="cx"> properties.zIndex.addDependency("position", allowedPositionValues);
</span><span class="cx"> properties.top.addDependency("position", allowedPositionValues);
</span><span class="lines">@@ -556,8 +644,29 @@
</span><span class="cx"> this._addMetricsMouseListeners(group.properties.maxWidth, highlightMode);
</span><span class="cx"> this._addMetricsMouseListeners(group.properties.maxHeight, highlightMode);
</span><span class="cx">
</span><del>- let dimensionsGroup = new WebInspector.DetailsSectionGroup([dimensionsTabController, dimensionsRegularGroup, dimensionsMinGroup, dimensionsMaxGroup]);
- this._populateSection(group, [dimensionsGroup]);
</del><ins>+ group.defaultGroup = new WebInspector.DetailsSectionGroup([dimensionsTabController, dimensionsRegularGroup, dimensionsMinGroup, dimensionsMaxGroup]);
+
+ let rRow = new WebInspector.DetailsSectionRow;
+
+ properties.r = new WebInspector.VisualStyleRelativeNumberSlider("r", WebInspector.UIString("Radius"), this._keywords.boxModel, this._units.defaults);
+
+ rRow.element.appendChild(properties.r.element);
+
+ let rxRow = new WebInspector.DetailsSectionRow;
+
+ properties.rx = new WebInspector.VisualStyleRelativeNumberSlider("rx", WebInspector.UIString("Radius X"), this._keywords.boxModel, this._units.defaults);
+
+ rxRow.element.appendChild(properties.rx.element);
+
+ let ryRow = new WebInspector.DetailsSectionRow;
+
+ properties.ry = new WebInspector.VisualStyleRelativeNumberSlider("ry", WebInspector.UIString("Radius Y"), this._keywords.boxModel, this._units.defaults);
+
+ ryRow.element.appendChild(properties.ry.element);
+
+ group.svgGroup = new WebInspector.DetailsSectionGroup([rRow, rxRow, ryRow]);
+
+ this._populateSection(group, [group.defaultGroup, group.svgGroup]);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _populateMarginSection()
</span><span class="lines">@@ -847,6 +956,78 @@
</span><span class="cx"> this._populateSection(group, [textShadowGroup]);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ _populateFillSection()
+ {
+ let group = this._groups.fill;
+ let properties = group.properties;
+
+ let fillRow = new WebInspector.DetailsSectionRow;
+
+ properties.fill = new WebInspector.VisualStyleColorPicker("fill", WebInspector.UIString("Color"));
+ properties.fillRule = new WebInspector.VisualStyleKeywordPicker("fill-rule", WebInspector.UIString("Rule"), this._keywords.defaults.concat(["Nonzero", "Evenodd"]));
+
+ fillRow.element.appendChild(properties.fill.element);
+ fillRow.element.appendChild(properties.fillRule.element);
+
+ let fillOpacityRow = new WebInspector.DetailsSectionRow;
+
+ properties.fillOpacity = new WebInspector.VisualStyleUnitSlider("fill-opacity", WebInspector.UIString("Opacity"));
+
+ fillOpacityRow.element.appendChild(properties.fillOpacity.element);
+
+ group.specifiedWidthProperties = [properties.fillOpacity];
+
+ let fillGroup = new WebInspector.DetailsSectionGroup([fillRow, fillOpacityRow]);
+ this._populateSection(group, [fillGroup]);
+ }
+
+ _populateStrokeSection()
+ {
+ let group = this._groups.stroke;
+ let properties = group.properties;
+
+ let strokeRow = new WebInspector.DetailsSectionRow;
+
+ properties.stroke = new WebInspector.VisualStyleColorPicker("stroke", WebInspector.UIString("Color"));
+ properties.strokeWidth = new WebInspector.VisualStyleNumberInputBox("stroke-width", WebInspector.UIString("Width"), this._keywords.defaults, this._units.defaults);
+
+ strokeRow.element.appendChild(properties.stroke.element);
+ strokeRow.element.appendChild(properties.strokeWidth.element);
+
+ let strokeOpacity = new WebInspector.DetailsSectionRow;
+
+ properties.strokeOpacity = new WebInspector.VisualStyleUnitSlider("stroke-opacity", WebInspector.UIString("Opacity"));
+
+ strokeOpacity.element.appendChild(properties.strokeOpacity.element);
+
+ let strokeDasharrayRow = new WebInspector.DetailsSectionRow;
+
+ properties.strokeDasharray = new WebInspector.VisualStyleBasicInput("stroke-dasharray", WebInspector.UIString("Dash Array"), WebInspector.UIString("Enter an array value"));
+
+ strokeDasharrayRow.element.appendChild(properties.strokeDasharray.element);
+
+ let strokeDasharrayOptionsRow = new WebInspector.DetailsSectionRow;
+
+ properties.strokeDashoffset = new WebInspector.VisualStyleNumberInputBox("stroke-dashoffset", WebInspector.UIString("Offset"), this._keywords.defaults, this._units.defaults);
+ properties.strokeMiterlimit = new WebInspector.VisualStyleNumberInputBox("stroke-miterlimit", WebInspector.UIString("Miter"), this._keywords.defaults);
+
+ strokeDasharrayOptionsRow.element.appendChild(properties.strokeDashoffset.element);
+ strokeDasharrayOptionsRow.element.appendChild(properties.strokeMiterlimit.element);
+
+ let strokeLineOptionsRow = new WebInspector.DetailsSectionRow;
+
+ properties.strokeLinecap = new WebInspector.VisualStyleKeywordPicker("stroke-linecap", WebInspector.UIString("Cap"), this._keywords.defaults.concat(["Butt", "Round", "Square"]));
+ properties.strokeLinejoin = new WebInspector.VisualStyleKeywordPicker("stroke-linejoin", WebInspector.UIString("Join"), this._keywords.defaults.concat(["Miter", "Round", "Bevel"]));
+
+ strokeLineOptionsRow.element.appendChild(properties.strokeLinecap.element);
+ strokeLineOptionsRow.element.appendChild(properties.strokeLinejoin.element);
+
+ group.specifiedWidthProperties = [properties.strokeOpacity];
+
+ let strokeGroup = new WebInspector.DetailsSectionGroup([strokeRow, strokeOpacity, strokeDasharrayRow, strokeDasharrayOptionsRow, strokeLineOptionsRow]);
+ this._populateSection(group, [strokeGroup]);
+ }
+
</ins><span class="cx"> _populateBackgroundStyleSection()
</span><span class="cx"> {
</span><span class="cx"> let group = this._groups.backgroundStyle;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStylePropertyEditorcss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStylePropertyEditor.css (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStylePropertyEditor.css        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStylePropertyEditor.css        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -32,6 +32,10 @@
</span><span class="cx"> flex-grow: 1;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+.visual-style-property-container.inactive {
+ display: none;
+}
+
</ins><span class="cx"> .visual-style-property-container > .visual-style-property-title {
</span><span class="cx"> margin: 4px;
</span><span class="cx"> text-align: right;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleRelativeNumberSlidercss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleRelativeNumberSlider.css (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleRelativeNumberSlider.css        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleRelativeNumberSlider.css        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -43,5 +43,6 @@
</span><span class="cx">
</span><span class="cx"> .visual-style-property-container.number-input-box.relative-number-slider > .relative-slider {
</span><span class="cx"> width: 47%;
</span><ins>+ margin-top: 0;
</ins><span class="cx"> margin-right: 7px;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsVisualStyleUnitSlidercss"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.css (204757 => 204758)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.css        2016-08-23 05:34:42 UTC (rev 204757)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/VisualStyleUnitSlider.css        2016-08-23 05:56:45 UTC (rev 204758)
</span><span class="lines">@@ -26,12 +26,9 @@
</span><span class="cx"> .visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider {
</span><span class="cx"> position: relative;
</span><span class="cx"> margin: 5px 1px 0;
</span><ins>+ background-image: linear-gradient(90deg, transparent, black), url(../Images/Checkers.svg);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> .visual-style-property-container.unit-slider > .visual-style-property-value-container > .slider > img {
</span><span class="cx"> top: -1px;
</span><span class="cx"> }
</span><del>-
-.visual-style-property-container.unit-slider.opacity > .visual-style-property-value-container > .slider {
- background-image: linear-gradient(90deg, hsla(0, 0%, 0%, 0), #000), url(../Images/Checkers.svg);
-}
</del></span></pre>
</div>
</div>
</body>
</html>