MAMA: Markup report, part 1: the basics

By Brian Wilson

Introduction

Our first look at markup in MAMA's URL set will begin with the basics. We will look at some of the housekeeping concerns of every document: how they are encoded, how big documents are, how much of the document is actual markup, doctype usage, etc. We will also give a quick overview of the most popular elements and attributes before we start digging deeper into those sub-topics. This overview should give you an idea of what markup documents look like in the broadest sense.

For a deeper look at these areas and more, the following MAMA article topics are also available this week:

Document Encodings

Before a document's content can be examined, its encoding must be determined. The biggest trouble with specifying HTML encoding is that there are so many ways to do it. A document may specify none, one, or even ALL of the different methods. And, if there is disagreement at any of these levels of twirled spaghetti, a precarious dance must ensue.

MAMA tracked the specific encoding values from three primary locations:

  • The "charset" parameter of the HTTP header:
    ex: Content-Type: text/html; charset=ISO-8859-1
  • The "charset" parameter for the Content-Type via the META element:
    ex: <META Http-equiv="Content-Type" Content="text/html; charset=Shift-JIS">
  • The XML encoding:
    ex: <?xml version="1.0" encoding="utf-8"?>

The HTML encoding was specified using at least one of these methods in 2,626,228 of the URLs MAMA examined (74.8%). Of these, the dominant scheme was the META element syntax, used in ~90% of the cases where MAMA detected any of the 3 encoding sources.

Venn diagram for breakdown of encoding source specification methods

Note: Region sizes are not to scale.

Overall document sizes

Among the many statistics MAMA has gathered about the documents it analyzed, length statistics prove to be interesting to examine. One such criteria is the basic overall document length. This is simply the length of the original document, without adding in any of the page's external dependencies like CSS or Scripting. The average basic document size of MAMA's analyzed URLs was 16,406 characters.

MAMA's base document size ranges
Size range (characters)FrequencyPercentage
0 && <= 5,0001,113,22431.7%
>5,000 && <= 10,000717,82520.5%
>10,000 && <= 15,000509,45614.5%
>15,000 && <= 20,000324,7659.3%
>20,000 && <= 25,000213,0936.1%
>25,000 && <= 50,000432,12912.3%
>50,000 && <= 75,000112,4813.2%
>75,000 && <= 100,00040,3491.1%
>100,000 && <= 200,00035,3541.0%
> 200,0008,2870.2%

But what about all those dependencies?

One other interesting length factor MAMA tracked was labeled "extras". This measure added up the sizes of all external CSS, scripting, frames, and IFrames referenced by the main document. While the basic document length gives some idea of a user's initial download penalty, this "extras" length gives a better sense of the overall weight of a page before its objects (such as images and plug-ins) are loaded. The overall average length of all the "extras" is 20,296 characters, but it increases to 28,038 characters, factoring in only the cases where any of the "extras" exist. This is definitely a case where the documents that are "extras heavy" are throwing off the total average—as you can see, most documents actually have an "extras" sum of less than 10,000 characters. So, by at least one measure, the average page will download as much in "extras" content size as it must download for the main document.

MAMA's "extras" size ranges
(969,042 URLs had an "extras" size of 0)
Size range (characters)FrequencyPercentage
>0 && <= 5,000753,39221.5%
>5,000 && <= 10,000361,46010.3%
>10,000 && <= 15,000207,2835.9%
>15,000 && <= 20,000182,1165.2%
>20,000 && <= 25,000190,0395.4%
>25,000 && <= 50,000467,21413.3%
>50,000 && <= 75,000173,1564.9%
>75,000 && <= 100,00078,4972.2%
>100,000 && <= 200,00095,0932.7%
>200,00031,8880.9%

Doctypes

The markup validator has a lot to say about Doctypes. They are a key component in determining a successful validation. MAMA stored the information about a document's Doctype pulled from the W3C validator, but it also looked for the Doctype information separately. In MAMA's URL set, 1,788,294 of the URLs analyzed (50.96%) had a Doctype present. About 85% of MAMA's URLs would be rendered in most browsers using their "Quirks" mode.

Doctype versions

Different versions of the HTML standard can be detected via unique strings in the Doctype statement. The leading space in most of the values below helps differentiate between HTML and XHTML versions. HTML 4 variants are twice as popular as any of the other versions.

