<?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>144912</bug_id>
          
          <creation_ts>2015-05-12 07:30:45 -0700</creation_ts>
          <short_desc>WKWebView should expose _loadAlternateHTMLString:baseURL:forUnreachableURL:</short_desc>
          <delta_ts>2015-06-11 16:55:50 -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>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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="Stefan Arentz">stefan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
    
    <cc>ap</cc>
    
    <cc>benjamin</cc>
    
    <cc>sam</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1094156</commentid>
    <comment_count>0</comment_count>
    <who name="Stefan Arentz">stefan</who>
    <bug_when>2015-05-12 07:30:45 -0700</bug_when>
    <thetext>Exposing WKWebView#_loadAlternateHTMLString:baseURL:forUnreachableURL: would allow people to us show error messages in-content while maintaining a sane BackForwardList.

The problem with the alternatives, loadHTML or loadRequest from an embedded HTTP Server, do not play well with the (read-only) BackForwardList.

When presenting an error with loadHTML, it will *replace* the current page you are on.

When presenting an error with loadRequest, either from embedded server or file: URL, it will generate a new entry in the BackForwardList that you cannot get rid of.

The _loadAlternateHTMLString:baseURL:forUnreachableURL API seems to add the failing page to the BackForwardList while presenting alternative content, like an error message. This means a call to reloadFromOrigin will simply retry the page and leave the BackForwardList in a good state that makes sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1094324</commentid>
    <comment_count>1</comment_count>
    <who name="Stefan Arentz">stefan</who>
    <bug_when>2015-05-12 17:00:33 -0700</bug_when>
    <thetext>Would you accept a patch for exposing this functionality? I&apos;m happy work with the WebKit team to produce something.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1101448</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-06-11 16:55:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/21350071&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>