<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>200564</bug_id>
          
          <creation_ts>2019-08-08 22:53:37 -0700</creation_ts>
          <short_desc>REGRESSION(r248391): Web Inspector: changing Layout Direction Debug setting no longer adds dir=&quot;ltr&quot; to body element</short_desc>
          <delta_ts>2019-08-12 20:57:20 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikita Vasilyev">nvasilyev</reporter>
          <assigned_to name="Devin Rousso">hi</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1559806</commentid>
    <comment_count>0</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2019-08-08 22:53:37 -0700</bug_when>
    <thetext>This has to be recent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559807</commentid>
    <comment_count>1</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2019-08-08 23:04:14 -0700</bug_when>
    <thetext>  WI.resolvedLayoutDirection = function()
  {
      let layoutDirection = WI.settings.debugLayoutDirection.value;
-&gt;    if (!WI.isDebugUIEnabled() || layoutDirection === WI.LayoutDirection.System)
          layoutDirection = InspectorFrontendHost.userInterfaceLayoutDirection();
      return layoutDirection;
  };


WI.isDebugUIEnabled returns undefined:

    WI.isDebugUIEnabled = function()
    {
        return WI.showDebugUISetting &amp;&amp; WI.showDebugUISetting.value;
    };

WI.showDebugUISetting is undefined. This is where it&apos;s created:

    // This function is invoked after the inspector has loaded and has a backend target.
    WI.runBootstrapOperations = function() {
        WI.showDebugUISetting = new WI.Setting(&quot;show-debug-ui&quot;, false);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559808</commentid>
    <comment_count>2</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2019-08-08 23:08:39 -0700</bug_when>
    <thetext>Broke in https://trac.webkit.org/changeset/248391/webkit#file1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559810</commentid>
    <comment_count>3</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2019-08-08 23:15:06 -0700</bug_when>
    <thetext>This line broke it.

Main.js:
- 2707    if (layoutDirection === WI.LayoutDirection.System)
+ 2707    if (!WI.isDebugUIEnabled() || layoutDirection === WI.LayoutDirection.System)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559818</commentid>
    <comment_count>4</comment_count>
    <who name="Devin Rousso">hi</who>
    <bug_when>2019-08-08 23:36:44 -0700</bug_when>
    <thetext>This is something we don&apos;t want to expose outside of Web Inspector&apos;s debug mode (⌥⇧⌘D).

Are you saying that the layout direction doesn&apos;t work when NOT in the debug mode (⌥⇧⌘D)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559823</commentid>
    <comment_count>5</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2019-08-09 00:01:23 -0700</bug_when>
    <thetext>(In reply to Devin Rousso from comment #4)
&gt; This is something we don&apos;t want to expose outside of Web Inspector&apos;s debug
&gt; mode (⌥⇧⌘D).
&gt; 
&gt; Are you saying that the layout direction doesn&apos;t work when NOT in the debug
&gt; mode (⌥⇧⌘D)?

It doesn&apos;t work in Debug mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559825</commentid>
    <comment_count>6</comment_count>
      <attachid>375897</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2019-08-09 00:18:15 -0700</bug_when>
    <thetext>Created attachment 375897
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559832</commentid>
    <comment_count>7</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2019-08-09 02:02:19 -0700</bug_when>
    <thetext>This indeed fixes the regression. I&apos;d r+.

Nit: I noticed that several settings are instantiated in WI.loaded() while none in Bootstrap.js. Would it be better to add this one to WI.loaded() as well for consistency?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1559914</commentid>
    <comment_count>8</comment_count>
    <who name="Devin Rousso">hi</who>
    <bug_when>2019-08-09 09:32:39 -0700</bug_when>
    <thetext>(In reply to Nikita Vasilyev from comment #7)
&gt; Nit: I noticed that several settings are instantiated in WI.loaded() while none in Bootstrap.js. Would it be better to add this one to WI.loaded() as well for consistency?
`WI.loaded` exists just as a way to say &quot;run this stuff once all the scripts have loaded, but potentially before we&apos;re done creating the DOM&quot;.  We primarily use it now for initial state setup (both UI and protocol).  Frankly, we could probably just inline all of that code inside the last script in Main.html/Test.html (or distribute it, as the comment in AppControllerBase.js suggests).

In the case of `WI.showDebugUISetting`, most of our other global state `WI.Setting` are created in Setting.js itself (e.g. when the script is parsed/executed, not in some event), I think it&apos;s fine to do a similar thing in Bootstrap.js.  Putting it in `WI.loaded` would have the same effect, just delayed slightly more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1560678</commentid>
    <comment_count>9</comment_count>
      <attachid>375897</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2019-08-12 20:46:09 -0700</bug_when>
    <thetext>Comment on attachment 375897
Patch

rs=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1560690</commentid>
    <comment_count>10</comment_count>
      <attachid>375897</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-08-12 20:56:44 -0700</bug_when>
    <thetext>Comment on attachment 375897
Patch

Clearing flags on attachment: 375897

Committed r248590: &lt;https://trac.webkit.org/changeset/248590&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1560691</commentid>
    <comment_count>11</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2019-08-12 20:56:45 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1560692</commentid>
    <comment_count>12</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-08-12 20:57:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/54240508&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>375897</attachid>
            <date>2019-08-09 00:18:15 -0700</date>
            <delta_ts>2019-08-12 20:56:44 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-200564-20190809001814.patch</filename>
            <type>text/plain</type>
            <size>2455</size>
            <attacher name="Devin Rousso">hi</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2Vi
SW5zcGVjdG9yVUkvQ2hhbmdlTG9nCmluZGV4IGNlMzJhYzFmZmFkZDY5MjY5MGZjYmY3Y2NjN2Vi
NTViZGI1ZGY1NjcuLmYwZmM4ZDIzMDRhNzUwZjJiMTM1ODM2ZmE1MGVlYjI5NTFjODdkYzcgMTAw
NjQ0Ci0tLSBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2V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