MAMA: Frames

By Brian Wilson

Index:

  1. Introduction
  2. MAMA's strategy for dealing with frames
  3. FRAMESET element
  4. FRAME element
  5. IFRAME element
  6. NOFRAMES element
  7. Frame-related attribute: Target
  8. Framed document MIME types
  9. Frames and Doctypes
  10. Frames and the W3C-Member List

Introduction

The frame layout concept for Web pages was first implemented in Netscape 2.0 in 1995. It allowed the browser window to be sub-divided into any number of rows or columns of smaller, windowed documents. The concept has many design and usability problems, and yet it is popular enough (and easy enough) that its usage has blossomed over the years. Many authors and designers have a special place of fury in their hearts for frames— a place where disdain for other reviled constructs such as the BLINK and MARQUEE elements lives. The standards community codified common browser/author practice with HTML 4.0, and this included frames functionality as well as inline frames. However, in recognizing frames, the W3C also relegated it forever after to a special DTD ghetto. Perhaps some day the standards community will embrace a different concept similar to what frames accomplish. Nevertheless, the current version of frames enjoys wide deployment "in the wild", despite its many drawbacks. Frames defiantly maintain a degree of authoring inertia, despite the general disfavor. Authors probably do not care enough about the arguments against frames to use other alternatives—or else they just are not being original enough in coming up with design alternatives. Despite being dropped in XHTML 1.1, frames are not going to go away.

MAMA's strategy for dealing with frames

Documents containing frame-related elements are often quite simplistic—they usually consist of some document HEAD elements followed by the frame markup structure. This alone does not accurately depict all of the content that the browser is going to experience when accessing a URL using frames. Each of the sub-frame URLs (specified by the Src attribute of the FRAME element) may have a very rich markup experience that is not hinted at by the original frame structure document. For example, if Javascript or Flash was only used in a sub-frame, the analysis of the original frames page would not reflect that—even though the user would experience the full aggregate of the features used in ALL of the frames. Given the size of the analyzed URL set, it was not expected that MAMA would be able to catalog and subsequently visit each of the sub-frames individually in the timeframe available. To ensure that MAMA's analysis was as close to the real-world experience as possible, a (debatable) design decision was made to string together the content of the frames definition pages and the content of all sub-frames into one long document for MAMA to analyze. Some of MAMA's element counting statistics were inflated by this strategy, but it seems to be a useful approach for the study to have adopted. There are certainly a few drawbacks to this methodology—the overall view of the "document" can become distorted unless steps are taken to allow for the changes. MAMA compensated as well as it could by only using the originating frameset document as reference for things like Doctype and other document metadata and ignoring any corresponding information from the sub-frames.

FRAMESET element

