00:47
<jugglinmike>
In HTML, are parameters passed "by reference"?
03:21
<jugglinmike>
More specifically, I'm wondering about the parameters of internal algorithms. When an algorithm modifies one of its parameters, does that affect the corresponding value in the call site?
03:22
<jugglinmike>
I've always assumed "no," but I can't find any evidence either way in the spec, in the old issues, or in this channel's logs.
03:24
<jugglinmike>
I don't have a bouncer, but I'll check the logs in case anyone out there doesn't mind sharing the answer while I'm offline
03:24
<jugglinmike>
(in which case, thank you!)
03:43
<innovati>
In the spec it sounds like <meta charset=utf-8> is the only valid use of charset…is that the case? Is there a need to declare it? https://html.spec.whatwg.org/multipage/semantics.html#attr-meta-charset
03:46
<andreubotella>
innovati: there's a difference between requirements on authors of HTML documents and requirements on implementations of HTML (browsers)
03:46
<andreubotella>
Authors must use the UTF-8 encoding and have a <meta charset=utf-8> tag
03:46
<andreubotella>
but browsers have to support existing sites that use other encodings
05:13
<MikeSmith>
innovati: what andreubotella said — and as far as the authoring requirements, see https://html.spec.whatwg.org/multipage/semantics.html#charset:content-type
05:13
<MikeSmith>
> If an HTML document does not start with a BOM, and its encoding is not explicitly given by Content-Type metadata, and the document is not an iframe srcdoc document, then the encoding must be specified using a meta element with a charset attribute or a meta element with an http-equiv attribute in the Encoding declaration state.
05:14
<MikeSmith>
so you can omit the meta element if the document is served with a Content-Type header that gives the encoding
05:18
<MikeSmith>
and as far as the meta element, yeah, the only value charset value is "utf-8" (case-insensitive)
05:19
<MikeSmith>
<meta http-equiv=Content-Type content="text/html;charset=utf-8"> is also still conformant
08:23
<annevk>
jugglinmike: undefined to some extent; hope that Infra will tidy that up eventually
13:25
<innovati>
Thanks MikeSmith && andreubotella <3
15:37
<Domenic>
jugglinmike: we generally treat parameters like JavaScript or other similar languages do. "Object like" things (structs, etc.) are modifiable. "Primitive" things (booleans, numbers, etc.) are not.
15:38
<Domenic>
Strings are a bit of a mess in that they're often mutated in place, but usually we don't mutate them between algorithms.
15:38
<Domenic>
So strings are C++-like inside algorithms but JavaScript-like between algorithms.
15:39
<andreubotella>
Domenic: shouldn't that be made explicit in infra#321?
15:39
<Domenic>
andreubotella: I don't think that's in scope for that PR, which is just about the style of declaring algorithms.
15:39
<andreubotella>
fair enough
16:51
<jugglinmike>
annevk Domenic Thank you!