Skip to main content
View on YouTube to comment and like!

Syntax Video

Weird and Obscure Web Dev Trivia

Chapter 1 00:00

Transcript

Welcome to syntax. Today we have three-way stumped. We've all brought three weird and obscure HTML, CSS, JavaScript questions, and we're going to try and stump each other and see who has the best knowledge for this. You guys ready? Let's do it. I'm ready. Hand on the buzzer. All right. Available under a Dash WebKit prefix since Chrome version 1, this CSS property allows us to define multicolumn layouts.

Um, okay. Wes has buzzed in. What's your answer, Wes? A WebKit columns. Yeah, I'll I'll accept it. Yes. Yes. Yes. [laughter] I didn't realize that that was only a WebKit prefixed one. I've just been writing that raw. No, you can write it raw as well. Well, yeah, you can now, but it wasn't.

What I was saying is like you've can do it with a WebKit prefix since Chrome version one. They've since Yeah, they've since stabilized it, but yeah. So columns uh it's under this group but you typically can break it down into like column count or column width [music] and usually it was used for text right if you want to break text down into two or three columns on your page we don't need CS I mean this was before CSS grid before flexbox uh so literally all you need is column count and it'll break those elements up into multiple columns.

Yeah, in practice, I found this API to be only useful when you're trying to do like a newspaper style columns cuz anytime you try to use it for actually laying things out, it's a giant pain in the ass. Yeah, cuz the flow is different than CSS grid. It goes down then back up and then down, it's it's a different flow than CSS grid. Yeah.

The way that you can use this is if you want to get Pinterest um working. So, if you want things to stack perfectly inside of each other, now that CSS [music] masonry grid is dead, you have to set an explicit height on your container and then it will go it'll go down. So, like 1 2 3 and then it'll wrap up to the second one 3 4 5 6, which is almost never what you actually want. Usually want it to go like 1 2 3 and then go back to the first column for 46.

So, yeah, not a great API. There's very little control. Nice. Right. Great job, Wes. All right, y'all ready? Y'all ready for us? Okay, the question is, what does this select? Wes, this uses CSS donut scoping um where it defines a scope starting at the article body and then stops the scope [music] at the figure. So that scope inside of anything inside of that figure does not continue to cascade. [snorts] Yes. And what about just what about the figure itself though?

When there is a direct descendant [music] of the scope. Perfect. When there's a direct figure descendant of the scope, this [music] will donut scope to that. Yes. Fascinating. I' I've never used this. What's the support like? Is this is this out there? It is out. It is available in every browser and is in Safari or is in Firefox nightly currently. So, it is it is dropping.

Yeah, it's dropping it way. Nice. for the 2% of Firefox users still out there. All right. Uh I I can't win my own, so I'll have to take this one off. Are you guys ready? Ready. Let's do it. According to the CSS color for specification, how many named CSS colors are there?

What uh can we have a range? Green, golden rod. If both of you get it wrong, we'll do closest without going over. If both of us get it wrong, we're both going to get it wrong. All right. Well, then guess close. Yeah, I'm I'm guessing. Uh my guess is 124. Okay, that is incorrect.

Close, though. Is Oh, don't don't say that. You You gave Scott 200. Oh, wrong. There's 148. Uh there was 147 in, but yep, they added CSS colors 4. We added Rebecca purple. So, it's 148. I figured they would have added some more by now. Yeah, they should add some like fun ones, you know, like like I guess we have papaya whip already. Like if you were to add a color to CSS, what would you what would you add?

Syntax yellow. Yeah, syntax yellow. Syntax yellow. I would do something funny like um or like what if we could have like named gradients, you know, like like boine cow or something like that. That would be really nice, you know, just some some nice built-in ones. Man, we got a petition to get syntax yellow on there. That has to Yeah, that would be great. CJ gets the point on that one.

Sweet. It was closer without going over. All right. In the year 2005, the following code was valid JavaScript in what web browser in 2005. 2005. Oh, all right. West in. What do you got? Yeah. I don't have an answer, but I'm going to say say IE7.

No, I'm going to say IE5. No, I [laughter] wasn't doing that. That was way older. We'll bounce back. It would have existed in 2005 back and forth. Yeah. So, Wes, what do you got? What's the name of the other browser that was around? Not I. It starts with an N. Why am I blanking on the name of that browser? Can I Google?

