01:57
<Hixie>
man, why is utf-8 so hard for libraries to get right
10:13
<annevk>
I thinks this API for events is the way to go: https://gist.github.com/4463430
10:13
<annevk>
with the second and third argument reversed
10:13
<annevk>
and for now just make everything bubble and ignore capture altogether
10:24
<jgraham>
Is matchesSelector suppoed to be a built-in function on window, or something that a user could do in js?
10:24
<Ms2ger>
Builtin on Element, no?
10:25
<jgraham>
No, the one in the proposal is different
10:43
<hsivonen>
gsnedders: I put the <main> tests in a separate file and checked with jgraham and annevk first
10:43
<annevk>
jgraham: you would do it in JS
10:44
<annevk>
jgraham: as in the proposal
10:45
<jgraham>
annevk: Well it was marked as "syntactic sugar" so I thought you were proposing a built-in equavalent to the following JS
10:45
<jgraham>
Since sugar is usually something that you don't have to implement yourself
10:46
<jgraham>
hsivonen: I think what you did was fine fwiw
10:47
<annevk>
jgraham: ah yeah
10:47
<annevk>
jgraham: I think for Element.on we could overload and let the third argument be a string which would be interpreted as that sugar
10:47
<odinho>
Getting back a stop() function is a bit strange though?
10:47
<annevk>
odinho: why?
10:47
<odinho>
No, I just haven't seen it. s/strange/unfamiliar/
10:48
<annevk>
I quite like it, seems much more lightweight than returning an object with a method
10:48
<odinho>
More used to getting back object I can do moar stuff on.
10:48
<darobin>
well, it can also be an object :)
10:48
<odinho>
And if we'd even want to do something else with the registered listener than stopping it?
10:50
<odinho>
Though I guess the jqueryists would actually expect on to return eventTarget itself, so you could chain.
10:51
<Ms2ger>
Boo
10:51
<odinho>
It'd be nice not having to write addEventListener all the time.
10:51
<annevk>
I want to return a function/object as the other pattern of unregistering sucks
10:52
<odinho>
annevk: True dat.
10:52
<odinho>
(I'm very for the .on it no matter how it's done)
10:52
<annevk>
Yeah, I don't want to make addEventListener more complicated
10:53
<annevk>
The only other thing I thought of was making the methods exclusive but I think that's too much inconvenience
10:54
<darobin>
note that you could return an object and allow for chaining
10:55
<darobin>
all it takes would be for the returned object to also support .on() and know what event target to send it to (which it ought to)
10:55
<darobin>
of course, I'm not saying that's necessarily a good idea :)
10:57
<annevk>
I thought it was just element.matches() these days btw?
10:57
<annevk>
darobin: sounds like a bit too much magic
11:00
<darobin>
annevk: what bothers me more than the magic is that it actually only chains .on()
11:00
<darobin>
whereas in chaining I'd expect to be able to call whatever is callable on the original event target
11:00
<darobin>
$el.on(...).css(...).appendTo(...) etc.
11:01
<Ms2ger>
Eww
11:04
<annevk>
My new hobby: finding useful return values that break chaining
11:04
<jgraham>
Isn't that the normal case?
11:05
<jgraham>
I mean typically you expect a function (or method) to return a value
11:05
<jgraham>
Returning the object that you first thought of is a rather strange idea
11:11
<annevk>
It was a joke :)
11:15
<annevk>
Minutes are so bad... http://www.w3.org/2012/05/02-webapps-minutes.html#item04 "[ Bike shedding about name ]"
11:15
<annevk>
Pretty sure we actually made a decision there
11:19
<hsivonen>
btw, has anyone tested if IE10 has an “IE9 XML” mode in addition to an “IE10 XML” mode?
11:19
<hsivonen>
I guess that’s something I need to test
11:20
<hsivonen>
Also: Modes in mobile edition of IE9 and IE10
11:21
<hsivonen>
hmm. Google Maps for desktop renders in the IE10 Standard mode, so they don’t even have the excuse of that mode not existing on mobile
11:23
<annevk>
http://programmingisterrible.com/post/39812339693/are-16-bits-providing-at-most-65-536-distinct beautiful
11:24
<hsivonen>
hah
11:24
<darobin>
beautiful
11:24
darobin
u2665 chaining
11:31
<annevk>
also from that blog I learned about https://www.facebook.com/notes/facebook-engineering/xhp-a-new-way-to-write-php/294003943919
11:49
<darobin>
"The correct solution is to pass this input through htmlspecialchars() before displaying it to the user."
11:49
<darobin>
dude, the correct solution is to not use PHP in the first place
12:01
<annevk>
http://programmingisterrible.com/post/39590933826/the-ghost-of-http
12:01
<annevk>
this blog is getting better and better
12:02
<annevk>
darobin: doesn't matter, every language has the same problem whenever you string concat HTML
12:02
<darobin>
annevk: it does matter
12:02
<darobin>
if you build a templating language specifically for the web and you don't make it so that it escapes HTML by default, don't be surprised that there are so many exploits later
12:03
<annevk>
fair enough I suppose, but I don't really see PHP as a templating language, it's just another language
12:13
<hsivonen>
annevk: points to the blogger for including Atom on the list of failures. We should have publishes an RSS5 instead.
12:47
<odinho>
Hmm. HTML6 is XML. Sneaky. Not even backwards compat afics. http://html6spec.com/
12:49
<odinho>
( http://lists.w3.org/Archives/Public/public-html/2013Jan/0016.html )
12:52
<hsivonen>
sigh. constant vigilance needed. I thought we agreed not to do stuff like http://html5.org/tools/web-apps-tracker?from=7621&to=7622 back in 2006 after burying the “significant inline content” concept
12:55
<MikeSmith>
hsivonen: Hixie seems to be saying he intended it that way all along, for the title element at least
12:56
<hsivonen>
I wonder if he pinged glazou first
12:57
<MikeSmith>
I don't think he pinged anybody
12:58
<MikeSmith>
I think he made that change as a result of a recent IRC discussion
12:58
<MikeSmith>
I'll try to find a pointer to the logs
13:19
<MikeSmith>
hsivonen: http://logbot.glob.com.au/?c=freenode%23whatwg&s=20+Dec+2012&e=21+Dec+2012#c756715 and http://logbot.glob.com.au/?c=freenode%23whatwg&s=21+Dec+2012&e=22+Dec+2012#c757484
13:25
<hsivonen>
MikeSmith: thanks
13:27
<hsivonen>
I think I will end up sending email to the list :-(
13:29
<hsivonen>
do we have a wiki page that explains why conneg is bad and you should not try to solve things by saying “I know! Let’s use conneg!”S
13:29
<hsivonen>
s/S/?/
13:31
<annevk>
slightlyoff: not sure if you're on IRC, but the Event class I pointed to is the same as the DOM has plus WebKit proprietary extensions
13:31
<annevk>
slightlyoff: not actually changed for Dart
13:32
<annevk>
hsivonen: someone from Google is pushing it again: http://www.igvita.com/2012/12/18/deploying-new-image-formats-on-the-web/
13:32
<annevk>
hsivonen: 386'ing conneg is not for me
13:32
<hsivonen>
boo. Dart’s “cleaned up” DOM still has live child collections
13:33
<hsivonen>
firstChild/nextSibling FTW
13:33
<annevk>
Part of it is "cleaned up", lots of it seems a straight copy of the existing classes/interfaces
13:34
<annevk>
oh, Eric Lawrence points out some problems with conneg in the comments
13:37
<jgraham>
Dart hasn't died yet? How sad
13:38
<annevk>
It's not like Google's bleeding money over it
13:39
<jgraham>
Well no, but it is keeping bright people from working on better things
13:43
<hsivonen>
I ended up writing a short one-off comment about Accept: https://bugzilla.mozilla.org/show_bug.cgi?id=240493#c89
13:44
<annevk>
does webarch say anything about conneg?
13:45
<annevk>
it does
14:45
<annevk>
https://gist.github.com/4475457
14:45
<annevk>
That includes all the syntax sugar libraries have...
14:46
<annevk>
heycam|away: are you there? I wonder if the above overloading thingie actually works... Maybe Ms2ger knows?
14:46
<Ms2ger>
dictionary<EventCallback>?
14:47
<annevk>
{click: callback1, resize: callback2}
14:48
<Ms2ger>
Hrm
14:48
<Ms2ger>
A dictionary with an open-ended set of keys?
14:48
<Ms2ger>
Because that doesn't exist
14:48
<annevk>
Yes, with string keys and values of type between < and >
14:49
<annevk>
Ms2ger: well there's a bug for that
14:49
<darobin>
Ms2ger: that doesn't exist but there's a bug for it
14:49
<Ms2ger>
Oh?
14:49
<Ms2ger>
Has someone specced iteration order?
14:50
<annevk>
Ms2ger: https://mail.mozilla.org/pipermail/es-discuss/2013-January/027842.html
14:50
<annevk>
Ms2ger: anything else? :)
14:51
<Ms2ger>
But most likely, those wouldn't be distinguishable, no
14:57
<zewt>
annevk: don't know what the point of the weird dictionary thing is; not sure what "EventFilter" is but if it's the "filter based on keys for keypress" or whatever, like I said before that seems like a complex optimization for something having no need of optimization
14:57
<annevk>
zewt: it's so you can implement your own delegation
14:58
<annevk>
zewt: e.g. based on a selector, or something else
14:58
<zewt>
you can already do it manually now within the function if you want to do it yourself
14:59
<annevk>
sure but that's less reusable
15:00
<zewt>
if(!event.target.matchesSelector("whatever")) return;
15:02
<zewt>
also, an options dictionary seems natural, instead of an infrequently-used optional parameter
15:03
<hsivonen>
OK. I started the wiki page: http://wiki.whatwg.org/wiki/Why_not_conneg
15:03
<annevk>
hsivonen: heh
15:04
<annevk>
zewt: I believe it's quite frequently used actually
15:04
<zewt>
not to channel a hixie, but are there use cases for making up your own filters other than selectors? in my experience selectors are a pretty good fit
15:06
<zewt>
elem.addEventListener("click", this.onClick, { filter: ".button" }); seems nice and clean and clear to me
15:06
<darobin>
to back up zewt's point, is there a library that filters on something other than selectors?
15:08
<zewt>
can always start with string selectors, and make it a (DOMString or EventFilter) later if wanted
15:08
<annevk>
well selectors don't make sense for non-RootNode nodes
15:09
<zewt>
what's a RootNode?
15:09
<annevk>
see DOM
15:09
<zewt>
if that means "document" then that's wrong
15:09
<annevk>
why? if you register on a document you want to filter on its elemetn descendants, same for documentfragment
15:10
<zewt>
if you register on an element you want to filter on its descendants too, why wouldn't that make sense? that's how it's used
15:10
<darobin>
yeah, that's how it's used
15:10
<annevk>
sure, RootNode includes Element
15:10
<annevk>
again, see DOM
15:11
<zewt>
then that's not what I said :P and that's a pretty broken name
15:11
<zewt>
gotta head to work, later
15:11
<annevk>
well it means Document
15:11
<annevk>
just as much as it means Element
15:11
<annevk>
and DocumentFragment
15:12
<annevk>
those can all be roots
15:12
<zewt>
it doesn't mean the root node of a document, which is what it sounds like--it doesn't make sense for every node in a tree to be called a "root node", heh
15:12
<darobin>
yeah it's not the best name ever
15:12
<annevk>
it can be renamed if you have a suggestion
15:12
<darobin>
TreeNode?
15:12
<annevk>
it doesn't really matter
15:12
<zewt>
but anyway selectors inside a document are the overwhelming majority of use cases, makes sense to me to optimize for that
15:12
<annevk>
Comment is a TreeNode too
15:12
<darobin>
not really, no, but it's very confusing
15:13
<annevk>
zewt: the proposal optimizes for that
15:13
<zewt>
but afk work for real
15:13
<darobin>
comments have children?
15:14
<annevk>
a comment is part of a Tree
15:14
<darobin>
sure, everything is :)
15:14
<darobin>
BranchNode
15:14
<darobin>
?
15:14
<annevk>
right, that's why it's super confusing
15:14
<darobin>
NonLeafNode?
15:14
<darobin>
TrunkNode
15:14
<Ms2ger>
BlahNode
15:15
<darobin>
ContainerNode
15:15
<annevk>
ah
15:15
<darobin>
yeah, what Ms2ger said
15:15
<darobin>
anything that doesn't imply it's a root when it's not :)
15:15
<annevk>
Wikipedia suggests InternalNode and ExternalNode
15:15
<Ms2ger>
darobin, heya
15:15
<Ms2ger>
Feel like reviewing some tests? :)
15:15
<annevk>
http://en.wikipedia.org/wiki/Tree_(data_structure)#Terminology
15:15
<darobin>
Ms2ger: I will
15:15
<annevk>
oh but that doesn't work
15:15
<darobin>
annevk: don't use wikipedia for that, you'll get some computer science terminology out of it
15:16
<annevk>
yeah and it'd be wrong anyway
15:17
<annevk>
it should indicate it has the potential to have child nodes
15:17
<darobin>
MotherNode
15:17
<annevk>
uhuh
15:17
<darobin>
ParentNode
15:17
<annevk>
I guess that could work
15:17
<annevk>
the other one is named ChildNode at the moment
15:17
<annevk>
and element is in both
15:18
darobin
likes MotherNode better, but hey :)
15:18
<darobin>
"I found it and it's the MotherNode!"
15:19
<annevk>
looks like your first contribution to the DOM spec
15:19
<annevk>
at least from this generation
15:22
<annevk>
committed
15:25
<annevk>
oh hey, GitHub -> Twitter works again...
15:25
<annevk>
https://twitter.com/thedomstandard/status/288304791833161728
15:35
<odinho>
darobin: MotherNode sounds like something cool and nongeneric, should find some other use for it. :]
15:36
<darobin>
odinho: definitely :)
16:23
gsnedders
wonders how many HTTP devices there are where gzip is significant in overhead
16:29
<darobin>
gsnedders: I'm guessing mostly old feature phones and the zigbee devices
16:29
<darobin>
(and anything like the latter)
16:31
<MikeSmith>
what's zigbee devices?
16:35
<darobin>
MikeSmith: it's IoT stuff
16:36
<darobin>
like X10, but designed this decade
16:36
<annevk>
I changed https://gist.github.com/4475457 around btw
16:36
<darobin>
they use HTTP on some ridiculously small devices
16:38
<gsnedders>
darobin: How many feature phones run full HTTP clients?
16:38
<gsnedders>
Opera Mini will at times use HTTP, but normally not.
16:38
<gsnedders>
And it's rare to see a full browser nowadays on a feature phone.
16:39
<darobin>
gsnedders: well many *have* an HTTP client, few would actually see much actual usage
16:39
<annevk>
oh yes
16:39
<annevk>
GitHub -> Twitter works again fully
16:39
<annevk>
teehee
16:39
<darobin>
gsnedders: there are quite a lot of very old Nokias out there, they all have browsers
16:40
<darobin>
but browsing the web with those is unlikely to be a very happy experience :)
16:40
<annevk>
lots of phones have browsers, but are they used?
16:41
<gsnedders>
Most phones with browsers that get used have the power that gzip isn't massively noteworthy.
16:51
<darobin>
gsnedders: agreed, but that's not the case for zigbee devices
16:51
<darobin>
that said, I'm not sure what your context is — it's quite likely that those don't matter in your case
16:51
<darobin>
on really dumb devices gzip does have an impact
16:52
<darobin>
in fact IIRC zigbee uses EXI for those
17:02
<dglazkov>
good morning, Whatwg!
17:02
<gsnedders>
darobin: My context is hsivonen's claim HTTP would've been better without the negociation for gzip
17:03
<darobin>
mmm, possibly
17:05
<darobin>
HTTP would have been better with no authoritative metadata whatsoever
17:05
<darobin>
so you drop content type and content encoding, and only use magic numbers (falling back to sniffing)
17:06
<darobin>
authoritative metadata is just a nightmare design antipattern
17:09
<annevk>
Hmm, Twitter suggests people maybe want to encode to other encodings... http://cache.gyazo.com/2ad55482c4cbcc983ec49306dc3fa47d.png
17:10
<Ms2ger>
darobin, I bet you like Content-MD5
17:10
<darobin>
annevk: that's a lie
17:10
gsnedders
wonders how much Content-MD5 would help if everyone actually encforced it
17:10
<darobin>
Ms2ger: one of my faves!
17:10
<annevk>
darobin: Ms2ger is lying or I am?
17:11
annevk
is confused
17:11
<Ms2ger>
Eh?
17:11
<darobin>
annevk: Ms2ger always is, but it's a lie that people want to encode to anything other than utf8
17:11
<darobin>
don't listen to the voices!
17:11
<annevk>
ooh
17:11
<gsnedders>
Yay VCS!
17:11
<annevk>
I wasn't planning on changing the API based on some rambling on twitter
17:11
<gsnedders>
bzr failing to clone because of some UnicodeDecodeError.
17:14
<annevk>
I wonder how https://bugzilla.mozilla.org/show_bug.cgi?id=757726 helps if you can still do "in"
17:15
<gsnedders>
Or just have an <object> and see if the fallback content is used.
17:16
<annevk>
all it does it seems is create a weird object
17:21
<Pomax>
is this a reasonable place for html5lib questions, or do I have to use the mailing list for that?
17:22
<Ms2ger>
Ask away
17:22
<Pomax>
I'm just trying the basic documentation example, with an import html5lib, f = open("test.html"), doc = html5lib.parse(f), but already the content of doc is <None>
17:23
<Pomax>
using the smallest test html I could come up with that's a full document with some content, http://pastebin.mozilla.org/2043951
17:23
<gsnedders>
You almost certainly want to pass a treebuilder to it, so html5lib.parse(f, treebuilder="etree") gives you an ElementTree
17:23
gsnedders
hopes he's got the argument format right
17:23
<gsnedders>
Oh wow, I did.
17:23
<Pomax>
hm. in that case the docs definitely need a minor tweak, since the first example claims to already return a simpletree
17:23
<Pomax>
heh, nice
17:24
<Pomax>
alright, let me try that.
17:24
<gsnedders>
You basically don't want to use simpletree. We should probably just make etree the default.
17:24
<Pomax>
I was using someone else's library (bleach) that relies on html5lib but things started going tremendously wrong once I used html docs with svg elements, so I figured I'd try to track down where it goes wrong.
17:24
<jgraham>
<None> is the unhelpful representation of the root node in simpletree
17:24
gsnedders
is busy trying to fix 3to2 to get it converting Python 3 html5lib
17:25
<jgraham>
So it actually did work
17:25
<jgraham>
But didn't look like it had
17:25
<gsnedders>
jgraham: ...
17:25
<gsnedders>
I've contributed to this project for how long and didn't know this!
17:25
<jgraham>
Well None != <None>
17:25
<jgraham>
The angle brackets are everything
17:25
<gsnedders>
Well, yes, but still. Looks like some container containing just None.
17:26
<jgraham>
Well it is a side effect of the implementation of repr being "<%s>"%element.tagname and the root node having tagname of None
17:26
<jgraham>
Should just override it in that case
17:27
<gsnedders>
File a bug?
17:28
<jgraham>
It would be faster to fix the bug
17:28
<gsnedders>
Can you manually port the fix to Py3 then?
17:29
gsnedders
is sufficently far along with this he wants to just get it done without doing Py2->Py3 again
17:30
<MikeSmith>
gsnedders: about your tweet saying that hold html5lib runs much faster under latest PyPy for parsing the HTML5 spec
17:30
<MikeSmith>
how fast is that in absolute terms?
17:30
<gsnedders>
6s locally, which is 2x speed.
17:30
<MikeSmith>
I mean, does it make it actually usable for docs of that size?
17:30
<MikeSmith>
ok
17:31
<gsnedders>
When of the ugly bits of html5lib exhibits really bad perf in PyPy though, so it should be easy enough to make that quicker
17:31
<Ms2ger>
When?
17:31
<MikeSmith>
gsnedders: OK
17:32
<gsnedders>
s/When/One/
17:32
<MikeSmith>
without PyPy it takes a lot longer than 12s even
17:32
<gsnedders>
Then I guess I have a quicker computer than you :P
17:33
<gsnedders>
$ time python parse.py -b etree --no-html ../testdata/sites/web-apps-new.htm
17:33
<gsnedders>
real 0m13.742s
17:33
<gsnedders>
That appears to be pretty much it.
17:33
<MikeSmith>
hmm lemme try it now
17:34
<gsnedders>
web-apps-new.htm isn't in the repo, it's just http://www.whatwg.org/c yesterday evening
17:35
<MikeSmith>
real 0m11.481s
17:37
<gsnedders>
Interestingly, it's far slower with lxml
17:37
<MikeSmith>
I get 0m15.771s if I actually generate output from parse.py
17:40
<annevk>
hsivonen: fwiw, www-international is now "debating" "Why not conneg"
17:43
<MikeSmith>
annevk: "He can’t be serious, can he?"
17:43
<MikeSmith>
gotta love that
17:43
<Ms2ger>
Bwahahahahahahahahaha
17:43
<MikeSmith>
"Well, you expect shocking remarks out of WhatWG members." is good too
17:43
<annevk>
"Well, you expect shocking remarks out of WhatWG members." (Is this missing a "can"?)
17:44
<annevk>
I guess it works this way too
18:23
<TabAtkins_>
Morning, whatwg!
18:23
<TabAtkins_>
^_^
18:48
<annevk>
Ms2ger: step 9 in http://dom.spec.whatwg.org/#concept-event-dispatch is redundant with step 4.5 in invoke or not?
18:48
<annevk>
Ms2ger: (not step 9's substeps, those are needed)
18:50
<Ms2ger>
annevk, eh, why?
18:51
<annevk>
Ms2ger: oops
18:51
<annevk>
Ms2ger: hmm so yeah, bubbles needs to be checked either way :)
18:58
<Pomax>
hm, another html5lib question; if I want to parse an html5 doc that has embedded SVG with namespaced attributes like xlink:href, which creative mix of html5lib settings do I need to use to preserve those namespaces during parse? =)
19:05
<jgraham>
How much "like" xlink:href?
19:06
<jgraham>
There are a few special cases where namespaces are preserved, but generally HTML (and SVG-in-HTML) doesn't have namespaces
19:06
<jgraham>
(xlink:href is one such special case)
19:06
<Pomax>
"things like" being used to mean "things including" =)
19:07
<Pomax>
good point, the only namespaced attribute I found in the SVG spec attribute list for all the elements we need to support is the xlink:href one
19:07
<Pomax>
although then that still leaves the question of how to preserve it when running the html doc through html5lib. with "dom" the 'xlink:
19:07
<Pomax>
' bit is removed
19:08
<Pomax>
at least when I print out the parse result using the "Serialization of Streams" example
19:08
<Hixie>
hsivonen: what's wrong with http://html5.org/tools/web-apps-tracker?from=7621&to=7622 ? just s/must/should/ for <title> and <option>? and why so grumpy :-P
19:11
<vcarbune>
can anyone here help me with a doubt about cross-origin video text tracks processing?
19:13
<Ms2ger>
Did people here look at http://wiki.ecmascript.org/doku.php?id=harmony:binary_data, btw?
19:17
<Hixie>
bz's feedback is orders of magnitude more complicated to deal with than almost anyone else's
19:17
<Ms2ger>
His brain is orders of magnitude more complex, too
19:21
<Hixie>
http://w3cmemes.tumblr.com/post/39943615914/image-inline-image-1
19:21
<Hixie>
not sure what's up with the text
19:26
<annevk>
Ms2ger: shouldn't that binary_data include of the TypedArray stuff?
19:26
<Ms2ger>
I dunno
19:26
<annevk>
Ms2ger: I thought that was the idea actually
19:27
<Ms2ger>
I don't know what the idea was :)
19:28
<annevk>
I like how there's just as many opinions on es-discuss on how to design JS APIs as elsewhere
19:32
<JonathanNeal>
Is there a study available on the classnames or IDs that websites tend to use to label certain areas, like "main" for content, or the initial "wrapper"?
19:33
<Ms2ger>
Google had some of that, I think
19:33
<Ms2ger>
Maybe MOMA too
19:33
<Ms2ger>
(Or MAMA?)
19:33
<annevk>
JonathanNeal: Steve Faulkner did one recently to look for justification for the <main> element, don't have a pointer handy
19:45
<Ms2ger>
Oh, wow, navigator.plugins is in installation-time order?
19:47
<JonathanNeal>
annevk: thanks, yea, hopefully someone will find that link.
19:49
<annevk>
Ms2ger: sounds whacky
19:49
<Ms2ger>
That it does indeed
19:53
<tantek>
JonathanNeal, annevk, you might be thinking of: http://webdevdata.org/
19:53
<tantek>
It's even a community group: http://www.w3.org/community/webdevdata/
19:58
<stevefaulkner>
jonathanNeal http://triin.net/2006/06/12/CSS#figure-34 http://westciv.typepad.com/dog_or_higher/2005/11/real_world_sema.html http://dev.opera.com/articles/view/mama-common-attributes/#id http://lists.w3.org/Archives/Public/public-html/2012Oct/0109.html
19:59
<JonathanNeal>
Thanks stevefaulkner!
19:59
<stevefaulkner>
np
19:59
<JonathanNeal>
and thanks tantek!
20:00
<annevk>
well that was easy http://dvcs.w3.org/hg/d4e/raw-file/tip/source_respec.htm
20:00
<JonathanNeal>
container is much more popular than wrapper.
20:00
<annevk>
thanks Jacob / Travis (if you read this :))
20:00
<JonathanNeal>
I hardly see any "inset" either, and that's my goto name.
20:05
<annevk>
Which specification uses VoidFunction from IDL?
20:11
<Hixie>
anyone got IE10 handy?
20:31
<Hixie>
you really have to love the way we use IDL interfaces to define classes, not interfaces, and then implement them as prototypes, not classes.
20:33
<TabAtkins>
To be fair, JS prototypes are the equivalent of classes.
20:33
<TabAtkins>
But the interface/class thing is silly, yes. ^_^
20:33
<TabAtkins>
(And the "class" keyword coming in ES6 just desugars to prototype stuff.)
20:38
<dglazkov>
annevk: do you know what's the latest thinking on the prototype-swizzling story around adoptNode, document.open?
20:39
<annevk>
dglazkov: yes, I'm waiting for input from non-Gecko vendors on what they're planning on doing
20:39
<annevk>
dglazkov: plus maybe an explanation of what web components is doing in this area that has bz concerned
20:39
<annevk>
dglazkov: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20567 is the tracking bug
20:40
<annevk>
we could rename interface to class...
20:40
<annevk>
doesn't really matter
20:40
<dglazkov>
annevk: custom elements don't do anything in this area.
20:40
<annevk>
it seems bz thought otherwise
20:41
<dglazkov>
annevk: I was actually hopeful that if we had a precedent for this, I don't have to do the whole renameNode-style thing for custom elements
20:42
<annevk>
does this come down to the same thing though? not exactly...
20:42
<dglazkov>
annevk: I need to look at the bugs he filed to see what his thoughts were.
20:43
<annevk>
that bug has pointers to the mailing list discussion, which is where bz provided feedback
20:43
<annevk>
but e.g. there's not going to be precedent for doing this if e.g. WebKit is not going to implement this or Opera/IE are not interested...
20:43
<annevk>
all that's somewhat clear is what Gecko does and why it does that
20:45
<dglazkov>
annevk: bz doesn't actually list any specific concerns with web components in the thread. But he did file a bunch of bugs that might have more specifics.
20:45
<annevk>
k
21:24
<Steve^>
Hi, can anyone recommend a resource that simply lists the attributes and methods of <video>?
21:25
<tantek>
Steve^: https://developer.mozilla.org/en-US/docs/HTML/Element/video
21:34
<Steve^>
tantek, it doesn't seem to list the methods
21:34
<tantek>
they're linked from that page
21:34
<tantek>
from the TOC: https://developer.mozilla.org/en-US/docs/HTML/Element/video#DOM_interface
21:35
<Steve^>
Aha! https://developer.mozilla.org/en-US/docs/DOM/HTMLMediaElement
21:35
<Steve^>
thanks
21:35
<tantek>
and currently across two pages, for <video> and in general media elements: https://developer.mozilla.org/en-US/docs/DOM/HTMLVideoElement and https://developer.mozilla.org/en-US/docs/DOM/HTMLMediaElement
21:35
<tantek>
right
21:35
<tantek>
:)
21:36
<Steve^>
I thought the world was crazy, was just me
21:36
<tantek>
you being crazy does not falsify the possibility of the world also being crazy ;)
22:21
<Hixie>
TabAtkins: i think there are qualitative differences between what i would consider a "class" and the js style oop
22:26
<TabAtkins>
I submit that the definition of "class" is very very loose, unless you're purposely just using a single language's definition of the term.
22:26
<TabAtkins>
And within the possibility-space of "things that languages call 'classes' which are reasonable impls of some sort of OO thing", I claim that JS's prototype-based stuff is a class.
22:26
<TabAtkins>
Proof by example:
22:27
<gsnedders>
TabAtkins: classes aren't just syntactical sugar, because super.
22:27
<TabAtkins>
class foo { constructor(a) { this.a = a; return this; } bar(b) { print(b); } }
22:27
<TabAtkins>
===
22:27
<TabAtkins>
function foo(a) { this.a = a; return this; } foo.prototype.bar = function(b) { print(b); }
22:28
<TabAtkins>
Modulo a few tiny bits like super which can't be strictly desugared.
22:28
<Hixie>
yeah i'm not quite sure how to put into words what the difference is
22:28
<TabAtkins>
Cause there isn't one. ^_^
22:28
<Hixie>
there's definitely a difference between what JS does and what I think of as class-based-oop
22:28
<Hixie>
but it might be unrelated to the classness
22:29
<TabAtkins>
There are indeed differences, but every OOP implementation has differences, because OOP is a loosely-connected set of concepts.
22:29
<Hixie>
yes
22:31
<Hixie>
on another note, did we ever resolve http://lists.w3.org/Archives/Public/public-script-coord/2012OctDec/0363.html ?
22:36
<Hixie>
does webidl define what should happen here? http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2061
22:36
<Hixie>
firefox, safari, chrome: throw (various exceptions)
22:37
<Hixie>
opera: actually runs the method
22:37
<annevk>
Hixie: we did not resolve that
22:38
<annevk>
Hixie: my impression is that unless you file a bug, heycam might miss it
22:38
<Hixie>
opera doesn't even throw if you make the method 'select', which button doesn't have
22:39
<Hixie>
window.alert.call(document.body) in opera does response "WRONG THIS" though
22:39
<heycam>
annevk, Hixie, I think that should throw
22:39
<heycam>
iirc
22:40
<Hixie>
heycam: does the reason it should throw cover cases like http://lists.w3.org/Archives/Public/public-script-coord/2012OctDec/0363.html ?
22:41
<heycam>
Hixie, (will read in a bit, email exceeds my "reading simultaenous with attending meeting" bandwidth...)
22:41
<Hixie>
that e-mail exceeded my bandwidth even when i was doing nothing else, so, understood
22:42
<heycam>
:p
22:43
<SimonSapin>
It’s out! http://packages.python.org/cairocffi/ (sorry for the spam)
22:46
<annevk>
SimonSapin: doesn't explain why I'd want this drop-in replacement
22:47
<annevk>
SimonSapin: or should I know what "CFFI-based" means for that? :)
22:50
<SimonSapin>
annevk: pycairo does not install with the usual python tools, is different on python 2 and 3, exposing new cairo stuff means requiring new cairo version, it’s a pain to maintain (C code doing manual refcounting of Python objects, yay!), and nobody seems to be really maintaining it
22:50
<SimonSapin>
annevk: CFFI is an implementation detail, you don’t really need to care about it
22:50
<SimonSapin>
but it’s what makes it different from pycairo
23:12
<heycam>
Hixie, the reason I thought that example threw was because HTMLInputElement.prototype.checkValidity can't be called on an HTMLButtonElement (and vice versa)
23:13
<Hixie>
webidl says that, i assume?
23:13
<heycam>
Hixie, yes, there's a check if the object implements the interface that the operation is declared on
23:13
<Hixie>
k
23:13
<heycam>
Hixie, the origin issue is something that would need to be checked in the same place, but isn't currently
23:14
<Hixie>
k
23:14
<Hixie>
do i need to do anything to allow you to fix that one too?
23:15
<heycam>
Hixie, you might yes -- if anything it'll probably be a hook in Web IDL that defines a "security check" to be done at that point
23:16
<heycam>
Hixie, or maybe just define the origin of objects, and then I just check origins myself in that part of Web IDL
23:16
heycam
will reply on that thread
23:16
<Hixie>
k, thanks
23:35
<annevk>
bz will not be happy with an additional check there
23:44
<heycam>
why is the additional check needed? is there a way to get the value of the property despite the check that is done? (before a navigation or something?)
23:45
<Hixie>
you can get the property from one Document
23:45
<Hixie>
and apply it to another
23:45
<heycam>
oh right, I understand
23:45
<Hixie>
or take it from one Location, navigate such that the origin has changed, then apply it
23:49
<annevk>
heycam: why is it unreasonable for a subclass to supersede a method of a parent class?
23:49
<annevk>
heycam: is that some particular kind of OO people don't like?
23:50
<heycam>
unreasonable if it makes the ancestor one invalid to be called on the object
23:50
<annevk>
but why would you do that?
23:50
<heycam>
well why indeed :)
23:50
<heycam>
so I don't want to disallow overriding
23:50
<annevk>
sorry, I meant why would you call
23:51
<Hixie>
the case i most commonly run into is where the superclass implementation is "throw EAbstractMethod"
23:51
<heycam>
oh, who knows why you would -- but for languages where it's possible I think it makes sense that it still be valid to call the ancestor method
23:51
<annevk>
how would you do it in JS?
23:51
<heycam>
if you can get at the ancestor method that throws EAbstractMethod and you call it on an object that overrides that method, then I think it should still throw EAbstractMethod
23:51
<Hixie>
annevk: grab something from HTMLCollection and apply it to HTMLAllCollection
23:52
<Hixie>
heycam: and your app will crash, right
23:52
<heycam>
in some languages, yes
23:52
<Hixie>
heycam: i'm not saying it's the wrong thing to do, i'm just saying that on the web we can't let people crash the browser
23:52
<heycam>
but it's not crashing because it has an unexpected object type it's been called on
23:52
<annevk>
Hixie: and why does the this check not make that throw here?
23:52
<annevk>
Hixie: because it's a parent class?
23:52
<heycam>
I'm not saying that we should allow the browser to crash...
23:53
<Hixie>
annevk: well if there's no overridden subclass method, you don't want it to throw, right?
23:53
<annevk>
the whole inheritance thing on most classes in DOM-land is basically a shortcut for defining stuff...
23:53
<heycam>
if you define `interface A { void f(); };` then you need to write your f() prose such that it makes sense for any object that implements A, right?
23:54
<annevk>
Hixie: oops yeah
23:54
<Hixie>
heycam: in the case of the web apis, the problem is that we sometimes think in terms of interfaces and sometimes in terms of classes
23:54
<annevk>
maybe we should s/interface/class/ to get that out of the way?
23:54
<heycam>
s/implements A/is of a class that inherits from A/ then
23:55
<Hixie>
heycam: so e.g. HTMLElement is both an interface (HTMLElement.onblur is a property that means different things on HTMLAnchorElement and HTMLBodyElement), and a class (HTMLElement.click() is defined for HTMLElement and implemented identically for HTMLAnchorElement and HTMLBodyElement)
23:56
<heycam>
I don't think that's the relevant distinction, or at least, onblur ought to be defined so that its getter/setter makes sense when applied to both kinds of element
23:56
<heycam>
it's just that its behaviour is defined in terms of looking at what object "this" is when called
23:56
<Hixie>
onblur on HTMLAnchorElement is a way to set an event listener on the element, and on HTMLBodyElement is a way to set an event listener on the Window.
23:57
<annevk>
onblur you could easily define generically no?
23:57
<heycam>
right
23:57
<annevk>
just checking if it's body and then forwarding
23:57
<Hixie>
they're essentially completely different.
23:57
<Hixie>
annevk: sure. that's what i'm saying we should do for all these cases.
23:57
<heycam>
completely?
23:57
<Hixie>
annevk: either check the this, and throw if it's not the right one, or, check the this, and run the right code.
23:57
<annevk>
Hixie: heycam is saying the same, but that you do it in prose :)
23:58
<Hixie>
i don't really care where it's done
23:58
<heycam>
as long as we have well defined behaviour for when HTMLElement.onblur's setter is applied to an HTMLBodyElement, that is fine
23:58
<Hixie>
if it's prose, it's gonna require you (anne) and I to edit our specs; if it's done in WebIDL's definition, it's just heycam
23:59
<annevk>
do you need anything more than if onblur is set, these steps must be run: 1. if the context object is <body>, set a listener on Window. 2 otherwise set a listener on the context object
23:59
<annevk>
?
23:59
<Hixie>
heycam: for that one, there's only one in the idl. for onerror, there's two, and they have different types.
23:59
<Hixie>
heycam: i don't know that we really say what happens when you call HTMLElement.onerror's setter or getter on an HTMLBodyElement.