Why Mozilla is committed to Gecko as WebKit popularity grows

Source: Internet
Author: User

 

Why Mozilla is committed to Gecko as WebKit popularity grows

After Google's recent release of the WebKit-based Chrome browser, some of our readers have been wondering if Mozilla's gecko rendering engine is still relevant. ARS takes a close look at Gecko and WebKit and explains why gecko will continue to put the fire in Firefox.

By Ryan Paul | last updatedSeptember 9, 2008 am ctwebkit's strengths

In the wake of Google's release of the new WebKit-based Chrome browser, some technology enthusiasts are beginning to wonder if the days are numbered for Mozilla's gecko rendering engine. despite the growing popularity of WebKit, those who understand the differences between the two rendering engines and have an appreciation of gecko's technical strengths, recognize that there is no basis for speculation about the possibility of Mozilla adopting it for future versions of Firefox.

WebKit is an open-source HTML Rendering Engine that was developed by Apple with code from KDE's khtml project. as we noted in our chrome review, WebKit is an extremely lightweight Renderer that is often praised for its tight and clean code base, excellent standards-compliance, and small memory footprint. these characteristics have made it a popular choice for browser implementers and numerous other adopters.

WebKit is primarily used in Apple's Safari web browser and on the iPhone, but high-profile third-party users include Adobe, Nokia, and trolltech. webKit is also used by a multitude of other lesser-known browsers, including ICAB, omniweb, shiira, and Epiphany. it's a favorite in the alternative-OS community as well, and is making its way to Haiku, syllable, and even amiga. on the Linux desktop, programmers (including myself) are increasingly using it to build rich Internet applications. after evaluating all of the available choices, Google saw WebKit as the obvious choice for both its Android mobile browser and for chrome on the desktop.

The consensus of the developers who are using WebKit is clear: it's an outstanding rendering engine that lends itself to an extremely diverse assortment of practical uses. it is everywhere, and it is gaining traction at a very impressive rate. that traction is causing some developers to question whether Mozilla's gecko rendering engine is still relevant.

Why Apple rejected Gecko

Gecko, which originated at Netscape and predates khtml, is often criticized for its large and infamously complex code base. gecko has always been extraordinarily powerful, but its richest and most impressive capabilities originally came at a high cost in size, complexity, and memory overhead. the consequence is that gecko is unsuitable for adoption in specified places where its additional functionality is an impediment instead of an asset.

One of the primary reasons for the enormous complexity of the gecko code base is that it aims to provide much more than just an HTML Renderer. mozilla's early goals were extremely ambitious-the original Mozilla Application Suite has ded a browser, a complete mail and newsgroup program, a web design tool, and an IRC client. in addition to rendering HTML, Gecko also provides a versatile XML-based user interface rendering framework called XUL that was used extensively in those applications. XUL is still used today to create the Firefox user interface, and it facilitates that browser's support for extensions, which are regarded by using enthusiasts as one of the most valuable features offered by Firefox.

Another reason for much of the complexity in gecko is the use of XPCOM, a powerful component system. although XPCOM brings a lot of really compelling capabilities to gecko and made the entire engine highly modular, some developers embraced it too between and used it in places where it was probably not wise do so. when ARS interviewed former Mozilla developer Scott Collins back in 2004, he listed the excessive use of XPCOM among Mozilla's top mistakes.

With all of the complexity introduced by XUL and XPCOM, it made sense for Apple to choose something lighter for safari. apple wanted to make a browser that cocould be integrated tightly with Mac OS X. it's also possible that they foresaw the need for a rendering engine that cocould scale down to a mobile device, a factor that also made khtml a better solution than gecko at the time.

When Apple chose to use khtml for Safari 2003, Mozilla's Mike Shaver responded with a blog entry acknowledging gecko's weaknesses. he also astutely predicted that Apple wowould become an ally in promoting open web standards and that Apple's demo-to create its own browser wowould provide against opportunities for mutual learning and improvement.

"Gecko missed its 'small and lean 'target by an area code, and we 've been slogging back towards the goal, dragging our profilers and benchmarks behind us, for years. if I had to write a new browser, and I was going to have to touch the layout code in a serious way, I wowould think about Mozilla alternatives, "he wrote back in 2003. "I really hope that Mozilla will learn from Safari/khtml, because they 've done a lot of great work in about a tenth of the Code."

A revamped gecko puts the fire in Firefox 3

A lot of things have changed since 2003, and the gecko code base has come a long way. gecko is still very complex, but contains of its historical weaknesses have been addressed by Mozilla's engineering efforts. gecko received a massive overhaul for Firefox 3, with countless changes that significantly improved the entire browsing experience.

Gecko 1.9 uses the cross-platform Cairo rendering framework. this greatly improved SVG support simplified extends aspects of the code base and facilitated some cool features, like support for full-page zooming. the overhaul also included significant refactoring of the Reflow algorithm, making it possible for gecko to pass the acid 2 test. mozilla also aggressively already CED memory consumption, coming out ahead of both safari and opera.