No. No. Oh, my Google Home just went [laughter] off. [gasps] Um, Firefox. Yes. Yes, that is correct. This looks like JSX, right? It looks like like why is there some why is there some HTML in my JavaScript? So this is known as ECMAScript for XML or E4X. Um and there was a full-on specification like it came out in 2004. So since the year 2000 over 20 years ago, they were trying to put uh XML into our JavaScript. And the initial idea was you could actually create uh XML objects cuz you know like there's a there's an API for like this creating a new XML element and passing a string into it. Uh this is the current API that we have, but this was a proposal to be able to write code that looks like this.

Oh man. Yeah. And so even like there's the Yeah. The Yahoo Developer Network talked about how to do this. There was also like a query language for it. So if you have actual like XML data, you could there was syntax almost like JSON like syntax for getting into this XML. So like you could filter where data.em.source is Amazon. This line of code would filter this list down uh to That's cool.

This is what they took from us. Yeah, that seems [laughter] like not that long ago, but also so long ago. Yeah. Infinite amount of time ago. Yeah. So, yeah, Wes gets this one. He's He's uh in the lead right now. I'm very smart. I told you. Well, and because I don't want to win this, I have uh two questions for you all both, giving you an opportunity to score even more points than me. So the first JavaScript question I have for you here is which of the following are globals in [music] JavaScript?

It's multiple choice. Which of the following? Okay. [laughter] I know I buzzed I buzzed in first and I'm going to say yeah uh data view. Data view is a global but it is not the only one. Wes. Oh, uh, reflect, data view, and a sync function.

You're both wrong. What? I think reflect and data view are JS globals. [music] You're wrong, Wes. Okay. Uh, I think they're all globals. Yes, Wes. They are all globals. And with that, what does atomics [music] do? That's your bonus question. You get bonus question time.

Is this an open open book quiz? Atomics is a atomics is a library for dealing with um not a library sorry it's an API for working I want to say has something to do with time but now I'm trying to think it's maybe something to do with data uh all right you can both uh buzz in CJ if you if you can figure out what atomics is before [music] Wes can you can answer it yeah um it's for working with uh arrays like typed arrays so it's atomic operations on typed arrays Yeah. What is an atomic operation like mutating it like add or remove?

I don't know if it's for arrays specifically, but when memory is shared, multiple threads can read and write the same data in memory. Atomic operations make sure that predictable values are written and read that operations are finished before the next operation starts. And there's a whole host of atomics [music] atomic pause, atomic store, sub, wait. Um, so I don't think it is limited to just arrays, but CJ, you were way closer cuz it has nothing to do with dates.

All right, you guys ready? 3 2 1. Is this valid JavaScript? Oh. Um, buzzed in. Oh, CJ buzzed in. I should just CJ buzz in. You got to make a buzzing sound with your your your mouth. All right, CJ. Uh, as long as you don't have any zero width characters in there. Yes, it is.

It is just spaces. Just white spaces. That is correct. Cool. Because JavaScript ignores whites space. You can definitely put as many white spaces in there as as you want. Um, and I find that sometimes helpful if you don't want to put brackets around something like this. You can simply just put a space. I I don't use that at [laughter] all.

I put that in when I'm in the dev tools and I don't feel like wrapping it in a in [music] like going back to the start and wrapping it. You just put a couple you put a space in there and it will work. You can just do something like this. Where that's also useful is um when you chain if you have like an array like and you want to chain them. Yes.

Right. That's because our spaces. Yeah. Okay. So weird. Eh. All right. To the HTML questions. Scott, go back in time to when you were first making websites. This is No. Don't Don't help him. He has zero points. is not. No. All right. Only available in Internet Explorer. This HTML element set up a sound to be played in the background.

Oh, come on. BG sound. You got it, Wes. Oh, did you ever use this? Oh, yeah. I used it on MySpace. I've never used BG sound. Yeah. So, this is this is obsolete. And so, this was before HTML 5. Um, and basically you could pass in like a MIDI file or an AU file [music] and it would play sound in the background. And this was the era when you when uh sites didn't have to ask you this either. So you would just go to a site and all of a sudden it would start playing music.

Auto played. Yeah. Is Is that how they did the hamster dance? I bet it is. [music] Yeah, I think so. Scott shambles. I [laughter] listen if anybody has ever seen me in a high pressure uh quiz situation, you know that I crumble immediately. Wes, [music] we all saw this at the uh Family Feud. My brain just goes blank. It just blanks. Uh my question is, what are command and command for attributes in HTML?

