2019-02-01 [16:58:51.0000] https://stackoverflow.com/questions/52791470/how-to-package-or-import-html-templates-without-html-imports [06:11:12.0000] So I want to add rel="" to
[06:11:17.0000] Should I recast as a hyperlink? [06:11:39.0000] That seems pretty reasonable from my perspective, but maybe folks think that's nonsense? [06:12:05.0000] Domenic: MikeSmith: ^^ [06:12:16.0000] annevk: I’m going to push a PR to the insert algo of the DOM spec either later today or next week. [06:12:44.0000] nox: sounds exciting [06:13:11.0000] annevk: https://gist.github.com/nox/0bb2a3f5f0223b3ec273d97d586db7eb [06:13:23.0000] According to a pedantic reading of the spec, that should log null. [06:13:38.0000] Err, a collection of length 0 [06:14:03.0000] nox: oh, so that's a pretty complicated issue [06:14:13.0000] annevk: Is there an issue already? [06:14:23.0000] Safari seems to follow the spec and the others not. [06:14:52.0000] nox: https://github.com/whatwg/dom/issues/575 and variants [06:15:14.0000] nox: it basically seems that some browsers have an additional queue to do script things from [06:15:54.0000] annevk: I see the issue a bit differently. [06:15:55.0000] annevk: I think even if the rel="" thing hadn’t come up, it could make sense to recast as a hyperlink [06:15:58.0000] nox: I ran out of time/interest last time I attempted to fix it [06:16:18.0000] MikeSmith: cool [06:16:31.0000] annevk: To me it is more about Chrome/Firefox making no difference between two children of a fragment and two children of a div being added to the tree. [06:17:03.0000] E.g., they don’t run insertion steps etc until every child of the fragment are added to the tree where they belong. [06:17:44.0000] annevk: It reminds me of a change I did for adopting a node, where a single loop was changed into two separate loops for running the adopting steps. [06:18:03.0000] annevk: yeah, since navigates, it also makes sense for to associate link types with it [06:18:40.0000] but as far as noopener and noreferrer too, I think those never should have become link types to begin with [06:18:51.0000] I realize it’s a lost cause now [06:20:01.0000] MikeSmith: it did stray a bit from the original relationship angle, indeed [06:20:23.0000] MikeSmith: I guess the main thing we don't want with is for it to match :link and :visited though [06:20:43.0000] yeah if you consider that the semantics of putting rel=stylesheet href=foo into a document is that it means the resource at foo is a stylesheet for the document [06:20:52.0000] It seems those pseudo-classes are pretty clearly defined in terms of those elements [06:20:52.0000] oh [06:21:03.0000] right [06:21:21.0000] nox: I don't think that's correct [06:21:43.0000] nox: the insertion/removal steps are run, but scripts/styles are done later in a separate queue [06:22:13.0000] nox: I found a way to observe this difference somewhere, I initially also thought the fix was what you're suggesting there [06:22:56.0000] nox: I might be mistaken, it's been a while, but I'm pretty sure it was not that "simple" [06:29:35.0000] annevk: I think you are mistaken. [06:30:07.0000] annevk: Let me give you another snippet [06:31:30.0000] annevk: https://gist.github.com/nox/520dd79ff14023888e6d02f10f800ec2 [06:32:07.0000] annevk: If it just delayed running the script, wouldn't the element not be upgraded? [06:42:30.0000] nox: imagine you insert a document fragment containing an script followed by an iframe, when the script executes the iframe already needs to have its nested browsing context et al created [06:42:54.0000] annevk: https://gist.github.com/nox/cb5cd57ac2c07966b6f19767a6e29d4e [06:43:58.0000] annevk: This prints 0 in Safari and 1 in Firefox. [06:44:11.0000] annevk: AFAIK, changing selectedness of options and whatnot is part of insertion steps, right? [06:44:24.0000] I don't know [06:44:41.0000] https://html.spec.whatwg.org/multipage/form-elements.html#the-select-element:nodes-are-inserted [06:47:10.0000] annevk: I'll comment with my few snippets. [06:48:14.0000] nox: it might mean that none of this quite makes sense, but I'm pretty sure Gecko at least has an additional queue of sorts [06:48:22.0000] annevk: Yes it does. [06:48:27.0000] nox: perhaps it does selectedness differently [06:48:49.0000] annevk: No, using a additional queue would definitely make the script run after selectedness was handled. [06:49:01.0000] (Printing 1 means it printed the index after it was handled) [06:49:27.0000] annevk: I'm looking into that because I randomly found we introduced a similar concept of delaying the execution of scripts in Servo and it doesn't interact very well with insertion steps. [06:49:59.0000] I'd be glad if we could sort this out somehow since not having script execution defined is not great of course [06:50:18.0000] There's similar issues on the whatwg/html side around the parser and scripts [06:59:57.0000] nox: https://github.com/whatwg/dom/pull/576 does indeed have that iframe/script example as to why running insertion steps later doesn't work [07:01:44.0000] annevk: It is *so* weird. [07:02:14.0000] annevk: https://gist.github.com/nox/78b0034279dbdc902e2786ee99fee75c [07:02:24.0000] This prints 1, according to the spec it should print 0. [07:03:56.0000] Ah never mind, I'm dumb dumb. [07:04:58.0000] Forgot how promises get run, hah. [07:06:19.0000] annevk: https://gist.github.com/nox/78b0034279dbdc902e2786ee99fee75c This prints 0/constructed/connected in Safari and constructed/connected/1 in Firefox, which to me makes absolutely no sense. [07:07:10.0000] 0/constructed/connected, to me, is what the spec currently says to do, [07:07:25.0000] OTOH constructed/connected/1 sounds really really weird to me. [07:07:41.0000] nox: I'm not sure why you keep referencing the spec, it's not reliable for these things [07:08:03.0000] annevk: Sure, let's forget about the spec! [07:08:25.0000] annevk: Do you have any clue why Firefox and Chrome would construct/connect the custom element before being able to say there is 1 custom-element in the tree? [07:09:20.0000] annevk: AAAAAH, ignore me. [07:09:39.0000] annevk: Never realised that defining a custom element would upgrade every existing element which was already in the tree… [07:09:42.0000] That explains a lot. [07:09:50.0000] nox: define() runs [CEReactions] [07:09:57.0000] nox: right [07:10:05.0000] annevk: I referenced the spec because it doesn't seem to me like Safari isn't aligned with it in any circumstance. [07:11:53.0000] annevk: But the latest issue you linked with style/script does show that Safari doesn't follow the spec in that case, so thanks. [07:12:30.0000] nox: it seems to me the spec is broken for several cases, also iframe/script [07:12:40.0000] nox: hmm, maybe not for iframe [07:20:48.0000] annevk: https://github.com/whatwg/dom/pull/576 [07:21:03.0000] "annevk requested a review from nox on 21 Feb 2018" 😂 [07:22:42.0000] nox: aha, now I don't even have to apologize for leaving this unsolved [07:25:03.0000] annevk: Hah! [08:02:49.0000] Domenic: if you could have another look at revising event loops that'd be great [08:03:21.0000] Domenic: another thing I thought of is that we could require 1:1, but allow user agents (when it's safe) to block one loop on another via a line of prose [08:03:44.0000] Domenic: that would simplify the spec model and also give us a way out for worklets [08:04:23.0000] Domenic: and to be clear, the reason I'm working on event loops is primarily to get rid of unit of related browsing contexts and friends [08:04:35.0000] Domenic: it's effectively the last major dependency on that [08:17:14.0000] annevk: I'll try to find time before the weekend. [08:17:55.0000] I'll be sure to run your new idea past our implementers, but so far they have preferred a spec that reflects implementations, and I think that is the correct priority of constituencies even if one that is more theoretically pure would make our jobs as spec authors simpler. [08:17:58.0000] Domenic: thanks, would be nice to be able to get back to it directly after [08:18:42.0000] Domenic: note that currently we already have different loops for worklets and windows [08:18:59.0000] Domenic: unless they want to write a patch that fixes that, I think my approach is the only way forward there [08:19:03.0000] Yeah, lots of confusion caused by that already, unfortunately :( [08:19:20.0000] Domenic: unless you want to block the refactoring on me fixing a bug someone else introduced, which seems rather unfair [08:19:39.0000] Domenic: and at that point I'd like some kind of escalation of talking directly to the people involved [08:19:53.0000] Heh, isn't it you who always says we should fix our foundations before building on them? [08:21:46.0000] Domenic: so yes, but 1) I still don't really see this as being problematic 2) I think unit of related browsing contexts is a far bigger problem and worth fixing sooner [08:22:16.0000] Sure, we all have different priorities. [08:23:08.0000] Domenic: that's rather dismissive [08:23:37.0000] No, I'm just saying, please try to see both sides. [08:23:50.0000] Domenic: so why isn't Google putting resources into fixing the worklet mess? [08:24:04.0000] Domenic: afaik only Google is shipping worklets... [08:24:13.0000] Domenic: maybe we should take that out instead? [08:24:37.0000] I'm finding this conversation unproductive and hard to deal with first thing in the morning, and I have a meeting in 5, so I would ask that we resume it at a later time. [08:25:09.0000] Domenic: I basically only have European office hours [08:29:39.0000] annevk: could you summarize or send pointers to explain "the worklet mess"? I haven't been following what's getting messed up there [08:30:28.0000] astearns: basically, must worklets always be concurrent, or not? I think it depends on the type of worklet, but the spec gives them all the same concurrent event loop [08:30:52.0000] thanks [08:31:12.0000] astearns: however, if they'd sometimes have to share a window event loop, that would undermine a bunch of infrastructure, which makes assumptions about window event loops (currently browsing context event loops) [08:32:05.0000] astearns: and I think it's more complicated, it's that in principle they're allowed to be concurrent, but some types are also allowed to be interweaved [08:32:26.0000] (but eg audio is prolly not, at least, that'd seem bad) [08:42:16.0000] Domenic: so would it work if we kept the existing wording, except replaced it to say similar-origin window agent, and leave the security issue and worklets as a follow-up? [08:42:47.0000] Domenic: then there wouldn't be a regression [08:44:10.0000] Domenic: anyway, it would be good to know what exactly would unblock this since I'm not really sure what to do given the current text and the problems I keep running into with it and thus far you haven't really gotten concrete [08:44:47.0000] Domenic: and despite this apparently being a priority for Google I don't see any issues about it, which is odd? [13:04:23.0000] annevk: form-as-hyperlink reads well to me. I... *may* have done exactly that to get a POST-ing "link" before... [13:31:50.0000] TabAtkins: 🎉 [13:34:58.0000] I’m somewhat surprised this analogy has not been made before [13:58:50.0000] A