diff options
author | bptato <nincsnevem662@gmail.com> | 2024-05-20 18:12:09 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-05-20 18:12:09 +0200 |
commit | 7c4bb940410c8f5ad59e1d21d5565364a9a0cd71 (patch) | |
tree | d46d682ce9d4f308232c961985d8411c2a70197c /src/server/buffer.nim | |
parent | 723613b0a02605dbf715d74c70b9ec29f1092c76 (diff) | |
download | chawan-7c4bb940410c8f5ad59e1d21d5565364a9a0cd71.tar.gz |
html: improve Request, derive Client from Window
* make Client an instance of Window (for less special casing) * misc work on Request & fetch * improve origin comparison (opaque origins of same URLs are now considered the same)
Diffstat (limited to 'src/server/buffer.nim')
-rw-r--r-- | src/server/buffer.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim index 54c32de3..178dd94b 100644 --- a/src/server/buffer.nim +++ b/src/server/buffer.nim @@ -887,7 +887,8 @@ proc setHTML(buffer: Buffer) = buffer.attrs, factory, navigate, - some(buffer.loader) + buffer.loader, + buffer.url ) let confidence = if buffer.config.charsetOverride == CHARSET_UNKNOWN: ccTentative @@ -1317,10 +1318,10 @@ proc submitForm(form: HTMLFormElement; submitter: Element): Option[Request] = #TODO return none(Request) let httpmethod = if formmethod == fmGet: - HTTP_GET + hmGet else: assert formmethod == fmPost - HTTP_POST + hmPost #let target = if submitter.isSubmitButton() and submitter.attrb("formtarget"): # submitter.attr("formtarget") @@ -1549,7 +1550,7 @@ proc click(buffer: Buffer; anchor: HTMLAnchorElement): ClickResult = repaint = true if s.isSome: let url = newURL("data:text/html," & s.get).get - let req = newRequest(url, HTTP_GET) + let req = newRequest(url, hmGet) return ClickResult( repaint: repaint, open: some(req) @@ -1559,7 +1560,7 @@ proc click(buffer: Buffer; anchor: HTMLAnchorElement): ClickResult = ) return ClickResult( repaint: repaint, - open: some(newRequest(url, HTTP_GET)) + open: some(newRequest(url, hmGet)) ) return ClickResult(repaint: repaint) |