04:03 | <_1_tima> | I am here: http://maps.google.com/maps?q=26.891408333333334,80.93088833333333 |
07:22 | <annevk> | jgraham: what's an easy way to generate an image with wptserve? |
07:23 | <annevk> | jgraham: I want to control the headers and have something that resembles a valid image in the response |
07:23 | <annevk> | jgraham: do we have a pattern for that? |
07:23 | <Ms2ger> | A .headers file? |
08:02 | <Ms2ger> | Lovely, now people are coming into #servo wanting to implement css-egg |
08:18 | <annevk> | Ms2ger: is the magic of .headers defined somewhere? |
08:20 | <Ms2ger> | http://wptserve.readthedocs.org/en/latest/handlers.html#file-handlers |
09:36 | <jgraham> | annevk: Yeah, what Ms2ger said as long as you are happy to serve a static image |
09:37 | <jgraham> | If you really mean "generate an image" you will need to write some python code |
09:39 | <annevk> | jgraham: yeah so the problem is that I don't want static headers |
09:39 | <jgraham> | What do you want them to depend on? |
09:40 | <annevk> | jgraham: some GET parameters |
09:40 | <jgraham> | Then you need some python code |
09:40 | <jgraham> | def main(request, response): |
09:40 | <jgraham> | headers = [] |
09:40 | <jgraham> | body = open("/path/to/image").read() |
09:41 | <jgraham> | if "type" in request.GET: |
09:41 | <jgraham> | headers.append(("Content-Type", request.GET["type"])) |
09:41 | <annevk> | thanks, reading the image in seems reasonable |
09:41 | <jgraham> | return headers, body |
09:50 | <annevk> | jgraham: what's the current path for these Python scripts? |
09:51 | <jgraham> | annevk: I was just thinking that I'm not sure :) |
09:52 | <jgraham> | annevk: __file__ as a global variable should exist and be the absolute path to the the script, so you can use that to resolve paths without caring about the pwd |
09:54 | <annevk> | jgraham: can I assume os.path.relpath is supported? |
09:54 | <annevk> | jgraham: so e.g. os.path.relpath("image.gif", __file__) ? |
09:55 | <jgraham> | Well that wouldn't do what you want |
09:55 | <jgraham> | I would |
09:55 | <jgraham> | import os |
09:55 | <jgraham> | os.path.join(os.path.dirname(__file__), "image.gif") |
09:57 | <annevk> | thanks |
10:05 | <annevk> | So this is fun. IE11 successfully loads both image/png and image/gif, but only successfully decodes the latter... |
10:06 | <annevk> | I sort of thought both should work |
10:17 | <philipj> | caitp, zcorpan, yes, I added the [LenientThis] FIXME (we have now switched to TODO(name)) |
10:18 | <Ms2ger> | I never saw the point of (name) |
10:27 | <annevk> | jgraham: we don't have global image/video/audio resources that would be good to reuse? |
10:27 | <annevk> | I guess video/audio is hard given that browsers suck at having one format that works everywhere |
10:27 | <jgraham> | annevk: There are some… try /common or /media (off the top of my head) |
10:29 | <annevk> | ah yeah /media and /images |
10:29 | <annevk> | jgraham: my tentative location has been http/nosniff |
10:29 | <annevk> | jgraham: though I'm also considering fetch/nosniff since I might write this down as a subsection of Fetch |
10:30 | <jgraham> | annevk: Yeah, I don't have a strong opinion about where, and we can always move things later |
10:32 | <Ms2ger> | I'm leaning towards fetch, but either way |
12:36 | <annevk> | Where can I find out whether WebVTT is sniffed or not? |
12:51 | <annevk> | jgraham: I have more questions |
12:51 | <annevk> | jgraham: if I append a <script> as part of an asynchronous test |
12:51 | <annevk> | jgraham: how do I assert things from there? |
12:51 | <annevk> | jgraham: also currently I have this rather inelegant code: |
12:51 | <annevk> | script.onerror = t.step_func_done(function() { assert_true(true) }) |
12:52 | <annevk> | script.onload = t.step_func_done(function() { assert_true(false) }) |
12:52 | <annevk> | is there something better for that? |
12:54 | <jgraham> | annevk: Listening to clytn talk about hosting events at the moment, I might not be able to give a coherent answer :) |
12:55 | <jgraham> | annevk: If you only have one test in a file, you don't need the async_test() stuff at all, you can just use raw asserts() |
12:55 | <annevk> | jgraham: I have a couple |
12:55 | <jgraham> | If you just want to test the things you said above, there are easier ways |
12:56 | <jgraham> | script.onerror = t.step_func_done(function(){}) |
12:56 | <jgraham> | script.onload=t.unreached_func("Should not get a load event") |
12:56 | <annevk> | jgraham: I want to create a sequence of script elements and for each script element assert its events (either positive or negative) and let them execute something that is also an assert |
12:57 | <jgraham> | annevk: That doesn't seem too hard; what's the problem? |
12:58 | <jgraham> | I mean if you insert a script you can just call t.step_func or whatever from that script |
12:58 | <annevk> | jgraham: I'm not sure how to tie what the script executes with the async_test |
12:58 | <annevk> | jgraham: doesn't that require t to be a global? |
12:59 | <zcorpan> | jgraham: Ms2ger: help. my brain stopped working trying to figure this out from the spec. what should happen for onclick = 1; alert(onclick); onclick = {}; alert(onclick) ? |
13:00 | <Ms2ger> | I knew this once |
13:00 | <Ms2ger> | It's TreatNonObjectAsNull, no? |
13:00 | <zcorpan> | ah. yes it is |
13:00 | <Ms2ger> | So alert(null), alert({}) |
13:01 | <zcorpan> | i totally missed the extended attribute |
13:01 | <zcorpan> | thx |
13:01 | <Ms2ger> | Np |
13:01 | <jgraham> | annevk: Well yeah it requires it to be global. If it's not you would have to pass it in somehow. Not sure how else it coulf work? |
13:01 | <darobin> | globals in tests aren't particularly frowned upon |
13:02 | <darobin> | you don't expect to be able to run a bunch of them in the same context |
13:02 | <darobin> | that would lead to a lot of weirdness |
13:03 | darobin | wonders if we could try that then drink a last beer as we watch the world 'splode |
13:07 | <annevk> | jgraham: that also seems racy, would need a unique global per script... |
13:09 | <jgraham> | annevk: I don't understand what you're trying to do here |
13:10 | <jgraham> | If you want a test to contain some asserts in script A and some in inserted script B then you need some way to reference that test from B |
13:10 | <jgraham> | Making the test a global seems like the easiest way to do that |
13:11 | <jgraham> | But please give me an example to look at |
13:11 | <annevk> | I'm creating the scripts asynchronously |
13:12 | <jgraham> | Right, but as long as the test can't end before the script has run, what's the problem? |
13:14 | <annevk> | There's not necessarily a problem, it's just that I can't use a single variable |
13:21 | <annevk> | Although actually, a problem might be that I don't know when all scripts will have executed... |
13:21 | <jgraham> | Do you need to know that? |
13:22 | <annevk> | jgraham: not sure where else to run .done() |
13:22 | <jgraham> | One test, multiple scripts? |
13:23 | <annevk> | jgraham: the script may or may not execute |
13:24 | <jgraham> | Depending on what? |
13:24 | <annevk> | nosniff |
13:24 | <jgraham> | So one way is a pass and the other is a fail? |
13:25 | <annevk> | I can load a script in a execute or non-execute way. If I load it in an execute way I want to see that it actually executed and that load is dispatched. If I load it in a non-execute way I want to make sure it did not actually execute and that error is dispatched. |
13:25 | <jgraham> | If you expect the script to not execute and not executing is the pass condition there's pretty much no choice but to use a timer to say "if it didn't execute in X time, it's a PASS" |
13:25 | <zcorpan> | Ms2ger: shouldn't html/dom/interfaces.html have Blob defined somewhere? |
13:56 | <wanderview> | annevk: Request.clone() is not an adequate sanitize step, right? we need to use the constructor to sanitize I think |
13:57 | <annevk> | wanderview: correct |
13:57 | <annevk> | wanderview: clone() just creates a clone |
13:57 | <wanderview> | thanks |
13:57 | <wanderview> | yea |
13:58 | <wanderview> | annevk: the cache sanitize language uses a mix of clone and constructor right now |
13:58 | <annevk> | wanderview: interesting |
13:59 | <annevk> | wanderview: cloning seems bad per definition |
13:59 | <annevk> | wanderview: e.g. the stream just needs to be moved, not tee'd |
13:59 | <wanderview> | probably worried about draining the body... but Requests with bodies cannot be put into cache any more (because we only accept GET) |
13:59 | <annevk> | wanderview: also, I thought that if you did put them in, the body should be drained... |
14:00 | <wanderview> | annevk: I think clone is being used for places we don't want to drain... like cache.match() |
14:00 | <annevk> | wanderview: shouldn't match just read out the variables? |
14:00 | <annevk> | wanderview: why would that even clone? |
14:00 | <wanderview> | annevk: should .match() need a sanitize step? |
14:00 | <annevk> | wanderview: I don't really see why |
14:00 | <wanderview> | annevk: or do you only want to sanitize on putting in? |
14:01 | <annevk> | wanderview: I want sanitize when fetching |
14:01 | <wanderview> | annevk: so just .add() and .addAll()? |
14:01 | <annevk> | wanderview: ehsan convinced me that putting it in should just put it in |
14:01 | <wanderview> | ok |
14:01 | <annevk> | At some point I'll have free time to move Cache into Fetch and make it all nice and consistent... |
14:04 | <Ms2ger> | zcorpan, I don't think it's strictly necessary |
14:04 | <zcorpan> | Ms2ger: ok |
14:06 | <zcorpan> | annevk: shouldn't we make fetches in general be reliable wrt cookies though? |
14:06 | <wanderview> | annevk: you want Cache in Fetch just because of the dependency? |
14:07 | <annevk> | wanderview: the other bit of rationale was that Cache is bigger than SW |
14:07 | <wanderview> | annevk: I guess I'm wondering if Cache should just be its own spec at this point |
14:07 | <annevk> | wanderview: different idea I had was to create storage.spec.whatwg.org and put it there along with new storage features |
14:09 | <annevk> | zcorpan: are implementers interested? |
14:09 | <zcorpan> | annevk: don't know |
14:09 | <wanderview> | annevk: not sure I have enough experience with spec stuff to really say which would be better... the OCD person inside me says Cache should be its own spec and depend on Fetch and storage specs |
14:12 | <annevk> | wanderview: yeah, if setting up a spec had no costs that might be "better" |
14:13 | <annevk> | zcorpan: that would be my main worry if we wanted to architect something a bit more predictable |
14:16 | <Domenic> | annevk: what "new storage features"? |
14:17 | <annevk> | Domenic: see whatwg⊙wo and e.g. https://wiki.whatwg.org/wiki/Storage |
14:17 | <Domenic> | ah, that one |
14:17 | <annevk> | It's time to define the storage architecture... |
14:18 | <annevk> | And expose some of its primitives yadayada |
15:00 | <zcorpan> | opinions, people who care about readonly attributes on window? https://www.w3.org/Bugs/Public/show_bug.cgi?id=24160 (cssom-view) |
15:04 | <caitp> | don't readonly attributes on window run the risk of breaking old sloppy mode JS? |
15:05 | <zcorpan> | caitp: in strict mode you get TypeError. non-strict is like no-op setter |
15:05 | <caitp> | yeah, but if people expect the setter to not be no-op, then it's a problem :x |
15:06 | <zcorpan> | yes |
15:06 | <zcorpan> | [Replaceable] solves that |
15:11 | <caitp> | the hacks people come up with to make sense of this platform:> |
15:14 | <zcorpan> | there is no sense :-) |
15:17 | <jgraham> | Like nonsense? |
15:26 | <wanderview> | annevk: looking at https://wiki.whatwg.org/wiki/Storage... why put StorageManager on Navigator? |
15:26 | <wanderview> | how does a Worker access it? (I thought navigator was window only) |
15:27 | <annevk> | wanderview: workers have navigator |
15:27 | <wanderview> | oh, ok |
15:29 | <wanderview> | annevk: I like that API for v1... I imagine some people will want finer grained estimates, but doing the whole origin/storage area seems a good start |
15:30 | <annevk> | yeah, if we can get the UX/UI sorted I'm pretty happy with this too |
15:58 | <JakeA> | Domenic: annevk: thoughts on cancellable promises vs cancellable tokens https://gist.github.com/jakearchibald/9a24f3c06f06b9c06a1e |
17:20 | <annevk> | JakeA: that issue... also, we should probably start using "cancelable" (see color and other American spelled terms) |
17:20 | <annevk> | JakeA: will try to review tomorrow |
17:31 | <annevk> | jgraham: https://github.com/w3c/web-platform-tests/pull/1715#commitcomment-10548986 given that, it's reviewed, right? |
17:31 | <annevk> | jgraham: also, did critic disappear? |
17:51 | <Domenic> | annevk: JakeA: yeah, like Event.prototype.cancelable |
18:09 | <Domenic> | JakeA: left comments |
18:11 | <JakeA> | Domenic: annevk: ah, sorry, didn't realise the UK thing |
18:12 | <Domenic> | It's OK, I didn't actually know which was American vs. UK, I just sometimes spell it one way and sometimes another. |
18:12 | <Domenic> | That's one argument in favor of abort, but then again I'm not looking forward to the html5rocks article on promise abortions |
18:12 | <boogyman> | finally{}. is not an "oncancelled", it is "always execute when complete" workflow, unless i am mistaken @ Domenic |
18:13 | <Domenic> | boogyman: yes, exactly, that was my point. |
18:34 | <benjamingr> | lol, promise abortions sounds like something that'd spur public debate in the us |
18:34 | <benjamingr> | Promise cancellation really confuses me :D |
18:58 | <JakeA> | Promises are way more complicated than they look, but you can get most stuff done knowing 90%. I think cancellable promises will be the same |
19:00 | <JakeA> | Although most of the people I meet who make a living from JS don't know how to create one object that extends another |
19:00 | <JakeA> | That's why I like the class syntax sugar |
19:02 | <Ms2ger> | Damn object-orientation |
19:32 | <jgraham> | annevk: Yes. Critic may have got a bit behind which can happen sometimes. |
19:35 | <bradleymeck> | sweet delicious finally |
19:36 | <bradleymeck> | so many memory leaks when you aren't sure if something is done, guarantees are nice. I am still sad that generators don't have a way to invoke finally if they go into the GC |
19:38 | <annevk> | jgraham: anyway, I got review on GitHub so can I merge or someone else? |
19:39 | <annevk> | jgraham: never mind, Mike already did it :-) |