10:06
<MikeSmith>
TabAtkins: since css-parse.js no longer provides a parse(...) function I'm trying to figure out what to call instead
10:06
<MikeSmith>
ok I see https://github.com/tabatkins/parse-css#parsing-functions
10:08
<MikeSmith>
TabAtkins: so now I'm wondering, if I'm parsing the contents of a sizes attribute, what should I use
10:12
<MikeSmith>
TabAtkins: OK I see I have my code doing `cssParser.parse("@media " + unparsedSize.toString() + " {}");` so I suppose I need to try parseARule()
20:31
<TabAtkins>
MikeSmith: Ooooof, no, that code's definitely wrong.
20:31
<TabAtkins>
MikeSmith: The spec should describe this, let me dig it up to ensure I'm remembering right.
20:33
<TabAtkins>
MikeSmith: Here you go: https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-sizes-attribute
20:33
<TabAtkins>
Use parseACommaSeparatedListOfComponentValues() first, then follow the algo for each component of the returned list.
20:34
<TabAtkins>
(Basically just find the last non-ws component value for the size, and if there's anything non-ws preceding it, parse that as a media query.)
20:36
<TabAtkins>
I mean, using that sort of string concat will sorta work, but only because the parser doesn't do any validation anyway, and it'll act incorrectly in the presence of some markup errors (like putting a `{}` in your sizes attr). It doesn't do any special work for you - it'd just return a CSSRule with a type of "media" and a prelude of the token stream it got
20:36
<TabAtkins>
out of unparsedSize.
20:38
<TabAtkins>
(HTML's lack of deeply nested headings makes large sections like <img>'s really hard to navigate.)
21:07
<Ms2ger>
HTML's lack of deeply nested headings?
21:07
<Ms2ger>
Are you high?
22:07
<TabAtkins>
Ms2ger: IT DOESN'T NEST DEEPLY ENOUGH
22:14
<Ms2ger>
Will it ever?
22:35
<TabAtkins>
Well, for my purposes, if it puts the major <img> algorithms in their own subsections, like the <picture> spec did, that would be enough.
22:36
<TabAtkins>
For some reason <img> thinks it's desperately important to give a heading to every single alt='' use-case, but crams every single other part of its processing model into a single undelineated section.
22:39
<Ms2ger>
Well, ask and you'll probably get some headers :)
22:43
<TabAtkins>
Hixie: ^^^
22:44
<Ms2ger>
He'll probably say "file a bug"
22:45
<TabAtkins>
Heh.
23:52
<MikeSmith>
TabAtkins: yeah that code I cited isn't that part that does the actual checking of the specific requirements for sizes in the HTML source/img spec; instead it's some separate code that runs just to to do an additional syntax check on the <source-size> and <source-size-value> parts.
23:54
<TabAtkins>
MikeSmith: Well, running it through @media doesn't actually help anything; there's no syntax checking above the base statement/rule level.