2021-07-01 [01:34:35.0083] Hi, Can anyone please describe what is exact procedure to "Consume the maximum number of characters possible" mentioned here: https://html.spec.whatwg.org/#named-character-reference-state [01:35:32.0274] * Hi, Can anyone please describe what is the exact procedure to "Consume the maximum number of characters possible" mentioned here: https://html.spec.whatwg.org/#named-character-reference-state [01:45:30.0344] Hm, there's arguably a bug there, since the string `¢erNotDot;` should only match the charref `¢er`, rather than the prefix of `·` [01:46:08.0081] * Hm, there's arguably a bug there, since the string `¢erd;` should only match the charref `¢er`, rather than the prefix of `·` [01:47:44.0487] * Hm, there's arguably a bug there, since the string `¢erd;` should only match the charref `¢`, rather than the prefix of `·` [01:47:55.0225] * Hm, there's arguably a bug there, since the string `¢er` should only match the charref `¢`, rather than the prefix of `·` [01:50:21.0827] So what's the correct way to do this? [01:51:45.0453] Keep a copy of the named character references list, and for every consumed character, remove the entries that don't match up for that character [01:53:07.0308] But keep in a variable the latest entry that you have consumed in full (that is, for which the next character would be end-of-string) [01:54:29.0619] Once the list is empty, unconsume as many characters as (number of characters you've consumed in this algorithm - length of the latest entry consumed in full or 0) [01:54:52.0418] the latest entry consumed in full is the match you've found, if there is any [01:56:27.0036] sorry to ask a stupid question but what does it mean to "unconsume" here? [01:59:31.0276] To walk back the pointer into the input stream, such that the next input characters would be the characters after the end of the matched character reference, even if in parsing you've consumed more characters than those [02:00:40.0500] oh ok! thank you for the help!! [02:08:20.0816] If it's not very obvious, that part of the algorithm tries to find the longest character reference that matches the input [02:09:19.0036] So both `cent` and `centerdot;` are character references, so if the next few characters are `center;`, you want to match `cent` only [02:09:39.0867] If you're reading character by character, you would have to read `center` and then backtrack when you find the semicolon [02:10:46.0708] but if you do find `centerdot;` you want to take that as the match, not `cent` [02:24:05.0296] So from what I understand from the above explanation an html stream

center;

would be read as

¢er

right? [02:24:39.0229] displayed as: ¢er; [02:24:57.0635] * So from what I understand from the above explanation an html stream

center;

would be read as

¢er;

right? [02:28:39.0856] sujaldev: `center;` would never reach that algorithm — because `center;` doesn’t begin with an `&` ampersand [02:29:24.0528] sorry i mean ¢er; [02:29:48.0033] let me just edit that [02:29:55.0501] * So from what I understand from the above explanation an html stream

¢er;

would be read as

¢er;

