Web Inspector: add DebugUI setting to manually override UI layout direction
authorbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Feb 2017 18:33:45 +0000 (18:33 +0000)
committerbburg@apple.com <bburg@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Feb 2017 18:33:45 +0000 (18:33 +0000)
commit7191ea6ae2327ccb290bdbeac93bbdda6c06db11
tree77c170bb1f88f1acf0d7a301b57d020a1e2a65e0
parent9aea4926d6dd617dd412d3c0a4cc5455b7079375
Web Inspector: add DebugUI setting to manually override UI layout direction
https://bugs.webkit.org/show_bug.cgi?id=168222

Reviewed by Joseph Pecoraro.

Expose three layout direction settings:
 - System (inherit system UI layout direction)
 - LTR (the default regardless of system language)
 - RTL (under development, only accessible via this menu)

* UserInterface/Base/Main.js:
The UI layout direction is normally only set once per frontend load.
There is no expectation on macOS that applications can switch dynamically.
But, for DebugUI purposes we need to switch the layout direction quickly.
Store the new setting and trigger a hard reload of the frontend page.
If the 'system' setting is specified, fall back to the system layout
direction as provided by InspectorFrontendHost.

* UserInterface/Base/Setting.js:
Add an application-level setting for (user interface) layout direction.

* UserInterface/Views/SettingsTabContentView.js:
(WebInspector.SettingsTabContentView):
(WebInspector.SettingsTabContentView.prototype.layout):
(WebInspector.SettingsTabContentView.prototype.initialLayout): Deleted.
Make this a normal layout() method so that we can dirty the view
when DebugUI is turned on or off.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Main.js
Source/WebInspectorUI/UserInterface/Base/Setting.js
Source/WebInspectorUI/UserInterface/Views/SettingsTabContentView.js