November 14, 2002, 12:11 AM ET
GetContentSize changed slightly
Some comments here, some comments on Webgraphics and various e-mails have convinced me to alter my GetContentSize tool a bit.
The tool measures the percent of a single HTML document -- not including any attached images or supplementary files -- devoted to what I call "text content." Text content is everything content-related that the user is able to view. (Or, in the case of blind users, all content a screen reader can access.) HTML code, in and of itself, is not text content. The sentence you're reading right now, however, is.
When I launched the tool last week, it calculated the text content by stripping away all HTML tags in a given document and calculating the ratio of the number of remaining characters to the number of characters in the first place. A problem, some pointed out, is that this didn't account for content embedded in HTML tags -- particularly alt attributes (text meant to describe/replace images) and title attributes (supplementary descriptive information often coded into links, acronyms, etc., and traditionally accessible via browser tooltips).
That's changed.
The tool now includes all contents of every title, alt and summary attribute. That's definitely text content, and it deserves to be counted as such.
(The seldom-used summary attribute, by the way, is supposed to be used to describe data tables. Not many people use it, but I figured I'd include it.)
I have a feeling this will increase the content-to-code ratios for many blogs, as many bloggers tend to use the title attribute liberally, but it probably won't affect other sites' ratios much.

Post a comment:
Comments on this entry are closed.
Don't see any comments? That's because my Web hosting provider has made a server upgrade that broke the commenting feature on this site. I'm working to restore that; please check back later.