Usage of XPCOM has been decreased in your places over the years, and its resource overhead was CED ced by the new cycle collector. this work will continue as Mozilla purges XPCOM more extensively from gecko in preparation for Firefox 4 and replaces XPCOM reference counting with real garbage collection. ongoing development efforts are addressing other Gecko weaknesses, too. for instance, Gecko improvements that landed in the first Firefox 3.1 Alpha add support for some CSS 3 features that are implemented in WebKit. there are also lots of performance improvements that make gecko more competitive. mozilla's tracemonkey engine landed in recent nightly builds and will likely be supported ded in 3.1; it massively boosts JavaScript performance.

From a technical perspective, gecko is now very solid and no longer lags behind WebKit. A testament to the rate at which Gecko has been improving is its newfound viability in the mobile space, where it was practically considered a nonstarter not too long ago. mozilla clearly has the resources, developer expertise, and community support to take gecko anywhere that WebKit can go.

  • Text Size
  • Download PDF(Subscribe required)
  • Print this article
  • Leave a comment
Why gecko gets love from third-party adopters

It's also worth noting that some of gecko's unique and seemingly idiosyncratic features are becoming useful to third-party adopters. there are a growing number of applications being built on top of the Mozilla platform that leverage XUL with impressive results. A few examples are the songbird music player, the Miro video player, and ActiveState's Komodo IDE. firefox 3 itself can be used as a XUL application runtime, which means that third-party developers can build rich Internet applications with XUL and JavaScript and deploy them with dependencies on computers with Firefox 3. similarly, we are beginning to see sophisticated XUL applications deployed entirely as Firefox extensions. one example is penpencil, A diagramming and GUI prototyping tool that recently won the extend Firefox 3 contest.

Some of the most prominent WebKit adopters are also investors considerable resources into gecko and Firefox. nokia, for instance, is funding the development of a Firefox QT port and Adobe is collaborating with Mozilla to develop Tamarin, a new JavaScript Engine that uses code from Flash's ActionScript virtual machine.

Gecko is clearly capable of achieving parity with WebKit in power, performance, and low memory consumption, while still providing unique and highly advantageous features that can't be found in other rendering engines or easily added to WebKit. despite the belief of some critics that WebKit is categorically better, there is no technical basis for arguing that Firefox shoshould drop gecko.

Mozilla explains why WebKit isn' t the future of Firefox

We asked Mike Shaver, who is now Mozilla's VP of engineering, to comment on how he views the Gecko/WebKit dichotomy today and why he believes gecko is still important.

"I have a lot of respect for the WebKit guys, and for the work they 've done," he told us in an e-mail. "The Web is better because they're around and pushing hard, and Mozilla itself is better from the competitive push as well as cooperation ranging from new web standards to plugin interfaces to the nerdiest of implementation discussions."

Although he respects the technical achievements of WebKit, he believes that the WebKit development model and fragmentation in the WebKit ecosystem wocould create serious challenges that make it unsuitable for Firefox.

"We're re getting a ton of value out of a uniied engine for all our projects, from desktop to device and xulrunner to Thunderbird. if you look at the WebKit landscape right now, you see a lot of different projects there and it's not clear how or if they'll converge, "he wrote. "We 'd obviusly need to hack WebKit pretty hard to adapt it to our needs, and it's not likely that adding another fast-moving Variant to that mix wocould be helpful to anyone, least of all WebKit! We learned about fork maintenance and integration the hard way (and had to learn it a couple of times, to be honest), so that's not trouble that we want to borrow ."

The WebKit governance model and Apple's general lack of transparency are also issues that wowould negatively impact Mozilla if Firefox adopted WebKit.

"I think we wowould have a hard time maintaining our momentum and depth of community empowerment in the WebKit setting. the level of visibility around patches and review is a lot in our world, as one example, and we don't have bugs disappearing into an apple-only bug system, "He told us. "for us to come into WebKit's world and insist on that additional transparency wocould be unfair and counterproductive, but to live without it wouldn't be an option for Mozilla. our system works for us, and their system works for them (and is in every ways less noisy ), but I don't think that any one system cocould work very well for both of us."

Conclusion

My hope is that this detailed examination of gecko's strengths, and the effort that Mozilla has invested in overcoming its weaknesses, will help illuminate the continuing relevance of Gecko in the Mozilla ecosystem and finally put to rest dubious speculation about the possibility of WebKit adoption for Firefox.

The technical advantages of Gecko are evident when viewed objectively, and the amount of effort that wocould be required to make WebKit fit into the Firefox stack wowould far outweigh the technical benefits. as we have noted in the past, there are also reasons why the choice and diversity inherent in having multiple competing implementations is valuable, too.

There are missing things the gecko and WebKit developer communities can learn from each other, but replacing gecko wocould not serve any justifiable purpose. in closing, I'll leave you with one more thought from Mike Shaver:

"We follow WebKit as closely as anyone in the world, and we cast as critical an eye towards our technology stack as anyone in the world," he told us. "But a brain transplant is neither practical nor likely to be useful."

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.