01:08
<khafra>

With fetch, an implementation is supposed to throw an AbortError DOMException when consuming the body if the signal passed to fetch is aborted, however I'm unsure which part of the spec covers this. Does anyone know where this comes from? Thanks, would be super helpful

const ac = new AbortController()
const { signal } = ac

const response = await fetch('https://example.com', {
	signal: signal
})

ac.abort()

await response.text()
01:16
<Domenic>

With fetch, an implementation is supposed to throw an AbortError DOMException when consuming the body if the signal passed to fetch is aborted, however I'm unsure which part of the spec covers this. Does anyone know where this comes from? Thanks, would be super helpful

const ac = new AbortController()
const { signal } = ac

const response = await fetch('https://example.com', {
	signal: signal
})

ac.abort()

await response.text()
https://fetch.spec.whatwg.org/#abort-fetch
01:18
<Domenic>
step 6
03:20
<khafra>
thanks, had an issue where the error was getting swallowed. Got it sorted out now :)
05:58
<hsivonen>
Filed as https://github.com/microsoft/vscode/issues/161764
Well, that wasn't particularly successful.
08:36
<johannhof>
It really feels like specs are extremely inconsistent in which error to throw when some common condition such as not "allowed to use", non-fully active document or missing user activation is checked.
08:38
<annevk>
In part it's because web developers don't branch on exception types and JavaScript doesn't really encourage that kind of programming either.
08:39
<annevk>
So my recommendation is to just TypeError most things. Now, AbortSignal has changed things a bit so if the API takes a signal perhaps some non-"AbortError" DOMException makes sense.
08:41
<johannhof>
So, if, say, ~70% of precedent is "NotAllowedError" and 30% are something else including TypeError, should we still use TypeError?
08:41
<annevk>
(Also, nobody would fault you for making this consistent. You might even get some applause.)
08:41
<johannhof>
Or does precedent with other specs matter at all here?
08:42
<johannhof>
Yeah I was thinking of just going around sending PRs to make things consistent but really don't want to deal with the compat fallout :D Are you saying there's likely not that much breakage as developers don't branch on types anyway?
08:43
<annevk>
Historically it's been pretty easy to change exceptions around, yeah. I think you're right that simpler advice would be welcome here, but I'm not immediately sure where it would go. Web IDL or the TAG's document on APIs I suppose.
08:45
<annevk>
E.g., https://www.w3.org/TR/DOM-Level-2/range.html#RangeException was a thing.
08:47
<sideshowbarker>

hsivonen: https://lists.w3.org/Archives/Public/www-validator/2022Sep/0012.html

I have the self-closing-tag check in the Tokenizer code but I guess I should have it in the TreeBuilder code instead — so I can make it namespace-aware, and so that the warning doesn’t get reported for SVG elements.

09:06
<hsivonen>

hsivonen: https://lists.w3.org/Archives/Public/www-validator/2022Sep/0012.html

I have the self-closing-tag check in the Tokenizer code but I guess I should have it in the TreeBuilder code instead — so I can make it namespace-aware, and so that the warning doesn’t get reported for SVG elements.

