Title: [249118] trunk/Source/WebInspectorUI
Revision
249118
Author
[email protected]
Date
2019-08-26 14:59:24 -0700 (Mon, 26 Aug 2019)

Log Message

Web Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
https://bugs.webkit.org/show_bug.cgi?id=201090

Reviewed by Joseph Pecoraro.

There's a lot of "wasted" padding space around each item that we could reuse (or "move") for
other navigation items.

* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item.scope-bar):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only):
* UserInterface/Views/ScopeBar.css:
(.scope-bar):
(body[dir=ltr] .scope-bar > li.multiple > select):
(body[dir=rtl] .scope-bar > li.multiple > select):
(.scope-bar > li.multiple > .arrows):

* UserInterface/Views/RadioButtonNavigationItem.js:
(WI.RadioButtonNavigationItem):
(WI.RadioButtonNavigationItem.prototype.update): Deleted.
There's no reason to forcibly set the `min-width` since all instances are just text.

* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.initialLayout):
* UserInterface/Views/AuditTestGroupContentView.css:
(.content-view.audit-test-group > header > nav:not(:empty):before): Deleted.
Remove the unnecessary "Showing: " prefix before the `WI.ScopeBar`.

* UserInterface/Views/ScopeRadioButtonNavigationItem.js: Removed.
* UserInterface/Views/ScopeRadioButtonNavigationItem.css: Removed.
These classes were never used.

* Localizations/en.lproj/localizedStrings.js:

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (249117 => 249118)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-08-26 21:59:24 UTC (rev 249118)
@@ -1,3 +1,40 @@
+2019-08-26  Devin Rousso  <[email protected]>
+
+        Web Inspector: decrease horizontal padding of `WI.ScopeBar` to have more room
+        https://bugs.webkit.org/show_bug.cgi?id=201090
+
+        Reviewed by Joseph Pecoraro.
+
+        There's a lot of "wasted" padding space around each item that we could reuse (or "move") for
+        other navigation items.
+
+        * UserInterface/Views/FilterBar.css:
+        (.filter-bar > .navigation-bar > .item.scope-bar):
+        * UserInterface/Views/RadioButtonNavigationItem.css:
+        (.navigation-bar .item.radio.button.text-only):
+        * UserInterface/Views/ScopeBar.css:
+        (.scope-bar):
+        (body[dir=ltr] .scope-bar > li.multiple > select):
+        (body[dir=rtl] .scope-bar > li.multiple > select):
+        (.scope-bar > li.multiple > .arrows):
+
+        * UserInterface/Views/RadioButtonNavigationItem.js:
+        (WI.RadioButtonNavigationItem):
+        (WI.RadioButtonNavigationItem.prototype.update): Deleted.
+        There's no reason to forcibly set the `min-width` since all instances are just text.
+
+        * UserInterface/Views/AuditTestGroupContentView.js:
+        (WI.AuditTestGroupContentView.prototype.initialLayout):
+        * UserInterface/Views/AuditTestGroupContentView.css:
+        (.content-view.audit-test-group > header > nav:not(:empty):before): Deleted.
+        Remove the unnecessary "Showing: " prefix before the `WI.ScopeBar`.
+
+        * UserInterface/Views/ScopeRadioButtonNavigationItem.js: Removed.
+        * UserInterface/Views/ScopeRadioButtonNavigationItem.css: Removed.
+        These classes were never used.
+
+        * Localizations/en.lproj/localizedStrings.js:
+
 2019-08-24  Devin Rousso  <[email protected]>
 
         Web Inspector: "Copy Rule" menu item does not propagate comments properly

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (249117 => 249118)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2019-08-26 21:59:24 UTC (rev 249118)
@@ -1018,7 +1018,6 @@
 localizedStrings["Show type information"] = "Show type information";
 localizedStrings["Show warnings logged to the Console"] = "Show warnings logged to the Console";
 localizedStrings["Show:"] = "Show:";
-localizedStrings["Showing:"] = "Showing:";
 localizedStrings["Site-specific Hacks"] = "Site-specific Hacks";
 localizedStrings["Size"] = "Size";
 localizedStrings["Size of current object plus all objects it keeps alive"] = "Size of current object plus all objects it keeps alive";

