05:42
<sideshowbarker>
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#rules-for-parsing-floating-point-number-values step 16
Right — and that’s relevant if either the “valid floating-point number” algorithm or the https://html.spec.whatwg.org/multipage/input.html#number-state-(type=number):valid-floating-point-number-4 requirement invoke the “rules for parsing floating-point number values” algorithm. But as far as I can see, neither part does. At least they definitely don’t directly invoke it.
05:51
<sideshowbarker>

As far as I can understand, neither the “rules for parsing floating-point number values” algorithm nor the If the value of the element is not a valid floating-point number, then set it to the empty string instead statement specify anything about requiring the number to be exposed to JS.

Certainly the requirements (elsewhere) for actually doing anything with HTMLInputElement.value are about exposing the value to JS. But those are separate requirements. The “rules for parsing floating-point number values” algorithm and the “If the value of the element is not a valid floating-point number, then set it to the empty string instead” statement seem to be just limited to the string value. And implementation-wise, all they require is to essentially just run a lexer on the string, looking at the string character-by-character — without converting or otherwise processing the string in any way.

06:00
<zcorpan>
sideshowbarker: aha, yeah. Maybe it makes more sense to invoke the parse rules then
06:02
<sideshowbarker>
Yeah — or maybe drop the requirement entirely?
06:03
<sideshowbarker>
Though I guess that wouldn’t be backward-compatible now
06:03
<sideshowbarker>
But I mean, it doesn’t seem like anyone knows why that is-valid requirement was added to begin with, or what problem it’s meant to solve
06:05
<sideshowbarker>
And the parse rules already get invoked on that string — just elsewhere, later
09:29
<annevk>
Also implementations don't show the result of parse as per the test I showed yesterday. They only do that once you manipulate the value using the up and down buttons. That leads me to think implementations do have a non-parsing validator as required by the specification, however weird that may be.
20:04
<Dominic Farolino>
How is it valid to return ? ReadableStreamFromIterable(...) from https://streams.spec.whatwg.org/#rs-from?
20:05
<Dominic Farolino>
The ? means operations can give you a throw completion, which we're just returning instead of converting to an exception and re-throwing it to Web IDL?
20:11
<Dominic Farolino>
Or does ? somehow translate to "re-throw" in Web IDL world. It doesn't seem like it though.
20:15
<Dominic Farolino>
HTML does this too: https://html.spec.whatwg.org/C#structuredserialize
20:15
<zcorpan>
Dominic Farolino: does https://tc39.es/ecma262/multipage/notational-conventions.html#sec-returnifabrupt help?
20:15
<zcorpan>
and the next section
20:15
<ljharb>
that's indeed what it means in JS.
20:17
<Dominic Farolino>
Dominic Farolino: does https://tc39.es/ecma262/multipage/notational-conventions.html#sec-returnifabrupt help?
To me it does not, but probably that's just because I don't get it :) those algorithms just Return the abrupt completions early. So ultimately that leads to us passing abrupt completions to Web IDL as the return value of some methods, and I don't see anything in Web IDL that converts abrupt completions to proper Exceptions
20:18
<Dominic Farolino>
Except for in the places where we invoke user callbacks. That seems to be the only place Web IDL specifically references "abrupt completions" and re-throws their completion record value.
20:19
<Dominic Farolino>
I'd expect generalized handling of that sort elsewhere in Web IDL, if we were allowed to return ES completion records from Web IDL methods
20:22
<zcorpan>
Maybe Domenic knows this better :)
20:28
<Domenic>
The boundary between these is not super clear but the intention is that if you "return" an abrupt completion that's equivalent to throwing in the rest of the web ecosystem
20:29
<Domenic>
https://github.com/whatwg/infra/pull/539 tried to do stuff with this
20:29
<Domenic>
A lot of places in Web IDL use the ?/! notation and thus completions
20:32
<Domenic>
https://github.com/whatwg/infra/issues/518 seems to express the same confusion
20:43
<Dominic Farolino>
I see. Good to know the intention and that this is a generally accepted convention. Thanks.