Sorry. Bad review on my part. Yeah, it should go in the tree builder where the slash is acknowledged.
09:12
<annevk>
hsivonen: I don't really see negative tests for old IBM encoding labels; do you remember creating those?
09:12
<annevk>
We could maybe add some to unsupported-encodings.any.js though I'm not sure as we'd have to assume some kind of default I guess. We do for UTF-7 and UTF-32 though so maybe that's okay?
09:12
<hsivonen>
hsivonen: I don't really see negative tests for old IBM encoding labels; do you remember creating those?
I don't remember creating negative tests for those.
09:14
<hsivonen>
We could maybe add some to unsupported-encodings.any.js though I'm not sure as we'd have to assume some kind of default I guess. We do for UTF-7 and UTF-32 though so maybe that's okay?
Should be safe to assume a windows-1252 default if the content is ASCII. If in the future we do the work to change that case to result in UTF-8, we can change the tests at that time.
09:15
<annevk>
I wonder why I waited, perhaps because we also had this idea of using the replacement encoding for some.
09:44
<sideshowbarker>
hsivonen: r? https://github.com/validator/htmlparser/pull/74
10:09
<Domenic>
So, if, say, ~70% of precedent is "NotAllowedError" and 30% are something else including TypeError, should we still use TypeError?
I'd be more in favor of consistent, separate error types. I agree with Anne that it doesn't matter much, but my takeaway isn't to convert everything to TypeError, personally.
10:10
<Domenic>
I've ended up on "NotAllowedError" for allowed to use, "InvalidStateError" for non-fully active document... not sure about user activation.
10:12
<johannhof>
I think that would be "SecurityError" by majority vote
10:14
<johannhof>
Yeah intuitively I agree with you Domenic that just flattening all errors to one type seems a little oversimplistic?
10:15
<annevk>
I don't feel strongly, but I also rather not reveal more information than strictly necessary. The states alluded to above end up exposed in other ways as well so they are probably fine though.
10:16
<johannhof>
(also don't fully understand "NotAllowedError" vs. "SecurityError" use cases, and looking at specs I suspect most people don't)
10:16
<johannhof>
I guess there are things that aren't allowed for non-security reasons
10:17
<Domenic>
Right, although I can't imagine we've been very clear about what's a security reason vs. not, and I'm not sure I'd classify either permissions policy or user activation as a security reason :)
10:18
<Domenic>
I guess the most clear-cut "SecurityError" cases are cross-origin access stuff
10:19
<johannhof>
Yeah looking at https://webidl.spec.whatwg.org/#notallowederror those two actually seem clear cut for NotAllowedError
10:22
<Domenic>
Anyway I would personally support any consistification efforts here but it just feels like you're setting yourself up for potential compat pain. Perhaps better would be to tackle the problem going forward by having a reference of common checks => usual errors they produce.
10:24
<johannhof>
Right, I agree that this seems painful to fix across the board retroactively now. Should the TAG Design Principles require authors of "new things that could be used to throw errors" to recommend an error type in the respective spec?
10:25
<johannhof>
I filed this for "fully active" before: https://github.com/w3ctag/design-principles/issues/395
10:30
<annevk>
hsivonen: turns out Safari still supports some x-mac-* labels (will PR later and will take suggestions for additional labels to include)
10:37
<Domenic>
Right, I agree that this seems painful to fix across the board retroactively now. Should the TAG Design Principles require authors of "new things that could be used to throw errors" to recommend an error type in the respective spec?
I'm unsure how many new general "things that could throw errors" we plan to add to the platform, so not sure it's worth a Design Principles addition...
10:37
<Domenic>
Slight cleanup inspired by this discussion: https://github.com/whatwg/webidl/pull/1202
10:38
<hsivonen>
hsivonen: turns out Safari still supports some x-mac-* labels (will PR later and will take suggestions for additional labels to include)
Does Safari support in-content labels for all the weird stuff in the Mac Safari Text Encoding menu?
10:45
<Sam Sneddon [:gsnedders]>
(for the record)
10:50
<hsivonen>
sent an image.
As noted before, it's hard to believe in the use case-drivenness of that list. (specifically: Shift JIS X0213, Big5 times 3, Hebrew times 2, Turkish times 2, both GB18030 and GB2312, Mac OS Korean)
10:51
<hsivonen>
As noted before, it's hard to believe in the use case-drivenness of that list. (specifically: Shift JIS X0213, Big5 times 3, Hebrew times 2, Turkish times 2, both GB18030 and GB2312, Mac OS Korean)
Hmm. Is ISO Hebrew there with visual direction, which would make sense for times 2.
10:56
<Sam Sneddon [:gsnedders]>
As noted before, it's hard to believe in the use case-drivenness of that list. (specifically: Shift JIS X0213, Big5 times 3, Hebrew times 2, Turkish times 2, both GB18030 and GB2312, Mac OS Korean)
As I think has been mentioned before, that list was essentially copy-pasted from Mail (in 2002), and the last change to the contents of the list seems to have been in 2008. I suspect the changes between 2002 and 2008 were to some degree bug-report-driven.
10:59
<hsivonen>
As I think has been mentioned before, that list was essentially copy-pasted from Mail (in 2002), and the last change to the contents of the list seems to have been in 2008. I suspect the changes between 2002 and 2008 were to some degree bug-report-driven.
I'm curious about what Mail counterparty MUA motivated Shift JIS X0213.
11:00
<Sam Sneddon [:gsnedders]>
I'm curious about what Mail counterparty MUA motivated Shift JIS X0213.
I mean I have no idea about the origin of the Mail list, but it wouldn't totally surprise me if that was mostly unchanged from NeXTSTEP Mail.
11:02
<hsivonen>
I mean I have no idea about the origin of the Mail list, but it wouldn't totally surprise me if that was mostly unchanged from NeXTSTEP Mail.
I suppose Shift JIS X0213 might have had a narrow time window to have come from there if NeXTSTEP Mail had a Pokemon approach to encodings.
11:26
<sideshowbarker>
PSA: The W3C HTML checker now reports a warning for any HTML elements that use self-closing-tag syntax — that is, specifically just for elements in the HTML namespace, but not for SVG or MathML elements. Laissez les bons temps rouler
11:28
<Sam Sneddon [:gsnedders]>
I suppose Shift JIS X0213 might have had a narrow time window to have come from there if NeXTSTEP Mail had a Pokemon approach to encodings.
oh, no, it's not NeXTSTEP in origin. I think it might have just been every (almost every?) encoding supported by Carbon (I think) at the point at which it was added.
11:29
<Sam Sneddon [:gsnedders]>
But definitely: no real curation occurred.
11:38
<Sam Sneddon [:gsnedders]>
Shift JIS X 0213 was added to Safari for the sake of completeness, it seems.
11:41
<Sam Sneddon [:gsnedders]>
and actually appears to be the latest meaningful change to the menu… in 2003.
11:42
<Andreu Botella>
I'm checking, and GNOME Web / Epiphany also has way too many entries in the encoding menu, possibly taking after Safari
11:42
<Andreu Botella>
do they even work?
11:42
<Ms2ger 💉💉>
Party like it's 1999
11:45
<johannhof>
Slight cleanup inspired by this discussion: https://github.com/whatwg/webidl/pull/1202
I think that's fair, do you have any suggestion where a document that lists recommended error types for common failure scenarios could live?
11:46
<Ms2ger 💉💉>
Reminds me of those ridiculous sgml shorthands, which I mostly forgot... was it <foo/contents/> or something like that?
11:46
<Sam Sneddon [:gsnedders]>
I'm checking, and GNOME Web / Epiphany also has way too many entries in the encoding menu, possibly taking after Safari
historically most browsers just threw basically everything they supported in the menu
11:47
<Andreu Botella>
in GNOME Web they map to windows-1252
12:00
<sideshowbarker>
Reminds me of those ridiculous sgml shorthands, which I mostly forgot... was it `` or something like that?

