<!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>[193104] 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/193104">193104</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 10:47:04 -0800 (Thu, 03 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188479">r188479</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="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsDOMTreeUpdaterjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleTimingEditorcss">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.css</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleTimingEditorjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.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 (193103 => 193104)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:46:58 UTC (rev 193103)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:47:04 UTC (rev 193104)
</span><span class="lines">@@ -1,5 +1,36 @@
</span><span class="cx"> 2015-12-02 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r188479. rdar://problem/23221163
+
+ 2015-08-14 Devin Rousso <drousso@apple.com>
+
+ Web Inspector: Add a visual editor for timing functions
+ https://bugs.webkit.org/show_bug.cgi?id=148022
+
+ Reviewed by Timothy Hatcher.
+
+ Uses the existing bezier editor and the Visual keyword picker to make an editor for timing functions.
+
+ * UserInterface/Views/VisualStyleTimingEditor.css: Added.
+ (.visual-style-property-container.timing-editor > .visual-style-property-value-container):
+ (.visual-style-property-container.timing-editor > .visual-style-property-value-container > .keyword-picker-select):
+ (.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor):
+ (.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor:hover):
+ (.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor:active):
+
+ * UserInterface/Views/VisualStyleTimingEditor.js: Added.
+ (WebInspector.VisualStyleTimingEditor):
+ (WebInspector.VisualStyleTimingEditor.prototype.parseValue):
+ (WebInspector.VisualStyleTimingEditor.prototype.get bezierValue):
+ (WebInspector.VisualStyleTimingEditor.prototype.set bezierValue):
+ (WebInspector.VisualStyleTimingEditor.prototype._getValue):
+ (WebInspector.VisualStyleTimingEditor.prototype._setValue):
+ (WebInspector.VisualStyleTimingEditor.prototype._generateSynthesizedValue):
+ (WebInspector.VisualStyleTimingEditor.prototype._bezierMarkerClicked):
+ (WebInspector.VisualStyleTimingEditor.prototype._handleKeywordChanged):
+
+2015-12-02 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r188442. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-08-13 Nikita Vasilyev <nvasilyev@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsDOMTreeElementjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js (193103 => 193104)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2015-12-03 18:46:58 UTC (rev 193103)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js        2015-12-03 18:47:04 UTC (rev 193104)
</span><span class="lines">@@ -1081,17 +1081,17 @@
</span><span class="cx">
</span><span class="cx"> _buildAttributeDOM(parentElement, name, value, node)
</span><span class="cx"> {
</span><del>- let hasText = (value.length > 0);
- let attrSpanElement = parentElement.createChild("span", "html-attribute");
- let attrNameElement = attrSpanElement.createChild("span", "html-attribute-name");
</del><ins>+ var hasText = (value.length > 0);
+ var attrSpanElement = parentElement.createChild("span", "html-attribute");
+ var attrNameElement = attrSpanElement.createChild("span", "html-attribute-name");
</ins><span class="cx"> attrNameElement.textContent = name;
</span><del>- let attrValueElement = null;
</del><ins>+ var attrValueElement = null;
</ins><span class="cx"> if (hasText)
</span><span class="cx"> attrSpanElement.appendChild(document.createTextNode("=\u200B\""));
</span><span class="cx">
</span><span class="cx"> if (name === "src" || name === "href") {
</span><del>- let baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
- let rewrittenURL = absoluteURL(value, baseURL);
</del><ins>+ var baseURL = node.ownerDocument ? node.ownerDocument.documentURL : null;
+ var rewrittenURL = absoluteURL(value, baseURL);
</ins><span class="cx"> value = value.insertWordBreakCharacters();
</span><span class="cx"> if (!rewrittenURL) {
</span><span class="cx"> attrValueElement = attrSpanElement.createChild("span", "html-attribute-value");
</span><span class="lines">@@ -1470,7 +1470,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> for (let change of this._nodeStateChanges) {
</span><del>- let element = change.element;
</del><ins>+ var element = change.element;
</ins><span class="cx"> if (!element)
</span><span class="cx"> continue;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsDOMTreeUpdaterjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js (193103 => 193104)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js        2015-12-03 18:46:58 UTC (rev 193103)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DOMTreeUpdater.js        2015-12-03 18:47:04 UTC (rev 193104)
</span><span class="lines">@@ -102,16 +102,16 @@
</span><span class="cx"> this._updateModifiedNodesTimeout = null;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- let updatedParentTreeElements = [];
</del><ins>+ var updatedParentTreeElements = [];
</ins><span class="cx"> for (let recentlyModifiedNode of this._recentlyModifiedNodes) {
</span><del>- let parent = recentlyModifiedNode.parent;
- let node = recentlyModifiedNode.node;
- let changeInfo = null;
</del><ins>+ var parent = recentlyModifiedNode.parent;
+ var node = recentlyModifiedNode.node;
+ var changeInfo = null;
</ins><span class="cx"> if (recentlyModifiedNode.attribute)
</span><span class="cx"> changeInfo = {type: WebInspector.DOMTreeElement.ChangeType.Attribute, attribute: recentlyModifiedNode.attribute};
</span><span class="cx">
</span><span class="cx"> if (recentlyModifiedNode.updated) {
</span><del>- let nodeTreeElement = this._treeOutline.findTreeElement(node);
</del><ins>+ var nodeTreeElement = this._treeOutline.findTreeElement(node);
</ins><span class="cx"> if (!nodeTreeElement)
</span><span class="cx"> continue;
</span><span class="cx">
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx"> if (!parent)
</span><span class="cx"> continue;
</span><span class="cx">
</span><del>- let parentNodeItem = this._treeOutline.findTreeElement(parent);
</del><ins>+ var parentNodeItem = this._treeOutline.findTreeElement(parent);
</ins><span class="cx"> if (parentNodeItem && !parentNodeItem.alreadyUpdatedChildren) {
</span><span class="cx"> parentNodeItem.updateTitle();
</span><span class="cx"> parentNodeItem.updateChildren();
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleTimingEditorcss"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.css (0 => 193104)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.css         (rev 0)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.css        2015-12-03 18:47:04 UTC (rev 193104)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+.visual-style-property-container.timing-editor > .visual-style-property-value-container {
+ display: flex;
+}
+
+.visual-style-property-container.timing-editor > .visual-style-property-value-container > .keyword-picker-select {
+ order: 1;
+}
+
+.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor {
+ width: 23px;
+ height: 20px;
+ margin: 0 2px 0 0.5px;
+ content: url(../Images/CubicBezier.svg);
+ cursor: default;
+}
+
+.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor:hover {
+ filter: brightness(0.9);
+}
+
+.visual-style-property-container.timing-editor > .visual-style-property-value-container > .bezier-editor:active {
+ filter: brightness(0.8);
+}
</ins></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsVisualStyleTimingEditorjs"></a>
<div class="addfile"><h4>Added: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.js (0 => 193104)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.js         (rev 0)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/VisualStyleTimingEditor.js        2015-12-03 18:47:04 UTC (rev 193104)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.VisualStyleTimingEditor = class VisualStyleTimingEditor extends WebInspector.VisualStyleKeywordPicker
+{
+ constructor(propertyNames, text, possibleValues, layoutReversed)
+ {
+ super(propertyNames, text, possibleValues, layoutReversed);
+
+ this.element.classList.add("timing-editor");
+
+ this._customValueOptionElement = document.createElement("option");
+ this._customValueOptionElement.value = "custom";
+ this._customValueOptionElement.text = WebInspector.UIString("Custom");
+ this._keywordSelectElement.appendChild(this._customValueOptionElement);
+
+ this._bezierMarkerElement = document.createElement("span");
+ this._bezierMarkerElement.title = WebInspector.UIString("Click to open a cubic-bezier editor");
+ this._bezierMarkerElement.classList.add("bezier-editor");
+ this._bezierMarkerElement.hidden = true;
+ this._bezierMarkerElement.addEventListener("click", this._bezierMarkerClicked.bind(this));
+ this.contentElement.appendChild(this._bezierMarkerElement);
+
+ this._bezierEditor = new WebInspector.BezierEditor;
+ this._bezierEditor.addEventListener(WebInspector.BezierEditor.Event.BezierChanged, this._valueDidChange.bind(this));
+ this._bezierEditor.bezier = WebInspector.CubicBezier.fromString("linear");
+ }
+
+ // Protected
+
+ parseValue(text)
+ {
+ return /(cubic-bezier\(.+\))/.exec(text);
+ }
+
+ get bezierValue()
+ {
+ var bezier = this._bezierEditor.bezier;
+ if (!bezier)
+ return null;
+
+ return bezier.toString();
+ }
+
+ set bezierValue(text)
+ {
+ var bezier = WebInspector.CubicBezier.fromString(text);
+ this._bezierEditor.bezier = bezier;
+ }
+
+ // Private
+
+ _getValue()
+ {
+ return this._customValueOptionElement.selected ? this.bezierValue : super._getValue();
+ }
+
+ _setValue(value)
+ {
+ this.bezierValue = value;
+ if (this.valueIsSupportedKeyword(value)) {
+ super._setValue(value);
+ this._bezierMarkerElement.hidden = true;
+ return;
+ }
+
+ var bezier = this.bezierValue;
+ this._customValueOptionElement.selected = !!bezier;
+ this._bezierMarkerElement.hidden = !bezier;
+ this.specialPropertyPlaceholderElement.hidden = !!bezier;
+ if (!bezier)
+ super._setValue(value);
+ }
+
+ _generateSynthesizedValue()
+ {
+ return this._customValueOptionElement.selected ? this.bezierValue : super._generateSynthesizedValue();
+ }
+
+ _bezierMarkerClicked()
+ {
+ var bounds = WebInspector.Rect.rectFromClientRect(this._bezierMarkerElement.getBoundingClientRect());
+ this._cubicBezierEditorPopover = new WebInspector.Popover(this);
+ this._cubicBezierEditorPopover.content = this._bezierEditor.element;
+ this._cubicBezierEditorPopover.present(bounds.pad(2), [WebInspector.RectEdge.MIN_X]);
+ }
+
+ _handleKeywordChanged()
+ {
+ super._handleKeywordChanged();
+ var customOptionSelected = this._customValueOptionElement.selected;
+ this._bezierMarkerElement.hidden = !customOptionSelected;
+ this.specialPropertyPlaceholderElement.hidden = !!customOptionSelected;
+ if (customOptionSelected)
+ this.bezierValue = "linear";
+ }
+};
</ins></span></pre>
</div>
</div>
</body>
</html>