2015-07-01 [21:02:30.0000] Anyone with latest Safari mind testing if Array.prototype.includes is present? [21:05:37.0000] Also Uint8Array.prototype.includes [21:10:20.0000] Safari 6.1.6 returns undefined for both [21:11:06.0000] Sorry, should have specified I was looking for Safari 8 and 9 [22:27:23.0000] Domenic: neither in Safari 8.0.5 [22:27:43.0000] I have reports of it being in 8.1 [22:47:44.0000] Domenic: 8.1 here [22:48:51.0000] Array.prototype.includes 👍, Uint8Array.prototype.includes 👎 [01:30:17.0000] JakeA: I guess we could revisit the new Request() aspect of fetch(), if someone has the time, though that still leaves open what new Request() should do [01:31:26.0000] annevk: I'm not suggesting it's wrong, just couldn't work out why it was different [01:32:09.0000] JakeA: so request has a pointer to a stream; then you create a new request that then gets to own that stream [01:32:31.0000] JakeA: the old request now no longer has a pointer to a stream, sure, the used flag can be set, but body would be null [01:32:54.0000] JakeA: and then you get into the thing what null body should mean... [01:34:35.0000] annevk: ahh, I thought new Request(request) would create a new stream that read from the original request stream [01:34:41.0000] your way is more efficient [02:00:32.0000] /me has been reading too much C++... this is basically auto_ptr vs. shared_ptr [02:01:13.0000] I am not sure what the use case is for a "copy constructor" for Request anyway? [02:26:06.0000] Domenic: mostly to normalize the request [02:26:16.0000] Domenic: while making sure we don't forget anything [02:26:48.0000] In what case can a Request be un-normalized? [02:27:53.0000] Domenic: the one passed to FetchEvent [02:28:44.0000] Domenic: (and anything passed to FetchEvent that's then passed to cache.put()) [02:28:45.0000] annevk: how did the author generate an un-normalized Request to pass to FetchEvent though? [02:28:55.0000] Domenic: the UA did [02:29:10.0000] annevk: why would the UA do something seemingly crazy like that? [02:29:41.0000] Domenic: it's not crazy, it reflects the settings for the document, but not all of those can be used for the service worker, so you need a reset of sorts before you go to the network [02:29:55.0000] Domenic: the document/worker/shared worker* [02:30:36.0000] Hmm. I don't really understand, but I'll take your word for it... [02:31:19.0000] Domenic: e.g. the client of a request passed to FetchEvent will be the document/worker [02:32:00.0000] Domenic: but the request resulting from fetch() should always have a client that is the global environment [02:32:10.0000] Domenic: there's a ton of stuff like that [02:32:15.0000] hmm [02:32:49.0000] /me refers back to his Twitter rant about not enough people understanding what is going on [02:33:25.0000] hey annevk Domenic :) [02:33:30.0000] so what about the promise rejection events? [02:33:38.0000] hahaha [02:33:56.0000] do you think mozilla will implement them? [02:33:59.0000] Oh, wait, I thought you said cancelation [02:34:12.0000] bz seemed open to implementing them [02:34:30.0000] would be cool to get some feedback on the current spec [02:34:38.0000] I didn't really follow that thread admittedly [02:34:41.0000] jochen__: pointer? [02:34:42.0000] impl. in blink is done % feedback from other vendors [02:34:59.0000] https://github.com/domenic/unhandled-rejections-browser-spec [02:35:08.0000] + the three pull requests from me :) [02:35:13.0000] jochen__: I need to update for https://github.com/domenic/unhandled-rejections-browser-spec/issues/2#issuecomment-113226244 [02:35:23.0000] it seems like this is a new phase after microtasks [02:35:41.0000] https://github.com/domenic/unhandled-rejections-browser-spec/issues/1 seems important [02:36:02.0000] Sigh, I should do that too, it's just so much less exciting [02:36:18.0000] #1 is spec'd and implemented, so just close it? [02:36:23.0000] To be clear, it's about *Worker objects having .onunhandledrejection etc. [02:36:28.0000] No, #1 is not specced or implemented [02:36:49.0000] Worker global scopes have the events. Worker objects do not yet. [02:36:57.0000] ah [02:37:06.0000] not sure that's desirable [02:37:06.0000] "Environment settings object seems to be a place to dump stuff?" sounds about right [02:37:13.0000] haha [02:37:26.0000] that would require dispatching the events cross process [02:37:43.0000] jochen__: yeah, it's kind of a "nobody has asked for this, but it's consistent with onerror" thing [02:38:39.0000] Does Worker's onerror fire for all exceptions or just during compile? [02:38:56.0000] i'd be surprised [02:39:00.0000] Good question... bz seemed to imply all errors, but worth checking... [02:39:13.0000] I do agree that being consistent would be nice [02:39:21.0000] if it fired for all exceptions [02:39:24.0000] And it doesn't seem super hard to post a message across the process... [02:39:25.0000] because out of process [02:39:34.0000] what would the message contain? [02:39:37.0000] Nah, all errors https://html.spec.whatwg.org/multipage/workers.html#runtime-script-errors-2 [02:39:52.0000] "For dedicated workers, if the error is still not handled afterwards, the user agent must queue a task to fire a trusted event that uses the ErrorEvent interface..." [02:40:02.0000] ohhhh interesting [02:40:10.0000] "and with the error attribute initialised to null" [02:40:13.0000] jochen__: sorry, I meant internally the browser would use a message to transmit the error... [02:40:21.0000] instead of trying to structured clone the error object or something [02:40:23.0000] that is the problem in this case [02:40:35.0000] there's no structured cloning of Error objects [02:40:36.0000] to get a coherent PromiseRejectionEvent you'd have to structured clone the { promise, error } object [02:40:38.0000] yeah [02:40:47.0000] so we could fire an event with no information... [02:41:07.0000] right [02:42:03.0000] The best we could do (messy) is switch from promise objects to promise IDs, and then also have a message field (optionally lineno/columno/filename). [02:42:06.0000] Seems not worth it [02:42:19.0000] I think we should fix structured cloning of Error btw: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28389 [02:43:18.0000] s/of Error// ;) [02:43:25.0000] maha [02:43:29.0000] good luck with that [02:43:30.0000] there's no guarantee that the reason is a an error [02:43:35.0000] could be an array buffer [02:43:35.0000] But yeah, promises seems harder [02:43:36.0000] ^ right, also that [02:43:52.0000] true [02:44:03.0000] so: no events on *Worker objects :) [02:44:26.0000] We should get bz's buy in on that, but it sounds good to me... [02:44:27.0000] also, the event isn't really like the error event [02:44:28.0000] I mean in the other case we also fire without any information... [02:44:42.0000] in the other case we have message/lineno/colno/filename [02:44:49.0000] that has a lot of special implications that are just not true for this event, i.e., it's own kind of event listener [02:45:17.0000] so what about this phase after microtask checkpoint thing [02:45:32.0000] Domenic: you can just do null defaulting in the dictionary [02:46:05.0000] Domenic: since the event cannot be constructed without the dictionary that's fine [02:46:38.0000] annevk: this null thing is quite confusing actually [02:46:52.0000] annevk: Firefox seems to give undefined for things HTML says are null [02:47:00.0000] oh [02:47:24.0000] HTML is imprecise [02:47:28.0000] You don't have to use null [02:47:28.0000] let me find what i am talking about [02:47:36.0000] And you could require both a promise and a reason [02:48:06.0000] not sure what "require any reason" would imply though, I guess best to leave that optional [02:48:21.0000] (or even better, figure out what that means) [02:51:07.0000] Domenic: did you see my new pull requests btw? [02:51:28.0000] jochen__: yeah, I've been having fun with V8 extras today, will probably merge when I get home from work [02:51:37.0000] annevk: here is an example of null that confuses me. https://html.spec.whatwg.org/multipage/comms.html#messageevent [02:51:50.0000] "The data attribute must return the value it was initialised to. When the object is created, this attribute must be initialised to null." [02:51:59.0000] But (new MessageEvent({})).data === undefined [02:52:28.0000] Domenic: that's a bug [02:52:39.0000] Maybe because of how the constructor works? But teh constructor isn't specified outside of IDL as far as I can tell. [02:53:06.0000] We have a generic description for event constructors: https://dom.spec.whatwg.org/#constructing-events [02:53:21.0000] It needs some cleaning up though to work with internal slots and stuff, but IDL hasn't formalized those :-( [02:53:26.0000] Ah OK, that's nifty [02:53:39.0000] So that definition implies .data === undefined I think since {}.data === undefined [02:53:52.0000] But note that if a dictionary member is undefined it's missing so it wouldn't be set by that constructor [02:53:54.0000] So I guess... null only matters for UA created MessageEvents that don't bother to set data? [02:54:02.0000] Hmm [02:54:05.0000] So it would be null per the prose rules [02:54:22.0000] "for each dictionary member defined therein find the attribute on event whose identifier matches the key of the dictionary member and then set the attribute to the value of that dictionary member" I dunno [02:54:28.0000] "data" sounds like a dictionary member defined therein [02:54:34.0000] But instead of relying on prose it's way better to just default to null in the dictionary for events that can't be created through document.createEvent() [02:55:11.0000] OK well defaulting to null seems like a good plan I'll file that on myself and fix later. [02:55:41.0000] Domenic: I think IDL says that if a member is "undefined" it's not defined [02:56:15.0000] I read it as referring to the actual definition, i.e. `dictionary MessageEventInit { ... }` [02:56:39.0000] Nope, it refers to the argument passed [02:57:18.0000] But it should use "present" and "not present" as terminology... [02:57:29.0000] *shrug* [02:57:33.0000] bbiab, food time [03:07:47.0000] enjoy [03:50:42.0000] wanderview: that bug report on Twitter… Firefox fails a CORS check for fetch('//other-origin/foo') from a page, even if the serviceworker returns a valid non-opaque response [04:09:05.0000] I wonder why Google Calendar can confirm via email that someone is attending but cannot actually show that information in the event... Maybe a bug specific for organizations using Google Calendar? [04:41:04.0000] Domenic: it seems weird that Streams makes many states unobservable [04:41:19.0000] annevk: streams are supposed to be largely stateless [04:41:30.0000] Domenic: e.g. not being able to distinguish an empty stream from a non-read canceled stream is just... uh [04:41:31.0000] annevk: e.g. consider arrays, you don't care how the array became empty [04:41:49.0000] they're a data structure, not a record of what's happened in your system [04:42:41.0000] Hmm, guess I have to think about it more [05:06:41.0000] Domenic: why is it a good thing that they don't keep track? Most asynchronous data structures seem to keep track in some way... [05:07:29.0000] And more specifically I'd think most stream implementations would keep track of such details [05:25:23.0000] annevk: no async data structures I can think of keep track. Certainly not promises. No data structures in general, that I can think of. Why? Hmm... [05:25:53.0000] Domenic: https://w3c.github.io/FileAPI/#dfn-Blob does [05:26:15.0000] annevk: no, it definitely doesn't. Example: [05:26:25.0000] Domenic: isClosed? [05:26:49.0000] You can't distinguish between a blob with [1,2,3,4,5] created from scratch, versus a blob with [1,2,3,4,5] created from slicing a blob [1,...,1000] [05:27:10.0000] sure, but all closed blobs are the same [05:27:24.0000] nobody cares if the closed blob used to have 1000 bytes in it or 0 [05:27:28.0000] but they're distinguishable from empty blobs [05:27:59.0000] i mean, empty but not-yet-closed streams are distinguishable from empty-and-closed streams [05:28:16.0000] it's just that if you know there's no more data to put in the stream, there's not much point in keeping the stream unclosed. [05:28:22.0000] I thought wanderview said that was not true [05:28:31.0000] just makes it annoying for anyone to figure out whether the stream is over yet [05:28:33.0000] same as blobs [05:29:07.0000] ehhhh it's borderline, it's a matter of whether .getReader().closed fulfills immediately or not [05:30:12.0000] we could add synchronous querying of the fact, but in general it's better to just write generic code that isn't so concerned with the state, and deals with the generic starts-readable-becomes-closed scenario, with starts-readable-immediately-becomes-closed as a special case. [05:31:19.0000] I guess it's okay, it seems somewhat weird that if you cancel a stream it's suddenly treated as the empty string, but folks will deal [05:32:17.0000] remember you can only cancel if you "own" it (i.e. you can get a reader) [05:36:31.0000] So actually, is that not a problem for the synthetic case we've been discussing? [05:36:42.0000] hmm how so? [05:37:34.0000] You can now empty any response from a server and the browser cannot tell whether the server returned the empty string or someone meddled with the stream [05:37:53.0000] @#&*()*$ [05:38:48.0000] OK. I will think about that tomorrow. That caught me by surprise a lot. Dammit. [05:41:04.0000] We should just have an isDirty flag, would work instead of offset too... :-P [05:41:44.0000] I mean, last time my mind was blown, I went from "no state!!" to "OK I guess offset is not the worst thing ever." Maybe tomorrow I'll come around to isDirty :( [05:42:06.0000] I guess a wrapper also would handle all of this [05:42:50.0000] Would that impact speed? But sure... [05:42:53.0000] But yhirano_ worries about performance, especially with piping [05:42:54.0000] yeah [05:43:26.0000] Ideally what we expose here is the lowest of the lowest-level stuff, minus all the security bugs [05:43:31.0000] in theory it shouldn't but in the still-somewhat-speculative world of off-main-thread piping, it could. So far that world is pretty vague but we've tried to maintain enough flexibility. [05:52:51.0000] You can also do yhirano_'s preferred wrapper https://github.com/yutakahirano/fetch-with-streams/pull/43#issuecomment-110968431 which should not impact perf [05:52:58.0000] i should sleep [07:35:51.0000] jochen__: Domenic: https://bugzilla.mozilla.org/show_bug.cgi?id=1179244 [07:37:13.0000] "Your password fails to meet the security requirements" blabla [07:54:06.0000] annevk: so the promise event stuff will be in DOM or HTML spec? [07:54:11.0000] at least the DOM Event part of it? [07:54:32.0000] it's described as patches to HTML and ECMAScript [07:56:09.0000] another question, annevk did you figure out where and when the custom element meeting actually will be? [07:57:36.0000] (even if I had stronger opinions on custom elements, the timing is rather bad. July is the holiday month in Finland ) [07:57:41.0000] smaug____: not yet, the ball is with slightlyoff it seems [07:57:54.0000] smaug____: it's very likely in Mountain View [07:58:05.0000] smaug____: but it could move to San Francisco I suppose [07:58:31.0000] I'm staying in San Francisco since that's where the service worker meetup will be, I believe [07:58:51.0000] oh, right, that one too [08:00:08.0000] waiting to see the time when SW is stable and implemented everywhere [08:00:35.0000] maybe next year [08:30:30.0000] annevk: the custom elements meeting is on July 21st, right? < smaug____ [08:30:58.0000] MikeSmith: yes [08:31:42.0000] yes, that one, but still unclear where [08:32:02.0000] ah ok [08:33:15.0000] I assumed it will be at Google in Mountain View where we had it last [08:33:29.0000] *where we had the Shadow DOM meeting [08:33:45.0000] but that room was too small [08:33:51.0000] and not arranged so well [08:34:19.0000] or I dunno, maybe that actually helped the meeting be more productive [08:49:24.0000] I hope there's not going to be a ton of people... [08:52:46.0000] no holographic telepresence at google yet? [09:23:24.0000] annevk: MikeSmith: one thing which made the last meeting a bit hard was the proposals coming right before the meeting [09:23:47.0000] getting proposals a week earlier or so would have perhaps made the meeting even more productive [09:24:35.0000] smaug____: agreed [09:25:07.0000] I've been trying to do my homework https://esdiscuss.org/topic/will-any-new-features-be-tied-to-constructors but so far that has made me skeptical of doing Custom Elements at all... [09:29:49.0000] annevk: btw, I think cloning for printing isn't perhaps that interesting case, since we wouldn't probably run ctors, but try to clone whatever there is in shadow DOM or so, I think [09:29:53.0000] not sure though [09:30:02.0000] in Gecko we don't run scripts in the clone document [09:30:47.0000] beforeprint may change the original document right before printing and then afterprint restore the state after cloning [09:30:51.0000] as of now [09:31:06.0000] smaug____: if in order to create an element you need to run its constructor, cloning would need to do that too [09:32:27.0000] not sure about clone-for-printing [09:32:32.0000] that is rather odd case [09:32:42.0000] bz likes to bring it up [09:32:52.0000] but same goes for text selection and then copying things [09:32:56.0000] it just needs some state which can be printed [09:33:10.0000] sure [09:33:32.0000] selection is perhaps more valid case, and just plain normal cloneNode() [09:34:20.0000] cloneNode() invoking some JavaScript seems harmless [09:34:45.0000] the parser invoking JavaScript is potentially problematic, since non- points are not vetted [09:35:12.0000] and then there's various algorithms in browsers that want to clone elements, such as printing and editing, that might not anticipate the world to change [09:36:52.0000] cloneNode(true): when should the ctors run? [09:42:36.0000] smaug____: prolly in tree order [09:43:01.0000] philipj: richt: davve: is the plan to support Web Audio without