Define new HTTP response headers for this spec.

These are based on Intercooler, though some were ommitted to be defined in seperate documents.

And others I decided against. Particularly X-IC-Open was ommitted so as not to allow ads
universally agreed to be annoying: "popups".
This commit is contained in:
alcinnz 2018-11-15 12:49:51 -05:00
parent cb225883ef
commit dae4ae8ee1
1 changed files with 11 additions and 2 deletions

View File

@ -15,14 +15,23 @@ Additionally `trigger="load"` can be specified on links with a `prepend`, `repla
2. If this was a GET request, mark the target element as being loaded from that URL.
3. Process the HTTP response headers as specified in [HTTP response headers](https://tildegit.org/alcinnz/PostJS/src/branch/master/drafts/hyperlinks-advanced-targets.md#http-response-headers) and other specifications.
4. If the `replace` attribute was used, delete the current children of those elements.
5. Parse the response HTML snippet into the target elements.
5. Parse the response HTML snippet into the target elements. Any `<script>` or `<style>` elements MUST be ignored, but if a `<title>` is encountered the browser chrome must be updated.
6. Update the style for the HTML to resemble what it would've been if these new elements were in there to begin with.
7. Reload any elements loaded from paths conflicting (to keep the page equally up to date). Upon response these are handled per these steps as if it had a replace target.
For step 7, two paths conflict if one is a directory that contains the other.
## HTTP response headers
TODO
New HTTP response headers are defined for HTTP responses otherwise handled via this specification. These are all prefixed with `X-HTML-` for now.
### X-HTML-Refresh
Specifies additional whitespace-seperated URLs that have been updated and should impact which elements on the page get reloaded.
### X-HTML-SavePoint
Saves the current state and URL of the page to the history stack. and sets the current URL to the specified value.
### X-HTML-Remove
Specifies a floating point number of seconds after which the target element should be removed from the page.
## TODO
* Handle forms.