web browsers (was: squeak laptop for the rest of us)

Lex Spoon lex at cc.gatech.edu
Wed Apr 20 20:37:26 UTC 2005


In general, one place that is worth starting from scratch, if you are up
for it, is certainly HTML layout in general.  That's a huge project, but
it's one where the best solution may well look nothing like what is
currently there.

On the other hand, it's a huge project, with the obvious drawback of,
well, being huge.

> > Do you think, for example, that the HTML tokenizer should be tossed?  
> > How about the parser?  The formatting code in class HtmlFormatter?
> 
> Are these the same as optionally used in Celeste? I have been single
> stepping through this stuff a bit, but that is no way to get the big
> picture of course. Again, I will have to spend some time with that code
> before I can make any intelligent comment.

Yes, Celeste uses it.  Scamper per se is really a simple class for
wrapping up URL's, MIMEDocument, HTML parsing, and HTML formatting.

It's something like:

	HTMLTokenizer turns String's into HtmlToken's

	HTMLParser turns those into an HTMLDocument (with a DOM-like tree of
entities)

	HtmlFormatter is used to encode those

Other classes of interest:

	Url hierarchy -- for dealing with URL's

	MIMEDocument  holds a string and a MIME type

	

> 
> > What
> > about Squeak's built in text-flowing code, which is what Scamper mainly
> > relies on for layout? 
> 
> That is definitively something I have to look into. I only have a faint
> idea about the Paragraph code, the Morphic stuff adapated from Self, the
> old "back to the future" demo and the "wondering letters" demo. I
> suppose Scamper is related to the third one? Perhaps two or more of
> these are actually the same thing and I am confused about this.

The general strategy right now is to use a Text with TextAttribute's
applied to it.  A TextAttribute is part of Squeak that lets you take
one segment of text and do things like these to it:

	- turn them blue
	- increase the font size
	- switch to bold-face
	- add an indent (this is used for things like displaying lists)
	- display a Morph (used for pictures and for HTML form elements)



> Karl posted about that. I tried that package back in the 3.2 days and it
> caused Squeak to seg-fault on most pages I looked at. This was on a
> Sparc Solaris machine which might be a more fragile platform than normal
> - I didn't even know that Smalltalk-only code could crash Squeak like
> that.

If there's a segfault, then it is irrelevant to Karl's code.  You are
right that the VM should not let that happen.  If you can come up with a
repeatable example of that, then it's definitely a VM problem.


> > All this said, it might be a poor strategy to make a complete
> > web browser.  There's just too much to do, because we have reached a
> > state where "the web" is defined by what Mozilla does. 
> 
> What IE does, you mean. 

:>  Well, IE just copies Mozilla, right?  Yeah, I'm being snarky.  On
the other hand, I'm told that some sites only work on Mozilla and not
IE.

FWIW, Mozilla Firefox works great for me and has quite an army of
users at this point.  I hated the original Mozilla -- it was ridiculously
slow -- but Firefox seems reasonable.


> With a proper Squeak browser I would expect
> to be able to call up the halo on the offending item and force it to be
> readable.

Yeah....  Imagine computing with Squeak as your platform....


> Speaking of Mozilla, some update of Fedora Core 2's official stream
> broke things so that if I run Mozilla as anything but root it will crash
> on all but the most trivial pages. [...] Do users actually find this kind of
> thing acceptable? 

No.  :)  Well, considering Microsoft's success, maybe a lot of users do.


> Even though less and less sites use them, the
> lack of frame support in Scamper can be limiting. It is possible that
> this could be solved with nearly the same code as tables.

That sounds right.


> > Happily,
> > Squeak can do exactly the same thing via the ExternalWebBrowsing package
> > on SqueakMap.
> 
> Yes, but then we are talking about Squeak-on-a-Linux-latop instead of a
> Squeak-laptop. Which might be the best solution after all. This is what
> I am trying to figure out. It certainly would be the least disruptive
> for the MIT guys.

Yeah, that's all true.  If you make use of external code, however, it
gives you a lot of intermediate steps for moving towards a Squeak
laptop.  You don't have a useless machine for years while you wait for a
fully general web browser.

Also, I am not sure that it becomes more Squeaky if you remove Linux
but then write a massive "virtual machine" which is essentially its own
operating system.  If you want to boot into Squeak, then a great way to
do that is use Linux as the platform and then run Squeak from the
init scripts.  You can dump X windows and just use Linux for device drivers
and a file system.

-Lex



More information about the Squeak-dev mailing list