It wasn't a rewrite, but certainly a reorganize.
Most of startwindow.js now lives in the "master window" block, wherein it is 
compiled only once.
This saves space and time, and allows for a proper instanceof operator, as 
described in my previous post.
Here's a tricky thing about the reorganization though.
On rare occasions a function refers to document.
If compiled once, it always refers to document in window 0. That's bad!
I wrote a my$doc function in the master window to figure out the document of 
your current context.
The compiled-once function can use that to refer to document.
I tried function() { return eval("document"); }, which I thought would run in 
realtime and work, but it doesn't work. Don't know why.
Maybe eval runs once when the function is compiled.
In any case, I had to write it as a native method, which isn't hard, it's only 
3 lines of C.
This function is critical; it's key to folding all that stuff into the master 
window.

I also made a few minor fixes here and there, and uncovered something else that 
I didn't fix,
because I don't know anything about it, never heard of it, and it logically 
belongs in another commit.
It did however cause a seg fault, and I had to work around that.
See startwindow.js line 1421.
Here it is, from oranges.com.

document.createElement("g:plusone");
document.createElement('<iframe name="stlframe" allowtransparency="true" 
style="body{background:transparent;}" ></iframe>');

What are those?!

Karl Dahlke
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev

Reply via email to