REGRESSION(r248391): Web Inspector: changing Layout Direction Debug setting no longer...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2019 03:56:37 +0000 (03:56 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Aug 2019 03:56:37 +0000 (03:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200564

Reviewed by Joseph Pecoraro.

`WI.resolvedLayoutDirection` was called before `WI.runBootstrapOperations`, which is what
instantiates `WI.showDebugUISetting`. Without it, `WI.resolvedLayoutDirection` will ignore
the value of `WI.settings.debugLayoutDirection` and instead use the system.

Moving the instantiation of `WI.showDebugUISetting` outside `WI.runBootstrapOperations`
allows the setting to be created when the Bootstrap.js script is loaded, rather than after
the `DOMContentLoaded` event is fired. This means that it's guaranteed to exist before any
interface/view code runs.

* UserInterface/Debug/Bootstrap.js:
(WI.runBootstrapOperations):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Debug/Bootstrap.js

index 270d912..88f3340 100644 (file)
@@ -1,5 +1,24 @@
 2019-08-12  Devin Rousso  <drousso@apple.com>
 
+        REGRESSION(r248391): Web Inspector: changing Layout Direction Debug setting no longer adds dir="ltr" to body element
+        https://bugs.webkit.org/show_bug.cgi?id=200564
+
+        Reviewed by Joseph Pecoraro.
+
+        `WI.resolvedLayoutDirection` was called before `WI.runBootstrapOperations`, which is what
+        instantiates `WI.showDebugUISetting`. Without it, `WI.resolvedLayoutDirection` will ignore
+        the value of `WI.settings.debugLayoutDirection` and instead use the system.
+
+        Moving the instantiation of `WI.showDebugUISetting` outside `WI.runBootstrapOperations`
+        allows the setting to be created when the Bootstrap.js script is loaded, rather than after
+        the `DOMContentLoaded` event is fired. This means that it's guaranteed to exist before any
+        interface/view code runs.
+
+        * UserInterface/Debug/Bootstrap.js:
+        (WI.runBootstrapOperations):
+
+2019-08-12  Devin Rousso  <drousso@apple.com>
+
         Web Inspector: remove WI.DeprecatedRemoteObjectProperty
         https://bugs.webkit.org/show_bug.cgi?id=200549
 
index f5834d1..72ec2f7 100644 (file)
@@ -37,10 +37,10 @@ WI.settings.engineeringPauseForInternalScripts.addEventListener(WI.Setting.Event
         WI.settings.engineeringShowInternalScripts.value = true;
 }, WI.settings.engineeringShowInternalScripts);
 
+WI.showDebugUISetting = new WI.Setting("show-debug-ui", false);
+
 // This function is invoked after the inspector has loaded and has a backend target.
 WI.runBootstrapOperations = function() {
-    WI.showDebugUISetting = new WI.Setting("show-debug-ui", false);
-
     // Toggle Debug UI setting.
     new WI.KeyboardShortcut(WI.KeyboardShortcut.Modifier.Option | WI.KeyboardShortcut.Modifier.Shift | WI.KeyboardShortcut.Modifier.CommandOrControl, "D", () => {
         WI.showDebugUISetting.value = !WI.showDebugUISetting.value;