of 16
8/14/2019 Device Creation_Yael Aharon_Nokia
1/16
Gettin into WebKit o en source ro ect
Yael Aharon
Principal SW Engineer
Nokia
8/14/2019 Device Creation_Yael Aharon_Nokia
2/16
Open source is no joke
April 1st, 2004. A senior manager visited
our office in Burlington with a message: We are going to adopt an open source
browser engine for Nokia devices,
replacing the in-house engine. At the time, we knew nothing about open
source.
April fools day ?
But this was no joke.
8/14/2019 Device Creation_Yael Aharon_Nokia
3/16
Open source is no free ride either
Our choice was to use the WebKit open
source project. Soon after, a few technical details came
up.
8/14/2019 Device Creation_Yael Aharon_Nokia
4/16
If the glove doesnt (perfectly) fit - I
WebKit was designed for the desktop,
where memory allocations hardly ever fail. But in Nokia devices, sometimes they do.
the browser when memory allocations fail.
The last thing we wanted in a project thisbig, was to add error handling in everysingle file.
What to do?
8/14/2019 Device Creation_Yael Aharon_Nokia
5/16
If the glove doesnt (perfectly) fit - II
Thats when our memory manager was
born. Instead of modifying thousands of files,
we identified a handful of key places to
check the level of available memory in thesystem, and handle failure gracefully.
8/14/2019 Device Creation_Yael Aharon_Nokia
6/16
If the glove doesnt (perfectly) fit - III
WebKit is loaded with features.
But our in-house browser included somenon-standard extensions.
Unable to drop these features, and unableto convince WebKit to add these features,we found an architectural design that willkeep these features in our product, withlittle to no changes in WebKit code.
8/14/2019 Device Creation_Yael Aharon_Nokia
7/16
Be special
What makes a product stand out, when it
relies on open source project? Our innovative engineers came up with
many ideas.
The graphical history was a great idea,adopted by competitors too.
Page overview was another one. Allows
viewing the whole page on a small screen. Double tree rendering not so great idea.
8/14/2019 Device Creation_Yael Aharon_Nokia
8/16
Source control is a religion
When adopting an open source project,
comes the question of which sourcecontrol system to use. Ours, or theirs?
For a while, we used a combination of.
Not productive!
Got to pick whats best for the engineers.
Easy to write automated scripts to movethe modified files from one source controlsystem to another.
8/14/2019 Device Creation_Yael Aharon_Nokia
9/16
When to branch?
It is really important to choose the optimal time
for branching. We branched right away, thinking it would be
easier to maintain a snapshot of WebKit.
webkit.org.
But soon enough, our branched code becameoutdated, and it takes a lot of effort to catch-up.
We plan to start working directly in the WebKittrunk, and branch only towards releases.
8/14/2019 Device Creation_Yael Aharon_Nokia
10/16
The review
For an open source project to succeed, it
must be policed very tightly. WebKit has a very rigorous review
process.
ne, some mes more an one rev ewer,would review your patch from manyaspects, and provide feedback.
Becoming a reviewer is a merit basedprocess.
You must prove yourself first.
8/14/2019 Device Creation_Yael Aharon_Nokia
11/16
When every space counts - I
Who likes coding conventions and guidelines?
We all have our prefered way for indenting andnaming and doing things.
In a big open source project, lack of coding.
Messy code leads to sloppiness and that leadsto
When we started working with WebKit, we had a
hard time adjusting to the projects codingconventions.
8/14/2019 Device Creation_Yael Aharon_Nokia
12/16
When every space counts - II
In fact, one reason for rejecting our
patches used to be wrong indentations. But once we got used to it, we saw the
benefits consistent, professional grade
code.
8/14/2019 Device Creation_Yael Aharon_Nokia
13/16
Continuous testing
Bad or buggy code can bring a project
down, and fast. WebKits policy requires every patch to
either include new automated tests, or
explain why new tests are not needed. Automated tools are running thousands of
automated tests before every commit, so
regression can be caught immediately.
8/14/2019 Device Creation_Yael Aharon_Nokia
14/16
Whats in it for me?
Working in an open source project has
challenges, so why would engineers buy-in?
Working on a big project gives engineers
the opportunity to collaborate and networkwith colleagues, working for othercompanies.
Engineers get to see their work being usedin many more products.
8/14/2019 Device Creation_Yael Aharon_Nokia
15/16
Way ahead
The WHATWG (Web Hypertext Application
Technology Working Group) is adding many newand interesting features to HTML 5.
Of course, we want them in our products.
,and implement the new features in WebKit. Butthen we would get the features in THEIR priorityorder, and with THEIR interpretation.
So dont wait for someone else to do the work.Jump in, participate!
8/14/2019 Device Creation_Yael Aharon_Nokia
16/16