Doctype versions popularity in MAMA
Doctype-version substringFrequencyPercentage
Using
Doctype
" html 4" (HTML 4 variants)1,122,39262.8%
" xhtml 1.0"548,30730.7%
" html 3.2"57,3543.2%
"ietf"34,9652.0%
" xhtml 1.1"20,9581.2%
"softquad" || "//sq//"9,9500.6%
" html 2"7,6400.4%
" html 3.0"1,7110.1%

Doctype flavors

Beginning with HTML 4.0, HTML was stratified into 3 separate variants: Strict, Transitional, and Frameset. A portion of the Doctype statement directly reflects these variants and we can easily discern the "flavors" of HTML by searching for the substrings. The Transitional configuration is more than 10 times as likely as the other types.

Doctype flavor popularity in MAMA
Doctype-flavor substringFrequencyPercentage
Using
Doctype
"Transitional"1,459,91281.6%
"Strict"130,1917.3%
"Frameset"64,5163.6%

For more about doctypes, read the doctypes section of the Basic structure article.

Miscellaneous document structure matters

MAMA calculated a "Tag Ratio" for each document. This was total length of the content within all tags divided by the overall page length. A Tag Ratio of 0 would be all plain text, while a Tag Ratio of 100.0 would be completely tags, without even having linefeeds or spaces between the tags. The average document had a Tag Ratio of 61.64%—almost 2/3 of each document being tags.

MAMA also kept its eye out for character entities—a portable way to express characters that are not in the page's specified character set. All Unicode characters can be given as a numeric entity, while many of these can also be expressed via special name codes. In almost every case where a named entity counterpart exists for a character, the named version is least as popular as the numeric version, if not often much more so.

ex: &nbsp; (used 2,537,947 times); &#160; found 41,390 times

The character entity used most often was the "non-breaking space", found in 72.3% of all MAMA's documents.

Top 10 most popular character entities
Entity DescriptionEntityEntity
Code
Frequency   Entity DescriptionEntityEntity
Code
Frequency
Non-breaking space nbsp2,537,947 Small 'u' with Diaeresisüuuml226,695
Ampersand&amp1,256,005 Small 'e' with Acuteéeacute207,322
Copyright Sign©copy776,051 Small 'a' with Diaeresisäauml204,855
Quotation Mark"quot520,902 Small 'o' with Diaeresisöouml184,313
Greater-Than Sign>gt276,149 Right Double-Angle Quotation Mark»raquo123,207

Popular markup elements and attributes

For authors that have spent any time at all writing HTML documents, there will be no real surprises about which elements are the most popular. The 10 most popular markup elements can be divided into three basic categories:

  • Basic document-structure elements (HTML, HEAD, BODY, TITLE and META)
  • Tables (TABLE, TR and TD)
  • Hyperlinks and images (A and IMG)
Top 10 markup elements
ELEMENTFrequencyPercentage   ELEMENTFrequencyPercentage
HEAD3,464,51998.7% META3,276,34793.4%
TITLE3,459,20798.6% IMG3,219,48791.7%
HTML3,452,97598.4% TABLE2,894,18482.5%
BODY3,452,90798.4% TD2,891,97282.4%
A3,307,39794.2% TR2,891,20582.4%

The list of the most popular attributes in MAMA comes primarily from only 4 of the previously covered top 10 elements. Attributes for A, IMG, META and TABLE are the most popular. It is interesting that none of the top structural elements (HEAD, TITLE, HTML, BODY) score any attributes in the top 10 attribute beauty pageant.

Top 10 markup attributes
ELEMENT[Attribute]FrequencyPercentage   ELEMENT[Attribute]FrequencyPercentage
A[Href]3,304,83494.2% META[Http-equiv]2,826,85980.6%
META[Content]3,273,61093.3% IMG[Border]2,810,26580.1%
IMG[Src]3,219,30491.7% META[Name]2,710,63877.2%
IMG[Width]2,957,80884.3% TABLE[Border]2,691,89976.7%
IMG[Height]2,945,98984.0% TABLE[Width]2,637,11775.1%

Conclusion

This overview of the basics of markup seems to be too thin to allow us to come to any real "conclusions" on the topic just yet. We are just getting started. The information here on document encodings and length, doctypes, tag ratios, and character entities glosses over many of the details found in the deeper writeup. Our final, simplistic mention of popular markup elements and attributes merely sets the stage for what will follow—in the coming weeks, we will devote considerably more attention to the details of elements and attributes in common use.

This article is licensed under a Creative Commons Attribution, Non Commercial - Share Alike 2.5 license.

Comments

The forum archive of this article is still available on My Opera.

No new comments accepted.