<!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>[193032] 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/193032">193032</a></dd>
<dt>Author</dt> <dd>timothy@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 10:33:42 -0800 (Thu, 03 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/187519">r187519</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="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsActivateButtonNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsActivateButtonToolbarItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsButtonNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsButtonToolbarItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsControlToolbarItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsDividerNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsFlexibleSpaceNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsHierarchicalPathNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsRadioButtonNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsToggleButtonNavigationItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js</a></li>
<li><a href="#branchessafari601branchSourceWebInspectorUIUserInterfaceViewsToggleControlToolbarItemjs">branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.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 (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/ChangeLog        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,58 @@
</span><span class="cx"> 2015-12-01 Timothy Hatcher <timothy@apple.com>
</span><span class="cx">
</span><ins>+ Merge r187519. rdar://problem/23221163
+
+ 2015-07-28 Brian J. Burg <burg@cs.washington.edu>
+
+ Web Inspector: Convert NavigationItem subclasses to ES6
+ https://bugs.webkit.org/show_bug.cgi?id=147364
+
+ Reviewed by Timothy Hatcher.
+
+ Convert remaining NavigationItem subclasses to use ES6 class.
+
+ Also promote the _additionalClassNames to be a protected getter,
+ and inline the style class names that are only used in one place.
+
+ Mechanical changes are elided from the changelog.
+
+ * UserInterface/Views/ActivateButtonNavigationItem.js:
+ (WebInspector.ActivateButtonNavigationItem):
+ (WebInspector.ActivateButtonNavigationItem.prototype.get additionalClassNames):
+ * UserInterface/Views/ActivateButtonToolbarItem.js:
+ (WebInspector.ActivateButtonToolbarItem):
+ * UserInterface/Views/ButtonNavigationItem.js:
+ (WebInspector.ButtonNavigationItem):
+ (WebInspector.ButtonNavigationItem.prototype.get additionalClassNames):
+ * UserInterface/Views/ButtonToolbarItem.js:
+ (WebInspector.ButtonToolbarItem):
+ * UserInterface/Views/ControlToolbarItem.js:
+ (WebInspector.ControlToolbarItem):
+ (WebInspector.ControlToolbarItem.prototype.get additionalClassNames):
+ * UserInterface/Views/DividerNavigationItem.js:
+ (WebInspector.DividerNavigationItem):
+ (WebInspector.DividerNavigationItem.prototype.get additionalClassNames):
+ * UserInterface/Views/FlexibleSpaceNavigationItem.js:
+ (WebInspector.FlexibleSpaceNavigationItem):
+ (WebInspector.FlexibleSpaceNavigationItem.prototype.get additionalClassNames):
+ * UserInterface/Views/HierarchicalPathNavigationItem.js:
+ (WebInspector.HierarchicalPathNavigationItem.prototype.get additionalClassNames):
+ (WebInspector.HierarchicalPathNavigationItem.prototype.get _additionalClassNames): Deleted.
+ * UserInterface/Views/NavigationItem.js:
+ (WebInspector.NavigationItem):
+ (WebInspector.NavigationItem.prototype.get _classNames):
+ * UserInterface/Views/RadioButtonNavigationItem.js:
+ (WebInspector.RadioButtonNavigationItem):
+ (WebInspector.RadioButtonNavigationItem.prototype.get additionalClassNames):
+ * UserInterface/Views/ToggleButtonNavigationItem.js:
+ (WebInspector.ToggleButtonNavigationItem):
+ (WebInspector.ToggleButtonNavigationItem.prototype.get additionalClassNames):
+ * UserInterface/Views/ToggleControlToolbarItem.js:
+ (WebInspector.ToggleControlToolbarItem):
+ (WebInspector.ToggleControlToolbarItem.prototype.get additionalClassNames):
+
+2015-12-01 Timothy Hatcher <timothy@apple.com>
+
</ins><span class="cx"> Merge r187507. rdar://problem/23221163
</span><span class="cx">
</span><span class="cx"> 2015-07-28 Joseph Pecoraro <pecoraro@apple.com>
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsActivateButtonNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,37 +23,33 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ActivateButtonNavigationItem = function(identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role)
</del><ins>+WebInspector.ActivateButtonNavigationItem = class ActivateButtonNavigationItem extends WebInspector.ButtonNavigationItem
</ins><span class="cx"> {
</span><del>- WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, image, imageWidth, imageHeight, suppressEmboss, role);
</del><ins>+ constructor(identifier, defaultToolTip, activatedToolTip, image, imageWidth, imageHeight, suppressEmboss, role)
+ {
+ super(identifier, defaultToolTip, image, imageWidth, imageHeight, suppressEmboss, role);
</ins><span class="cx">
</span><del>- this._defaultToolTip = defaultToolTip;
- this._activatedToolTip = activatedToolTip || defaultToolTip;
- this._role = role;
-};
</del><ins>+ this._defaultToolTip = defaultToolTip;
+ this._activatedToolTip = activatedToolTip || defaultToolTip;
+ this._role = role;
+ }
</ins><span class="cx">
</span><del>-WebInspector.ActivateButtonNavigationItem.StyleClassName = "activate";
-WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName = "activated";
-
-WebInspector.ActivateButtonNavigationItem.prototype = {
- constructor: WebInspector.ActivateButtonNavigationItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get defaultToolTip()
</span><span class="cx"> {
</span><span class="cx"> return this._defaultToolTip;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get activatedToolTip()
</span><span class="cx"> {
</span><span class="cx"> return this._activatedToolTip;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get activated()
</span><span class="cx"> {
</span><span class="cx"> return this.element.classList.contains(WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set activated(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -68,9 +64,9 @@
</span><span class="cx"> if (this._role === "tab")
</span><span class="cx"> this.element.removeAttribute("aria-selected");
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- generateStyleText: function(parentSelector)
</del><ins>+ generateStyleText(parentSelector)
</ins><span class="cx"> {
</span><span class="cx"> var classNames = this._classNames.join(".");
</span><span class="cx">
</span><span class="lines">@@ -93,11 +89,14 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return styleText;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- // Private
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>- _additionalClassNames: [WebInspector.ActivateButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName]
</del><ins>+ get additionalClassNames()
+ {
+ return ["activate", "button"];
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-WebInspector.ActivateButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del><ins>+WebInspector.ActivateButtonNavigationItem.ActivatedStyleClassName = "activated";
</ins></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsActivateButtonToolbarItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ActivateButtonToolbarItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,28 +23,27 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ActivateButtonToolbarItem = function(identifier, defaultToolTip, activatedToolTip, label, image, suppressEmboss, role)
</del><ins>+WebInspector.ActivateButtonToolbarItem = class ActivateButtonToolbarItem extends WebInspector.ActivateButtonNavigationItem
</ins><span class="cx"> {
</span><del>- WebInspector.ActivateButtonNavigationItem.call(this, identifier, defaultToolTip, activatedToolTip, image, 32, 32, suppressEmboss, role);
</del><ins>+ constructor(identifier, defaultToolTip, activatedToolTip, label, image, suppressEmboss, role)
+ {
+ super(identifier, defaultToolTip, activatedToolTip, image, 32, 32, suppressEmboss, role);
</ins><span class="cx">
</span><del>- if (typeof label === "string") {
- this._labelElement = document.createElement("div");
- this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
- this._element.appendChild(this._labelElement);
</del><ins>+ if (typeof label === "string") {
+ this._labelElement = document.createElement("div");
+ this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
+ this._element.appendChild(this._labelElement);
</ins><span class="cx">
</span><del>- this.label = label;
</del><ins>+ this.label = label;
+ }
</ins><span class="cx"> }
</span><del>-};
</del><span class="cx">
</span><del>-WebInspector.ActivateButtonToolbarItem.prototype = {
- constructor: WebInspector.ActivateButtonToolbarItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get label()
</span><span class="cx"> {
</span><span class="cx"> return this._labelElement.textContent;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set label(newLabel)
</span><span class="cx"> {
</span><span class="lines">@@ -55,5 +54,3 @@
</span><span class="cx"> this._labelElement.textContent = newLabel;
</span><span class="cx"> }
</span><span class="cx"> };
</span><del>-
-WebInspector.ActivateButtonToolbarItem.prototype.__proto__ = WebInspector.ActivateButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsButtonNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,59 +23,46 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ButtonNavigationItem = function(identifier, toolTipOrLabel, image, imageWidth, imageHeight, suppressEmboss, role, label) {
- WebInspector.NavigationItem.call(this, identifier);
</del><ins>+WebInspector.ButtonNavigationItem = class ButtonNavigationItem extends WebInspector.NavigationItem
+{
+ constructor(identifier, toolTipOrLabel, image, imageWidth, imageHeight, suppressEmboss, role, label)
+ {
+ super(identifier);
</ins><span class="cx">
</span><del>- console.assert(identifier);
- console.assert(toolTipOrLabel);
</del><ins>+ this._embossedImageStates = WebInspector.ButtonNavigationItem.States;
+ this._imageCacheable = true;
</ins><span class="cx">
</span><del>- this.toolTip = toolTipOrLabel;
</del><ins>+ console.assert(identifier);
+ console.assert(toolTipOrLabel);
</ins><span class="cx">
</span><del>- this._element.addEventListener("click", this._mouseClicked.bind(this));
</del><ins>+ this.toolTip = toolTipOrLabel;
</ins><span class="cx">
</span><del>- this._element.setAttribute("role", role || "button");
</del><ins>+ this._element.addEventListener("click", this._mouseClicked.bind(this));
</ins><span class="cx">
</span><del>- if (label)
- this._element.setAttribute("aria-label", label);
</del><ins>+ this._element.setAttribute("role", role || "button");
</ins><span class="cx">
</span><del>- this._imageWidth = imageWidth || 16;
- this._imageHeight = imageHeight || 16;
- this._suppressEmboss = suppressEmboss || false;
</del><ins>+ if (label)
+ this._element.setAttribute("aria-label", label);
</ins><span class="cx">
</span><del>- if (suppressEmboss)
- this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName);
</del><ins>+ this._imageWidth = imageWidth || 16;
+ this._imageHeight = imageHeight || 16;
+ this._suppressEmboss = suppressEmboss || false;
</ins><span class="cx">
</span><del>- if (image)
- this.image = image;
- else
- this.label = toolTipOrLabel;
-};
</del><ins>+ if (suppressEmboss)
+ this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName);
</ins><span class="cx">
</span><del>-WebInspector.ButtonNavigationItem.StyleClassName = "button";
-WebInspector.ButtonNavigationItem.DisabledStyleClassName = "disabled";
-WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName = "suppress-bezel";
-WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName = "suppress-emboss";
-WebInspector.ButtonNavigationItem.TextOnlyClassName = "text-only";
</del><ins>+ if (image)
+ this.image = image;
+ else
+ this.label = toolTipOrLabel;
+ }
</ins><span class="cx">
</span><del>-WebInspector.ButtonNavigationItem.States = {};
-WebInspector.ButtonNavigationItem.States.Normal = "normal";
-WebInspector.ButtonNavigationItem.States.Active = "active";
-WebInspector.ButtonNavigationItem.States.Focus = "focus";
-WebInspector.ButtonNavigationItem.States.ActiveFocus = "active-focus";
-
-WebInspector.ButtonNavigationItem.Event = {
- Clicked: "button-navigation-item-clicked"
-};
-
-WebInspector.ButtonNavigationItem.prototype = {
- constructor: WebInspector.ButtonNavigationItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get toolTip()
</span><span class="cx"> {
</span><span class="cx"> return this._element.title;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set toolTip(newToolTip)
</span><span class="cx"> {
</span><span class="lines">@@ -84,12 +71,12 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> this._element.title = newToolTip;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get label()
</span><span class="cx"> {
</span><span class="cx"> return this._element.textContent;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set label(newLabel)
</span><span class="cx"> {
</span><span class="lines">@@ -97,12 +84,12 @@
</span><span class="cx"> this._element.textContent = newLabel || "";
</span><span class="cx"> if (this.parentNavigationBar)
</span><span class="cx"> this.parentNavigationBar.updateLayout();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get image()
</span><span class="cx"> {
</span><span class="cx"> return this._image;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set image(newImage)
</span><span class="cx"> {
</span><span class="lines">@@ -121,12 +108,12 @@
</span><span class="cx"> this._element.appendChild(this._glyphElement);
</span><span class="cx">
</span><span class="cx"> this._updateImage();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get enabled()
</span><span class="cx"> {
</span><span class="cx"> return !this._element.classList.contains(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set enabled(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -134,12 +121,12 @@
</span><span class="cx"> this._element.classList.remove(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
</span><span class="cx"> else
</span><span class="cx"> this._element.classList.add(WebInspector.ButtonNavigationItem.DisabledStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get suppressBezel()
</span><span class="cx"> {
</span><span class="cx"> return this._element.classList.contains(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set suppressBezel(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -147,9 +134,9 @@
</span><span class="cx"> this._element.classList.add(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
</span><span class="cx"> else
</span><span class="cx"> this._element.classList.remove(WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- generateStyleText: function(parentSelector)
</del><ins>+ generateStyleText(parentSelector)
</ins><span class="cx"> {
</span><span class="cx"> var classNames = this._classNames.join(".");
</span><span class="cx">
</span><span class="lines">@@ -167,42 +154,58 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return styleText;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><ins>+ // Protected
+
+ get additionalClassNames()
+ {
+ return ["button"];
+ }
+
</ins><span class="cx"> // Private
</span><span class="cx">
</span><del>- _additionalClassNames: [WebInspector.ButtonNavigationItem.StyleClassName],
- _embossedImageStates: WebInspector.ButtonNavigationItem.States,
- _imageCacheable: true,
-
- _mouseClicked: function(event)
</del><ins>+ _mouseClicked(event)
</ins><span class="cx"> {
</span><span class="cx"> if (!this.enabled)
</span><span class="cx"> return;
</span><span class="cx"> this.dispatchEventToListeners(WebInspector.ButtonNavigationItem.Event.Clicked);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _canvasIdentifier: function(state)
</del><ins>+ _canvasIdentifier(state)
</ins><span class="cx"> {
</span><span class="cx"> console.assert(!this._suppressEmboss);
</span><span class="cx"> return "navigation-item-" + this._identifier + "-" + (state || WebInspector.ButtonNavigationItem.States.Normal);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _updateImage: function()
</del><ins>+ _updateImage()
</ins><span class="cx"> {
</span><span class="cx"> if (this._suppressEmboss)
</span><span class="cx"> this._glyphElement.style.webkitMask = "url(" + this._image + ")";
</span><span class="cx"> else
</span><span class="cx"> this._generateImages();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- _generateImages: function()
</del><ins>+ _generateImages()
</ins><span class="cx"> {
</span><span class="cx"> console.assert(!this._suppressEmboss);
</span><span class="cx"> if (this._suppressEmboss)
</span><span class="cx"> return;
</span><span class="cx"> generateEmbossedImages(this.image, this._imageWidth, this._imageHeight, this._embossedImageStates, this._canvasIdentifier.bind(this), !this._imageCacheable);
</span><span class="cx"> }
</span><ins>+}
+
+WebInspector.ButtonNavigationItem.DisabledStyleClassName = "disabled";
+WebInspector.ButtonNavigationItem.SuppressBezelStyleClassName = "suppress-bezel";
+WebInspector.ButtonNavigationItem.SuppressEmbossStyleClassName = "suppress-emboss";
+WebInspector.ButtonNavigationItem.TextOnlyClassName = "text-only";
+
+WebInspector.ButtonNavigationItem.States = {};
+WebInspector.ButtonNavigationItem.States.Normal = "normal";
+WebInspector.ButtonNavigationItem.States.Active = "active";
+WebInspector.ButtonNavigationItem.States.Focus = "focus";
+WebInspector.ButtonNavigationItem.States.ActiveFocus = "active-focus";
+
+WebInspector.ButtonNavigationItem.Event = {
+ Clicked: "button-navigation-item-clicked"
</ins><span class="cx"> };
</span><del>-
-WebInspector.ButtonNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsButtonToolbarItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ButtonToolbarItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,30 +23,27 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ButtonToolbarItem = function(identifier, toolTip, label, image, suppressEmboss, role)
</del><ins>+WebInspector.ButtonToolbarItem = class ButtonToolbarItem extends WebInspector.ButtonNavigationItem
</ins><span class="cx"> {
</span><del>- WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, 16, 16, suppressEmboss, role);
</del><ins>+ constructor(identifier, toolTip, label, image, suppressEmboss, role)
+ {
+ super(identifier, toolTip, image, 16, 16, suppressEmboss, role);
</ins><span class="cx">
</span><del>- if (typeof label === "string") {
- this._labelElement = document.createElement("div");
- this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
- this._element.appendChild(this._labelElement);
</del><ins>+ if (typeof label === "string") {
+ this._labelElement = document.createElement("div");
+ this._labelElement.className = WebInspector.ButtonToolbarItem.LabelStyleClassName;
+ this._element.appendChild(this._labelElement);
</ins><span class="cx">
</span><del>- this.label = label;
</del><ins>+ this.label = label;
+ }
</ins><span class="cx"> }
</span><del>-};
</del><span class="cx">
</span><del>-WebInspector.ButtonToolbarItem.LabelStyleClassName = "label";
-
-WebInspector.ButtonToolbarItem.prototype = {
- constructor: WebInspector.ButtonToolbarItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get label()
</span><span class="cx"> {
</span><span class="cx"> return this._labelElement.textContent;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set label(newLabel)
</span><span class="cx"> {
</span><span class="lines">@@ -58,4 +55,4 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-WebInspector.ButtonToolbarItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del><ins>+WebInspector.ButtonToolbarItem.LabelStyleClassName = "label";
</ins></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsControlToolbarItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ControlToolbarItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,19 +23,17 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ControlToolbarItem = function(identifier, toolTip, image, imageWidth, imageHeight)
</del><ins>+WebInspector.ControlToolbarItem = class ControlToolbarItem extends WebInspector.ButtonNavigationItem
</ins><span class="cx"> {
</span><del>- WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, imageWidth, imageHeight, false);
-};
</del><ins>+ constructor(identifier, toolTip, image, imageWidth, imageHeight)
+ {
+ super(identifier, toolTip, image, imageWidth, imageHeight, false);
+ }
</ins><span class="cx">
</span><del>-WebInspector.ControlToolbarItem.StyleClassName = "control";
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>-WebInspector.ControlToolbarItem.prototype = {
- constructor: WebInspector.ControlToolbarItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.ControlToolbarItem.StyleClassName],
</del><ins>+ get additionalClassNames()
+ {
+ return ["control"];
+ }
</ins><span class="cx"> };
</span><del>-
-WebInspector.ControlToolbarItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsDividerNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/DividerNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,18 +23,17 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.DividerNavigationItem = function(identifier) {
- WebInspector.NavigationItem.call(this, identifier);
-};
</del><ins>+WebInspector.DividerNavigationItem = class DividerNavigationItem extends WebInspector.NavigationItem
+{
+ constructor(identifier)
+ {
+ super(identifier);
+ }
</ins><span class="cx">
</span><del>-WebInspector.DividerNavigationItem.StyleClassName = "divider";
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>-WebInspector.DividerNavigationItem.prototype = {
- constructor: WebInspector.DividerNavigationItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.DividerNavigationItem.StyleClassName],
</del><ins>+ get additionalClassNames()
+ {
+ return ["divider"];
+ }
</ins><span class="cx"> };
</span><del>-
-WebInspector.DividerNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsFlexibleSpaceNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/FlexibleSpaceNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,18 +23,17 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.FlexibleSpaceNavigationItem = function(identifier) {
- WebInspector.NavigationItem.call(this, identifier);
-};
</del><ins>+WebInspector.FlexibleSpaceNavigationItem = class FlexibleSpaceNavigationItem extends WebInspector.NavigationItem
+{
+ constructor(identifier)
+ {
+ super(identifier);
+ }
</ins><span class="cx">
</span><del>-WebInspector.FlexibleSpaceNavigationItem.StyleClassName = "flexible-space";
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>-WebInspector.FlexibleSpaceNavigationItem.prototype = {
- constructor: WebInspector.FlexibleSpaceNavigationItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.FlexibleSpaceNavigationItem.StyleClassName],
</del><ins>+ get additionalClassNames()
+ {
+ return ["flexible-space"];
+ }
</ins><span class="cx"> };
</span><del>-
-WebInspector.FlexibleSpaceNavigationItem.prototype.__proto__ = WebInspector.NavigationItem.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsHierarchicalPathNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/HierarchicalPathNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -219,8 +219,7 @@
</span><span class="cx">
</span><span class="cx"> // Protected
</span><span class="cx">
</span><del>- // FIXME: Should not be prefixed with an underscore.
- get _additionalClassNames()
</del><ins>+ get additionalClassNames()
</ins><span class="cx"> {
</span><span class="cx"> return ["hierarchical-path"];
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/NavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,57 +23,52 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.NavigationItem = function(identifier, role, label) {
- // FIXME: Convert this to a WebInspector.Object subclass, and call super().
- // WebInspector.Object.call(this);
</del><ins>+WebInspector.NavigationItem = class NavigationItem extends WebInspector.Object
+{
+ constructor(identifier, role, label)
+ {
+ super();
</ins><span class="cx">
</span><del>- this._identifier = identifier || null;
</del><ins>+ this._identifier = identifier || null;
</ins><span class="cx">
</span><del>- this._element = document.createElement("div");
- this._hidden = false;
</del><ins>+ this._element = document.createElement("div");
+ this._hidden = false;
</ins><span class="cx">
</span><del>- if (role)
- this._element.setAttribute("role", role);
- if (label)
- this._element.setAttribute("aria-label", label);
</del><ins>+ if (role)
+ this._element.setAttribute("role", role);
+ if (label)
+ this._element.setAttribute("aria-label", label);
</ins><span class="cx">
</span><del>- this._element.classList.add(...this._classNames);
- this._element.navigationItem = this;
-};
</del><ins>+ this._element.classList.add(...this._classNames);
+ this._element.navigationItem = this;
+ }
</ins><span class="cx">
</span><del>-WebInspector.NavigationItem.StyleClassName = "item";
-WebInspector.NavigationItem.HiddenStyleClassName = "hidden";
-
-
-WebInspector.NavigationItem.prototype = {
- constructor: WebInspector.NavigationItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get identifier()
</span><span class="cx"> {
</span><span class="cx"> return this._identifier;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get element()
</span><span class="cx"> {
</span><span class="cx"> return this._element;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get parentNavigationBar()
</span><span class="cx"> {
</span><span class="cx"> return this._parentNavigationBar;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- updateLayout: function(expandOnly)
</del><ins>+ updateLayout(expandOnly)
</ins><span class="cx"> {
</span><span class="cx"> // Implemented by subclasses.
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get hidden()
</span><span class="cx"> {
</span><span class="cx"> return this._hidden;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set hidden(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -82,26 +77,21 @@
</span><span class="cx">
</span><span class="cx"> this._hidden = flag;
</span><span class="cx">
</span><del>- if (flag)
- this._element.classList.add(WebInspector.NavigationItem.HiddenStyleClassName);
- else
- this._element.classList.remove(WebInspector.NavigationItem.HiddenStyleClassName);
</del><ins>+ this._element.classList.toggle("hidden", flag);
</ins><span class="cx">
</span><span class="cx"> if (this._parentNavigationBar)
</span><span class="cx"> this._parentNavigationBar.updateLayoutSoon();
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> // Private
</span><span class="cx">
</span><span class="cx"> get _classNames()
</span><span class="cx"> {
</span><del>- var classNames = [WebInspector.NavigationItem.StyleClassName];
</del><ins>+ var classNames = ["item"];
</ins><span class="cx"> if (this._identifier)
</span><span class="cx"> classNames.push(this._identifier);
</span><del>- if (this._additionalClassNames instanceof Array)
- classNames = classNames.concat(this._additionalClassNames);
</del><ins>+ if (this.additionalClassNames instanceof Array)
+ classNames = classNames.concat(this.additionalClassNames);
</ins><span class="cx"> return classNames;
</span><span class="cx"> }
</span><span class="cx"> };
</span><del>-
-WebInspector.NavigationItem.prototype.__proto__ = WebInspector.Object.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsRadioButtonNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,23 +23,19 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.RadioButtonNavigationItem = function(identifier, toolTip, image, imageWidth, imageHeight) {
- WebInspector.ButtonNavigationItem.call(this, identifier, toolTip, image, imageWidth, imageHeight, null, "tab");
-};
</del><ins>+WebInspector.RadioButtonNavigationItem = class RadioButtonNavigationItem extends WebInspector.ButtonNavigationItem
+{
+ constructor(identifier, toolTip, image, imageWidth, imageHeight)
+ {
+ super(identifier, toolTip, image, imageWidth, imageHeight, null, "tab");
+ }
</ins><span class="cx">
</span><del>-WebInspector.RadioButtonNavigationItem.StyleClassName = "radio";
-WebInspector.RadioButtonNavigationItem.ActiveStyleClassName = "active";
-WebInspector.RadioButtonNavigationItem.SelectedStyleClassName = "selected";
-
-WebInspector.RadioButtonNavigationItem.prototype = {
- constructor: WebInspector.RadioButtonNavigationItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get selected()
</span><span class="cx"> {
</span><span class="cx"> return this.element.classList.contains(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set selected(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -50,12 +46,12 @@
</span><span class="cx"> this.element.classList.remove(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
</span><span class="cx"> this.element.setAttribute("aria-selected", "false");
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get active()
</span><span class="cx"> {
</span><span class="cx"> return this.element.classList.contains(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set active(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -63,9 +59,9 @@
</span><span class="cx"> this.element.classList.add(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
</span><span class="cx"> else
</span><span class="cx"> this.element.classList.remove(WebInspector.RadioButtonNavigationItem.ActiveStyleClassName);
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- generateStyleText: function(parentSelector)
</del><ins>+ generateStyleText(parentSelector)
</ins><span class="cx"> {
</span><span class="cx"> var classNames = this._classNames.join(".");
</span><span class="cx">
</span><span class="lines">@@ -79,9 +75,9 @@
</span><span class="cx"> styleText += parentSelector + " ." + classNames + ".selected:not(.disabled):active > .glyph { background-image: -webkit-canvas(" + this._canvasIdentifier(WebInspector.ButtonNavigationItem.States.ActiveFocus) + "); }\n";
</span><span class="cx">
</span><span class="cx"> return styleText;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- updateLayout: function(expandOnly)
</del><ins>+ updateLayout(expandOnly)
</ins><span class="cx"> {
</span><span class="cx"> if (expandOnly)
</span><span class="cx"> return;
</span><span class="lines">@@ -101,11 +97,16 @@
</span><span class="cx"> this.element.classList.remove(WebInspector.RadioButtonNavigationItem.SelectedStyleClassName);
</span><span class="cx"> this.element.setAttribute("aria-selected", "false");
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- // Private
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>- _additionalClassNames: [WebInspector.RadioButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName],
</del><ins>+ get additionalClassNames()
+ {
+ return ["radio", "button"];
+ }
</ins><span class="cx"> };
</span><span class="cx">
</span><del>-WebInspector.RadioButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del><ins>+WebInspector.RadioButtonNavigationItem.StyleClassName = "radio";
+WebInspector.RadioButtonNavigationItem.ActiveStyleClassName = "active";
+WebInspector.RadioButtonNavigationItem.SelectedStyleClassName = "selected";
</ins></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsToggleButtonNavigationItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleButtonNavigationItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,32 +23,35 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ToggleButtonNavigationItem = function(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, suppressEmboss) {
- WebInspector.ButtonNavigationItem.call(this, identifier, defaultToolTip, defaultImage, imageWidth, imageHeight, suppressEmboss);
</del><ins>+WebInspector.ToggleButtonNavigationItem = class ToggleButtonNavigationItem extends WebInspector.ButtonNavigationItem
+{
+ constructor(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, suppressEmboss)
+ {
+ super(identifier, defaultToolTip, defaultImage, imageWidth, imageHeight, suppressEmboss);
</ins><span class="cx">
</span><del>- this._toggled = false;
- this._defaultImage = defaultImage;
- this._alternateImage = alternateImage;
- this._defaultToolTip = defaultToolTip;
- this._alternateToolTip = alternateToolTip || defaultToolTip;
-};
</del><ins>+ // The image isn't cacheable because it dynamically changes and the same canvas identifier is reused.
+ // FIXME: We could try overriding _canvasIdentifier() to return different identifiers. If we did that
+ // we would also need to override generateStyleText() to use the different identifiers.
+ this._imageCacheable = false;
</ins><span class="cx">
</span><del>-WebInspector.ToggleButtonNavigationItem.StyleClassName = "toggle";
</del><ins>+ this._toggled = false;
+ this._defaultImage = defaultImage;
+ this._alternateImage = alternateImage;
+ this._defaultToolTip = defaultToolTip;
+ this._alternateToolTip = alternateToolTip || defaultToolTip;
+ }
</ins><span class="cx">
</span><del>-WebInspector.ToggleButtonNavigationItem.prototype = {
- constructor: WebInspector.ToggleButtonNavigationItem,
-
</del><span class="cx"> // Public
</span><span class="cx">
</span><span class="cx"> get defaultToolTip()
</span><span class="cx"> {
</span><span class="cx"> return this._defaultToolTip;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get alternateToolTip()
</span><span class="cx"> {
</span><span class="cx"> return this._alternateToolTip;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set alternateToolTip(toolTip)
</span><span class="cx"> {
</span><span class="lines">@@ -56,17 +59,17 @@
</span><span class="cx">
</span><span class="cx"> if (this._toggled)
</span><span class="cx"> this.toolTip = this._alternateToolTip;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get defaultImage()
</span><span class="cx"> {
</span><span class="cx"> return this._defaultImage;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get alternateImage()
</span><span class="cx"> {
</span><span class="cx"> return this._alternateImage;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set alternateImage(image)
</span><span class="cx"> {
</span><span class="lines">@@ -74,12 +77,12 @@
</span><span class="cx">
</span><span class="cx"> if (this._toggled)
</span><span class="cx"> this.image = this._alternateImage;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> get toggled()
</span><span class="cx"> {
</span><span class="cx"> return this._toggled;
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><span class="cx"> set toggled(flag)
</span><span class="cx"> {
</span><span class="lines">@@ -97,16 +100,12 @@
</span><span class="cx"> this.toolTip = this._defaultToolTip;
</span><span class="cx"> this.image = this._defaultImage;
</span><span class="cx"> }
</span><del>- },
</del><ins>+ }
</ins><span class="cx">
</span><del>- // Private
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>- _additionalClassNames: [WebInspector.ToggleButtonNavigationItem.StyleClassName, WebInspector.ButtonNavigationItem.StyleClassName],
-
- // The image isn't cacheable because it dynamically changes and the same canvas identifier is reused.
- // FIXME: We could try overriding _canvasIdentifier() to return different identifiers. If we did that
- // we would also need to override generateStyleText() to use the different identifiers.
- _imageCacheable: false
</del><ins>+ get additionalClassNames()
+ {
+ return ["toggle", "button"];
+ }
</ins><span class="cx"> };
</span><del>-
-WebInspector.ToggleButtonNavigationItem.prototype.__proto__ = WebInspector.ButtonNavigationItem.prototype;
</del></span></pre></div>
<a id="branchessafari601branchSourceWebInspectorUIUserInterfaceViewsToggleControlToolbarItemjs"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js (193031 => 193032)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js        2015-12-03 18:33:33 UTC (rev 193031)
+++ branches/safari-601-branch/Source/WebInspectorUI/UserInterface/Views/ToggleControlToolbarItem.js        2015-12-03 18:33:42 UTC (rev 193032)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -23,18 +23,17 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ToggleControlToolbarItem = function(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight) {
- WebInspector.ToggleButtonNavigationItem.call(this, identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, false);
-};
</del><ins>+WebInspector.ToggleControlToolbarItem = class ToggleControlToolbarItem extends WebInspector.ToggleButtonNavigationItem
+{
+ constructor(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight)
+ {
+ super(identifier, defaultToolTip, alternateToolTip, defaultImage, alternateImage, imageWidth, imageHeight, false);
+ }
</ins><span class="cx">
</span><del>-WebInspector.ToggleControlToolbarItem.StyleClassName = "toggle";
</del><ins>+ // Protected
</ins><span class="cx">
</span><del>-WebInspector.ToggleControlToolbarItem.prototype = {
- constructor: WebInspector.ToggleControlToolbarItem,
-
- // Private
-
- _additionalClassNames: [WebInspector.ToggleControlToolbarItem.StyleClassName, WebInspector.ControlToolbarItem.StyleClassName]
</del><ins>+ get additionalClassNames()
+ {
+ return ["toggle", "control"];
+ }
</ins><span class="cx"> };
</span><del>-
-WebInspector.ToggleControlToolbarItem.prototype.__proto__ = WebInspector.ToggleButtonNavigationItem.prototype;
</del></span></pre>
</div>
</div>
</body>
</html>