<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WKWebView should expose _loadAlternateHTMLString:baseURL:forUnreachableURL:"
   href="https://bugs.webkit.org/show_bug.cgi?id=144912">144912</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>WKWebView should expose _loadAlternateHTMLString:baseURL:forUnreachableURL:
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit2
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>stefan&#64;arentz.ca
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>