#dev | Logs for 2017-06-05

« return
[13:06:53] <TheMightyBuzzard> FatPhil, merging your PR. go ahead with standardizing our output if you like. don't remove the bits that intentionally strip out entities from user input though. i'm not cool allowing them until Bytram's had time to test every evil combination he can think of on every browser he can find.
[13:09:17] <TheMightyBuzzard> something being standardized doesn't mean it's not exploitable. like it being perfectly legal to stack 500 diacritics on a letter using unicode.
[13:12:22] <Xyem> Woo, it got merged! Thanks :)
[13:12:46] <TheMightyBuzzard> we intentionally break with standards to prevent that and we will absolutely do so for anything else that can be made into a nuisance or worse.
[13:12:52] <TheMightyBuzzard> yup yup
[13:17:02] <TheMightyBuzzard> Folks, I am currently entirely off caffeine to hopefully avoid seeing a doctor about my kidneys. Withdrawls are roughly 10x worse than from adderall(amphetamine+dextroamphetamine). Doing my best not to be an utter bastard to people but it's not remotely easy.
[13:18:36] <FatPhil> when I cold turkeyed from coffee because of messages from my kidneys, I used to go to the coffee room, and drink nothing but pure water, and just sniff the coffee others were pouring. I managed to convery my craving into a smell craving.
[13:20:11] <FatPhil> TMB: my '&' -> '&amp;' changes should have no negative side effects, unless we later try to reparse the url we're creating.
[13:20:20] <TheMightyBuzzard> i had to cheat this morning and down a small cup of real coffee instead of decaf. the headache and jonesing was just too harsh.
[13:21:08] <TheMightyBuzzard> FatPhil, nod nod. it's possible we do but all that would cause is more standards failures which won't keep me up at night.
[13:22:37] <FatPhil> Hmmm, even then, the only context I can imagine that happening would be if we're trying to show the URL as well as link to it, that that's CDATA too, so would also benefit from &amp;
[13:22:46] <FatPhil> So it's on dev now?
[13:23:10] <TheMightyBuzzard> nah, just merged it. i'll put it up real quick though.
[13:24:04] <FatPhil> Let me save a few before pages...
[13:24:22] <FatPhil> so I can diff the after pages and check the expected has happened.
[13:25:10] <TheMightyBuzzard> okey doke
[13:26:04] <TheMightyBuzzard> if you have a kerberos login you can check vs our staff rehash instance
[13:27:19] <TheMightyBuzzard> gonna grab a smoke while ya do
[13:27:58] <FatPhil> front page and one story saved localy (and also validator pages in a tab) - I'm all good, merge at your leisure!
[13:32:57] * FatPhil wonders if he can do anything clever with the 2L of cherry ice cream (with real cherries) that he bought yesterday, but forgot to put in the freezer :(
[13:36:30] <TheMightyBuzzard> ouch. not sure i'd risk it if it's been at room temperature overnight.
[13:36:52] <TheMightyBuzzard> okay, dev's up to date with master
[13:41:07] <FatPhil> Before: Result: 875 Errors, 124 warning(s)
[13:41:19] <FatPhil> After: Result: 212 Errors, 119 warning(s)
[13:41:54] <FatPhil> (that's the 70 comment long article)
[13:42:16] <TheMightyBuzzard> nifty
[13:43:51] <FatPhil> manually checking the diffs, to be sure.
[13:45:49] * TheMightyBuzzard is currently fixing a bug in the irc library MrPlow uses
[13:47:08] <TheMightyBuzzard> ok, well i was going to but the code makes no sense to me right now
[13:48:36] <FatPhil> Everything looks exactly as intended
[13:50:08] <TheMightyBuzzard> good deal. a rare and joyous circumstance.
[13:52:14] <TheMightyBuzzard> aight. i'm out. breakfast and something away from people to keep my mind off the headache and jonesing.
[14:11:50] <FatPhil> Anyone got any smarts with this modern CSS nonsense?
[14:12:30] <FatPhil> Can I use ``elem.cl { ... }'' to style only elements of type elem that have class cl?
[14:13:53] <FatPhil> It looks like I can use CSS2 to do ``elem[class~=cl] { }''
[14:17:09] -!- cmn32480 [cmn32480!~cmn32480@Soylent/Staff/Editor/cmn32480] has parted #dev
[14:29:11] <FatPhil> Hmmm, no matter, there's a simpler approach... I can get it down to
[14:29:14] <FatPhil> Result: 84 Errors, 119 warning(s)
[14:30:20] <FatPhil> just need to remove some DOM abuse...
[14:34:12] <TheMightyBuzzard> FatPhil, aren't you looking at that backwards? ".class element {blah;}" should do what you want, no?
[14:34:43] <FatPhil> that's an element of type element inside an element with class class
[14:34:54] <TheMightyBuzzard> ahh, nod nod
[14:35:28] <FatPhil> CSS syntax is pretty ad hoc, and basically pants
[14:36:17] <FatPhil> however, I'm glad the w3c came up with it, as it proves that they aren't prepared to eat their "XML for evarything!!!" dogfood.
[14:36:27] <TheMightyBuzzard> i think what we generally have done is make the class unique to those elements and style the class. our css is far from optimized but it works more or less.
[14:37:27] <TheMightyBuzzard> blerg. xml can eat my entire ass.
[14:38:22] <FatPhil> yeah, if even they didn't use it, that means we're all free to ignore it as a failed experiment too.
[14:39:07] <FatPhil> I love the (various) Naggum quote(s) about XML
[14:39:55] <TheMightyBuzzard> it's like the worst case scenario of line noise in a perl regex or an infinitely wacky C pointer declaration
[14:40:29] <FatPhil> Here we go, one of my faves: http://harmful.cat-v.org
[14:45:23] <TheMightyBuzzard> blah. have that patch written up but i don't remember how to use a local library in Rust. i'll screw with it later. i need nicotine and something to keep my mind occupied without actually making it work.
[14:48:58] <FatPhil> Looks like there's a ton of stuff that's entirely <b>bold</b>, and which could be simple styled that way without needing the inner <b> tag.
[14:58:42] <FatPhil> Hmmm, I can't see anything that would be styled with this line:
[14:58:44] <FatPhil> .nbutton a:hover {background-color: #555}
[14:59:55] <FatPhil> there are no a's within .nbutton's, only a's within b's within p's within .nbutton's.
[15:05:27] <Xyem> When I added CSS, I just followed BEM naming. At the very least, it sticks out so it can be found/changed if wanted.
[15:05:45] <FatPhil> BEM?
[15:06:23] <Xyem> For example, .purchasesub(BLOCK)__duration(ELEMENT)
[15:07:29] <Xyem> And then if you have a modifier (like size), it would be .purchasesub__duration--big
[15:07:54] <Xyem> I've only just come across it, so I probably haven't followed it very well: http://getbem.com
[15:08:14] <FatPhil> Ah, OK.
[15:09:06] <Xyem> For example, it may be that the input selectors are meant to be an element, rather than the list they are in..
[15:09:07] <FatPhil> I'm no fan of the modern CSS obsession.
[15:09:30] <FatPhil> In the old day it was semantically meaningless tag soup of random different tags.
[15:10:01] <FatPhil> Nowadays it's a semantical meaningless tag soup of <div class="random classes">
[15:11:24] <Xyem> And if you follow BEM, it's <div class="random classes withreallyabsurdlylongnames">
[15:17:48] <FatPhil> https://github.com
[15:35:46] <FatPhil> TMB: looks like ``elem.cl'' is a valid way of demanding both an element type and a class to match
[17:22:38] <FatPhil> paulej72: can you explain 56a8c6ff8b54e8ea7d2811fc7ced861f3c04e381 "Fixes man, fixes"?
[17:23:25] <paulej72> Let me look
[17:24:42] <FatPhil> autocomplete (a) is HTML 5 only, and we're HTML 4.01; (b) doesn't apply to checkboxes, even in HTML 5 - what would it even mean to "autocomplete" a checkbox?
[17:25:14] <FatPhil> use --color-words for ease of viewing
[17:26:41] <paulej72> some shit ass browsers remember your checkbox status on reload. I added that to make sure the browser would not check the boxes if they were not susposed to
[17:27:14] <FatPhil> you mean they ignore
[17:27:22] <FatPhil> checked="checked"
[17:27:40] <paulej72> IIRC i thought I got this from some search I did after FF was keeping the boxex checked on reload
[17:28:20] <FatPhil> You wouldn't need to RC if you put the reason behing the change in the commit message, just sayin'.
[17:28:37] <paulej72> I think it was for the unchecked ones being set after setting them by clicking then reloading
[17:29:56] <paulej72> sure, but at the time i was just trying to get things to work correctly and was not really worried about documententing
[17:30:38] <paulej72> Is that coming up as invalid html
[17:30:56] <FatPhil> Yup. As is the />
[17:31:11] <FatPhil> HTML4.01 is not XML or XHTML
[17:33:59] <paulej72> wonder how many vailicdation errors we would get if we whent html 5?
[17:34:37] <FatPhil> Loads, from all the html 4-isms :(
[17:35:53] <FatPhil> w3 validator for html 5 is crappy, alas
[17:38:13] <FatPhil> 5's a big change from 4, I don't think it gives us anything we desperately need.
[17:38:26] <FatPhil> And it's a "fluid" standard (i.e. not a standard at all)
[17:38:50] <FatPhil> paulej72: this issue? https://stackoverflow.com
[17:39:31] <paulej72> yeah that page looks familiar
[17:42:49] <FatPhil> Man, Firefox looks fucked in the head.
[17:43:20] <FatPhil> It's only one validator error, I'll ignore it, and aim for the ones with more impact on the #errors
[17:44:43] <FatPhil> oooh yeah, I think I know what patch I'll do next, I think I can get it to Result: 83 Errors, 2 warning(s)
[17:45:11] <FatPhil> not bad considering this morning it was at Result: 875 Errors, 124 warning(s)
[17:47:00] <paulej72> man that is impressive, keep up the work :)
[17:49:32] <FatPhil> It's an inflated figure, as it's a big story I'm looking at, so many errors are repeated.
[18:05:26] <FatPhil> emacs is braindead... git is braindead...
[18:35:10] <FatPhil> paulej72: what's the id used for in things like this:
[18:35:16] <FatPhil> <h4 id="31229" class="noTH"><label class="commentHider" for="commentHider_31229...
[18:47:16] <FatPhil> ouch!
[18:47:26] <FatPhil> The obvious...
[18:47:35] <FatPhil> not good...
[19:11:33] <FatPhil> Do you consider there to be a highly significant difference between
[19:11:37] <FatPhil> https://dev.soylentnews.org
[19:11:53] <FatPhil> and https://dev.soylentnews.org
[19:14:23] <paulej72> #commentwrap is the start of comments below the story. #31295 is the specific comment that was just modded or replied to. differnt ops will put the one or the other at the top of the reloaded page.
[20:09:52] <FatPhil> the problem is that fragment identifiers can't begin with a digit (for no sensible reason at all as far as I can tell)
[20:23:51] <TheMightyBuzzard> that one's likely not as easy a fix. can't just change templates because the redirects aren't in the templates.
[20:34:53] <FatPhil> ~75 of the remaining 83 HTML validator errors on the comments page are id="[0-9]
[20:36:28] <FatPhil> finding instances of /cid=(.+?)#$1/ shouldn't be too hard
[20:42:02] <TheMightyBuzzard> cid= won't often be on that line
[20:43:00] <TheMightyBuzzard> it's not gonna be real hard but it will consume some time making sure all instances get found
[20:43:49] <FatPhil> git grep '#.*{cid}'
[20:46:32] <FatPhil> there seems no functional difference between
[20:46:33] <FatPhil> https://dev.soylentnews.org
[20:46:45] <FatPhil> https://dev.soylentnews.org
[20:47:02] <FatPhil> as the only elements between those two ids are div starts, no content.
[20:48:16] <FatPhil> which provides a trivial upgrade path - fix the redirects to use comment_$CID, and when you're sure they're all fixed, retire the invalid unused ids.
[23:19:22] <Bytram> FatPhil: Kudos on diving into cleaning up our generated html / css!!
[23:20:39] <Bytram> Some of the questions you are asking sound familiar... not certain this is the doc I'd found long ago, but it seems to cover much of the material that helped me to *understand* what the different kinds of things are that can be used to identify a particular item in the html and how one of those is chosen instead of another:
[23:20:51] <Bytram> See: https://www.w3.org
[23:22:14] <Bytram> there is some use of terminology that has *precise* meaning, e.g. 'parent' versus 'ancestor' and 'child' vs 'descendent'
[23:23:26] <Bytram> to use a human analogy, a grandparent has a child which is a parent to yet another child...
[23:26:10] <Bytram> So, "A > B" means that there is an element, B, that is a direct child of an element A. e.g:
[23:28:06] <Bytram> <A href="https://soylentnews.org">SoylentNews <B>is <EM>great!</EM></B></A>
[23:28:23] <Bytram> A > B {color: red;}
[23:28:53] <Bytram> forces the text within <B>is <EM>great!</EM></B> to be colored red
[23:29:11] <Bytram> A > EM {color: blue;}
[23:30:00] <Bytram> would not match anything, because the EM is a child of B which is a child of A... there is NO case where the EM is directly a child of A.
[23:30:26] <Bytram> A EM {color: green;}
[23:32:18] <Bytram> an adjacency between 'A' and 'EM' with just whitespace between them denotes an ancestor / descendant relationship... which WOULD MATCH in this case... baring the existence of a more specific selector, this rule would present 'great!' in green.
[23:34:01] <Bytram> given the prior example:
[23:34:08] <Bytram> <A href="https://soylentnews.org">SoylentNews <B>is <EM>great!</EM></B></A>
[23:34:16] <Bytram> and these rules:
[23:34:31] <Bytram> A > B {color: red;}
[23:34:54] <Bytram> B > EM {color: green;}
[23:35:15] <Bytram> A > B > EM {color: blue;}
[23:37:14] <Bytram> A EM {text-decoration: overline;}
[23:37:53] <Bytram> ask yourself: "What would the result look like?"
[23:38:39] <Bytram> this is by no means exhaustive, but once this level of stuff started to make sense, then I could step up to things like:
[23:40:50] <Bytram> class names are denoted with a leading period, e.g.:
[23:41:00] <Bytram> .foo {font-size: larger;}
[23:41:10] <Bytram> could be referenced using:
[23:41:31] <Bytram> <b class="foo">big and bold</b>
[23:43:21] <Bytram> .bar {font-style: italic;}
[23:43:59] <Bytram> <b class="bar">bold and leaning</b>
[23:44:08] <Bytram> and now
[23:45:45] <Bytram> b.foo {text-transform: uppercase;}
[23:46:26] <Bytram> says that a element (B) using class "foo" will have all of its text folded to uppercase.
[23:47:20] <Bytram> ugh... sorry. correction:
[23:47:40] <Bytram> b .baz {text-transform: uppercase;}
[23:49:18] <Bytram> ^^ means match when a *descendant* of a b (bold) element has specified: class="baz"
[23:50:36] <Bytram> Play around with multiply-nested (and encompassing) SPANs and/or DIVs ...
[23:50:58] <Bytram> then take a look at the "specificity" section in that doc I linked to.
[23:52:42] <Bytram> It's complicated, yes -- no doubt about that. For me, picturing all the 'things' in a document being one huge Venn diagram, and the various css selectors that I coded acted to pick out a subset of that entire doc.
[23:54:18] <Bytram> ooops, forgot one important thing:
[23:55:07] <Bytram> #foobar {font-family: Times, serif;}
[23:56:45] <Bytram> the # character introduces an ID (in this case 'foobar'), which is not supposed to start with a digit (I can't remember for sure offhand whether it must start with an alphabetic character or not.)
[23:57:13] <Bytram> so, give one last example across all these:
[23:57:27] <Bytram> span {color: red;}
[23:57:44] <Bytram> .foo {font-size: larger;}
[23:58:02] <Bytram> #bar {font-weight: bold;}
[23:59:56] <Bytram> ugh, I think I outsmarted myself on that one.