Apple has open source, but so what? (middle)

In the last article (for details, please click: " Apple has open source, but so what? (Part 1) "), it was mentioned that the birth of Apple's first open source project Darwin was inextricably linked with the return of Steve Jobs' revenge.

As an open-source operating system, Darwin has a very pure open-source pedigree, and there are such big-shot figures as FreeBSD founder Jordan Hubbard. During its service, it has made outstanding contributions to Apple, whether it is macOS, iOS or iPadOS, and even HomePod and Apple TV (TvOS) are based on Darwin.

Unfortunately, Darwin has become a thing of the past and disappeared into silence. However, a few years after Darwin was open sourced, another heavyweight open source project of Apple, WebKit, was put on the table and won the baton of Apple's open source.

This time, how much is Apple's open source and how sincere it is?

 

Part 2: Love and Hate of Open Source WebKit, the Hero of WWII

 

At the end of the last century, the browser war between Microsoft and Netscape is still talked about. To put it simply, at that time, Microsoft had already become a commercial giant relying on Windows, and with the introduction of technical standards such as NC and JAVA, Microsoft began to feel that its building was in jeopardy.

At the time, the most popular browser was Netscape (the predecessor to Firefox). In response to Netscape, Bill Gates used the "killer": Microsoft invested 2 billion to quickly launch the browser IE2.0, and decided to open this product for free, and announced that Windows95 and IE would be bundled for sale .

With a combination of punches, Microsoft successfully used its monopoly advantage to reshuffle the browser market. The market share of the IE browser was as high as 96% in 2002. In this browser war, Microsoft did not win by developing a product with higher performance and better technology, but by using the business method of "bad money for good money".

The consequence is that IE, a classic but buggy browser, greatly reduces the quality of life of developers, and the various problems it leaves behind still plague many Web developers. There are radical views that IE almost destroyed the Internet by forcing web developers to climb the ice and snow.

The browser wars didn't stop there. In 2004, Firefox was reborn from the ashes of Netscape, and together with Apple Safari, Norway's Opera and Google Chrome, the second browser war was about to break out. Under the siege, Microsoft's IE share was constantly eroded.

Among them, Safari quickly became one of the world's mainstream browsers through bundling and powerful functions, and even dominated the US mobile browser market for a while. Among them, the open source WebKit (the engine of the Safari browser) is a well-deserved hero behind it. Of course, Safari ended up losing out to Google Chrome, and has shown signs of fatigue in recent years. Statcounter statistics show that Safari ranks second with a 19.3% share in February 2022.

https://gs.statcounter.com/

But at present, the most serious problem facing Safari is not the decline in market share, but the fact that the Safari browser is far behind other competitors in supporting web functions, and many people have regarded it as the "spirit of IE" left behind Reality Mapping .

Jen Simmons is an evangelist for Apple's Safari & WebKit developer team. On February 8, 2022, she launched a survey and discussion about Safari issues on Twitter:

Everyone I've met is saying Safari is the worst, new age IE... Then point out the specific bugs and lack of support that are frustrating you, preventing you from building websites/apps, please Submitted at Tickets. 

Here, we do not intend to pursue Safari in the end is how to get to this point. Starting from the open source story of WebKit, you may also be able to glimpse a few clues.

 

01 Mars hits the earth, Apple's "scumbag" open source

Before Safari, Apple experienced a time when it was "controlled" by Microsoft and Adobe . At that time, Microsoft controlled the office software (Word, Excel, Powerpoint, etc.), and Adobe controlled the key tools used by creative and designers (Photoshop, Illustrator, etc.), and they were almost the core of the third-party Mac software ecosystem.

This kind of "humiliation" that the third party is more powerful than its own platform, Apple can't swallow it. In order to strengthen its control over its own platform, it is impossible for Apple to let "web browsing technology" fall into the same dilemma, and it is imperative to develop Safari.

In 2001, Microsoft IE had won the battle with Netscape, and it was in full swing. This year, Apple took action internally: a new team was formed and a new, secretive web browser project was launched to develop a new browser that could replace Microsoft's Internet Explorer. At the time, all Mac computers sold had Internet Explorer as their default configuration, and Macs had no native browser.

To do this, a browser kernel is the key. The browser kernel is also the engine, which consists of two parts: the rendering engine (layout engineer or Rendering Engine) and the JS engine. It is responsible for getting the content of the web page (HTML, XML, images, etc.), organizing the information (eg adding CSS, etc.), and calculating how the web page should be displayed, and then outputting it to a monitor or printer.

Different kernels have different rendering effects. If Apple wants to come up with a competitive "ace project" on the browser, it must start with the kernel. This time, the open source projects that Apple has in mind are KHTML and KJS.

These two open source projects include the WebCore and JSCore engines, which are typesetting engines developed by KDE (  K Desktop Environment ) in 1998 and initially used for open source operating systems such as Linux and Unix. After comparing the Gecko engine (used by Firefox), Apple chose KHTML, which has a cleaner architecture and is smaller. 

