Pragmatic Paddy

April 27, 2007

Delving into the Firefox source code

Filed under: javascript, programming — Paddy Mullen @ 5:09 pm

Continuing from the previous post. I downloaded the Firefox source code and started trying to figure out why textContent was faster than innerHTML.

The FF source code is a daunting beast, around 57,000 files. I started with grep. this returned 57 files for innerHTML and 72 files for textContent. I then used comm to see which files had both words in them, only one did.

Somehow I decided to try looking at the idl files that grep returned. From these files I was able to figure out what I thought were the .cpp files related to the properties.

Here are links to the files on Mozilla’s website
innerHTML is found in this file
nsGenericHTMLElement.cpp
Here is a changelog of the setInnerHTML function
http://lxr.mozilla.org/mozilla1.8/ident?i=SetInnerHTML

Here is the cpp file that contains textContent
nsHTMLOptionElement.cpp
here is the changelog of the setText function
http://lxr.mozilla.org/mozilla1.8/ident?i=SetText

I haven’t actually yet figured out what each function does, but I’m getting there. I’m also not sure if I have the correct file for textContent.

speed of innerHTML vs textContent

Filed under: javascript, programming — Paddy Mullen @ 4:52 pm

January 17, 2007

Getting ie6 to cache background images

Filed under: javascript — Paddy Mullen @ 11:43 pm

Powered by WordPress