Hey, man. Wow, that was fast. Um this has to be exactly right or you don't get the points. [laughter] [gasps] Uh this is the a new API in HTML and JavaScript that allow you to declaratively like do things. Um so like like opening and closing of modals or or one example we gave on the podcast was being able to uh declaratively make pause and play buttons. [music] Um, so you would register them with JavaScript and then you'd be able to just say command and [music] command four where command four is for the element and then the the command itself would be like pause or play. Um, so there are a number of built-in ones as well as you can register custom ones.

Wes with a very thorough and very correct answer. Nice. You got you nailed that answer. [laughter] That's a cool API. I'm excited for this. Is it related to the HTML invoker API? It is the invoker API. That's the name. Sorry, I didn't even say that. Invokers API. I I don't even know if they really refer to them that much as invokers anymore other than just [music] command. It is a invoker commands API is is what it is called technically. Yes, I think the invokers API is the way to create custom ones and then just the command and command 4 are the like properties like and what are the what are the ones that are built in?

The ones that are built in are for popover and modal right now. So basically being able to trigger a popover or a modal and then there is a nice API for custom ones [music] um as is right now. And guys it's available in every browser except for well it's in Safari technology preview.

So if you're on Mac OS betas it's available on everything right now. So shout out. It's it's in Firefox proper. [music] So yeah. All right. You ready? This is valid JavaScript. Yes. Bing. Explain what and why an HTML page might be emoji baked.

Emoji baked. Uh I I pinged in Bos. Um I don't even know what emoji baked is. I'm going to guess, folks. I got to get a point. Emoji baked [music] is when an emoji has been manipulated incorrectly.

No, I'll take a guess. I've never actually heard the term. Maybe this has something to do with just like ASKY encodings. So if a page has like the encodings are actually sent over in the source of the HTML [music] um instead of the emojis themselves. I don't know. I I don't know. I don't know. Am I close? I'm on the right track.

No, you're right. You're right. You're on the right track. Is it you? Is it when it's not UTF8? Yes. Okay. Give it to Scott kind of. [laughter] And emojis show up as text charact or they shows up as the Yeah, [music] the wrong they don't show up as emojis. So, we had this happen on the syntax Slack channel the other day where our RSS feeds were being piped in and we were getting random Chinese characters show up. Um, and we're like, what the heck is going on? And we couldn't find these characters anywhere in it. [music] So I finally just copy pasted the Chinese characters which translated to nothing [music] and I copy pasted it into chat. I was like what's going on?

And they said this is emoji baked meaning that the [music] encoding of our feed was UTF8 [music] but it was being ingested as a some sort of other encoding. So essentially when you ingest text that's been encoded as something other than UTF8 and you you parse it separately then all of the code points of UTF8 are off and and you end up getting like other random characters.

In this case they were offset by a certain amount and they were just showing us random Chinese characters. I don't know if I deserve points for that answer but I'm going to give CJ a half a point for that one. I I was just, you know, this this is like the classic uh testing interview strategy of just like start talking and maybe you'll get it right because I had no I had I had no idea.

All right, hold on. We feel bad for Scott for doing so poorly. So, we're going to give him a chance to bring it home. My question is a CSS question. The font property in CSS is a shorthand for all of the or many of the font properties. I will give you one point for every shorthand property that is able to be setable in the font property.

So, you know, when you set a font, you can use a shorthand to set a number of font properties. I'll give you one point for every single one that is available in there. Okay, I love the pity question. Um, font size, font weight, font style. Yeah. Three font variation settings.

Yes, that's four. Font family. Did we say that one? No. Five. You only need one more to win the game. Scott, I remember even like what they are, but I don't know what the proper like I don't know what the proper names are. Tell I'll tell you there's eight.

So, there's three more and I don't know that you would ever get it. Well, there's one more I think you could get. One of them is for limiting like if it can do [music] the uh browser based with for bolding. I don't know. Font liature settings. I don't know. Yeah. All right. So, we're going to give you five points. Does that that doesn't that's not enough to win it. The other three were going to kick yourself for this one. Line height.

Oh, cuz that can be defin Okay. I was just thinking about font hyphen properties. And then the other two were font width width and system family name which I don't even know. The system family name is an option of caption icon menu message box small caption or status bar.

That would be crazy if I would have gotten that one. Yeah, you [laughter] would have known I was cheating. You would have known that was [gasps] Oh well, good job, Scott. Those ones where you have to list them all off, you're actually very good at. So, good job. And I don't have to buzz. If I don't have to buzz, [music] I You're not stressed out. Yeah. Yeah.

Awesome. Thank you so much for watching. Let us know how you did down in the comments. Did you get all of these right? Did you get any wrong? Um, and we'll catch you in the next

Quote it with credit and a link. Quoting Syntax