This element is used to create the layout grid of the sub-document frames, and was encountered 378,033 times (10.77% of all MAMA's URLs). FRAMESET specifies how the current document can be sub-divided into a grid of relative or specific dimensions using the Rows and Cols attributes, but neither of these attributes are the most frequently used—that title belongs to the attribute Border. The primary reason for this is that a Rows OR Cols attribute is often used to the exclusion of the other attribute. In spite of Rows and Cols being less popular than Border, the majority of URLs using the FRAMESET element have ROWS and COLS attributes together in combination (203,575 times). The list of attributes below (Fig 3-1) demonstrates a peculiar Web behavior: authors will dream up markup attributes and pepper their code with them, whether they actually have an effect in any browser. The only standards-legal attributes in this list are Rows and Cols, and the others are browser-extensions. The full MAMA attribute list shows that there were as many as 24 other attributes detected for FRAMESET (like Cellpadding, Spacing and Frameset)...many of which are clearly erroneous and can not possibly have an effect in any browser!

Fig 3-1: FRAMESET element/attribute frequency
ELEMENT/AttributeFrequency ELEMENT/AttributeFrequency
FRAMESET378,033    Marginheight8,210
    Border320,423    Noresize6,238
    Rows310,679    Scrolling5,522
    Frameborder301,851    Leftmargin1,818
    Framespacing277,052    Name1,810
    Cols268,482    Topmargin1,791
    Bordercolor16,160    Framecolor1,262
    Marginwidth8,331    Framepadding1,189

FRAME element

This element is used to specify the target object that will live in the frame. It also gives direction for the individual frame's behavior. One would expect a 1-to-1 relationship between the usage of the FRAMESET and FRAME elements, but that is not quite the case—377,803 URLs used both of these elements at the same time, leaving 230 FRAMESET-only URLs and 304 FRAME-only URLs. Attribute popularity follows standards-approved lines and is much more uniform than for the FRAMESET element. The Longdesc attribute, on the other hand, is poorly represented and has never caught on.

Documents that use frames can point to other documents containing frames. It is possible that an author could nest frames to an infinite depth, but in practice the chances of that happening by design or accident are ... well ... pretty low. How low? We are not exactly sure (yet), because MAMA only tried to detect the use of nested frames— specifically the FRAME element—in second-level framed documents and not beyond that. In all, 56,242 URLs were found to have nested frames (14.88% of all URLs using frames). This seems like a good starting point for further study if it seems warranted.

Fig 4-1: FRAME element/attribute frequency
ELEMENT/AttributeFrequency ELEMENT/AttributeFrequency
FRAME378,107    Border31,645
    Src377,986    Framespacing18,098
    Name349,820    Bordercolor8,203
    Scrolling312,463    Topmargin5,366
    Noresize268,967    Leftmargin4,626
    Marginwidth160,768    Resize2,098
    Marginheight159,237    Width1,121
    Frameborder118,858    Longdesc643
    Target89,487  

URLs using the most frames

The site MAMA found with the most Frame document references was http://www.iddic.com/index.html/ (URL no longer active) with 65 (Fig 4-2). It looks like this is not a unique case, as several URLs were detected to have more than 50 frames each. The average number of frames (when they ARE used) is 2.83.

Fig 4-2: URLs with the highest Frame quantities
URLquantity
http://www.iddic.com/index.html/ (URL no longer active)65
http://www.cywu.org.uk/63
http://www.markt-zell.de/63
http://www.timiane.dk/index.htm/52

IFRAME element

This element creates an inline, or floating, frame in a document. Instead of a document that only specifies the way other documents will live together in a window, an IFRAME is included within the normal document flow, in much the same way an inline IMG is used. In practice, many will be familiar with IFRAME these days as a carrier for complex (and sometimes bothersome) advertisements found on many websites. Src is naturally the dominant attribute here, with Frameborder being (strangely) slightly more popular than the more practical issue of specifying dimensions for the IFRAME (Height and Width). Usage of the Longdesc attribute barely makes it into this list; its frequency is well below the usages of many non-standardized attributes.

Fig 5-1: IFRAME element/attribute frequency
ELEMENT/AttributeFrequency ELEMENT/AttributeFrequency
IFRAME222,462    Align29,256
    Src218,803    Allowtransparency22,674
    Frameborder203,627    Bordercolor8,534
    Width202,572    Framespacing7,839
    Height202,147    Noresize7,098
    Scrolling178,129    Target5,308
    Marginwidth117,095    Topmargin3,347
    Marginheight115,280    Leftmargin3,228
    Name87,763    Bgcolor2,434
    Border35,869    Background-color914
    Hspace34,504    Longdesc362
    Vspace34,383  

How often IFRAMEs are used

The maximum number of IFRAME references was an astounding 769, with the average number for documents using IFRAME being 1.51. The FRAME and IFRAME elements are not used in conjunction very often—only 19,472 cases out of 222,462 (8.75%).

Note:
Use caution accessing any of the high-IFRAME-quantity URLs mentioned in Fig 5-2: some browsers may have problems with these extreme situations.

Fig 5-2: URLs using the most IFRAMEs
URLQuantity
http://www.nbhqjx.com/769
http://www.1000irani.com/708
http://www.kramers-landhandel.de/shop/ (URL no longer active)386
http://www.pizza-juechsen.de/385
http://www.anomaliesandquandaries.homestead.com/134
http://www.kissnews.de/shop/start.html/117
http://www.revelation13.net/movie.html/107
http://www.trierer-orgelpunkt.de/104

NOFRAMES element

This element is for non-framed, fallback content. Only a browser that does not understand frames or has frames functionality turned off will display the content. It is considered good practice to use this element on any Web page that is also specifying the use of Frames, and it was detected in 313,084 URLs—82.8% of the URLs using FRAMESET.

Frame-related attribute: Target

According to HTML 4.01, there are only 5 elements that can carry the Target attribute: A, AREA, BASE, FORM and LINK. The URLs that MAMA analyzed used the attribute in a distressingly diverse list of elements (25)! Elements with no business carrying this attribute, like DIV and OPTION, occur in quantities too frequent to be an accident. Looking at cases on the standards-approved side of the fence, use of Target with the A element is far, far greater than the general usage of frames would indicate. Authors are most likely concerned with the frame situation their hyperlinks will end up in, so they take steps to control it with the Target.

Fig 7-1: Target attribute frequency
ELEMENTFrequency
A1,978,018
FORM199,085
BASE159,479
AREA146,703
LINK1,585

Target attribute values

What sort of values does the Target attribute use? It has several reserved keywords, all beginning with the underscore character ("_"): "_blank", "_top", "_self", "_parent" and "_new". As expected, these values are the most popular. Values resembling these keywords (such as "blank" or "top") are also very popular, as are values which stress the parent-child relationship of frame documents to their content documents (including "main" and "contents", and even German equivalents of the same: "hauptframe" and "inhalt").

Fig 7-2: Target attribute values
(See also the complete frequency table)
Target attribute valueFrequency Target attribute valueFrequency
_blank1,548,594mainframe31,691
_top550,637google_window20,905
_self306,182contents18,076
_parent121,225hauptframe15,829
_new84,293inhalt12,828
main82,075content10,316
new52,756top7,977
blank43,287  

Framed document MIME types

In the process of fetching the first-level frames of a document, MAMA tracked the MIME type of the frames. Some file types were outright rejected before this tracking could occur, based solely on file extension alone. The following file extensions were not tracked but were probably not rare occurrences: /\.(exe|mov|mp3|pdf|swf|wav|wma|wmv)/i. After eliminating those, the most popular values were almost all "text/html" (by a very wide margin), with "text/plain" and an empty MIME type also occurring with some frequency.

Note:
In the full frequency table the overall total is much larger than the number of URLs containing frames. This is because a URL can point to multiple frames at once.

Frames and Doctypes

HTML 4 and XHTML 1.0 have a special Doctype that is meant to be used when any frame-related elements are used in a document. How do documents fare at actually using these Doctypes? The answer is, "lower than the general population", but the overall numbers are still not too bad: 129,190 of the 378,033 URLs using the FRAMESET element (34.17%) also use a Doctype—but not so fast! Are these Doctypes specifying the frameset Doctype? Oops—that would be a "no" just as often as it is a "yes": only 60,638 of the URLs that use the FRAMESET element (16.04%) use a frameset Doctype.

Frames and the W3C-Member List

Now, we can revisit the W3C-Member company list. If the use of frames is at odds with the standards and design folk, one would expect that usage by the W3C companies would be much less than the general population. That does seem to hold generally true at a quick glance. In our "The Wild" sample space of 3,509,180 URLs, 378,033 use frames (10.77%), and 222,462 use iframes (6.34%). In the W3C-company population, 14/429 use frames (3.26%), and 26/429 use iframes (6.06%). To harp on the Doctype issue again (because we can), only 6 of those sites using frames had Doctypes, with only two(!!) of those using the frameset Doctype.

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.