KDE Community Icon 

On May 25, 2001, Apple engineer Don Melton (who was also the chief designer of the Safari project at the time) officially forked a branch from the KHTML fork, the predecessor of WebKit.

It is worth noting that both KHTML and KJS engines are free software, follow the GPL license , and support the development of BSD systems. This means that products derived from them must continue to be open sourced under the GPL.

So, in January 2003, at the Macworld Expo keynote speech in San Francisco, Jobs himself announced Safari at the same time as he announced a port of Apple's KHTML engine -- the WebCore open source. (In fact, it is the open source WebCore and JavaScriptCore that have to be open sourced directly from KHTML)

In the description, Safari's main features are fast web browsing, more native platform integration, and better compatibility than most existing websites. Importantly, it gave Apple control of a key technology in the Mac lineup. In some views, Apple's primary reason for committing to open-source WebKit is to unseat Microsoft and shake its browser throne.

This commercial purpose is naturally very different from the ideal of freedom advocated by the open source world, where open source projects are tools, weapons, and sharp tools to break through Apple's business shortcomings.

Of course, since Apple has opened the "Pandora's Box" of open source, there is no turning back. If Apple wants to continue to consolidate its browser status through WebKit, it has to deeply participate in the open source community. But based on Apple's own culture, it can be considered that Mars hit the earth...

In 2003, on the same day as the Macworld conference in San Francisco, Don Melton formally established the Apple Safari team and sent an email to the lead developer of KHTML and KJS to try to work with KHTML on WebCore.

Obviously, both Apple and KDE are happy and proud of this cooperation. Melton's letter is full of praise for this open source code, and Apple's launch of Safari will undoubtedly carry forward KHTML. Both are happy to see it. of.

Sadly, the honeymoon period between the two is short. Within two years, the rift between open source KDE and Apple was evident. It is said that exchanging code between WebKit and KHTML has become increasingly difficult over time, with Apple committing a slew of changes after long intervals, and without documentation, many features may only be half-developed. (Like a scumbag?)

It was quite difficult for KDE to integrate these changes back into KHTML. In addition, Apple also requires KDE developers to sign a non-disclosure agreement before viewing Apple code, which is also difficult for KDE to accept.

 

WebCore in WebKit is shared

A fight is inevitable. In 2005, KDE developers began to publicly attack Apple's practices, saying that the partnership between the two parties had completely disintegrated. That spring, two KHTML developers, Zack Rusin and Carewolf, both expressed their frustrations in blog posts.

This almost exemplifies that Apple is unlikely to "give back" to the open source community in a way that the open source community can benefit from.

After the matter was reported by the media, Apple made concessions. In 2005, at WWDC (Apple Worldwide Developers Conference), WebKit came from behind the scenes to the front, and Apple veteran Bertrand Serlet officially announced that WebKit was completely open source (before it was only WebCore). 

At this point, the relationship between KDE and Apple has also improved somewhat. Some KDE developers started committing changes for WebKit, and the Apple team reverted to many Apple-specific fixes and abstracted the platform layer so that the engine's core code could work on other platforms.

However, KDE has not forgotten Apple's "scumbag behavior" . They did not fully join the development of WebKit, but launched KDE development platform 4.5 at the end of 2010, supporting KHTML and WebKit side by side.

In any case, Apple-led WebKit has indeed surpassed KHTML and KJS itself. It is well-known in the browser field and has many innovations. Trends such as HTML5 and CSS3 are inseparable from Webkit.

But in the process of open source WebKit, Apple's "lust for control" and "acclimatization" with the open source community are also real. The open source of WebKit has won a real reputation and market for Apple, but in fact, the complete open source of WebKit is so unpleasant. 

 

02 Halfway through a Google, the open source WebKit stands in the center of the monopoly storm

After being fully open sourced in 2005, WebKit began to appear outside of Safari. For example, in November 2005, Nokia released a WebKit-based web browser for its S60 platform.

WebKit is getting hotter and hotter. In January 2007, the iPhone was released, and WebKit, as the basis of Mobile Safari, exerted its power on the iOS platform and began to sweep the mobile field.

However, for a fertile business ground, there is never a shortage of competitors. 10 months after the iPhone's debut, Google killed it off, releasing one of the fruits of its acquisition: the Android operating system. After learning the news, Jobs was very angry:

We didn't go into the search business, they went into the mobile business, make no mistake, they want to kill the iPhone.

For a time, the smoke of gunpowder was everywhere, and Google and Apple entered a state of full competition, including the browser business. In September 2008, the Chrome browser was officially launched. The interesting thing is that Chrome is also supported by WebKit . It uses the WebCore part of Webkit, and Google's own V8 engine is used in the JS engine. After the improvement, Google greatly improves the script execution speed, and Chrome stands out.

