This is not the full code but some remarks on what and my reasoning. I hope this email style is readable. ----------------------------- Remark: This is the decorate.c portion +set_property_string(io, "class", ""); --------------------------- Remark: I am going to redundantly establish both 'class' and 'className' in decorate because it seems that they are both used sometimes. ----------------------- Remark: Here I redundantly add class as well as className to the htmlclass if (htmlclass) { set_property_string(io, "className", htmlclass); + set_property_string(io, "class", htmlclass); } ----------------------- Remark: Now I'm in jsNode. I specify nodeType in every case. It is mostly set to 1, which is the value for any element. Could this be done more generically - probably. It may help clarity if it is spread out. set_property_number(t->jv, "nodeType", 3); set_property_number(t->jv, "nodeType", 1); etc etc -------------------- Remark: Next change is that I commented out the "iframe" entry from availableTags. It seemed to crash edbrowse. Pages do exotic things inside of iframes. So I wanted to see what would happen if I set it aside and work without them temporarily. @@ -1251,7 +1274,7 @@ const struct tagInfo availableTags[] = { {"form", "a form", TAGACT_FORM, 10, 1}, {"button", "a button", TAGACT_INPUT, 0, 4}, {"frame", "a frame", TAGACT_FRAME, 2, 4}, - {"iframe", "a frame", TAGACT_FRAME, 2, 4}, +// {"iframe", "a frame", TAGACT_FRAME, 2, 4}, ------------------------- Remark: Next is the jseng-moz.cpp portion. setTimeout is the only function that I changed. @@ -1888,12 +1888,17 @@ static JSObject *setTimeout(unsigned int argc, jsval * argv, bool isInterval) ------------------------ Remark: here are my setTimeout changes. This is the only thing I did to jseng-moz.cpp. Is my solution leaky? Could be. If the callor sends legal code, I think it works. If the callor doesn't send legal code, you have problems other than the number of arguments. It could use improvement. - if (argc != 2 || !JSVAL_IS_INT(argv[1])) - goto badarg; v0 = argv[0]; - v1 = argv[1]; - n = JSVAL_TO_INT(v1); + if (argc != 2 || !JSVAL_IS_INT(argv[1])) + { + // if only one parameter was supplied, hardcode + // a number of milliseconds. 1? 100? 1000? + n = 100; + } else { + v1 = argv[1]; + n = JSVAL_TO_INT(v1); + } if (JSVAL_IS_STRING(v0) || v0.isObject() && JS_ValueToObject(jcx, v0, fo.address()) && @@ -1980,9 +1985,6 @@ abort: return to; } --------------------- Remark: I entirely removed the badargs label -badarg: - JS_ReportError(jcx, "invalid arguments to %s()", methname); - return NULL; } /* setTimeout */ ------------------ Remark: The rest of my changes are entirely in startwindow.js -status = 0; +// document.status is removed because it creates a conflict with +// the status property of the XMLHttpRequest implementation +// pages seem to want document.style to exist +document.style = {"bgcolor":"white"}; ------------------- Remark: I think maybe both sides of the comparison need to be lowercased in the three getElementsBy functions. My example scenario was that var weird = document.getElementsByClassName("liveSmall toggled links") returned no elements but var weird = document.getElementsByClassName("livesmall toggled links") did. document.gebtn$ = function(top, s) { var a = new Array; -if(s === '*' || (top.nodeName && top.nodeName === s)) +if(s === '*' || (top.nodeName && top.nodeName.toLowerCase() === s)) a.push(top); if(top.childNodes) { for(var i=0; i 0){ this.readyState = 4; +this.status = 200; +this.statusText = "OK"; this.onreadystatechange(); } } ---------------------- Remark: Pages want some things having to do with CSS that we haven't done yet, such as getComputedStyle, defaultView and the CSS Specification. So in the next change I add four things having to do with how pages query objects for their styles. +document.defaultView = function() +{ +return this.style; +} + +document.defaultView.getComputedStyle = function() +{ + obj = new CSSStyleDeclaration; + obj.element = document; + obj.style = document.style; + return obj; +} + +getComputedStyle = function(n) +{ + obj = new CSSStyleDeclaration; + obj.element = this; + obj.style = new Array; + obj.style.push({n:obj.style[n]}); + return obj; +} + +CSSStyleDeclaration = function(){ + this.element = null; + this.style = null; +}; + +CSSStyleDeclaration.prototype = { +getPropertyValue: function (n) + { + if (this.style[n] == undefined) + { + this.style[n] = 0; + return 0; + } else { + return this.style[n]; + } + } +} + ------------------- Remark: Last thing: this is my implementation of Event, which I added to the addEventHandler code. +Event = function(options){ + this._bubbles = true; + this._cancelable = true; + this._cancelled = false; + this._currentTarget = null; + this._target = null; + this._eventPhase = Event.AT_TARGET; + this._timeStamp = new Date().getTime(); + this._preventDefault = false; + this._stopPropagation = false; +}; + -- 1.8.3.2