02:53
<tibberio>
hi
03:13
<Lachy_>
hi tibberio
03:42
<tibberio>
hi Lachy_, I'm asleep, night
12:42
<Lachy>
I implemented the text/html content sniffing algorithm in JavaScript http://html5.lachy.id.au/content-sniffing/
12:42
<Lachy>
also checked it into google code
12:44
<virtuelv_>
Lachy: should the [invalid] sequence '<??>' really be text/html?
12:45
<Lachy>
that's what the algorithm says
12:45
<Lachy>
in the spec
12:45
<Lachy>
I wondered about that too, but I figured it would be better to implement exactly what the spec says and then provide feedback about it
12:46
<Lachy>
wait, why wouldn't <??> be text/html?
12:47
<Lachy>
if anything, it should always be text/html, since it's not well formed XML and thus can't be a feed
12:47
<Lachy>
i.e. <??><feed> probably shouldn't be Atom
13:05
<zcorpan>
Lachy: that's a good environment to run testcases
13:05
<zcorpan>
for browsers
13:05
<Lachy>
yep
13:06
<Lachy>
it would probably be a good idea to integrate it into the live dom viewer later
13:06
<zcorpan>
similar to http://html5.org/parsing-tests/testrunner.htm and http://simon.html5.org/test/html/serializing/001.htm
13:07
<zcorpan>
though you could use json as the format for the tests
13:08
<Lachy>
right, that shouldn't be too hard to do
13:08
<zcorpan>
though i wonder if you have to have a server involved to actually test what browsers do
13:09
<zcorpan>
i.e. the relevant sniffing only occurs for resources served over the wire
13:09
<Lachy>
yeah, but that's not too hard to do
13:09
<zcorpan>
true
13:10
<Lachy>
I tried a few simple test cases with data: URIs and Firefox didn't sniff them
13:10
<zcorpan>
right, data: are never sniffed
13:10
<zcorpan>
afaik
13:11
<Lachy>
so we'd probably need to load from the server into an iframe or something
13:11
<zcorpan>
exactly
13:11
<zcorpan>
slightly annoying but certainly doable :)
13:12
<Lachy>
I think I have a PHP script somewhere that will echo whatever data you pass, using whatever MIME specified,
13:12
<zcorpan>
we could perhaps also use Philip`'s appoach with creating tests
13:13
<zcorpan>
hmm
13:13
<zcorpan>
might be better to just find all the edge cases
13:18
<Philip`>
http://canvex.lazyilluminati.com/misc/dom-viewer/reflect.cgi?%3Cscript%3Ealert('Hello%20world')%3C/script%3E echoes stuff but it's probably not so useful since it always does text/html
13:19
<Philip`>
(There's a reflect-xhtml.cgi for XHTML)
13:19
<Lachy>
I've got one that does the same thing, though I'm going to make it check for a content-type parameter in the query string and use that
13:21
<Philip`>
http://canvex.lazyilluminati.com/misc/dom-viewer/reflect.c - I don't really fancy modifying that to actually parse the query string at all, so it's probably more sensible to use PHP :-)
13:21
<Lachy>
the only problem with something like that is that it creates a huge security risk
13:21
<virtuelv_>
Lachy: the spec doesn't define text/plain when it lacks angle brackets?
13:21
<Lachy>
virtuelv, no, why would it?
13:22
virtuelv_
goes back and reads the proposal again
13:22
<Lachy>
virtuelv_, it's the algorithm that sniffs content delivered as text/html to see if it's a feed. If it's not a known feed format, it's text/html
13:22
<Lachy>
seel http://www.whatwg.org/specs/web-apps/current-work/multipage/section-content-type-sniffing.html#content-type3
13:38
<Lachy>
Philip`, zcorpan, http://html5.lachy.id.au/output
13:41
<zcorpan>
Lachy: you need to do stipslashes()
13:42
<Lachy>
oh crap, that should be off by default on my server.
13:43
<Lachy>
hmm. I'll have to add stripslashes for now, since I can't remember how to do it in .htaccess or php.ini or whatever it is
13:43
<zcorpan>
i can't get "<rss>" to be echoed
13:44
<zcorpan>
in firefox
13:45
<zcorpan>
and safari
13:46
<zcorpan>
no wait it works in safari
13:47
<zcorpan>
Lachy: you also need an id on the <datalist> :)
13:47
<Lachy>
oops :-)
13:51
<Lachy>
where can I find an Atom test file?
13:52
<zcorpan>
in the rfc :)
13:52
<Lachy>
never mind, found one
13:53
<zcorpan>
hmm, ie doesn't add attributes to the root node from misplaced <html> tags
13:53
<Lachy>
it appears that Firefox will only sniff as the result of a GET request, not a POST
13:56
<Lachy>
Firefox needs to see the Atom xmlns and there needs to be at least a title and link element in it for it to be sniffed as a feed.
13:56
<Lachy>
http://html5.lachy.id.au/output?type=text%2Fhtml&data=%3Cfeed+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2005%2FAtom%22%3E%0D%0A++%3Ctitle%3EExample+Feed%3C%2Ftitle%3E%0D%0A++%3Clink+href%3D%22http%3A%2F%2Fexample.org%2F%22%2F%3E%0D%0A%3C%2Ffeed%3E%0D%0A
13:58
<zcorpan>
doesn't opera sniff for feeds?
13:58
<Lachy>
it doesn't appear to
13:58
<Lachy>
maybe it needs more content in it
13:59
<Lachy>
nope, it doesn't (at least not for Atom)
14:00
<zcorpan>
not for rss 2.0 either
14:01
<Lachy>
hmm. How do I turn off AddDefaultCharset for just that one file?
14:02
<Lachy>
I've tried putting it in a <Files> directive, but it doesn't seem to to work
14:03
<zcorpan>
AddDefaultCharset Off in the same folder should work (for all files in that folder)
14:03
<Lachy>
yeah, but it's in the root directory, so I don't want it to do that
14:04
<zcorpan>
dunno
14:04
<zcorpan>
perhaps opera only does sniffing for following <link>s
14:05
<Lachy>
oh well, I'll just turn it off for everything now and fix it later
14:06
<Lachy>
maybe, try it
14:06
<zcorpan>
but it's a php file, and AddDefaultCharset doesn't apply to php
14:06
<zcorpan>
php sends its own headers
14:07
<Lachy>
http://html5.lachy.id.au/output?type=text%2Fhtml&data=%3Clink+rel%3D%22alternate%22+type%3D%22application%2Fatom%2Bxml%22+href%3D%22http%3A%2F%2Fhtml5.lachy.id.au%2Foutput%3Ftype%3Dtext%252Fhtml%26data%3D%253Cfeed%2Bxmlns%253D%2522http%253A%252F%252Fwww.w3.org%252F2005%252FAtom%2522%253E%250D%250A%2B%2B%253Ctitle%253EExample%2BFeed%253C%252Ftitle%253E%250D%250A%2B%2B%253Clink%2Bhref%253D%2522http%
14:07
<Lachy>
253A%252F%252Fexample.org%252F%2522%252F%253E%250D%250A%253C%252Ffeed%253E%250D%250A%22%3E%0D%0A%3Cp%3ETest
14:07
<Lachy>
AddDefaultCharset applies based on the MIME type I think
14:08
<Lachy>
so all text/* responses get ; charset=...
14:08
<zcorpan>
yeah but php will still send its own headers
14:08
<zcorpan>
php overrides apache
14:09
<Lachy>
indeed, but it's not. I'm using headers("Content-Type: $type"); in the php, so it should send exactly what's in the text box, but it doesn't
14:09
<zcorpan>
it does afaict
14:10
<Lachy>
yeah, it does now, cause I turned off AddDefaultCharset already
14:10
<Lachy>
but if I turn it on again, it won't
14:11
<zcorpan>
can you turn it on again, please?
14:12
<Lachy>
done
14:12
<zcorpan>
oh, indeed. that's not how my server behaves though
14:13
<zcorpan>
perhaps a different version of php or different settings
14:13
<Lachy>
which version of Apache does your server run?
14:13
<zcorpan>
1.3 iirc
14:13
<Lachy>
I'm using PHP 5, Apache 1.3 I think
14:13
<zcorpan>
php 4
14:13
<zcorpan>
ok, so then php 5 pays attention to apache settings
14:13
<Lachy>
I'll try it with PHP4...
14:15
<zcorpan>
hmm, perhaps i was wrong
14:16
<Lachy>
nope, still does it
14:16
<Lachy>
I've turn default charset off again
14:30
<Lachy>
zcorpan, for the HTML status updating, I think it would be easiest if we just use HTTP basic authentication and using a .htpasswd file, which grants access to the confirmation script for Hixie (or whoever else is authorised)
14:32
<zcorpan>
Lachy: ok
14:33
<Lachy>
we just need to write the script that commits the changes to the DB, and then make a few minor changes to the existing update script and we're done
14:53
<zcorpan>
Lachy: great
14:56
<gsnedders>
Lachy: it's all the magic_quotes settings
14:56
<Lachy>
gsnedders, thanks, I do have the instructions for it written down somewhere. I just have to find them and set it up
14:57
<gsnedders>
http://uk2.php.net/magic_quotes
14:57
<gsnedders>
(a "feature" that's gone in PHP6)
14:58
<hsivonen>
interpreter/compiler-level settings that change programming language semantics suck big time
14:59
<Lachy>
yeah, PHP already sucks and fixing PHP by turning off silly "features" just needs to be done
15:03
<gsnedders>
according to the PHP devs, <span title="this > that"> is invalid HTML.
15:04
<gsnedders>
the only way I could get them to fix the bug in strip_tags() which claims to only work with valid HTML anyway was to quote both HTML5, HTML 4.01, and SGML.
15:06
<Lachy>
PHP devs often don't know HTML very well at all
15:06
<Lachy>
try to get them to fix the ampersand bug, for instance!
15:07
<Lachy>
the one where they generate and output "...&PHPSESSID=..." instead of using &amp;
15:08
<Dashiva>
Or just get them to handle multiple selects/checkboxes without hacking the names
15:09
<Lachy>
yeah, that too
15:09
<Dashiva>
Although that's not html-specific, they mangle it the same way with parsing ini files
15:09
<gsnedders>
Lachy: oh, that's a config option. duh :P
15:10
<Lachy>
gsnedders, I know, but it should be default!
15:10
<gsnedders>
but backwards compatibility!11!!!!elevnty!
15:10
<Lachy>
they should have fixed it for PHP5, which isn't backwards compatible anyway
15:10
<Lachy>
or even PHP6
15:10
<gsnedders>
yes, they're backwards compatible!11!!1!
15:10
<gsnedders>
It's stupid.
15:11
<gsnedders>
They refuse to fix things in the name of BC, yet totally break it anyway.
15:11
<Lachy>
yeah, I know. I should just learn python and how to get it running on my server
15:13
<gsnedders>
yeah, I've been meaning to learn python too.
15:14
<gsnedders>
far more general use, too
15:23
<Philip`>
Python's going to break backward compatibility too, but at least they're intending to fix lots of small mistakes at the same time, which seems good as long as you only do it once a decade
15:40
<Lachy>
woo hoo! My first python script running on my server :-) http://lachy.id.au/temp/test