Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.96 KB

SPECIFICATIONS.md

File metadata and controls

39 lines (30 loc) · 1.96 KB

Specifications

The purpose of this document is to keep track of the various technical decisions I'm making in the polyfill, so that the proposals can be built out with the necessary specificity.

Hyperlinks

  • Anchors with the target attribute will replace the target, instead of a hard navigation

Buttons

  • HTTP buttons are only enabled if the action attribute is a valid URL
  • If the method attribute is a valid HTTP method (any casing), use that, otherwise use GET
  • If the target attribute is specified, it will replace the first element that matches that selector, unless there is an iFrame with an identical name
  • Buttons with a name and value will send that data, in the URL if GET/DELETE, the body otherwise
  • The presence of a valid action supersedes the form action

Forms

  • Forms support the PUT, PATCH, and DELETE methods
  • Forms support the target attribute, and replace the target instead of the whole page

Targeting and Replacement

  • If the target is a preexisting special keyword or iFrame, preexisting behavior takes precedence
  • If the target is an invalid query selector, or a query selector that does not return any elements, then nothing happens
  • Add additional _this keyword which targets the element that made the request (_self is taken)

Navigation

  • History is only saved if there is a full-page navigation
  • Back button will show the page as it was when the navigation occurred (including any partial, non-navigation replacements that happened). This mimics existing navigation behavior

Misc

  • Query strings are dropped from the URL, to mimic (4.10.22.3)

Unresolved

  • CSS classes that replicate possible pseudo-classes (i.e. for a request in progress)
  • Toggle that allows you to specify that a replacement should trigger a page replacement
  • Should buttons implement existing iFrame and "special" targets?