Yeah, something like that.

And we wonder why there was only one person who ever wrote a conforming SGML parser... (and is the same person who created XSLT)

12:07
<Sam Sneddon [:gsnedders]>
Reminds me of those ridiculous sgml shorthands, which I mostly forgot... was it <foo/contents/> or something like that?
<foo/bar/. net syntax (null end tag, IIRC)
12:09
<Sam Sneddon [:gsnedders]>

ISO 8879 § 7.5.1.3 opens with:

The null end-tag is an interesting idea for short elements.

12:14
<Domenic>
I think that's fair, do you have any suggestion where a document that lists recommended error types for common failure scenarios could live?
Probably best would be in the individual definitions (e.g. "allowed to use", "fully active") but if something more centralized is desired, I think Web IDL would be reasonable.
12:15
<annevk>
hsivonen: I don't know, it wouldn't surprise me
12:16
<annevk>
Domenic: thanks for landing the 'restore "with"' commit and fixing up the commit message; I had forgotten about it :-(
12:17
<Domenic>
Anytime!
12:21
<hsivonen>

ISO 8879 § 7.5.1.3 opens with:

The null end-tag is an interesting idea for short elements.

Is The Standard online these days or do you have a copy of The Handbook?
12:21
<Domenic>
PSA: The W3C HTML checker now reports a warning for any HTML elements that use self-closing-tag syntax — that is, specifically just for elements in the HTML namespace, but not for SVG or MathML elements.

Laissez les bons temps rouler
Hope you're ready for when the internet descends on you :D
12:32
<sideshowbarker>
Domenic: it’s my bedtime
14:55
<Sam Sneddon [:gsnedders]>
Is The Standard online these days or do you have a copy of The Handbook?
The Handbook (I mean, you can get a PDF of it, behind paywalls, but also plenty of corporate/institutions/libraries have subscriptions to paywalls that include it)
15:00
<Sam Sneddon [:gsnedders]>
ah, apparently that's an expansion in the copy of ISO 8879 in the handbook, sad.
15:01
<Sam Sneddon [:gsnedders]>

ISO 8879:1986 itself has a much less interesting opening sentence:

The net is recognized as a null end tag only if the start-tag of an open element in the base document type was a net-enabling start-tag.