<?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>145085</bug_id>
          
          <creation_ts>2015-05-15 17:39:32 -0700</creation_ts>
          <short_desc>Web Inspector: Tab Restoration may call shown on initial ContentView twice</short_desc>
          <delta_ts>2026-01-12 09:08:21 -0800</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>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Joseph Pecoraro">joepeck</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>jonowells</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1095323</commentid>
    <comment_count>0</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-05-15 17:39:32 -0700</bug_when>
    <thetext>* SUMMARY
Tab Restoration may call shown on initial ContentView twice.

* STEPS TO REPRODUCE
1. Inspect &lt;http://bogojoker.com/shell/&gt;
2. In Debugger Tab select the &quot;easySlider.min.js&quot; resource =&gt; creates a SourceCodeTextEditor
3. Switch to the Elements Tab
4. Close Inspector =&gt; saves state of tabs
5. Open Inspector
6. Select Debugger Tab to trigger tab restoration
  =&gt; Unexpectedly the TextResourceContentView for &quot;easySlider.min.js&quot; gets &quot;shown&quot; called twice.

* TRACES
- Note that BackForwardEntry._restoreFromCookie seems to be the culprit.
  - it restores some ContentView and calls shown()
  - it then proceeds to call shown() again on what it just showed.

    Views/SourceCodeTextEditor.js:100:20: CONSOLE LOG SourceCodeTextEditor.shown http://bogojoker.com/shell/js/easySlider.min.js
    Views/SourceCodeTextEditor.js:101:22: CONSOLE TRACE
    0: shown(Views/SourceCodeTextEditor.js:101:22)
    1: shown(Views/TextResourceContentView.js:104:31)
    2: prepareToShow(Models/BackForwardEntry.js:61:35)
    3: _showEntry(Views/ContentViewContainer.js:472:28)
    4: showBackForwardEntryForIndex(Views/ContentViewContainer.js:212:28)
    5: showContentView(Views/ContentViewContainer.js:188:42)
    6: _showContentViewForIdentifier(Views/ResourceClusterContentView.js:236:57)
    7: restoreFromCookie(Views/ResourceClusterContentView.js:147:61)
    8: _restoreFromCookie(Models/BackForwardEntry.js:78:43)
    9: prepareToShow(Models/BackForwardEntry.js:57:32)
    10: _showEntry(Views/ContentViewContainer.js:472:28)
    11: showBackForwardEntryForIndex(Views/ContentViewContainer.js:212:28)
    12: showContentView(Views/ContentViewContainer.js:188:42)
    13: showContentViewForRepresentedObject(Views/ContentBrowser.js:168:58)
    14: showDefaultContentViewForTreeElement(Views/NavigationSidebarPanel.js:196:64)
    15: _checkElementsForPendingViewStateCookie(Views/NavigationSidebarPanel.js:701:54)
    16: _checkOutlinesForPendingViewStateCookie(Views/NavigationSidebarPanel.js:656:60)
    17: finalAttemptToRestoreViewStateFromCookie(Views/NavigationSidebarPanel.js:242:57)
    18: finalAttemptToRestoreViewStateFromCookie([native code])

    Views/SourceCodeTextEditor.js:100:20: CONSOLE LOG SourceCodeTextEditor.shown http://bogojoker.com/shell/js/easySlider.min.js
    Views/SourceCodeTextEditor.js:101:22: CONSOLE TRACE
    0: shown(Views/SourceCodeTextEditor.js:101:22)
    1: shown(Views/TextResourceContentView.js:104:31)
    2: prepareToShow(Models/BackForwardEntry.js:61:35)
    3: _showEntry(Views/ContentViewContainer.js:472:28)
    4: shown(Views/ContentViewContainer.js:425:24)
    5: shown(Views/ClusterContentView.js:75:41)
    6: shown(Views/ResourceClusterContentView.js:125:61)
    7: prepareToShow(Models/BackForwardEntry.js:61:35)
    8: _showEntry(Views/ContentViewContainer.js:472:28)
    9: showBackForwardEntryForIndex(Views/ContentViewContainer.js:212:28)
    10: showContentView(Views/ContentViewContainer.js:188:42)
    11: showContentViewForRepresentedObject(Views/ContentBrowser.js:168:58)
    12: showDefaultContentViewForTreeElement(Views/NavigationSidebarPanel.js:196:64)
    13: _checkElementsForPendingViewStateCookie(Views/NavigationSidebarPanel.js:701:54)
    14: _checkOutlinesForPendingViewStateCookie(Views/NavigationSidebarPanel.js:656:60)
    15: finalAttemptToRestoreViewStateFromCookie(Views/NavigationSidebarPanel.js:242:57)
    16: finalAttemptToRestoreViewStateFromCookie([native code])</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095324</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-05-15 17:39:44 -0700</bug_when>
    <thetext>&lt;rdar://problem/20985259&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095327</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-05-15 17:42:06 -0700</bug_when>
    <thetext>Sounds like a duplicate of 135000 but that was closed as WONTFIX.

It would be great to simplify the BackForward logic a bit. It is so complex, I can&apos;t follow it. We should really clarify when an entry gets added that wouldn&apos;t want &quot;shown&quot; called on it. Otherwise, we can just check &quot;if (!cv.visible) cv.shown()&quot; and not rely on passing booleans around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1095328</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-05-15 17:42:21 -0700</bug_when>
    <thetext>Bug 135000</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>