- From: Robin Berjon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 13 Apr 2010 11:20:20 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/ReSpec.js/js In directory hutz:/tmp/cvs-serv8129/js Modified Files: respec.js Log Message: forgot to include the IDL writing as well Index: respec.js =================================================================== RCS file: /sources/public/2009/dap/ReSpec.js/js/respec.js,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- respec.js 13 Apr 2010 11:15:09 -0000 1.107 +++ respec.js 13 Apr 2010 11:20:18 -0000 1.108 @@ -1833,14 +1833,13 @@ var len = it.datatype.length; if (it.nullable) len = len + 1; if (it.array) len = len + 2; - if (it.type == "attribute") maxAttr = (len > maxAttr) ? len : maxAttr; + if (it.type == "field") maxAttr = (len > maxAttr) ? len : maxAttr; else if (it.type == "constant") maxConst = (len > maxConst) ? len : maxConst; - if (it.type == "attribute" && it.readonly) hasRO = true; }); var curLnk = "widl-" + obj.refId + "-"; for (var i = 0; i < obj.children.length; i++) { var ch = obj.children[i]; - if (ch.type == "attribute") str += this.writeAttribute(ch, maxAttr, indent + 1, curLnk, hasRO); + if (ch.type == "field") str += this.writeField(ch, maxAttr, indent + 1, curLnk); else if (ch.type == "constant") str += this.writeConst(ch, maxConst, indent + 1, curLnk); } str += this._idn(indent) + "};</span>\n"; @@ -1848,6 +1847,22 @@ } }, + writeField: function (attr, max, indent, curLnk) { + var str = "<span class='idlField'>"; + if (attr.extendedAttributes) str += this._idn(indent) + "[<span class='extAttr'>" + attr.extendedAttributes + "</span>]\n"; + str += this._idn(indent); + var pad = max - attr.datatype.length; + if (attr.nullable) pad = pad - 1; + if (attr.array) pad = pad - 2; + var nullable = attr.nullable ? "?" : ""; + var arr = attr.array ? "[]" : ""; + str += "<span class='idlFieldType'>" + this.writeDatatype(attr.datatype) + arr + nullable + "</span> "; + for (var i = 0; i < pad; i++) str += " "; + str += "<span class='idlFieldName'><a href='#" + curLnk + attr.refId + "'>" + attr.id + "</a></span>"; + str += ";</span>\n"; + return str; + }, + writeAttribute: function (attr, max, indent, curLnk, hasRO) { var sets = [], gets = []; if (attr.raises.length) {
Received on Tuesday, 13 April 2010 11:20:21 UTC