Modified: trunk/Source/WebInspectorUI/UserInterface/Main.html (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Main.html	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.html	2019-08-26 21:59:24 UTC (rev 249118)
@@ -182,7 +182,6 @@
     <link rel="stylesheet" href=""
     <link rel="stylesheet" href=""
     <link rel="stylesheet" href=""
-    <link rel="stylesheet" href=""
     <link rel="stylesheet" href=""
     <link rel="stylesheet" href=""
     <link rel="stylesheet" href=""
@@ -777,7 +776,6 @@
     <script src=""
     <script src=""
     <script src=""
-    <script src=""
     <script src=""
     <script src=""
     <script src=""

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.css	2019-08-26 21:59:24 UTC (rev 249118)
@@ -74,10 +74,6 @@
     display: none;
 }
 
-.content-view.audit-test-group > header > nav:not(:empty):before {
-    content: attr(data-prefix);
-}
-
 .content-view.audit-test-group > header > nav > .scope-bar > li {
     margin: 0 3px;
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/AuditTestGroupContentView.js	2019-08-26 21:59:24 UTC (rev 249118)
@@ -56,7 +56,6 @@
         }
 
         this._levelNavigationBar = new WI.NavigationBar(document.createElement("nav"));
-        this._levelNavigationBar.element.dataset.prefix = WI.UIString("Showing:");
         this.headerView.addSubview(this._levelNavigationBar);
 
         this._percentageContainer = this.headerView.element.appendChild(document.createElement("div"));

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FilterBar.css	2019-08-26 21:59:24 UTC (rev 249118)
@@ -47,7 +47,6 @@
 }
 
 .filter-bar > .navigation-bar > .item.scope-bar {
-    --scope-bar-padding-override: 4px;
     --scope-bar-margin-override: 0;
 }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.css	2019-08-26 21:59:24 UTC (rev 249118)
@@ -33,7 +33,7 @@
 
 .navigation-bar .item.radio.button.text-only {
     position: relative;
-    padding: 2px 9px 4px;
+    padding: 2px 4px 4px;
     border: none;
     z-index: 0;
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js	2019-08-26 21:59:24 UTC (rev 249118)
@@ -28,8 +28,6 @@
     constructor(identifier, toolTip, image, imageWidth, imageHeight)
     {
         super(identifier, toolTip, image, imageWidth, imageHeight, null, "tab");
-
-        this._initializedMinWidth = false;
     }
 
     // Public
@@ -60,34 +58,6 @@
         this.element.classList.toggle(WI.RadioButtonNavigationItem.ActiveStyleClassName, flag);
     }
 
-    update(options = {})
-    {
-        super.update(options);
-
-        if (options.expandOnly)
-            return;
-
-        var isSelected = this.selected;
-
-        if (!isSelected) {
-            this.element.classList.add(WI.RadioButtonNavigationItem.SelectedStyleClassName);
-            this.element.setAttribute("aria-selected", "true");
-        }
-
-        if (!this._initializedMinWidth) {
-            var width = this.element.offsetWidth;
-            if (width) {
-                this._initializedMinWidth = true;
-                this.element.style.minWidth = width + "px";
-            }
-        }
-
-        if (!isSelected) {
-            this.element.classList.remove(WI.RadioButtonNavigationItem.SelectedStyleClassName);
-            this.element.setAttribute("aria-selected", "false");
-        }
-    }
-
     // Protected
 
     get additionalClassNames()

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeBar.css	2019-08-26 21:59:24 UTC (rev 249118)
@@ -28,7 +28,7 @@
     overflow: hidden;
 
     --scope-bar-margin-default: 2px;
-    --scope-bar-padding-default: 9px;
+    --scope-bar-padding-default: 4px;
     --scope-bar-text-color-default: var(--text-color);
     --scope-bar-background-color-default: unset;
     --scope-bar-background-opacity-default: var(--glyph-opacity);
