Title: [255950] releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI
Revision
255950
Author
[email protected]
Date
2020-02-06 07:12:08 -0800 (Thu, 06 Feb 2020)

Log Message

Merge r255901 - Web Inspector: the height of the undocked title area shouldn't change when zoomed
https://bugs.webkit.org/show_bug.cgi?id=207228

Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WI.contentLoaded):
(WI.contentLoaded.updateZoomFactorCSSVariable): Added.
Save the zoom factor as a number in a CSS variable on the `<body>`.

* UserInterface/Views/Variables.css:
(body.mac-platform:not(.docked)): Added.
(body:not(.docked)): Deleted.
Divide the default `22px` by the current zoom factor so that it cancels out when rendered.
Make it so that the undocked title area is only shown on macOS <https://webkit.org/b/204627#c47>

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/ChangeLog (255949 => 255950)


--- releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/ChangeLog	2020-02-06 15:12:04 UTC (rev 255949)
+++ releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/ChangeLog	2020-02-06 15:12:08 UTC (rev 255950)
@@ -1,3 +1,21 @@
+2020-02-05  Devin Rousso  <[email protected]>
+
+        Web Inspector: the height of the undocked title area shouldn't change when zoomed
+        https://bugs.webkit.org/show_bug.cgi?id=207228
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Base/Main.js:
+        (WI.contentLoaded):
+        (WI.contentLoaded.updateZoomFactorCSSVariable): Added.
+        Save the zoom factor as a number in a CSS variable on the `<body>`.
+
+        * UserInterface/Views/Variables.css:
+        (body.mac-platform:not(.docked)): Added.
+        (body:not(.docked)): Deleted.
+        Divide the default `22px` by the current zoom factor so that it cancels out when rendered.
+        Make it so that the undocked title area is only shown on macOS <https://webkit.org/b/204627#c47>
+
 2020-02-05  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Some cookie table column headers should not be localizable

Modified: releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/UserInterface/Base/Main.js (255949 => 255950)


--- releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/UserInterface/Base/Main.js	2020-02-06 15:12:04 UTC (rev 255949)
+++ releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/UserInterface/Base/Main.js	2020-02-06 15:12:08 UTC (rev 255950)
@@ -542,9 +542,17 @@
     function updateConsoleSavedResultPrefixCSSVariable() {
         document.body.style.setProperty("--console-saved-result-prefix", "\"" + WI.RuntimeManager.preferredSavedResultPrefix() + "\"");
     }
-    WI.settings.consoleSavedResultAlias.addEventListener(WI.Setting.Event.Changed, updateConsoleSavedResultPrefixCSSVariable);
+
+    WI.settings.consoleSavedResultAlias.addEventListener(WI.Setting.Event.Changed, updateConsoleSavedResultPrefixCSSVariable, WI.settings);
     updateConsoleSavedResultPrefixCSSVariable();
 
+    function updateZoomFactorCSSVariable() {
+        document.body.style.setProperty("--zoom-factor", WI.settings.zoomFactor.value);
+    }
+
+    WI.settings.zoomFactor.addEventListener(WI.Setting.Event.Changed, updateZoomFactorCSSVariable, WI.settings);
+    updateZoomFactorCSSVariable();
+
     // Signal that the frontend is now ready to receive messages.
     WI._backendTargetAvailablePromise.promise.then(() => {
         InspectorFrontendAPI.loadCompleted();

Modified: releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/UserInterface/Views/Variables.css (255949 => 255950)


--- releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/UserInterface/Views/Variables.css	2020-02-06 15:12:04 UTC (rev 255949)
+++ releases/WebKitGTK/webkit-2.28/Source/WebInspectorUI/UserInterface/Views/Variables.css	2020-02-06 15:12:08 UTC (rev 255950)
@@ -212,8 +212,8 @@
     --border-color-dark: hsl(0, 0%, 72%);
 }
 
-body:not(.docked) {
-    --undocked-title-area-height: 22px;
+body.mac-platform:not(.docked) {
+    --undocked-title-area-height: calc(22px / var(--zoom-factor));
 }
 
 @media (prefers-color-scheme: dark) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to