right? [02:31:34.0810] ¢er; indeed [02:32:32.0163] trying to implement it now in my project! thank you again! [02:35:01.0390] sujaldev: I guess you probably already know about the html5lib test suite, but if not, you definitely want to be testing your implementation against that — https://github.com/html5lib/html5lib-tests [02:36:37.0199] and not to muddy the waters, but it’s worth mentioning that you don’t need to match the steps in that part of the parsing algorithm exactly, as long as you end up with the same result [02:37:39.0469] > <@sideshowbarker:mozilla.org> sujaldev: I guess you probably already know about the html5lib test suite, but if not, you definitely want to be testing your implementation against that — https://github.com/html5lib/html5lib-tests I didn't know about this, real helpful. [02:37:53.0647] yeah for https://github.com/validator/htmlparser we don’t match the spec steps exactly for that part of the algorithm, but do it in a different way that produces the same test results [02:39:28.0599] does it still follow state machine concept? [02:39:54.0295] yes [02:41:52.0317] there are some places where it doesn’t conform to the spec, and I’ve had some pull requests open for quite a while now to fix those, but… fixing them has not been a big priority for that particular project [02:43:49.0582] > <@sideshowbarker:mozilla.org> yeah for https://github.com/validator/htmlparser we don’t match the spec steps exactly for that part of the algorithm, but do it in a different way that produces the same test results If I knew more about parsing and also knew java would have loved to contribute to this [10:04:46.0615] how do overloads work in WebIDL? specifically, for `Window.alert`, which is spec'd to have two overloads `alert()` and `alert(message)`, what's `alert.length` supposed to be? [11:13:00.0225] shu: https://heycam.github.io/webidl/#dfn-create-operation-function [11:13:13.0710] step 6 [13:44:26.0768] zcorpan: thanks [15:19:54.0928] shu: what's the plan for https://github.com/heycam/webidl/pull/982? is it waiting on ES still? [16:08:51.0806] timothygu: resizable buffers is stage 3, so i was planning on requesting to merge that after there's at least one implementation shipping [16:09:18.0200] it's a fairly big proposal to implement, actually, so we might not see anything till Q4 [16:09:43.0714] okay, I converted it to a draft in the meantime [16:09:54.0783] ah okay, is that the convention? [16:39:50.0394] We invented a "do not merge yet" convention for WHATWG repos before draft PRs existed. These days it seems like a mix. [16:39:58.0724] * We invented a "do not merge yet" label convention for WHATWG repos before draft PRs existed. These days it seems like a mix. 2021-07-02 [17:21:15.0592] i thought "Draft" meant something like the author was still modifying it, and it wasn't ready for review [17:21:37.0400] and something like "do not merge" is, its contents are ready to go, but it's gated on other things [18:31:34.0710] Yeah I think I personally prefer that taxonomy [22:56:15.0402] for using Node.js in Github Actions, rather than needing specify any particular Node.js version, is there some way I can specify “just use the latest available Node.js version”? [07:21:56.0344] sideshowbarker: looks like it uses to `nvm` (bash version) syntax https://github.com/actions/setup-node#supported-version-syntax [07:22:19.0579] /me looks [07:22:44.0738] so is there an `nvm` syntax for “latest”? [07:23:27.0376] I know there’s `lts/*`, but that’s not latest-latest [07:24:03.0354] might just be `node` according to the docs https://github.com/nvm-sh/nvm#usage [07:24:31.0040] > # "node" is an alias for the latest version [07:26:07.0647] (have not actually tested this myself) [07:28:18.0239] oh cool — will try that [07:31:42.0389] dang, didn’t work [07:31:58.0361] https://github.com/w3c/mdn-spec-links/actions/runs/993930895 > Unable to find Node version 'node' for platform linux and architecture x64. [07:32:48.0692] no big deal, though — for the specific context, any version >=15 works fine [07:33:35.0565] I just need support for `.replaceAll()`, but the default node in Ubuntu latest is too old to have that [07:33:53.0518] so I guess I’ll just use `16` [07:35:46.0829] yeah, the latest-even number versions will last a while [07:35:58.0853] yeah 2021-07-03 [00:18:03.0659] HI, can anyone tell me how to design this type of card ? [00:26:31.0214] the "design" is self-evident in the image; how it should be coded is probably off-topic [00:43:07.0029] Sarath kumar: i do not understand your question.. it seems to have already been designed, no? [01:00:55.0488] current design is like below, i have to modify the current design to the above one [01:01:33.0858] Sarath kumar: Hi, this chatroom is for working on the web standards, or for help understanding them. It's not for general help with web development. [01:02:30.0558] You might want to try asking in #webdevelopment:matrix.org or #webdesign:matrix.org [01:31:00.0274] > <@sideshowbarker:mozilla.org> so is there an `nvm` syntax for “latest”? there appears to be a way to acquire the latest version of node for github actions, but you have to define it in the manifest https://github.com/actions/setup-node/blob/38d90ce44d5275ad62cc48384b3d8a58c500bb5f/src/installer.ts#L53 [01:32:05.0503] /me > <@dereknongeneric:mozilla.org> there appears to be a way to acquire the latest version of node for github actions, but you have to define it in the manifest https://github.com/actions/setup-node/blob/38d90ce44d5275ad62cc48384b3d8a58c500bb5f/src/installer.ts#L53 looks now [01:33:45.0112] unclear on what is meant by "manifest" here, but it is possible that they mean in the `package.json` file (`engines.node` key) [01:42:46.0041] we do not use the term "manifest" in node core when referring to the package.json file at all, but have seen Yarn do so in their docs [02:05:53.0726] probably going to end up setting up a test project to get this solved for my own purposes, but am surprised that this isn't more ergonomic [02:10:34.0383] I guess I rightly should be setting the `engines.node` version to `>=15.0.0` regardless — since that’s what’s required for using `.replaceAll()` [02:12:52.0566] in reality, it should probably be `>=16` since this release line will last you longer (wonder if setting this value to `node` does anything) [02:22:14.0336] I can try setting it to `node` and see [02:23:47.0162] you would still need to figure out what the github actions yaml file would need to look like in order for it to utilize the package.json tho (i think) [02:28:57.0700] ah [03:16:25.0452] > * <@sideshowbarker:mozilla.org> looks now this part is documented here, so it looks like it is simply determining whether the version specified in the package.json is the latest x.x.x version: https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#check-latest-version [04:25:55.0289] sideshowbarker: here it is my friend, all that needs to be done is to specify the version as `x.x.x` and ensure `check-latest` is set to `true` -- glad we got that squared away https://github.com/DerekNonGeneric/test-repo-please-ignore/blob/main/.github/workflows/build.yml [04:29:41.0468] > <@dereknongeneric:mozilla.org> sideshowbarker: here it is my friend, all that needs to be done is to specify the version as `x.x.x` and ensure `check-latest` is set to `true` -- glad we got that squared away https://github.com/DerekNonGeneric/test-repo-please-ignore/blob/main/.github/workflows/build.yml thanks much! [04:30:22.0047] yw 2021-07-04 2021-07-05 [07:45:20.0943] PSA: https://dontcallmedom.github.io/mdn-issue-by-spec/whatwg.rss [10:35:48.0921] Isn't https://searchfox.org/mozilla-central/rev/b7bc94b4689a7f002c61d016c6e162e5e5708bf3/testing/web-platform/tests/shadow-dom/imperative-slot-api.html#211,216-218 buggy [10:36:29.0686] That part of the test was written way before the spec [10:41:09.0520] The spec allows moves and there is no "recalc" 2021-07-06 [05:13:01.0578] are you supposed to convert carriage return to newline character in the html tokenization stage? [05:16:56.0170] https://github.com/html5lib/html5lib-tests/blob/master/tokenizer/domjs.test the first test in this file points to the above doubt... [05:20:01.0852] sujaldev: it's in the pre-processing the input stream stage; pretty sure the tokeniser tests assume the two are done together 2021-07-07 [19:30:01.0992] oki thanks! [19:48:21.0534] wonderful, https://drafts.csswg.org/ completely broken again for the Nth time [19:50:31.0658] after this having happened so frequently, it’s baffling that there’s not a watchdog or something set up [19:51:07.0966] /me goes off to raise an https://github.com/w3c/csswg-drafts issue about it for at least the 3rd time [05:30:45.0316] I have asked this before, I think. Is there some documentation for a good workflow for making spec changes? Including the usual github pr creation but also what checks people do to find if there are relevant WPTs etc. [07:18:51.0496] Admittedly, you are probably not exactly the intended audience but this might help https://wpc.guide/bug-guide/ [07:19:20.0967] but TBH, I often just look at similar patches and the follow-up bugs (e.g., for WPT) they led to [09:49:10.0242] annevk: domenic suggested you might have an opinion on https://github.com/bakkot/proposal-arraybuffer-base64/issues/5. the question under consideration (as I see it; he is welcome to correct) is, must any new base64-decoding API in the web platform decline to validate the padding bytes by default (and hence match the behavior of `atob`), or can it be stricter by default in pursuit of making it harder to accidentally fall into security issues arising from the (I think fairly natural) assumption that base64 encoding is one-to-one? [09:49:26.0961] also interested in opinions from others [09:50:38.0867] Domenic seems to feel strongly that it is more important to match `atob`, I feel fairly strongly that it is more important to make the less-secure behavior opt-in, so I am hoping we can get other opinions on the matter [09:55:31.0995] Matching data: URLs and other base64 encoding behaviors in the platform (e.g. SRI digests) is more important than atob [10:01:30.0064] I agree [10:03:20.0300] I understand that position even less; how many people are ever manually decoding a data: url or an SRI digest? [10:04:15.0944] (CSP, incidentally, requires padding, so the web platform is not uniform here) [10:05:42.0564] actually SRI does too, as far as I can tell from the spec [10:06:59.0207] Yeah the spec doesn't seem to match browsers there [10:08:11.0105] I can't find base64 decoding in the CSP/SRI specs, only the implementations [10:09:53.0468] that's because they don't aren't specified in terms of decoding; they compare by string equality, and assume that base64 encoding is 1-to-1, since everyone makes this assumption. [10:09:58.0979] * that's because they aren't specified in terms of decoding; they compare by string equality, and assume that base64 encoding is 1-to-1, since everyone makes this assumption. [10:10:10.0192] * that's because they aren't specified in terms of decoding; they compare base64-encoded strings by string equality, and assume that base64 encoding is 1-to-1, since everyone makes this assumption. [10:17:28.0705] > <@domenicdenicola:matrix.org> Yeah the spec doesn't seem to match browsers there Browsers disagree; Firefox follows the spec, Chrome does not [10:22:48.0863] * that's because they aren't specified in terms of decoding; they compare base64-encoded strings by string equality, and assume that base64 decoding is 1-to-1, since everyone makes this assumption. [10:39:40.0062] > that's because they aren't specified in terms of decoding; they compare base64-encoded strings by string equality, and assume that base64 decoding is 1-to-1, since everyone makes this assumption. i find this footgun argument to be pretty persuasive. fwiw i feel more radicalized than before from reading those tweets, and feel like if anything we should try to change the web default [10:52:51.0999] Domenic: r? https://github.com/whatwg/whatwg.org/pull/371 [10:58:26.0784] Domenic: also https://github.com/whatwg/html-build/pull/265 [11:00:38.0279] > <@shuyuguo:matrix.org> > that's because they aren't specified in terms of decoding; they compare base64-encoded strings by string equality, and assume that base64 decoding is 1-to-1, since everyone makes this assumption. > > i find this footgun argument to be pretty persuasive. fwiw i feel more radicalized than before from reading those tweets, and feel like if anything we should try to change the web default I just don't think these people are JS practictioners. They are crypto people (?) who maybe use base64 for crypto purposes. We should not expose base64 at all if our audience is people hand-rolling crypto. [11:00:46.0369] Note also that the tweets note that Go has the same default as JS [11:01:01.0901] It feels really bad for TC39 to try to shift the web default by fiat [11:02:49.0671] the "we shouldn't expose this at all" is a separate argument, which i think i also disagree with, but we should table in this context [11:03:38.0510] Well it's relevant because what is our goal in exposing this [11:03:53.0892] Is it to allow people to decode base64 in a fashion they're used to from Node/Go/Deno/the web? [11:04:08.0198] Or is it to allow people to do secure crypto-adjacent stuff that assumes bijection? [11:04:20.0170] > <@domenicdenicola:matrix.org> It feels really bad for TC39 to try to shift the web default by fiat i have a hard time engaging with this as well -- there are technical reasons to prefer the stricter variant, which there is disagreement with. it similarly feels bad to accuse TC39 of some kind of power grab here [11:04:20.0398] Filippo Valsorda is one of the people your employer pays to be hand-rolling crypto [11:04:39.0055] > <@bakkot:matrix.org> Filippo Valsorda is one of the people your employer pays to be hand-rolling crypto Yes, and I don't think he's the target audience for this API. [11:04:57.0365] I don't really think pointing at someone with a different opinion and saying "you get your money from the same dude" is really that insightful [11:05:27.0201] yes let's... cool down on that front [11:10:51.0800] Just for clarity: this is about the strictness of base64 **decoding** right? We do all agree that base64 encoding should always include padding? [11:11:55.0395] Yes [11:12:06.0513] i've tried to steer the conversation to something more pragmatic, but so long as we're talking about broad-scope arguments like "we shouldn't diverge at all from existing standardized web APIs" and "the current default is not great", i do find the latter more convincing because i'm not sure what group the former position helps in this particular case [11:12:53.0381] In this case, what are some arguments for being strict with padding by default? What use cases would this benefit? [11:13:02.0994] for the concrete AMP case, it seemed like the weird Java printer was, well, regarded as weird, and an attempt was made to fix it [11:13:59.0823] > <@lucacasonato:matrix.org> In this case, what are some arguments for being strict with padding by default? What use cases would this benefit? the use case that the (imo reasonable) assumption that base64 is a bijection holds, and that when it does not, it prompts the author to take a second look and figure out why [11:16:00.0513] Who is going around saying "I really want bijection"? I'm worried about people going "I want to switch from Buffer.from(x, "base64") to the new thing, but I did and now we have a production outage because I didn't know about how TC39 decided to diverge from Node semantics and data that used to work now fails" [11:16:28.0860] i think that's precisely the point of why it's so surprising -- nobody's going around saying that because they don't even realize it's not. i certainly didn't! [11:16:58.0058] I suspect people don't *expect* it. [11:17:09.0559] > <@shuyuguo:matrix.org> the use case that the (imo reasonable) assumption that base64 is a bijection holds, and that when it does not, it prompts the author to take a second look and figure out why shu: Many other languages and ecosystems have set the precedent that this is not the case though: Go, Python, Java, Deno, Node, Rust. I don't think it is a reasonable assumption to make. [11:17:21.0525] Bijection is just not a property one usually insists on for encoding/decoding, is my claim. Certainly not with text encodings! [11:17:28.0353] https://docs.rs/base64/0.13.0/base64/ <- too little padding is ok, too much is not [11:17:31.0981] Domenic: to be clear, `Buffer.from(x, "base64")` accepts _mixed_ base64 and base64url in the same string, which I am definitely not proposing to support [11:17:49.0891] > <@bakkot:matrix.org> Domenic: to be clear, `Buffer.from(x, "base64")` accepts _mixed_ base64 and base64url in the same string, which I am definitely not proposing to support Well OK, that's pretty bonkers, fair enough. [11:17:54.0017] Domenic: i'm worried about the latter too, but that's why i want more data here! it's all too easy to raise the specter of possible compat breakage [11:18:01.0599] (CSP does too, fun fact) [11:18:21.0272] Seems like *that* should be a non-default mode... [11:18:32.0118] and while we're here and i'm a little worked up, i really want us to stop pitting whatwg-vs-tc39, both inside and outside of tc39 [11:18:41.0393] (I'll open a tracking issue) [11:19:59.0061] i mean, obviously JS is a stakeholder in the web platform and we want to improve it too. there are delegate who don't care about the web as much, but perpetuating that dichotomy entrenches that position which is counter-productive [11:27:04.0717] I don't think this is a very WHATWG-vs.-TC39 thing; for me at least I tried to frame all my comments as about technical/API surface concerns on each proposal. E.g. even if TC39 wants to do this then I still am unsure about putting things on the prototypes vs. a separate utility class. At first I thought it was more a web-vs-non-web thing. But recent research showing that Deno/Node/Go/etc. all do forgiving base-64 makes it seem like it's not even that. It's apparently about whether you expect a new JS API to have some bijection property vs. whether you expect it to align with the JS ecosystem/other standard library APIs. [11:31:13.0885] > <@domenicdenicola:matrix.org> Bijection is just not a property one usually insists on for encoding/decoding, is my claim. Certainly not with text encodings! My claim is that a great many people _assume_ it holds, for base64 in particular. Either Chrome's implementation of CSP or the CSP spec itself assumes it holds, so it's not like it's only amateurs who make this mistake. (I don't know what the intent of the CSP authors was, so I'm not saying Chrome is wrong, just that it doesn't match the spec-as-written.) That is to say, my claim is that very few people have the correct intuition about what `atob` and friends actually do in this edge case, and in any case are unlikely to be exposed to it, and as such we should match what they expect these APIs to do, not what they actually do. [11:35:11.0050] > <@domenicdenicola:matrix.org> I don't think this is a very WHATWG-vs.-TC39 thing; for me at least I tried to frame all my comments as about technical/API surface concerns on each proposal. E.g. even if TC39 wants to do this then I still am unsure about putting things on the prototypes vs. a separate utility class. > > At first I thought it was more a web-vs-non-web thing. But recent research showing that Deno/Node/Go/etc. all do forgiving base-64 makes it seem like it's not even that. It's apparently about whether you expect a new JS API to have some bijection property vs. whether you expect it to align with the JS ecosystem/other standard library APIs. i was responding mainly to the "TC39 tries to shift the web default by fiat" comment [13:13:47.0641] Another data point in the "base64-being-bijection" problem. By default, the GNU coreutils `base64` program _emits_ base64-encoded output wrapped at 76 cols, so already it requires whitespace to be ignored during decoding. In terms of decoding, all popular non-JS base64 decoders that I tested (Perl, Python, Ruby, coreutils) ignore whitespace and treat `YQ==` and `YR==` similarly (return `a` with no errors). It really seems like forgiving-decode is already an established default across ecosystems. [13:20:04.0752] ah cool, thanks for the extra datapoint [13:20:59.0111] timothygu: so there's two notions of "ignoring padding". "treat YQ== and YR== similarly" is one; "treat YQ and YQ== similarly" is the other [13:22:22.0902] Yeah I understand. I was trying to conclude that the notion of “base64 as bijection” may already be a lost cause [13:24:09.0598] I claim that literally zero people will have put `YR==` into a base64 decoder except as one of a.) manually, to see what happens; b.) leaking memory, or c.) because they are actively malicious and trying to take advantage of the looseness of parsers [13:27:26.0651] since there is no reasonable way to end up with `YR==` as an input, I am not at all convinced you can meaningfully extrapolate from "base64 decoders in other languages accept it" to "we also should accept it". it is an implementation detail that no one encounters in real life outside of malicious input. [13:30:34.0042] (as another data point, the most popular Rust base64 decoder rejects `YR==`, so it's not universal.) [13:31:14.0272] > <@bakkot:matrix.org> I claim that literally zero people will have put `YR==` into a base64 decoder except as one of a.) manually, to see what happens; b.) leaking memory, or c.) because they are actively malicious and trying to take advantage of the looseness of parsers would it make sense to gather metrics to support this claim? I could imagine some browser adding a usecounter to atob() for inconsistent padding [13:33:17.0126] if you think that claim requires support, sure. I am confident in its accuracy personally. 2021-07-08 [03:36:14.0374] Many base64 implementations are strict by default and less strict when being passed flags to change the behavior. Variants of forgiving behavior: allowing line breaks (only allowing CRLF is often an option, "required" for email), allowing whitespace, allowing arbitrary non-base64 "characters", allowing invalid padding (in all variants you can imagine). As someone working on email I wish every implementation would be strict by default. That way implementations generating input requiring forgiving decoders would be found and fixed quickly. Sadly, that's not the world we live in. The next best option is to use forgiving decoders, but warn users when non-conforming input is processed. Please don't be forgiving and silent by default. [11:57:50.0222] what do whatwg specs say about adding non-standard methods to things [12:00:55.0182] > <@devsnek:matrix.org> what do whatwg specs say about adding non-standard methods to things https://html.spec.whatwg.org/multipage/infrastructure.html#extensibility-2 [12:01:38.0741] "Documents must not use such extensions" does this mean the document object? [12:02:45.0791] I think that's a requirement for authors to not use any such extensions [12:02:55.0185] ahh ok [12:03:18.0214] thanks! 2021-07-09 [07:38:47.0892] I have a question about origins - can somebody tell me if I'm completely misunderstanding them? Right now there are 2 kinds of origins: tuples and opaque, and opaque origins have this weird property where every time you calculate them, you get a "new" opaque origin which doesn't compare as same-origin with any previously-calculated opaque origin. The HTML spec uses them really carefully and calculates them at specific times to walk this tightrope, URL libraries use things like global atomic counters or UUIDs, etc. This whole "calculation is creation" setup is quite fragile and can lead to brittle code. [07:40:04.0855] So... as I've been reading about them, I've been thinking: it seems that there are really 3 kinds of origins - tuple (security domain defined by protocol + host + port), application-defined opaque (security domain defined some other way, for a specific operation or frame or other context), and undefined opaque (totally unknown security domain). Would that be an accurate way to model them? [07:45:18.0278] The URL standard says that the origin of "file:" URLs is "an exercise for the reader". IIRC, there was some disagreement because Chrome defines an origin for "file:" URLs and doesn't (or didn't) want to change that. Would that be an example of an application-defined opaque origin? In other words, Chrome has some other information which allows it to assign a security domain for certain file operations? 2021-07-10 [20:50:52.0735] 🤩heard there was a party in oculus tn..? [20:51:50.0671] wrong room, i suppose. [00:23:55.0334] anybody know what `{% raw %}` in a GitHub Actions workflow file does? [00:24:25.0546] context is https://docs.github.com/en/actions/guides/publishing-docker-images#publishing-images-to-github-packages 2021-07-11 2021-07-12 [00:38:57.0516] Eric Portis (he/him): I'm doing VERY basic first docs on using EXIF for getting intrinsic size in https://github.com/mdn/content/pull/6798 Would I be correct that all four of PixelXDimension, PixelYDimension, ResolutionX, and ResolutionY (and ResolutionUnit) must be set and consistent or they will be ignored? At this point I am saying very little because I can't find a good place in the existing docs to frame it. I think everyone assumes that all the terminology and relationships between terms are well understood but they aren't by me: CSS Pixel, Pixel density, device pixel density. Can you recommend a good explainer of that? I do kind of get it after some internet search, but would be good to have independent confirmation. [00:44:09.0795] hi, is there something like https://html.spec.whatwg.org/multipage/parsing.html for css and something like https://github.com/html5lib/html5lib-tests again for css? [00:45:08.0019] https://drafts.csswg.org/css-syntax/ [00:45:31.0901] Thank you! [09:28:29.0381] https://html.spec.whatwg.org/multipage/embedded-content-other.html#dimension-attributes [09:28:42.0936] > The width and height attributes on img, iframe, embed, object, video, source when the parent is a picture element and, when their type attribute is in the Image Button state, input elements may be specified to give the dimensions of the visual content of the element (the width and height respectively, relative to the nominal direction of the output medium), in CSS pixels. [09:29:03.0365] I am having a hard time parsing that sentence [09:29:29.0460] it does not seem grammatically correct/complete [09:35:31.0914] in particular, the part around _“when their type attribute is in the Image Button state, input elements may be specified ”_ [10:08:53.0343] sideshowbarker: "The width and height attributes on { img, iframe, embed, object, video, (source when the parent is a picture element) and, ( when their type attribute is in the Image Button state, input elements) } may be specified [...]" is how i read it [11:09:03.0868] Hello! [11:09:44.0795] Is anyone who is following modules interested in reviewing the PR which integrates the TC39 Realms proposal? I've updated it based on previous feedback from the editors. https://github.com/whatwg/html/pull/5339 [15:16:59.0994] > <@bakkot:matrix.org> sideshowbarker: "The width and height attributes on { img, iframe, embed, object, video, (source when the parent is a picture element) and, ( when their type attribute is in the Image Button state, input elements) } may be specified [...]" is how i read it ah OK, thanks 2021-07-13 [08:04:33.0139] Hello, I am using one of your images in my research paper (specifically: https://html.spec.whatwg.org/images/asyncdefer.svg), how do I cite you? [08:15:07.0712] * Hello, I am using one of your images in my research paper (specifically: https://html.spec.whatwg.org/images/asyncdefer.svg), how do I cite WHATWG? [11:09:07.0835] I think that depends on your paper/journal's style guide for citations. Probably cite them the way you would cite any webpage. 2021-07-14 [20:25:50.0949] are there any nested namespace objects in HTML? Math or JSON, but hanging off another property [20:26:14.0803] I can't think of any except maybe `crypto.subtle` [20:26:39.0748] (tc39 is bikeshedding `Temporal.now`) [20:27:34.0219] * are there any nested namespace objects in HTML? like Math or JSON, but hanging off another property [22:57:56.0436] > <@bakkot:matrix.org> are there any nested namespace objects in HTML? like Math or JSON, but hanging off another property `console`? [22:58:24.0736] oh man is `console` a namespace object? [23:03:21.0936] /me was checking the JS spec to make sure "namespace object" isn't a specific concept that they'd missed [23:03:40.0036] it is not! that's something we were debating, and we couldn't come to an exact definition [23:05:16.0964] ”namespace object“ is a WebIDL thing, not an ES thing, right? [23:09:12.0738] oh, _nested_ namespace objects [23:09:19.0628] /me is still half asleep [00:14:44.0249] > <@domenicdenicola:matrix.org> I think that depends on your paper/journal's style guide for citations. Probably cite them the way you would cite any webpage. It is APA 7th ed., is there any author? Or should I just have: HTML Living Standard, (2021, July 14). WHATWG. https://html.spec.whatwg.org/ [00:16:09.0187] > <@domenicdenicola:matrix.org> I think that depends on your paper/journal's style guide for citations. Probably cite them the way you would cite any webpage. It is APA 7th ed.! is there any author? Or should I just have: HTML Standard, (2021, July 14). WHATWG. https://html.spec.whatwg.org/ [07:40:51.0147] > <@shuyuguo:matrix.org> oh man is `console` a namespace object? It is, but it is not nested. It is lowercase for legacy reasons. https://console.spec.whatwg.org/#:~:text=For%20historical%20reasons%2C%20console%20is%20lowercased. [07:43:30.0112] > <@bakkot:matrix.org> I can't think of any except maybe `crypto.subtle` crypto and crypto.subtle were designed before Web IDL supported namespaces; otherwise they would probably be a good candidate. In general the web has a lot of things which should probably be namespaces but are instead singleton instances (e.g. navigator is another one). You can tell the difference since crypto.constructor exists and crypto.subtle.constructor exists. These days that pattern is lightly discouraged; see https://w3ctag.github.io/design-principles/#:~:text=Several%20non-constructible%20classes%2C%20like%20Navigator%2C%20History%2C%20or%20Crypto%2C%20are%20non-constructible%20because [07:45:30.0006] > <@yug34:matrix.org> It is APA 7th ed.! is there any author? Or should I just have: > > HTML Standard, (2021, July 14). WHATWG. https://html.spec.whatwg.org/ You could cite the editors, which are listed in https://html.spec.whatwg.org/multipage/acknowledgements.html#:~:text=For%20about%20ten%20years%20starting%20in%202003%2C%20this%20standard%20was%20almost%20entirely%20written%20by . But the text was authored by hundreds of people, who you can see in the large list above, so I'm not sure what your style guide would recommend for such cases. [08:51:13.0915] Have y'all seen https://dontcallmedom.github.io/mdn-issue-by-spec/ and in particular https://dontcallmedom.github.io/mdn-issue-by-spec/whatwg.html? [08:52:10.0627] Right? [08:52:13.0242] [html] Issue with input validation [08:52:33.0272] Too bad it's on static hosting or one could have a bit of fun 2021-07-15 [02:26:04.0020] Hi, is there a machine readable list of all the HTML elements, their attributes, etc? If so, where can I find it? Context: I'm looking to build a strongly-typed HTML DSL [02:26:17.0776] (please ping me when responding) [02:28:26.0421] weeb69: https://github.com/validator/validator/tree/main/schema/html5 [02:29:15.0429] > <@sideshowbarker:mozilla.org> weeb69: https://github.com/validator/validator/tree/main/schema/html5 is there a readme or anything i can look at to know to how to parse this? [02:31:16.0727] it’s a relaxng schema [02:31:29.0906] the entry points are in https://github.com/validator/validator/blob/main/schema/.drivers/ [02:31:34.0706] e.g., https://github.com/validator/validator/blob/main/schema/.drivers/html5-all.rnc [02:33:01.0426] but it’s meant to be used with two inputs: 1) that grammar, and 2) an instance against which to validate, using that grammar [02:33:36.0279] https://github.com/relaxng/jing-trang is the tool for working with it [02:35:10.0545] but it would be a lot of work to repurpose that grammar for something other than validation [02:35:28.0381] I need to convert that information to Rust types. I can't find any documentation on *how* the information is laied out (which files contains what) [02:36:01.0504] Right now, my best bet seems to be to scrape MDN docs and put in some manual work [02:36:06.0190] however, I’m not aware of any other machine-readable expressions of HTML that conform to the current spec [02:36:27.0618] The WebIDL? [02:36:56.0932] The syntax? [02:37:40.0368] does the WebIDL contain information about HTML elements? [02:37:54.0655] yes [02:38:04.0143] Only sort of [02:38:08.0268] but WebIDL expresses the DOM interface and DOM attributes, not the content/markup attributes [02:38:14.0468] > <@weeb69:matrix.org> does the WebIDL contain information about HTML elements? The JS APIs corresponding to all html elements [02:38:39.0157] and there is not 1-to-1 WebIDL for every element [02:38:44.0652] There's also https://html.spec.whatwg.org/multipage/indices.html#elements-3 [02:39:21.0646] ah yeah that would be parseable [02:41:14.0387] > <@ms2ger:igalia.com> There's also https://html.spec.whatwg.org/multipage/indices.html#elements-3 I have a feeling parsing that would be more work than parsing the MDN page [02:41:32.0819] https://developer.mozilla.org/en-US/docs/Web/HTML/Element and https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes [02:41:35.0378] ones [02:44:47.0532] https://github.com/mdn/content/tree/main/files/en-us/web/html [02:44:54.0229] this seems like a nice representation [02:45:14.0040] i could use just the directory structure to get the data [05:41:32.0309] It seems this all depends on how bad an inaccuracy here would be for your desired outcome.. :) [10:34:19.0058] Hm, it's not possible to set an ObservableArray attribute directly to an array (having it replace all the members), is it? @domenic? [10:34:36.0605] If not, I can raise an issue for it. [10:46:15.0833] Do I understand correctly that WebKit and Blink use the full HTML tokenizer for `meta` prescan but don't use the real tree builder for figuring out which tokens would imply ``? [10:48:06.0299] > <@tabatkins:matrix.org> Hm, it's not possible to set an ObservableArray attribute directly to an array (having it replace all the members), is it? @domenic? It is possible; see https://heycam.github.io/webidl/#ref-for-dfn-observable-array-type%E2%91%A3 [11:08:11.0434] Oh dang, that's nice. I'll still probably submit a PR to add an example of this to the description, as it's not clear from anywhere *outside* that algo that this is possible. [12:57:04.0123] Well, there's also https://heycam.github.io/webidl/#:~:text=building.employees%20%3D%20%5Bnew%20Employee(%22D%22)%2C%20employeeB%2C%20new%20Employee(%22C%22)%5D%3B [13:22:10.0651] Oh huh, I skipped right over that. [13:22:25.0646] I was actively reading that and the next chunk of example code. 2021-07-16 [00:34:50.0209] https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/html/parser/html_meta_charset_parser.h;l=58 indeed looks a lot like Chromium is using the real HTML tokenizer. But not the real tree builder: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/html/parser/html_meta_charset_parser.h;l=58 [00:35:46.0795] Can anyone think of bad Web compat consequences from using the real tree builder algorithm for figuring out where `body` starts? [00:36:28.0469] That is, running the tree builder in the scripting enabled mode without actually executing scripts during the `meta` prescan? [00:37:43.0654] Oops. The second link was supposed to be https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/html/parser/html_meta_charset_parser.h;l=58 [00:37:51.0420] What [00:38:14.0568] https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/html/parser/html_meta_charset_parser.cc;l=88 [00:38:27.0803] Something weird going on with how the copypasteable URL updates. [00:41:31.0580] AFAICT, the biggest risk is probably `meta` inside `script` in a manner that should be honored for compat. Need to write tests... [02:05:12.0030] > <@hsivonen:mozilla.org> AFAICT, the biggest risk is probably `meta` inside `script` in a manner that should be honored for compat. Need to write tests... FWIW, I would be strongly in favour of not allowing this (or `meta` inside `noscript`), if we could get away this from a compat POV [02:07:27.0244] I don't know the origins of why Hixie spec'd it as allowing it, though… [02:07:35.0486] Compat is nice and all, but sometimes I understand why people wanted to burn it all to the ground [02:13:01.0823] I guess it's somewhat difficult to avoid the actual parser changing encoding from `document.write`, and probably practically unacceptable :( [02:14:24.0008] Compat is nice / but compat can stop you / from doing all the things in life you'd like to. [02:16:01.0608] (also I think to quote The Smiths these days, one need to pretend that Morrissey doesn't exist and it's all Johnny Marr) [02:16:16.0450] Who are The Smiths? [02:18:15.0628] /me gets inspired to put on a far more acceptable band, The Jesus and the Mary Chain [02:23:30.0114] > <@gsnedders:mozilla.org> I don't know the origins of why Hixie spec'd it as allowing it, though… I thought Hixie specced it the way it's specced in order to imitate IE6. However, I could be wrong and maybe the spec is creative in ways it shouldn't have been. [02:24:27.0804] > <@hsivonen:mozilla.org> I thought Hixie specced it the way it's specced in order to imitate IE6. However, I could be wrong and maybe the spec is creative in ways it shouldn't have been. I have a suspicion that it didn't handle `