@@ -97,11 +97,11 @@
 }
 
 body[dir=ltr] .scope-bar > li.multiple > select {
-    left: calc(var(--scope-bar-padding) - var(--scope-bar-padding-default) + 1px);
+    left: calc(var(--scope-bar-padding) - var(--scope-bar-padding-default) - 4px);
 }
 
 body[dir=rtl] .scope-bar > li.multiple > select {
-    right: calc(var(--scope-bar-padding) - var(--scope-bar-padding-default) + 1px);
+    right: calc(var(--scope-bar-padding) - var(--scope-bar-padding-default) - 4px);
 }
 
 .scope-bar > li.multiple:not(.selected) > select {
@@ -116,4 +116,5 @@
     margin-top: -1px;
     margin-bottom: -1px;
     -webkit-margin-start: 6px;
+    -webkit-margin-end: 2px;
 }

Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeRadioButtonNavigationItem.css (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeRadioButtonNavigationItem.css	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeRadioButtonNavigationItem.css	2019-08-26 21:59:24 UTC (rev 249118)
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-.scope-radio-button-navigation-item {
-    position: relative;
-}
-
-.scope-radio-button-navigation-item > .scope-radio-button-item-select {
-    position: absolute;
-    top: 0;
-    width: 100%;
-    height: 100%;
-    border: 1px solid transparent;
-    -webkit-appearance: none;
-    background: transparent;
-    color: transparent;
-    outline: none;
-
-    --scope-radio-button-navigation-item-select-offset-start: 0;
-}
-
-body[dir=ltr] .scope-radio-button-navigation-item > .scope-radio-button-item-select {
-    left: var(--scope-radio-button-navigation-item-select-offset-start);
-}
-
-body[dir=rtl] .scope-radio-button-navigation-item > .scope-radio-button-item-select {
-    right: var(--scope-radio-button-navigation-item-select-offset-start);
-}
-
-/* Positions the "Style" text almost exactly over the radio-button-item */
-.scope-radio-button-navigation-item > .scope-radio-button-item-select:focus {
-    top: -2px;
-    border: none;
-}
-
-.scope-radio-button-navigation-item > .arrows {
-    width: 5px;
-    height: 11px;
-    -webkit-margin-start: 4px;
-    pointer-events: none;
-    transform: translateY(1px);
-}
-
-.scope-radio-button-navigation-item.selected > .arrows {
-    display: inline-block;
-}
-
-.scope-radio-button-navigation-item:hover > .arrows {
-    color: white;
-}

Deleted: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeRadioButtonNavigationItem.js (249117 => 249118)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeRadioButtonNavigationItem.js	2019-08-26 21:09:35 UTC (rev 249117)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeRadioButtonNavigationItem.js	2019-08-26 21:59:24 UTC (rev 249118)
@@ -1,94 +0,0 @@
-/*
- * 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.
- */
-
-WI.ScopeRadioButtonNavigationItem = class ScopeRadioButtonNavigationItem extends WI.RadioButtonNavigationItem
-{
-    constructor(identifier, toolTip, scopeItems, defaultScopeItem)
-    {
-        super(identifier, toolTip);
-
-        this._scopeItems = scopeItems || [];
-
-        this._element.classList.add("scope-radio-button-navigation-item");
-        this._element.title = defaultScopeItem ? defaultScopeItem.label : this._scopeItems[0].label;
-
-        this._scopeItemSelect = document.createElement("select");
-        this._scopeItemSelect.classList.add("scope-radio-button-item-select");
-
-        for (var item of this._scopeItems) {
-            var option = document.createElement("option");
-            option.value = item.identifier;
-            option.text = item.label;
-            this._scopeItemSelect.appendChild(option);
-        }
-
-        this.selectedItemIdentifier = defaultScopeItem ? defaultScopeItem.identifier : this._scopeItems[0].identifier;
-        this._scopeItemSelect.addEventListener("change", this._handleItemChanged.bind(this));
-        this._element.appendChild(this._scopeItemSelect);
-
-        this._element.appendChild(WI.ImageUtilities.useSVGSymbol("Images/UpDownArrows.svg", "arrows"));
-    }
-
-    // Public
-
-    set selectedItemIdentifier(identifier)
-    {
-        if (!identifier)
-            return;
-
-        this._scopeItemSelect.value = identifier;
-    }
-
-    get selectedItemIdentifier()
-    {
-        return this._scopeItemSelect.value;
-    }
-
-    dontPreventDefaultOnNavigationBarMouseDown()
-    {
-        return true;
-    }
-
-    // Private
-
-    _handleItemChanged()
-    {
-        var selectedItemIdentifier;
-        for (var item of this._scopeItems) {
-            if (item.identifier !== this.selectedItemIdentifier)
-                continue;
-
-            selectedItemIdentifier = item;
-            break;
-        }
-
-        this._element.title = selectedItemIdentifier.label;
-        this.dispatchEventToListeners(WI.ScopeRadioButtonNavigationItem.Event.SelectedItemChanged);
-    }
-};
-
-WI.ScopeRadioButtonNavigationItem.Event = {
-    SelectedItemChanged: "scope-radio-button-navigation-item-selected-item-changed"
-};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to