Adobe Extending Dreamweaver CS4 User Manual
Page 132
126
EXTENDING DREAMWEAVER CS4
Browser compatibility check issues API
ColAndColgroupCapturedByCaption.htm
//DWExtension layout-engine 5.0//dialog">
ColAndColgroupCapturedByCaption.js
function findIssue(){
var DOM = dw.getDocumentDOM();
var issueNodes = new Array();
if (DOM){
// first see if there are any caption tags in the doc.
var captions = DOM.getElementsByTagName('caption');
// declare a mess of variables that we'll need in the
// for loop below.
var currCap = null, props = null, parentTable = null;
var colgroups = null, cols = null, allcol = null;
var property = "", definedStyles = new Array();
// ok, now loop through all the captions, if any.
for (var i=0; i < captions.length; i++){
currCap = captions[i];
parentTable = currCap.parentNode;
// the caption is only a problem if it's in the valid
// spot (i.e., the first child of the table)
if (currCap == parentTable.childNodes[0]){
// find all colgroup and col tags that are in the
// same table as the caption.
colgroups = parentTable.getElementsByTagName('colgroup');
cols = parentTable.getElementsByTagName('col');
allcol = colgroups.concat(cols);
for (var x=0; x < allcol.length; x++){