So I’m back home now. The flight home was a bit shorter, about two hours, thankfully. Interestingly enough I feel more jet lagged now that I’m home then I was in Taiwan. I’ve heard that going east is worse then going west, so that might be the case for me right now. The rest of the rendering week, after I blogged last Tuesday, was just as awesome as the first part.
How Gecko Does X
I got to sit in on a lot more talks about “How Gecko does X” — like how the graphics engine works, how the layout system works, and my favourite in particular, how cycle collection works. Kyle Huey did an excellent job explaining how the Gecko cycle collector works. He gave us this paper as forward reading about it (it’s a little dense, but definitely worth reading). I’ll try to do a blog post in the future on what I learned/will learn about it.
David Baron and Adam Roach also gave an awesome talk on how the W3C and IETF work. WEBVTT is my first major exposure to open specifications that I’ve had and so I’ve been interested in all the hows/whats/whys of open specifications and the politics behind them.
Initial WEBVTT Support
It wasn’t all fun and games over in Taiwan though. We were also doing a lot of work. We finally got bug 833385 landed near to the end of the week. This means that we have support for all the new DOM elements that WEBVTT introduces such as: HTMLTrackElement, TextTrack, TextTrackList, TextTrackCue, and TextTrackCueList. We ran into a random inexplicable bug when we were doing full tries on the code, just before landing it. Ralph and I went to work debugging it (had to use an ASAN build) and we ended up discovering that it happened in a very rare situation where the cycle collector nulls out the HTMLMediaElement’s TextTrackList member while the HTMLMediaElement is still alive. This results in a situation where HTMLMediaElement::FireTimeUpdate() is called just before it is about to be deleted and since we weren’t doing null checks on the call to TextTrackList::Update() we would crash. After we got that fixed we were all green.
That leaves just bug 833382 left before we get initial support for WEBVTT. It was going well last week and we got an r+ from Chris Pearce. Now we just need an r+ from Boris and we should be good to go. It might take a few more rounds of review before that happens, but I’m optimistic we will be able to get this landed within a week or so.
One of the major problems I was having in Taiwan was trying to get a clean diff for 833382. The problem centered around the fact that up until now, mainly in my previous open-source class, we decided to use a git branch as a main point of ‘integration’. We’ve all been working off this branch for a while. The history of this branch has been so ridiculous and the code necessary for 833382 depends on so many other parts of the code that have been touched by, well everyone, that it was pretty much impossible for me to do a clean diff or even get a good rebase. To rebase this beast I would have had to go through 150+ commits, each having merge conflicts… So I ended up just making a clean branch off master and manually moving all the code that I needed over to the new branch and doing a diff like that. I’ll probably be staying away from these kinds of ‘integration’ branches in the future in order to ensure that my repo history can be more linear. Easier to get diffs that way.
The other thing I’ve been dealing with in the last few days is some code we landed back in February that was spotted to not be up to par by Boris. The issue is with some of the CSS selectors that we are using to style WEBVTT text — namely, we are using slow CSS selectors which is bad. This is the first that I’ve heard about some CSS selectors being slower than others, although that’s not suprising as I’m not super-super knowledgeable about CSS. Mozilla even has a page devoted to this that you can check out here. Ralph and I put together a patch yesterday to deal with this which will land today most likely. I’ll have to update 833382 to reflect those changes today as well.
CSS Parser Hacking
I also sat in on the vertical-text layout meeting as it is of particular interest to WEBVTT. WEBVTT requires the ability to have vertical-text and so far in Gecko we don’t have this. Apparently vertical-text has been kind of a thorn in the side of the layout team for a long time as it’s been particularly hard to implement. However, there is a major push now to get it done, so that’s great. In accordance with this Daniel Holbert asked me if I wanted to do some stuff for vertical-text in the CSS parser, I accepted and got my first layout bug! So I’ll be hacking around in the CSS parser and layout section of Gecko more in the future, hopefully.
Dave also told me the other day that he’s figured out an area of WebMaker that I can start contributing to, so I’m excited about that. I’ll be starting in about two weeks on this. I’ll most likely be splitting my time like 70/30 or something like that for WEBVTT and WebMaker. We talked briefly about it and so my understanding isn’t 100%, but what I got from our talk is that I will be implementing a kind of wrapper around an HTML5 video element that will allow Popcorn Maker to be able to work with it. From my understanding Popcorn Maker works with many different video formats/sources and so it needs a uniform interface to work with all these different videos. That’s where the wrapper comes in. It allows Popcorn Maker to work with many different video formats and sources without worrying about the particulars. However, all this might be completely wrong as I might have misunderstood some things from our brief conversation… So don’t take my word for it! At any rate I’ll do another blog post about it when I get more information.
Until next time.
This week marks the first week of my full time employment at CDOT. I’ll be getting to work on Mozilla projects all year long! Yayyyy.
I was off last week which was really good since it’s been non-stop for me pretty much since the beginning of school last September. The only downside was that when I got back this week it was really slow going. This is the most unproductive I’ve felt in a while — not that I didn’t get anything done this week. It’s just that I got back to work, sat down to get some bugs updated/fixed and write some WEBVTT code, and … I forgot everything. My brain felt sluggish — what is the proper way to malloc a pointer-to-a-pointer in C again? Typical programmer forgetting everything they’ve ever done.
The week kicked off with an orientation day at CDOT which pretty much took all day. This ended around 3:00 pm when we got to set up our physical work stations at our new desks (I’m not in a glass cage anymore where people can point and laugh at the programmer). I get to work on a beastly new Linux box that can build Mozilla-Central from scratch in ~10 minutes and a sleek looking new 15 inch Macbook Pro, so my work output won’t be as constrained by build times now :). Then on Tuesday I set up my build environment; downloading all the necessary packages, dependencies, software-dev tools, and repos. So it was only really until Wednesday when I got to sit down and look at some actual code and bugs. This is when I realized how much I had forgotten about during my break. That was pretty much all of Wednesday gone! 😦 However, I’m happy to say that as of today I’m back in commission and ready to churn out code like no tomorrow.
We also got two new people on the Mozilla team! Ali and Igor welcome to the team :). I’ve been helping them with the few questions they’ve had about things like Git, Bugzilla, IRC, etc. I’m really impressed at how fast they are picking everything up though. They’ve even fixed there very first bugs. Awesome!
The main things that I was able to get done this week was to implement the <lang> tag, a new part of the spec that was snuck in when we weren’t looking. This entailed adding a new stringlist pop function and new tests to go along with it. I also wanted to refactor the code a bit as the <lang> tag introduces some complexities that make the solution kind of a hack at this point. We haven’t fully refactored it and I think we won’t until after we get back from Taiwan as we’d like to focus our attention on getting WEBVTT landed in Nightly so we have something to show for it. We’re almost to that point. Ralph will be hopefully landing bug 833385 on Monday, bug 833382 will follow quickly, and then we need to land WEBVTT 0.5 in Firefox to and we should be good to go. I also addressed most of the review comments on bug 833382. I’ve yet to post a WIP because I still have one more thing left to address. It’s sitting over on integration right now though if you want to check it out. Final thing I worked on code-wise was trying to reproduce a sec-critical bug. I have to run an ASan (Address Sanitizer) build of Firefox for it. I’m still working on that currently and will be back with more updates next week.
Oh yeah. I’m going to Taiwan! Ralph was kind enough to invite Caitlin and I to the Web Rendering Work Week out in Taiwan this year and Mozilla was kind enough to allow us to attend! We’ll be leaving Friday the 17 and coming back Saturday the 26. It’s going to be awesome. I’ll make sure to tweet and blog a lot while I’m out there.
The other really cool things that happened this week was that I was able to get a glimpse into what’s going on with Webmaker at Mozilla as most our team at CDOT is working on it. I might do a little in the future, we will see. We attended an e-meeting and it was awesome to see some of the really cool work that is going on.
Final thing that happened is that Ralph, Caitlin, Marcuss, and I set up a meeting time on Fridays after the Webmaker meeting. We had our first today and it was super beneficial to me. I was feeling slightly lost this week in terms of the WEBVTT project and the meeting really helped me refocus and see what our immediate goals should be.
Until next time.