<?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>147525</bug_id>
          
          <creation_ts>2015-08-01 00:54:20 -0700</creation_ts>
          <short_desc>WebKit2 Removed API to change WebKit2.BackwardForwardList</short_desc>
          <delta_ts>2015-08-03 10:23:29 -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>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sam P.">sam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>beidson</cc>
    
    <cc>sam</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1114002</commentid>
    <comment_count>0</comment_count>
    <who name="Sam P.">sam</who>
    <bug_when>2015-08-01 00:54:20 -0700</bug_when>
    <thetext>In the WebKit1 API, it was possible to change a WebView&apos;s back/forward list.

For example, it was possible to reconstruct the history of a WebView (python):

    back_forward_list = webview.get_back_forward_list()
    back_forward_list.clear()  # removed in WebKit2
    
    for uri, title in histroy:
        history_item = WebKit.WebHistoryItem.new_with_data(uri, title)  # removed in WebKit2
        back_forward_list.add_item(history_item)  # removed in WebKit2

However there doesn&apos;t seem to be a workaround/replacement for these removals.

(Continuing from the discussion on https://bugs.webkit.org/show_bug.cgi?id=69343#c23)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114067</commentid>
    <comment_count>1</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2015-08-01 15:12:08 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; In the WebKit1 API, it was possible to change a WebView&apos;s back/forward list.
&gt; 
&gt; For example, it was possible to reconstruct the history of a WebView
&gt; (python):
&gt; 
&gt;     back_forward_list = webview.get_back_forward_list()
&gt;     back_forward_list.clear()  # removed in WebKit2
&gt;     
&gt;     for uri, title in histroy:
&gt;         history_item = WebKit.WebHistoryItem.new_with_data(uri, title)  #
&gt; removed in WebKit2
&gt;         back_forward_list.add_item(history_item)  # removed in WebKit2
&gt; 
&gt; However there doesn&apos;t seem to be a workaround/replacement for these removals.
&gt; 
&gt; (Continuing from the discussion on
&gt; https://bugs.webkit.org/show_bug.cgi?id=69343#c23)

WK2 has been developed under the philosophy that allowing direct API client manipulation of a live back/forward list was a mistake.

It caused way more crashing, correctness, and security bugs that one would think, and so far we&apos;ve found alternate ways for clients to accomplish what they figured they needed list manipulation for.

Can you concisely state what you did in WK1 that you can&apos;t do in WK2? Perhaps an alternative already exists, or can be implemented differently than making the list client mutable.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114069</commentid>
    <comment_count>2</comment_count>
    <who name="Sam P.">sam</who>
    <bug_when>2015-08-01 15:16:24 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Can you concisely state what you did in WK1 that you can&apos;t do in WK2?
&gt; Perhaps an alternative already exists, or can be implemented differently
&gt; than making the list client mutable.

The users instance in a browser was saved in their journal.  The saved data was the back/forward list and position for each tab.  When loading the data, a new webview would be created and the back/forward list would be recreated from the data (as per the code in comment #0).  This was to facilitate the desired design of the user being able to restore the browser state.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114071</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2015-08-01 15:20:54 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; Can you concisely state what you did in WK1 that you can&apos;t do in WK2?
&gt; &gt; Perhaps an alternative already exists, or can be implemented differently
&gt; &gt; than making the list client mutable.
&gt; 
&gt; The users instance in a browser was saved in their journal.  The saved data
&gt; was the back/forward list and position for each tab.  When loading the data,
&gt; a new webview would be created and the back/forward list would be recreated
&gt; from the data (as per the code in comment #0).  This was to facilitate the
&gt; desired design of the user being able to restore the browser state.

In what way does saving/restoring session state not solve this?

See WKPage.h:
WK_EXPORT WKTypeRef WKPageCopySessionState(WKPageRef page, void* context, WKPageSessionStateFilterCallback urlAllowedCallback);

WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKTypeRef sessionState);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114072</commentid>
    <comment_count>4</comment_count>
    <who name="Sam P.">sam</who>
    <bug_when>2015-08-01 15:27:07 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; In what way does saving/restoring session state not solve this?
&gt; 
&gt; See WKPage.h:
&gt; WK_EXPORT WKTypeRef WKPageCopySessionState(WKPageRef page, void* context,
&gt; WKPageSessionStateFilterCallback urlAllowedCallback);
&gt; 
&gt; WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKTypeRef
&gt; sessionState);

That function doesn&apos;t seem to be in the gtk bindings &lt;http://webkitgtk.org/reference/webkit2gtk/stable/index-all.html&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114073</commentid>
    <comment_count>5</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2015-08-01 15:38:47 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; In what way does saving/restoring session state not solve this?
&gt; &gt; 
&gt; &gt; See WKPage.h:
&gt; &gt; WK_EXPORT WKTypeRef WKPageCopySessionState(WKPageRef page, void* context,
&gt; &gt; WKPageSessionStateFilterCallback urlAllowedCallback);
&gt; &gt; 
&gt; &gt; WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKTypeRef
&gt; &gt; sessionState);
&gt; 
&gt; That function doesn&apos;t seem to be in the gtk bindings
&gt; &lt;http://webkitgtk.org/reference/webkit2gtk/stable/index-all.html&gt;.

I&apos;d suggest trying to get it into the GTK bindings, since it&apos;s literally just a bindings issue.

Session saving/restoring is specifically for this use case, and has higher fidelity than just &quot;a list of URLs&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114216</commentid>
    <comment_count>6</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2015-08-03 10:23:29 -0700</bug_when>
    <thetext>We&apos;re not going to add this back.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>