On July 7, 2009, Google announced a new project, the launch of "Chrome OS". Obviously, it was born to compete for the market of Microsoft and Apple. Moreover, it is also supported by WebKit. 

Apple's hard work, the open source project that was developed from the open source community, was used by another commercial company? Also become Safari's strongest competitor? Even today, the two are still fighting each other secretly. For example, " Chrome is faster and stronger, beats Safari on the Mac ", the headline is yours.

The business competition on the bright side is enough to see. Damn, because Google Chrome was forked and improved from WebKit, Apple and Google had to collaborate on an open source level.

KDE, a development group that is completely open source and has no substantial threat to Apple, is not compatible with Apple's open source cooperation, not to mention Google's competitor.

It is said that Google does not use things developed by Apple other than WebCore, but uses the multi-process browser architecture developed by itself. Also, about 50% of WebKit changes in WebKit came from developers at Google for a while. However, the final decision-making power of WebKit belongs to Apple . According to some third-party WebKit developers, the open source cooperation between the two does not have the mutual support of ordinary open source developers, but is more like two lions looking at each other. The atmosphere is tense.

 

This delicate relationship came to an end in 2013. In April, Google announced that Chrome would deprecate WebKit in favor of the Blink layout engine, because Apple unilaterally launched WebKit 2 without negotiation.

Google believes that there is too much Apple-specific code in WebKit 2, which not only does not work for Google, but also takes time to deal with compatibility issues. Many revisions submitted by Google were ultimately difficult to obtain Apple's approval, and the two sides had great differences on the development direction of WebKit.

At the same time, Apple's WebKit2 conflicted with Chromium's sandbox design, so Chromium has always stayed in WebKit, and used the transplant method to realize the docking with the mainline WebKit2. This increases the complexity of Chromium and affects Chromium's architecture porting efforts to some extent.

Blink engine is Google's derivative browser engine branched from WebKit, which aims to gradually break away from the influence of WebKit and stand on its own. So far, the pattern of the four major browser kernels (Trident is also known as IE kernel, WebKit, Blink and Gecko) is formed. Over the years, the quartet has been on its own, and only recently has it begun to work together to customize the specification due to Web compatibility issues. (For details, please click: "For the First Time in History! Apple/Google/Microsoft/Firefox Work Together to Solve Web Compatibility Issues" ) 

 

https://www.chromium.org/blink/ 

Immediately after the news of the Blink engine broke, developers on both sides began to comment on Hacker News. Most of the comments felt that Apple's WebKit change submission policy was hostile to non-Apple developers , especially WebKit 2. Some people believe that WebKit 2 is a product launched by Apple unilaterally, and there is no negotiation with Google and other people involved in the development of WebKit at all.

It is difficult to determine what is right and what is wrong between commercial companies. After all, it is often necessary to "do business in business".

However, it can be seen from the series of open source WebKit that large companies are profit-oriented. Don't think that Apple's open source WebKit has "opened a gap in the Berlin Wall". Someone is right: "WebKit to Apple is just an open source black sheep in its closed garden."

As Apple's open source project, and with great achievements, WebKit has an awkward "sense of dislocation" . This "sense of dislocation" was vividly displayed in the recent "UK antitrust investigation".

In February 2022, Andrea Coscelli, Chief Executive of the UK Competition and Markets Authority (CMA), announced in a press release :

Apple and Google have developed a bad habit of the way we use our phones and we fear it will lead to disorientation for millions of people in the UK.

Among the allegations of anticompetitive behavior, Apple has been criticized for requiring web-browsing apps to use the WebKit framework and WebKit Javascript on iOS and iPadOS. Apple's App Store review guidelines state: 2.5.6 Apps that browse the web must use the appropriate WebKit framework and WebKit Javascript.

Clearly, regulators believe this action will stifle innovation. And Apple's arguments in defense of itself are the need to protect users' security and privacy, as well as prevent Chromium's dominance.

"Do we really want to live in a world where the Chromium browser is 95% of the market? It's going to be a bad future for the Web". Jen Simmons in the picture above is the Apple Safari evangelist mentioned above. 

Of course, others don't see it that way. For example, Tim Sweeney, CEO of Epic Games, who has been at loggerheads with Apple over the App Store's high revenue sharing policy, said that WebKit restrictions are anti-competitive and intolerant.

Is Apple WebKit a success? There is no doubt that it was a success. However, from the perspective of open source, WebKit has always been under the strong control of Apple. Not only was it full of open source disputes at the beginning of open source, but now it has fallen into "monopoly" and "commercial war", showing a kind of awkwardness gesture.

Out of WebKit, Apple's most recent open source move is SWIFT. Stay tuned for the next issue: "Apple has open source, but so what? (Part 2)" SWIFT (click to view)

{{o.name}}
{{m.name}}

Guess you like

Origin my.oschina.net/u/5324949/blog/5488352