05:34
<matjas>
I’ve written a JavaScript library to encode/decode HTML entities as per the HTML spec (since no fully compliant library seemed to exist). Source: http://mths.be/he Demo: http://mothereff.in/html-entities Let me know if you think of any edge cases it fails on.
05:35
<matjas>
Hixie: needless to say, the entities.json file was extremely useful for this ^
09:09
<zcorpan_>
are there any specs that specify quirks apart from quirks-mode, html, cssom and cssom-view?
09:25
<Ms2ger>
zcorpan_, css-syntax?
09:25
<zcorpan_>
Ms2ger: those two quirks were moved back
09:26
<Ms2ger>
Ah
09:53
<matjas>
zcorpan_: thanks for the feedback. you mean like running this on http://mothereff.in/js-escapes (through dev tools)? var el = document.querySelector('textarea'); el.value = 'high surrogate: \uD834 low surrogate: \uDF06 surrogate pair in the wrong order: \uDF06\uD834'; el.oninput()
09:53
<matjas>
that returns the output I’d expect, but I’m probably missing something
09:54
<zcorpan_>
matjas: yes. the other direction is typing &#xD800; in the lower textarea in http://mothereff.in/html-entities which throws here
09:54
<matjas>
i meant http://mothereff.in/html-entities sorry
09:56
<matjas>
zcorpan_: ah, I see. `he.decode('&#xD800;')` works fine, it’s just that encodeURIComponent(surrogate) throws
09:56
<matjas>
zcorpan_: is it even possible to URLencode a lone surrogate?
09:57
<zcorpan_>
probably not
09:59
<zcorpan_>
matjas: "Otherwise, if the number is in the range 0xD800 to 0xDFFF or is greater than 0x10FFFF, then this is a parse error. Return a U+FFFD REPLACEMENT CHARACTER."
09:59
<matjas>
:(
10:00
matjas
adds a try/catch to avoid the error
10:01
<zcorpan_>
matjas: the output should be U+FFFD for &#xD800; per spec
10:01
<zcorpan_>
http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references
10:02
<zcorpan_>
even &#xD834;&#xDF06; -> U+FFFD U+FFFD
10:03
<matjas>
holy shit
10:03
<matjas>
good catch!
10:04
<zcorpan_>
you need to implement that table, too
10:04
<zcorpan_>
e.g. &#x0; -> U+FFFD
10:06
<zcorpan_>
&#x80; -> €
10:06
<jgraham>
gsnedders, zcorpan_, hsivonen, abarth, Hixie_, others: add yourselves as reviewers for html5lib-tests at https://critic.hoppipolla.co.uk
10:06
<Ms2ger>
jgraham, while you're here...
10:06
<Ms2ger>
http://webappsec-test.info/web-platform-tests/CSP/script-src/CSP_1_2.php
10:06
<jgraham>
Ms2ger: You too
10:06
<Ms2ger>
Is that a sane thing to do?
10:07
<jgraham>
Ms2ger: Seems pretty insane to me
10:08
<jgraham>
Or at least, I think it *could* work
10:08
<jgraham>
But it is likely to break people's assumptions when they try to gather test results
10:08
<jgraham>
So they will get 1 or 2 results but not 3
10:09
<Ms2ger>
That's why I'm getting complained at :)
10:09
<Ms2ger>
My test runner jumps to the next test before it's done
10:09
<jgraham>
Yep
10:10
<jgraham>
That's what I would expect
10:10
<Ms2ger>
So I reply with "don't do that"? :)
10:10
<jgraham>
Isn't it possible to have all three tests defined in the top-most frame and report up the tree by hand?
10:10
<jgraham>
Yeah, that's the best idea I think
10:11
<jgraham>
(to reply "don't do that")
10:11
Ms2ger
cc's jgraham
10:16
<annevk>
zcorpan_: DOM defines quirks
10:17
<annevk>
zcorpan_: and uses it to define compatMode
10:30
<annevk>
SimonSapin: so why does css-syntax not have the quirks inlined?
10:31
<SimonSapin>
annevk: removed because it belongs in Values, not in Syntax
10:31
<Ms2ger>
annevk, because we don't want them in syntax
10:31
<SimonSapin>
whether it should be inlined or not is another question
10:31
<annevk>
SimonSapin: that sounds reasonable
10:39
<zcorpan>
annevk: thanks
10:41
<zcorpan>
also for getElementsByClassName
10:54
<zcorpan>
matjas: you could try looping through all possible charrefs from 0 to ffff and compare the output with what a browser gives from innerHTML
10:55
<zcorpan>
matjas: also, do you intend to support the different parsing mode that is used in attribute values?
11:04
<zcorpan>
matjas: Å gets turned into &angst; which isn't wrong but i expected &Aring;
11:11
<zcorpan>
matjas: are there some characters that you choose not to convert to entities? is that configurable? i notice that U+000A doesn't turn into &NewLine;
11:14
<zcorpan>
matjas: http://mothereff.in/html-entities throws when entering newlines in the "encoded" textarea
11:15
<zcorpan>
ok i think that's enough playing with it for now
11:42
<matjas>
zcorpan: when more than one named reference is possible for a given symbol, `he` uses the shortest one, or the one with the fewest uppercase symbols
11:42
<matjas>
hence &angst; instead of &Aring;
11:42
<zcorpan>
matjas: i see
11:43
<zcorpan>
matjas: i think &Aring; has better compat though in older browsers
11:43
<matjas>
also, it only escapes symbols that are not printable ASCII or <>"'&
11:44
<zcorpan>
U+OOOA isn't printable ASCII
11:44
<matjas>
i explicitly added \n to the whitelist a few minor versions back
11:44
<zcorpan>
ok
11:44
<matjas>
should it be configurable? i figured most of the time people wouldn’t want to use &NewLine;
11:45
<matjas>
(similarly, he will never output &plus; and stuff like that)
11:45
<zcorpan>
yeah i dunno, i was just curious if there was a rule
11:46
<matjas>
support the different parsing mode that is used in attribute values → i need to look into that, but it sounds like a plan
11:47
<zcorpan>
maybe it'd be useful to opt to avoid named references if one wants better compat with old browsers
11:47
<zcorpan>
e.g. old IE doesn't support &apos;
11:47
<zcorpan>
nor the 1000s of mathml entities
11:52
matjas
files issues for everything zcorpan says
11:56
<Ms2ger>
Lovely
11:56
<Ms2ger>
We've got sites depending on img.x working
11:56
<Ms2ger>
And then we've got sites depending on it not working
12:19
<zcorpan>
matjas: give zcorpan 1,000,000 SEK
12:20
<zcorpan>
Ms2ger: interesting
12:21
<zcorpan>
Ms2ger: do you have pointer to bugs?
12:23
zcorpan
sees https://bugzilla.mozilla.org/show_bug.cgi?id=887660
12:32
<zcorpan>
Ms2ger: so webkit/blink/presto have x but IE10 doesn't
12:37
<matjas>
zcorpan: cannot reproduce the issue; WONTFIX
12:37
<zcorpan>
matjas: dang :-|
12:39
<gsnedders>
jgraham, ambv: am intending on pushing out a 1.0b2 over lunch (i.e., now)
12:40
<ambv>
Great. Do you need any help?
12:42
<gsnedders>
ambv: https://github.com/html5lib/html5lib-python/pull/84
12:43
<ambv>
gsnedders: the previous order in "Patches and suggestions" was chronological
12:43
<ambv>
now it's dubious because to get "alphabetical" you'd have to sort by last name
12:44
<gsnedders>
We need to make the order clear, at least. :)
12:44
<gsnedders>
(and last-name ordering is locale specific)
12:45
<ambv>
first name as well. Łukasz sorts after Luke and not after Zed.
12:46
<ambv>
I mean, that's a non-issue really, don't think I'm putting too much weight on it.
12:46
<gsnedders>
Yeah, I know.
12:47
<gsnedders>
Ordering stuff is hard.
12:47
gsnedders
tries to work out where fantasai should be in that list
12:47
<ambv>
Ordering is indeed hard. Tell me about it… http://bugs.python.org/issue18244#msg191535
12:48
<ambv>
Look at GVR's response below :D
12:48
<gsnedders>
Hah, not even touching MRO.
12:48
<gsnedders>
I try and *avoid* understanding it. :)
12:50
<gsnedders>
ambv: https://github.com/html5lib/html5lib-python/pull/84/files - that better?
12:51
<SimonSapin>
http://xkcd.com/541/
12:56
<Ms2ger>
Hixie_, you're writing down all those parsing edge cases somewhere, I hope?
12:59
<gsnedders>
Ms2ger: For template?
12:59
<Ms2ger>
Yeah
13:00
<Ms2ger>
jgraham, a critic question...
13:01
<Ms2ger>
You have select.repository { background-color: white; }
13:01
<Ms2ger>
Why?
13:02
<Ms2ger>
And what's the difference between Reviewer and Watcher?
13:11
<jgraham>
Ms2ger: I don't know why the background colour thing
13:12
<jgraham>
Ms2ger: A watcher is someone who gets the mail about a review but isn't allowed to mark changes as reviewed
13:12
<Ms2ger>
Seems not-so-useful
13:13
<jgraham>
So if there is some piece of code that you want to be able to comment on, but where you aren't the actual owner
13:13
<jgraham>
Well we use it a fair bit in Opera
13:13
<Ms2ger>
Seems useful if you want to restrict who can review what, I guess
13:13
<jgraham>
It can be useful for learning bits of the code that you want to know better
13:14
<Ms2ger>
On another note, did you see ehsan's PR?
13:14
<jgraham>
Yeah, I commented onit
13:14
<jgraham>
It's the wrong fix, I think
13:15
<gsnedders>
jgraham: Can you eyeball https://github.com/html5lib/html5lib-python/pull/84/files — it's purely a documentation change for 1.0b2
13:15
<jgraham>
Ms2ger: https://critic.hoppipolla.co.uk/r/187
13:16
<Ms2ger>
Will try to catch ehsan
13:16
<Ms2ger>
I don't want to page this in :)
13:16
<jgraham>
gsnedders: lr+tm
13:19
<SimonSapin>
Does html5lib test character encoding detection? How do you store the tests, plain files?
13:19
<gsnedders>
With tears.
13:19
<gsnedders>
https://github.com/html5lib/html5lib-tests/tree/master/encoding
13:20
<SimonSapin>
I’m writing many CSS Syntax tests in few JSON files, considering what to do when the input needs to be bytes
13:21
<gsnedders>
We use unicode escapes then encode as ISO-8859-1 in places.
13:21
<gsnedders>
Note that some JSON impls don't cope with characters in general category Cc as unicode escapes.
13:21
<SimonSapin>
I’m considering http://encoding.spec.whatwg.org/#x-user-defined
13:23
<SimonSapin>
which uses "private use" characters to map 0x80~0xFF
13:27
<SimonSapin>
It’s a shame the web does not have "real" ISO-8859-1, if only to encode bytes
13:28
<gsnedders>
We just take that attitude that you probably have a ISO-8859-1 encoder anyway. And if you don't, go implement one. It's not exactly hard.
13:29
<SimonSapin>
It’s not hard when you have a binary data type in your language ;)
13:30
<gsnedders>
:)
13:30
<gsnedders>
Yeah, had some weird issues with dom.js's HTML parser. :)
13:46
<matjas>
zcorpan: fixed/added everything you suggested, except for the attribute parsing: http://mothereff.in/html-entities
13:53
<zcorpan>
matjas: nice! here's a cookie! 🍪
13:55
<SimonSapin>
is it a tracking cookie?
13:56
<zcorpan>
it might be. but if it is, it stops tracking you when it leaves your body again.
13:57
<matjas>
unless that happens at Google. they collect that data (http://annevankesteren.nl/2010/04/no-joke-today)
13:59
<zcorpan>
matjas: the cookie would still stop tracking you when it leaves your body
14:00
<zcorpan>
maybe it could plant something that stays in the body, like a virus or a parasite
14:17
<annevk>
Can someone ask Hixie_ when he's around if all the setup about defining what objects are exposed in workers is done now in HTML?
14:18
<annevk>
I want to make it much clearer for XMLHttpRequest, FormData, URL, and URLQuery.
14:18
<annevk>
Oh, and TextEncoder and TextDecoder. Anything else?
14:35
<annevk>
Yes, too much email :(
14:53
<matjas>
zcorpan: i’m probably oversimplifying my code but the attribute value parsing seems pretty simple to implement
14:54
<matjas>
he.decode('foo&ampbar', { 'isAttributeValue': true }); // 'foo&ampbar'
14:57
<zcorpan>
matjas: do you not expand it when the next char is alphanumeric or = ?
15:02
<matjas>
yeah
15:02
<matjas>
i’ll push my commit soon. still wondering if I’m missing anything
15:17
<matjas>
https://github.com/mathiasbynens/he/commit/6816219031b1c1793a0dcbf29337411c2599e1a5
15:22
<matjas>
zcorpan_: if you wanna sanity-check the attribute parsing, reload mothereff.in/html-entities and test `he.decode()` in the console
15:26
<annevk>
Actually found a bug in the URL standard, yay
15:27
<dglazkov>
good morning, Whatwg!
15:31
<zcorpan_>
matjas: looks OK
16:06
<Hixie_>
ok. templates, day 3.
16:13
<annevk>
Hixie_: http://krijnhoetmer.nl/irc-logs/whatwg/20130627#l-634
16:14
Hixie_
looks
16:14
<Hixie_>
how do you mean?
16:14
<Hixie_>
workes and html is the same thing
16:15
<Hixie_>
you mean like where do we say "exposed"?
16:15
<Hixie_>
search for "exposed to javascript"
16:17
<annevk>
Hixie_: I guess what I'm wondering about is whether that's done
16:17
<Hixie_>
probably not
16:17
<Hixie_>
i don't think i yet do it for Element and company, for instance
16:17
<annevk>
Hixie_: when you made that commit I seem to recall you wanted to do more
16:18
<Hixie_>
the main problem is "The interfaces and exceptions defined by this specification, except where further restricted by explicit requirements in this specification" is far too inclusive
16:18
<annevk>
I cannot find the commit however :/
16:18
<Hixie_>
maybe i should just remove that
16:18
Hixie_
looks at blame
16:18
<Hixie_>
7851?
16:19
<Hixie_>
just filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=22493
16:19
<Hixie_>
feel free to comment in that bug about what you think should be exposed
16:20
<annevk>
Hixie_: yeah, which brought me to http://krijnhoetmer.nl/irc-logs/whatwg/20130424#l-597
16:20
<annevk>
Not entirely sure what the "relevant bug" is
16:21
<Hixie_>
relevant bug?
16:21
<Hixie_>
oh, zcorpan's comment
16:21
<Hixie_>
dunno
16:22
<annevk>
But okay, it seems I can use this for Event, Promise, URL, etc.
16:22
<Hixie_>
anyway, zcorpan's comment is a truism
16:22
<Hixie_>
i'm always intending to clarify things more :-)
16:22
<Hixie_>
yeah
16:22
<annevk>
Will look into that tomorrow. It'd be good to have that a bit clearer in those specifications.
16:23
<Hixie_>
anything you'd rather i list explicitly in the workers section rather than have in dom or wherever, feel free to put in the bug above (22493)
16:23
<annevk>
I feel like we should embrace workers as first-class citizens and that therefore it's better if we don't have magic lists.
16:24
<Hixie_>
lgtm
16:41
<Hixie_>
rafaelw: ping
16:48
<TabAtkins>
heycam|away: "dfn-consequential-interface" isn't a real target.
16:59
<Hixie_>
i don't understand why <title> triggers in-body mode when <link> doesn't.
17:01
<gsnedders>
Hixie_: Trigger from where?
17:01
<gsnedders>
(templates, I guess?)
17:01
<Hixie_>
<template>
17:02
<Hixie_>
<template><title></title><col> ends up in in-body mode, <col> is dropped. <template><link><col> ends up in colgroup mode, <col> and <link> end up as siblings.
18:06
<Hixie_>
it strikes me that where the HTML spec refers to "the rules given in the XML specification to map a string of bytes or characters into a Document object", it's making stuff up
18:06
<Hixie_>
no such rules actually exist
18:10
<hober>
that's right, yeah
18:10
<hober>
iirc there is no "xml->dom" spec, there's just the infoset doc
18:48
<miketaylr>
back
20:10
<Jasper>
http://dev.w3.org/csswg/css-syntax/ -- is it a bug that the railroad diagrams on this page are missing?
20:11
<Hixie_>
is it me or is "A host-including inclusive ancestor is either an inclusive ancestor or a host-including inclusive ancestor of an object's root's host, if any" a confusing sentence?
20:11
<Jasper>
TabAtkins, ^
20:12
<TabAtkins>
Hixie_: That's... very confusing.
20:12
<Hixie_>
ok good
20:12
Hixie_
files bug
20:12
<TabAtkins>
Jasper: Ooh, yeah, forgot about that bug. Let me fix.
20:12
<TabAtkins>
Preprocessor seems to not like SVG or something.
20:12
<Jasper>
TabAtkins, ns0:svg ?? I don't think that will work...
20:13
<TabAtkins>
Interesting...
20:13
<TabAtkins>
No, it won't work.
20:13
<Jasper>
Like, I don't think HTML5 has XML namespace support :)
20:13
<Jasper>
(And I'm fairly happy with that)
20:13
<TabAtkins>
The HTML parser doesn't give a crap about SVG namespace.
20:13
<Hixie_>
filed https://www.w3.org/Bugs/Public/show_bug.cgi?id=22496
20:13
<TabAtkins>
gsnedders: Any clue how to make the lxml tree output SVG in a null namespace when embedded in HTML?
20:17
<Hixie_>
rafaelw: ping?
20:28
<TabAtkins>
gsnedders: Alternately, how to make html5lib just output <svg> elements as in the HTML namespace, to trick lxml into not putting namespaces on them?
20:28
<Hixie_>
it puts prefixes on them?
20:29
<TabAtkins>
Yeah, check the source of http://dev.w3.org/csswg/css-syntax/#token-diagrams
20:29
<TabAtkins>
The <dl> down there is supposed to contain SVG diagrams.
20:30
<Hixie_>
just run a postprocessing step that strips the prefixes :-)
20:31
<TabAtkins>
Possible, but hacky and terrible. ;_;
20:53
<zcorpan>
wonder what the CSSOM for @page *should* be. right now it's just wrong
20:54
<Hixie_>
i wonder why <select><template> is important and whether that means we should support e.g. <ol><template>...
20:54
<Hixie_>
seems like it'd be a mess unless we require <template> to be at the top
20:54
<zcorpan>
TabAtkins: doesn't html5lib's serializer do teh right thing?
20:54
<TabAtkins>
zcorpan: Why is it wrong? I mean, it's terrible, but it seems to be the minimal possible correct interface.
20:55
<zcorpan>
TabAtkins: it doesn't represent the child at-rules
20:55
<TabAtkins>
Oh, but it's a CSSSTyleDeclaration.
20:55
<TabAtkins>
Yeah.
20:55
<zcorpan>
and includes all the properties
20:55
<TabAtkins>
zcorpan: I don't know what I'm doing, so I think I'm just using lxml's html serializer.
20:56
<TabAtkins>
zcorpan: html5lib's documentation is... lacking, to say the least.
20:57
<Hixie_>
should we allow <hgroup><template> ?
20:57
<zcorpan>
TabAtkins: <svg> roundtrips in anolis at least
20:57
<Hixie_>
i don't see a use case...
20:57
<Hixie_>
wow, even <Table><template> is gonna be a minefield. i guess we should require that they be the first children of <table>.
20:58
<zcorpan>
Hixie_: is there a parsing problem with supporting <hgroup><template>?
20:58
<Hixie_>
zcorpan: not that i can see
20:58
<TabAtkins>
zcorpan: Do I use something like "from html5lib.serializer import HTMLSerializer"?
20:59
<zcorpan>
TabAtkins: no idea. check the source of anolis, maybe?
20:59
<TabAtkins>
Hixie_: With <template> being such a generic tool, any parsing limitations that don't have a strong reason for existing should be removed.
20:59
<Hixie_>
i'm talking content models now, not parsing
20:59
<Hixie_>
for parsing i've done as much as i think is possible sanely.
20:59
<TabAtkins>
Oh, then yeah, allow it everywhere.
20:59
<Hixie_>
well, it can't be allowed everywhere, because of the parsing limitations
21:00
<TabAtkins>
Frex, <ol><template> is great when you have the auto-stamping templates. <ol><template><li>...</template></ol>
21:00
<zcorpan>
content models are easy to change when people complain
21:00
<Hixie_>
e.g. <table> <tr> <template> </template> <tr> ... is gonna put it in the <tr>, not the <table>, so we probably want to encourage <template> to be before the <tr>s
21:00
<Hixie_>
i've allowed it in <ol>
21:01
<TabAtkins>
And the point is, <template> is just the generic "how to do templating in HTML" solution. If you can imagine someone ever producing some markup from a template in JS (which I totally can with the contents of an <hgroup>), it should be allowed.
21:01
<Hixie_>
yeah, that's fair
21:01
<zcorpan>
allow in the same places we allow <script>?
21:01
<Hixie_>
zcorpan: it's allowed in many more places than that
21:01
<Hixie_>
zcorpan: e.g. in <ol>
21:02
<zcorpan>
why don't we allow <script> there?
21:02
<Hixie_>
sweet lord this means <ruby>'s content model is going to get EVEN MORE complicated
21:02
<Hixie_>
zcorpan: dunno, but we don't
21:02
<zcorpan>
ok
21:02
<Hixie_>
(we can consider changing that, but let's do that in a separate change!)
21:04
<Hixie_>
ah! no! saved by phrasing content. ruby can remain no more complicated than it already is.
21:04
<rafaelw>
hixie: sorry. here now.
21:05
<Hixie_>
rafaelw: hello sir!
21:05
<Hixie_>
rafaelw: question for you
21:05
<rafaelw>
shoot.
21:06
<Hixie_>
rafaelw: any idea why the "template contents" insertion mode checks for 'A start tag whose name is one of: "link", "script", "style", "meta"', but not, e.g., "base"?
21:06
<Hixie_>
rafaelw: meaning <template><link><col> ends up in colgroup mode, but <template><base><col> ends up in body mode and drops the col?
21:06
<rafaelw>
the idea was that there would be a set of elements which didn't "select the implied context element"
21:07
<rafaelw>
link, script, meta, style was (mainly) the list I got from tab (& you, irrc) at the time.
21:07
<rafaelw>
i think it would be fine to add more elements to that list.
21:07
<Hixie_>
ok
21:08
<Hixie_>
how about adding all the elements that are handled in "head" mode?
21:08
<Hixie_>
that seems like the least arbitrary list
21:08
<rafaelw>
what is that list?
21:09
<rafaelw>
(other than what we've already mentioned?
21:09
<Hixie_>
one sec
21:09
<Hixie_>
"base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title"
21:13
<Hixie_>
TabAtkins: so should we raise a validator warning if you use a <template> in a specific place, e.g. <ol> or <colgroup>, and put elements inside it that are nonsensical there?
21:13
<TabAtkins>
I think it's reasonable to more or less treat <template> as transparent, yes.
21:13
<Hixie_>
TabAtkins: it seems like that would more likely be an error than not, no? and if you want to do a random template, you can always put it in flow content...
21:14
<rafaelw>
So it seems clear to me that <style> and <script> should not select the implied context.
21:14
<Hixie_>
TabAtkins: well, it can't be only transparent, since e.g. you want to allow those specific templates in random places in <body> and <head>, right?
21:14
<Hixie_>
rafaelw: agreed
21:14
<TabAtkins>
Oh, true.
21:14
<rafaelw>
the rest of the metadata elements I wonder whether they should select <head> as the implied context.
21:15
<Hixie_>
rafaelw: there doesn't seem to be an advantage to doing that. it would just prevent us from using those elements anywhere later.
21:15
<Hixie_>
rafaelw: (e.g. as we have now with <link> and <meta>)
21:16
<rafaelw>
meaning <link> can now be used outside of head, e.g. for HTML Imports?
21:16
<Hixie_>
for microdata
21:16
<rafaelw>
and meta?
21:16
<Hixie_>
link and meta in <body> are currently defined for microdata
21:17
<Hixie_>
but they and the others could be used for other things, they parse just fine
21:17
<rafaelw>
yeah. i mean, I guess it's ok to allow the metadata elements to not select the implied context.
21:17
<rafaelw>
it kind of breaks down the mental model we were shooting for, though.
21:17
<TabAtkins>
Jasper: Thanks for bugging me; the railroad diagrams are fixed now.
21:17
<Hixie_>
rafaelw: what's the mental model?
21:17
<rafaelw>
which was that for any given input, you can point to a sane element which had you applied innerHTML to that element, it would have produced the same fragment.
21:18
<rafaelw>
Not totally acheivable, but that was kind of the goal.
21:18
<Hixie_>
why does this break that?
21:18
<rafaelw>
i.e. tr.innerHTML = <script><td> is ligit
21:18
<Hixie_>
(note that head.innerHTML uses 'in body', not 'in head')
21:20
<rafaelw>
Ah. Well, in that case.
21:20
<rafaelw>
Go nuts!
21:20
<TabAtkins>
zcorpan: It looks like CSSPageRule should inherit from CSSGroupingRule (to get the rule list stuff), and then expose attributes for all the properties (possibly in prose, so we can expand it without monkey-patching? Maybe that's okay, since we can just do a partial interface.)
21:20
<Hixie_>
rafaelw: k :-)
21:21
<rafaelw>
Yeah. I'm fine allowing metadata elements to not select the implied context.
21:21
<rafaelw>
I'll open a w3c bug to make sure the other editors are ok.
21:21
<TabAtkins>
zcorpan: By "that's okay", I meant just writing the exposed properties directly into the interface definition.
21:22
<TabAtkins>
Well, they should be exposed on the .style attribute, that is.
21:22
<TabAtkins>
Via a CSSPageDeclarations object or something.
21:23
<TabAtkins>
Ugh, though that means we don't have all the declaration-handling stuff from CSSStyleDeclaration.
21:23
<TabAtkins>
We need to refactor some of that stuff.
21:23
<Hixie_>
rafaelw: the other thing is that the template spec doesn't actually technically allow you to use template anywhere (like in <ol>, <table>, etc), is that just an oversight? we were talking before you got here of allowing it pretty much everywhere
21:23
<zcorpan>
TabAtkins: i don't follow
21:23
<TabAtkins>
Never mind me.
21:24
<TabAtkins>
Anyway, just shift CSSPageRule to inheriting from CSSGroupingRule instead of CSSRule.
21:24
<TabAtkins>
That'll give you the appropriate stuff for it containing at-rules.
21:25
<rafaelw>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=22501
21:25
<zcorpan>
TabAtkins: so cssRules would return the at-rules, and .style would give the margin declarations?
21:26
<TabAtkins>
Yeah.
21:26
<zcorpan>
it's not a problem that style exposes everything under the sun while @page only supports margin?
21:27
<Jasper>
TabAtkins, thanks!! This is why I love the web dev community..
21:27
<TabAtkins>
As far as I can tell, it doesn't. The declarations are just "the CSS declarations associated with the object".
21:27
<rafaelw>
hixie: looking.
21:28
<zcorpan>
sure, but there are all properties are IDL attributes on CSSStyleDeclaration
21:28
<gavinc>
Should or shouldn't test cases dealing with unicode ranges include unassigned characters? XML test cases does, but it feels good and crazy
21:28
<rafaelw>
hixie: ok, let's take those one at a time.
21:28
<zcorpan>
so you could do pagerule.style.backgroundColor
21:28
<TabAtkins>
Ah, got it.
21:28
<rafaelw>
i know that <table><template> works.
21:29
<rafaelw>
there are tests for that in html5lib.
21:29
<rafaelw>
does it look like the spec doesn't allow it?
21:29
<TabAtkins>
The clear answer is that we need to pull all the generic machinery out to a superclass, and then just have CSSStyleDeclaration inherit from that and apply the generic CSS properties.
21:29
<TabAtkins>
And page rules can do the same, but for the page properties.
21:29
<zcorpan>
yeah, that seems like a sane way to do it
21:30
<zcorpan>
although you can't tell what order was used for at-rules and declarations, but i guess that's fine
21:30
<rafaelw>
ol looks like it works as well.
21:30
<rafaelw>
what am i missing?
21:31
<Hixie_>
rafaelw: i'm not talking about parsing, i'm talking about document conformance requirements. what's allowed for authors to do.
21:31
<zcorpan>
i.e. @page { @bottom-left {} margin:1em } and @page { margin:1em; @bottom-left {} } would be represented the same
21:31
<rafaelw>
document con-what-ance?
21:31
<rafaelw>
what's that?
21:31
<Hixie_>
rafaelw: the rules that html authors follow that decides that they can't put <p> inside <ol> or <li> inside <p>
21:32
<Hixie_>
rafaelw: known in the trade as the "content mdel"
21:32
<Hixie_>
model
21:32
<rafaelw>
So, e.g. http://www.whatwg.org/specs/web-apps/current-work/multipage/tabular-data.html#the-table-element
21:32
<zcorpan>
TabAtkins: CSSFontFaceRule is inconsistent, maybe it should switch to .style after i fix CSSPageRule?
21:32
<rafaelw>
maybe should say that it's content model is ... and *template*
21:32
<rafaelw>
?
21:33
<rafaelw>
its
21:33
<TabAtkins>
zcorpan: Right, you can't tell order. The only place where I imagine that'll ever matter is when we do @mixin or the equivalent, and we'll just have to figure that out when we come to it.
21:33
<rafaelw>
(just trying to understand what part of the spec we are talking about)
21:33
<Hixie_>
rafaelw: right
21:33
<rafaelw>
I see.
21:33
<rafaelw>
That hadn't occurred to me =-(.
21:33
<TabAtkins>
zcorpan: CSSCounterStyleRule is like CSSFontFaceRule. When possible, I prefer exposing the attributes directly, rather than having to go through a .style indirection.
21:33
<Hixie_>
rafaelw: (probably saying <template> has to be first, so people don't run into problems with implied end tags)
21:33
<Hixie_>
rafaelw: it's no biggie
21:34
<Hixie_>
rafaelw: i'll just add it all over the place
21:34
<TabAtkins>
Switching CSSPageRule to the @font-face style would be better imo. ^_^
21:34
<rafaelw>
Does that content model imply anything for implementations?
21:34
<Hixie_>
rafaelw: not to browser implementations, no
21:34
<rafaelw>
Or is it purely communication to authors?
21:34
<rafaelw>
I see.
21:34
<Hixie_>
validators and authors
21:34
<Hixie_>
and editors
21:34
<rafaelw>
I see.
21:34
<rafaelw>
Ok. Yup, that makes sense.
21:35
<rafaelw>
Thanks, once again =-)
21:35
<zcorpan>
TabAtkins: so at-rules via cssRules and margins exposed as hard-coded IDL attributes?
21:35
<Hixie_>
rafaelw: np!
21:35
<TabAtkins>
zcorpan: Yeah.
21:36
<Hixie_>
rafaelw: nearly done with this edit, just need to finish off the <template> section itself (element definition, idl, examples, etc)
21:36
<zcorpan>
ok
21:36
<TabAtkins>
That's my preferred solution, at least.
21:37
<TabAtkins>
Actually... if we follow the @font-face example, you don't need any of the CSSStyleDeclaration methods at all.
21:38
<TabAtkins>
They only exist to help with generic handling of the rule, since the number of potential attributes it could have is so large and continually-growing.
21:38
<TabAtkins>
For a single at-rule, the list is small and rarely-growing.
21:38
<zcorpan>
should it have an attribute for the shorthand?
21:38
<TabAtkins>
Yeah.
21:39
<TabAtkins>
If you can set it in the rule, it should have an attribute.
21:39
<Hixie_>
most. complicated. content. model. ever.
21:39
<TabAtkins>
(Plus, we expand things into shorthands all the time, so you always have to treat shorthands and longhands the same, to aid with future expansion.)
21:42
<TabAtkins>
zcorpan: Just to be sure, I'm bringing up the .style/direct question on the list, to make sure we have agreement.
21:43
<zcorpan>
TabAtkins: ok, thanks. i filed a bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=22500
21:45
<Hixie_>
wow. we have no elements so far whose content model depends on what the parent element is, except those that are transparent.
21:45
<Hixie_>
how the heck did we last that long without content models that depend on context? that's amazing
21:47
<Hixie_>
TabAtkins: hah, my definition of transparent means i can's use it here, because it means "use the same part of hte content model in which this element was placed", but for most cases, that's a part of the content model that just says "zero or more template elements"
21:48
<TabAtkins>
Hm, that sounds weird.
21:48
<TabAtkins>
Why is there any place with an explicit content model of "zero or more template elements"?
21:48
<TabAtkins>
Oh, that's what you mean by "part of"
21:48
<Hixie_>
right, like, ol is zero or more template, followed by zero or more li
21:49
<Hixie_>
so if i made template transparent, it would itself only allow zero or more templates...
21:49
<Hixie_>
and no lis.
21:49
<TabAtkins>
Hixie_: Being able to mix <li> and <template> seems useful.
21:49
<Hixie_>
yeah but <ul> <li> <template></template> <li> <li> </ul> doesn't do what you think it does
21:49
<Hixie_>
since <template> doesn't autoclose <li>
21:49
<TabAtkins>
Sure, but that's just the auto-closing rules.
21:50
<Hixie_>
right
21:50
<TabAtkins>
Only <li> closes an <li>. (Or </ul>, or probably a few more less obvious cases I don't rely on.)
21:50
<TabAtkins>
On the other hand, I have a use-case for mixing static <li>s at the start of the list with a bunch of dynamically-generated <li>s following.
21:50
<TabAtkins>
My recipe app does this with the list of recipes on the week planner page.
21:50
<Hixie_>
i suppose we could allow it
21:51
<TabAtkins>
It starts with "Free Entry" and "Fasting", and then lists all the actual recipes in the db.
21:52
<Hixie_>
you gonna want <dl> <dt></dt> <template></template> <dd></dd> </dl>, or should i force <template> to replace entire groups in <dl>?
21:52
<TabAtkins>
Mixed. I can see using <template> to just fill in <dd>s.
21:53
<TabAtkins>
Resist the urge to add nanny restrictions. ^_^
21:53
<Hixie_>
i don't see them as restrictions, i see them as helpful ways to catch errors
21:55
<zcorpan>
you can't force <template> to replace entire groups anyway. say you have <dl><dt><dd></dd> <template></template> <dt><dd></dl>, if the template inserts a dd it becomes part of the earlier group
21:56
<Hixie_>
the content model of the <template> in that case could also be to have entire groups
21:56
<zcorpan>
ah ok
21:56
<Hixie_>
(but won't)
21:58
<Hixie_>
ok, so the current <dl> content model is: Zero or more groups each consisting of one or more dt elements followed by one or more dd elements.
21:58
<Hixie_>
what should it be, to allow <template>?
22:00
<Hixie_>
zcorpan: (btw if you want scripts allowed everywhere, it'll be trivial to make that happen once i've done all this work -- just make template and script have a new category, and replace "template" with that category everywhere in the content models. file a bug if you want that.)
22:01
<zcorpan>
Hixie_: ok
22:04
<zcorpan>
done
22:13
<annevk>
Hixie_: you want something similar to transparent I guess, it's valid (almost?) anywhere so just ignore it for the purposes of the content model of the parent
22:50
<Hixie_>
so it was brought to my attention that actually you might well want any random content model
22:51
<Hixie_>
e.g. <ol><template>Hello</template></ol> might be used by a script to stamp out <li>s which it then fills with the template.
22:53
<annevk>
yeah, I think <template> is basically anywhere and anything
22:54
<zcorpan>
<ol><template><td>hello</template></ol> ?
22:54
<TabAtkins>
annevk: Yeah, our argument was that, at least for normal <template>, let it be anything, because you dont' know what it'll be used for. When you mix in MDV and <template iterate>/etc, you can do content checking, because you have declarative knowledge of what it'll be used for.
22:54
<zewt>
i've done that sort of thing with <tr>'s with manual templating for table entries, recall it being sort of annoying
22:54
<TabAtkins>
zcorpan: Nearly that exact example was used in our convo. ^_^
22:57
<Hixie_>
anyone have a link to rafaelw's mdv spec, if such a thing exists? (not sure i know what i'm asking)
22:57
<rafaelw>
mdv? what's that?
22:57
<rafaelw>
;-)
22:57
<rafaelw>
There isn't a current "spec"
22:57
<rafaelw>
The spec is the code
22:57
<zcorpan>
btw tomorrow is my last day before several weeks of vacation, so if there's something i should fix tomorrow, lemme know :-)
22:57
<rafaelw>
The design has evolved to the point that it is conceptually two additional primitives.
22:58
<Hixie_>
zcorpan: yeah, what if they are going to stamp an <li><table>...<tr><th>... and then append the template
22:58
<rafaelw>
I'm planning to "spec" those (probably hand-wavy) to see if I can get anyone interested again.
22:58
<rafaelw>
Anything in particular you are curious about?
22:58
<Hixie_>
rafaelw: the context is i'm trying to work out if there's a context in which more detailed content models (ways to catch authoring mistakes) would help
22:58
<Hixie_>
rafaelw: so mostly i'm curious about what hte markup looks like
22:59
<rafaelw>
i see. then, yeah, there are some examples here: https://github.com/Polymer/mdv/tree/stable/examples/how_to
22:59
<Hixie_>
thanks
23:01
<Hixie_>
TabAtkins: fffffffffuuuuuuuuuu, <table> content model is even more insane to add <template> to arbitrarily
23:01
<TabAtkins>
Hixie_: Hahaha! Mine is an evil laugh!
23:01
<Hixie_>
seriously wtf, i don't even
23:02
Hixie_
finds a hack
23:02
<Hixie_>
", optionally with one or more <code>template</code> elements between any of the other elements"
23:07
<zcorpan>
should https://github.com/Polymer/mdv/blob/stable/examples/how_to/conditional_template.html be valid?
23:07
<gsnedders>
TabAtkins: What are you trying to do!?
23:07
<gsnedders>
TabAtkins: Trying to stop html5lib from putting foreign elements in a namespace?
23:08
<zcorpan>
seems like it shouldn't be using <ul>
23:08
<gsnedders>
TabAtkins: I don't see anything weird in that spec?
23:09
<gsnedders>
TabAtkins: Give me better bug reports, damn it! :P
23:10
<TabAtkins>
gsnedders: Basically, yeah. ^_^ I fixed it by using html5lib's serializer, which I didn't realize was even available. I was using lxml's serializer before.
23:10
<TabAtkins>
Which only serializes as xhtml, and so puts the namespaces stuff on <svg>.
23:10
<annevk>
Hixie_: sounds like MikeSmith is gonna love you
23:12
<gsnedders>
TabAtkins: Well, duh. lxml's serializer outputs XML. (Or does it have an HTML serializer?)
23:13
<gsnedders>
TabAtkins: html5lib's serializer doesn't really work for foreign content, but does most of the time. Breaks when you have namespaced attributes on foreign content, I believe.
23:17
<TabAtkins>
gsnedders: Well, I kind of expect that "html.tostring()" would output html. ^_^
23:17
<TabAtkins>
Luckily I don't care about namespaces stuff in foreign content. I just copied code from anolis.
23:25
<gsnedders>
TabAtkins: Oh, there is an html.tostring. But yeah, that just uses libxml2's HTML stuff. Which, as know, is shit.