Everyone these days, must have been red core browser brush screen, this goods:







Known as the world’s fifth independent kernel, China’s first, is it really so easy to make a browser kernel?

As I happen to have been collecting information and anecdotes about various browsers for years, let’s take a look at what a browser kernel is and how difficult it is.

Speaking of browsers, we have to start with Internet Explorer versus Netscape

The age of IT

In the IT heyday of 1992, when people could only read lines of characters on a black and white screen on the Internet, Marc Andreessen of the University of Illinois (NCSA) created a browser called Mosaic, which could display graphic information. After it was posted online for free, there was a lot of interest in this interaction. But they realised that, however popular Mosaic was, it was still a school product. To their dismay, they could not persuade the University of Illinois to transfer the Mosaic browser. Anderson eventually decided to rewrite the browser, and as a result, a new paid browser was created, Navigator, and the company became Netscape, which was founded in 1994.

Shortly after Netspace went public, Microsoft announced its long-awaited new operating system, Windows 95, along with its browser, Internet Explore 1.0.

The Internet Explorer functionality was horrible, no Java, no plug-ins, and very slow. In fact, IE1.0 was based on THE NCSA Mosaic browser, which was released in August 1995. In November of that year, Microsoft rushed out version 2.0.

IE and Netspace, in other words, came from Mosaic.

Interestingly, years later, Microsoft NT4 and Win2K code leaked, which happened to contain the code for IE2 and IE5.5. So one day in 2011, I also had a whim to deduct these two products from Microsoft’s leaked code, and spent a lot of effort to compile it. See the code:

Bbs.pediy.com/thread-1376…

The IE2 code is relatively easy to compile, with missing headers, incomplete implementations, and minor bugs to fix based on an understanding of the architecture.




Last IE2 diagram.

IE2 is an ancient browser said to have been adapted from Mosaic without Microsoft’s Trident typography engine, before CSS was invented, and is a huge departure from today’s browsers.

However, IE2 is not useless, at least I ported it to my interface library, and became a great richedit.

In fact, IE2 structure is very clear, buckle out of the process is very interesting. IE2 is a function that displays all giFs and text. Several other functions are responsible for parsing HTML.

When I buckle out, do a text display control, very cool, ha ha. Text selection and other logic is complete, and easy to read, because it is pure C.

After SGML_write parses the HTML into _w3doc, call TW_Draw to display everything, including the image.

The timeline arrives in the era of IE6

One of the great things that happened during this time was that CSS was also invented. According to the

www.zhihu.com/question/29…

Haakon Wium Lie is the CTO of Opera.

Interestingly, KHTML, the precursor to another browser kernel, WebKit, came from Trolltech’s QT project. KHTML and Opera are both Norwegian companies, and they basically have a relationship with each other and share some of their code, so I have to suspect that they started working on the browser kernel at the same time, and then for some reason started going their separate ways.

Three of the five most popular kernels (Opera, Blink, WebKit, Firfox, IE) came from the Norwegian faction, and many CSS standards were probably designed specifically for Opera.

Back to IE6, it was an epoch-making browser of its year. Although in today was black out of the sky, but this also side said that IE6 had much cow force, still in play today.

Internet Explorer 6 and its predecessor, Internet Explorer 5.5, proposed a lot of things that today seem very dark. Such as:

1. Put forward XMLHttpRequest, which was discovered by Google and became the popular AJAX around the world.

2. VML, vector rendering language, drawing all kinds of cool vector map is not a problem.

3. Put forward the filter function, which can achieve a variety of cool effects for the web page. In fact, the shutter animation we often see in Word is the filter function. And interestingly, this function in Word shares the same module with IE. I also tried to directly call COM interface in my own program to achieve the same cool effect.

4. Propose the concept of HTA, which can directly turn HTML into native applications. Is it similar to the current hybrid app and PWA?

5. Various advanced CSS typesetting functions.

It was all these magical and powerful features that made IE6 a smash hit with old rival Netscape (of course, Microsoft also used a lot of dirty tricks, such as bundled installations like the 360). Microsoft dominated the browser market so much that the entire browser division ran out of work for 10 years and was disbanded… Perhaps Microsoft thought it had the world in hand and there was little left for the browser to develop.

IE code interface library

Those who want to revisit IE5.5\IE6 can download it in my previous post. When I was shocked by IE, I also tried to deduct IE part from win2K leak code. Finally I masturbate to half of the time, found another pea pod of the elder brothers have masturbated out, he put the IE5.5 code into his interface library (it is said that brother ten thousand knock this code knock shoulder are out of the problem, is also very spell) :















Wan Brother collated based on IE code interface library, not only has the basic div + CSS function, but also support activeX control, support Filter effect interface. However, VML is not supported, and I guess the VML code has not been developed yet in IE5.5.

This version of IE architecture I wrote a few articles, originally posted on Baidu space, baidu space closed down, the article is missing…

From what I can remember, this version of the code was a little hard to understand. Said chaos is not, inside the division of various classes is very clear, but may be from the DOS era came out of the old programmer’s habit, the variables in the code, function name of what, many are shorthand, look tired, to always recall pPbsz and other variables specific what meaning.



I guess Microsoft is going to come after me for leaking code

But the notes are pretty good.

Interestingly, the Internet Explorer hasLayout problem, once well-known in the front-end world, can be found in this code causes the problem.



I guess Microsoft is going to come after me for leaking code



Haslayout comments

As you can see from the code, HasLayout is a member variable of element to reduce typographical calculations. For those interested, take a closer look at hasLayout’s logic.

This version of IE architecture has a small problem, not separate layout and rendering, are mixed in the same set of data structures (and later WebKit, divided into Node, RenderObject), and not cross-platform preparation, all use Windows data structures, such as HDC. I do not know that later IE to achieve cross-platform MAC is not to do blood.

After Internet Explorer 6 came out for N years, Google came out to punch in the face. Google was originally behind Firfox (the new browser that Netscape reinvented after being handed over to the open source community), but it has been focusing a lot of money on developing its own open source browser: Chrome. Sure enough, Chrome came out in 2008 and blew the world away, including me. See what happens next time.