Mozilla 2: Difference between revisions

70 bytes removed ,  3 February 2010
no edit summary
(→‎Project Status: changin metting notes link to ;Plataform)
No edit summary
Line 1: Line 1:
(See [[Mozilla_2/Old_Moz2|the 2004-era Mozilla 2 pages]] for older ideas.)
(See [[Mozilla 2/Old Moz2|the 2004-era Mozilla 2 pages]] for older ideas.)  


== Project Status ==
== Project Status ==


See the [[Platform#Meeting_Notes|latest status meeting notes]].
See the [[Platform#Meeting_Notes|latest status meeting notes]].  


=== Work List ===
=== Work List ===


A detailed list of items that we are working on can be found here:
A detailed list of items that we are working on can be found here:  


[[Mozilla 2/Work List|Mozilla 2 Work List]]
[[Mozilla 2/Work List|Mozilla 2 Work List]]  


=== Ends ===
=== Ends ===


Current thinking on goals, initially pitched in [[User:Brendan | Brendan]]'s [http://weblogs.mozillazine.org/roadmap/archives/2006/10/mozilla_2.html Mozilla 2 blog item], consists of these major bullet items:
Current thinking on goals, initially pitched in [[User:Brendan|Brendan]]'s [http://weblogs.mozillazine.org/roadmap/archives/2006/10/mozilla_2.html Mozilla 2 blog item], consists of these major bullet items:  


* Clean up our APIs to be fewer, better, and "on the outside" of Gecko, with symbol visibility strictly limited to public APIs.
*Clean up our APIs to be fewer, better, and "on the outside" of Gecko, with symbol visibility strictly limited to public APIs.  
* Based on these APIs and supported embedding scenarios, support intentional Gecko embedding in a first-class way.
*Based on these APIs and supported embedding scenarios, support intentional Gecko embedding in a first-class way.  
* Simplify the Mozilla codebase to make it smaller, faster, and easier to approach and maintain.
*Simplify the Mozilla codebase to make it smaller, faster, and easier to approach and maintain.  
* Take advantage of standard C++ features and fast paths instead of XPCOM and ad hoc code.
*Take advantage of standard C++ features and fast paths instead of XPCOM and ad hoc code.  
* Implement [http://www.ecmascript.org/ JS2] on top of [[Tamarin]] via [[JavaScript:ActionMonkey|ActionMonkey]].
*Implement [http://www.ecmascript.org/ JS2] on top of [[Tamarin]] via [[JavaScript:ActionMonkey|ActionMonkey]].  
* Optimization including JIT compilation for JS2 with very fast DOM access and low memory costs.
*Optimization including JIT compilation for JS2 with very fast DOM access and low memory costs.  
* Tool-time and runtime enforcement of important safety properties including memory safety and confidentiality properties for both XUL and the Web.
*Tool-time and runtime enforcement of important safety properties including memory safety and confidentiality properties for both XUL and the Web.  
* Rich graphics support including accelerated SVG/Canvas and Video Support
*Rich graphics support including accelerated SVG/Canvas and Video Support


=== Anti-Goals ===
=== Anti-Goals ===
What these mean in detail is mostly "to be decided", but we should try to say what we don't mean:


* We won't rewrite the Mozilla codebase by hand.
What these mean in detail is mostly "to be decided", but we should try to say what we don't mean:
* We won't gratuitously break API compatibility ("some of our APIs are fine, thank you").
* We won't drop XPCOM completely; we may even have configurable Mozilla 1 XPCOM compatibility.
* We won't bring up Mozilla 2 on mobile devices (but volunteers are welcome to port early and often; Mozilla 2 will fit on such devices much more easily than Mozilla 1 code does).


The goals boil down to competing more effectively with ourselves, with [http://webkit.org/ Webkit], and even with IE and Opera, for all three of the Web, XUL (or equivalent "widget" or "rich client platform" comparable), and C++ embeddable HTML rendering engine platforms. We should aspire to beat the competition on major time, space, and ease-of-use axes, not just show or place.
*We won't rewrite the Mozilla codebase by hand.  
*We won't gratuitously break API compatibility ("some of our APIs are fine, thank you").  
*We won't drop XPCOM completely; we may even have configurable Mozilla 1 XPCOM compatibility.
*We won't bring up Mozilla 2 on mobile devices (but volunteers are welcome to port early and often; Mozilla 2 will fit on such devices much more easily than Mozilla 1 code does).


=== Ongoing Work ===
The goals boil down to competing more effectively with ourselves, with [http://webkit.org/ Webkit], and even with IE and Opera, for all three of the Web, XUL (or equivalent "widget" or "rich client platform" comparable), and C++ embeddable HTML rendering engine platforms. We should aspire to beat the competition on major time, space, and ease-of-use axes, not just show or place.


* [[JavaScript:ActionMonkey]]: Rewriting spidermonkey to use actionmonkey. This is also the man hg branch that Moz2 work is being done in
=== Ongoing Work  ===
* [[XPCOMGC]]: Switch from reference counting to a GC
* [[Mozilla2/November-Agenda]]
* [[Gfx glue layer removal]]


=== Tools ===
*[[JavaScript:ActionMonkey]]: Rewriting spidermonkey to use actionmonkey. This is also the man hg branch that Moz2 work is being done in
*[[XPCOMGC]]: Switch from reference counting to a GC
*[[Mozilla2/November-Agenda]]
*[[Gfx glue layer removal]]


The goals are ambitious, and unrealistic without new tools and approaches to the code. Here are some of the major levers we use to move mountains.
=== Tools ===
* Moz2 uses [http://www.selenic.com/mercurial/wiki/ Mercurial] for version control
* [[Pork]] tool suite contains the source rewriting tools.


=== More Info ===
The goals are ambitious, and unrealistic without new tools and approaches to the code. Here are some of the major levers we use to move mountains.


The info below has not been significantly updated since December 2006
*Moz2 uses [http://www.selenic.com/mercurial/wiki/ Mercurial] for version control
*[[Pork]] tool suite contains the source rewriting tools.


==== Tasklist ====
=== More Info  ===


* Import final dirlist into Hg (Benjamin/Brendan)
The info below has not been significantly updated since December 2006


* Begin refactoring work/deCOMtamination/API work
==== Tasklist  ====
** Get tools good enough for broad use (Taras)
** Develop hitlist of areas to refactor (Taras/Brendan)
** Plan for refactoring DOM APIs (JST)


* Complete ES4 spec and ref impl (Brendan/Graydon)
*Import final dirlist into Hg (Benjamin/Brendan)


* Begin Tamarin/SM integration
*Begin refactoring work/deCOMtamination/API work
** Extract GC from Tamarin - remove all flash deps (TBH)
**Get tools good enough for broad use (Taras)  
** Ensure GC/Taramin compiles/runs on all platforms (TBH)
**Develop hitlist of areas to refactor (Taras/Brendan)  
** [[XPCOMGC]] object model
**Plan for refactoring DOM APIs (JST)


* Rich Graphics Plan
*Complete ES4 spec and ref impl (Brendan/Graydon)
** Video Prototypes (Chris D)
** SVG/Canvas Plan (Vlad)
** Accelerated Graphics Plan (Vlad)
** OpenText Improvements Plan (Pav)


* Security Plan (Window)
*Begin Tamarin/SM integration
* Layout Plan (Roc/DBaron)
**Extract GC from Tamarin - remove all flash deps (TBH)  
**Ensure GC/Taramin compiles/runs on all platforms (TBH)  
**[[XPCOMGC]] object model


==== Old Timeline ====
*Rich Graphics Plan
**Video Prototypes (Chris D)
**SVG/Canvas Plan (Vlad)
**Accelerated Graphics Plan (Vlad)
**OpenText Improvements Plan (Pav)


* Q107 - Kickoff of project
*Security Plan (Window)
** VCS up and ready for checkins
*Layout Plan (Roc/DBaron)
** Major areas of focus identified
** Owners for each area identified


* Q207
==== Old Timeline  ====
** ES4 Spec and Ref Impl Draft
** Plans flushed out for each major task area
** Refactoring tools usable by wider audience
** Prototype VIDEO Tag


* Q307
*Q107 - Kickoff of project
** ES4 Spec and Ref Impl Complete
**VCS up and ready for checkins
** Refactoring work begun
**Major areas of focus identified
*** Elimination of raw pointers
**Owners for each area identified
*** Shift to STD C++


* Q407
*Q207
** Tamarin GC Building on all major platforms
**ES4 Spec and Ref Impl Draft
** First prototype of Tamarin
**Plans flushed out for each major task area
** Design/Prototypes done for each major area
**Refactoring tools usable by wider audience
**Prototype VIDEO Tag


* Q108
*Q307
** First Alpha of Moz2/Gecko2/Fx4 released
**ES4 Spec and Ref Impl Complete
**Refactoring work begun
***Elimination of raw pointers
***Shift to STD C++


* Q208
*Q407
** Fx4 Alphas
**Tamarin GC Building on all major platforms
** All Major design work done
**First prototype of Tamarin
**Design/Prototypes done for each major area


* Q308
*Q108
** First Fx4/Moz2 Beta
**First Alpha of Moz2/Gecko2/Fx4 released


* Q408
*Q208
** Betas
**Fx4 Alphas
**All Major design work done


* Q109
*Q308
** Moz2/Fx4 Ship
**First Fx4/Moz2 Beta


==== A Better VCS (Brendan/Preed) ====
*Q408
**Betas


See [[VersionControlSummit2006|the great Version Control System shoot-out]]. We need a better VCS because Mozilla 2 will require more sweeping changes, and more experiments which must be run in parallel, than anything we've done so far. So we need at least
*Q109
**Moz2/Fx4 Ship


* better, cheaper branching
==== A Better VCS (Brendan/Preed) ====
* better merge algorithms for updating and landing branches
* decentralized operation (no master repository with slave workareas)
* good merge-from-CVS capability to track the Mozilla 1.9 trunk where possible
* great performance on Windows (this rules out cygwin-ported Linux VCSes)


See [http://weblogs.mozillazine.org/preed/2006/11/version_control_system_shootou.html preed's Mortal Kombat] salute and look for news on his blog.
See [[VersionControlSummit2006|the great Version Control System shoot-out]]. We need a better VCS because Mozilla 2 will require more sweeping changes, and more experiments which must be run in parallel, than anything we've done so far. So we need at least


An important aspect to get straight is the branching topology. We will have many unstable branches running concurrently during Moz2 development. Generally for each task you want sub-task branches (possibly per-author or per-feature) plus a task-integration branch that your group tries to keep building and working most of the time. The ability to chain a new branch to a new buildbot, with a minimum of fuss, is very helpful.
*better, cheaper branching  
*better merge algorithms for updating and landing branches  
*decentralized operation (no master repository with slave workareas)
*good merge-from-CVS capability to track the Mozilla 1.9 trunk where possible
*great performance on Windows (this rules out cygwin-ported Linux VCSes)


==== ES4 ====
See [http://weblogs.mozillazine.org/preed/2006/11/version_control_system_shootou.html preed's Mortal Kombat] salute and look for news on his blog.


* Ref implementation complete June 07
An important aspect to get straight is the branching topology. We will have many unstable branches running concurrently during Moz2 development. Generally for each task you want sub-task branches (possibly per-author or per-feature) plus a task-integration branch that your group tries to keep building and working most of the time. The ability to chain a new branch to a new buildbot, with a minimum of fuss, is very helpful.
* Merge Tamarin in existing JS APIs
* Tamarin Performance Improvements (see above)
* JS Trust labels


By combining APIs, code, and ideas from [http://lxr.mozilla.org/mozilla/source/js/src SpiderMonkey] and [http://lxr.mozilla.org/mozilla/source/js/tamarin Tamarin], we will build a [http://developer.mozilla.org/es4 JS2] virtual machine as part of Mozilla 2. The Tamarin code contribution is a big boost to this effort, and we intend to extend it, not copy code from it. But we need more than today's Tamarin in order to avoid certain pitfalls.  We will probably need all of these:
==== ES4 ====


* Dynamic optimizations for untyped JS (both Web and XUL JS -- we won't require all XUL JS to be annotated with types).
*Ref implementation complete June 07
* Profile-directed Ahead Of Time compilation for critical methods (in lieu of XUL FastLoad, to avoid taking a startup performance hit).
*Merge Tamarin in existing JS APIs
* Fresh thinking and hacking for VM-based security, learning from [[Security:Bibliography|recent security research]].
*Tamarin Performance Improvements (see above)  
*JS Trust labels


We hope to self-host a JS2 compiler on the VM, but if performance can't match or beat the competition (including today's SpiderMonkey), we will have to consider:
By combining APIs, code, and ideas from [http://lxr.mozilla.org/mozilla/source/js/src SpiderMonkey] and [http://lxr.mozilla.org/mozilla/source/js/tamarin Tamarin], we will build a [http://developer.mozilla.org/es4 JS2] virtual machine as part of Mozilla 2. The Tamarin code contribution is a big boost to this effort, and we intend to extend it, not copy code from it. But we need more than today's Tamarin in order to avoid certain pitfalls. We will probably need all of these:  


* Native compiler front end.
*Dynamic optimizations for untyped JS (both Web and XUL JS -- we won't require all XUL JS to be annotated with types).
*Profile-directed Ahead Of Time compilation for critical methods (in lieu of XUL FastLoad, to avoid taking a startup performance hit).
*Fresh thinking and hacking for VM-based security, learning from [[Security:Bibliography|recent security research]].


While "it would be nice" (sincerely; but also, these are famous last words) to optimize the VM such that the self-hosted compiler beats a C or C++ hand-crafted compiler, we cannot put purity ahead of performance. The trade-off for Tamarin's embedding in the Flash Player is different: offline compilation via the Flex SDK is the rule there, and the self-hosted compiler need only be fast enough for <code>eval</code> requirements (which will be novel to Flash in a future release).
We hope to self-host a JS2 compiler on the VM, but if performance can't match or beat the competition (including today's SpiderMonkey), we will have to consider:


Current DOM security checks use the [[Security:Scattered Security Checks]] model. For Mozilla 2, in order to JIT DOM calls efficiently, we need either [[Security:Security Checks In Glue]] or [[Security:Wrapper-based Checks]]. To support "mashups in the browser" and [http://www.w3.org/TR/XBL XBL2], we may need to support data-tainting with static flow analysis as well as dynamic taint propagation.
*Native compiler front end.


==== Semi-automated refactoring work/Oink ====
While "it would be nice" (sincerely; but also, these are famous last words) to optimize the VM such that the self-hosted compiler beats a C or C++ hand-crafted compiler, we cannot put purity ahead of performance. The trade-off for Tamarin's embedding in the Flash Player is different: offline compilation via the Flex SDK is the rule there, and the self-hosted compiler need only be fast enough for <code>eval</code> requirements (which will be novel to Flash in a future release).


[[Static Analysis]] via [[FirefoxSummit/2006/ProposedSessions/Oink|Oink]] will play an important role, we think, in partially or fully automating
Current DOM security checks use the [[Security:Scattered Security Checks]] model. For Mozilla 2, in order to JIT DOM calls efficiently, we need either [[Security:Security Checks In Glue]] or [[Security:Wrapper-based Checks]]. To support "mashups in the browser" and [http://www.w3.org/TR/XBL XBL2], we may need to support data-tainting with static flow analysis as well as dynamic taint propagation.


* deCOMtamination, including getting XPCOM completely out of the middle of Gecko
==== Semi-automated refactoring work/Oink  ====
* static data-tainting checks to uphold confidentiality properties
* conversion to [[Exceptions|exception-safe code]], and holding the line on exception safety
* conversion to C++ exceptions, possibly including a new XPCOM C++ binding
* identification of C++ ripe for conversion to JS2.
* conversion from ad-hoc or Mozilla-private APIs to standard C++ APIs
* simple metrics of code complexity, to be regularly compared to other open source projects


Other good ideas for Oink-based tools should be noted on [[Static Analysis]].  The "conversion" items above will use the to-be-written (but proven-in-concept) pattern-matching patch-generating tool discussed at [http://weblogs.mozillazine.org/roadmap/archives/2006/11/oinkbased_patch_generation.html another this blog post].
[[Static Analysis]] via [[FirefoxSummit/2006/ProposedSessions/Oink|Oink]] will play an important role, we think, in partially or fully automating


==== Embedding API Design ====
*deCOMtamination, including getting XPCOM completely out of the middle of Gecko
*static data-tainting checks to uphold confidentiality properties
*conversion to [[Exceptions|exception-safe code]], and holding the line on exception safety
*conversion to C++ exceptions, possibly including a new XPCOM C++ binding
*identification of C++ ripe for conversion to JS2.
*conversion from ad-hoc or Mozilla-private APIs to standard C++ APIs
*simple metrics of code complexity, to be regularly compared to other open source projects


* [[Mozilla 2/XPCOM and Binary Embedding]]
Other good ideas for Oink-based tools should be noted on [[Static Analysis]]. The "conversion" items above will use the to-be-written (but proven-in-concept) pattern-matching patch-generating tool discussed at [http://www.bestessays.com term papers].
* [[Mozilla 2:Embedding APIs]]
* [[Mozilla 2:Obsolete APIs]]


==== Rendering Performance ====
==== Embedding API Design  ====


==== Graphics/Advanced Rendering ====
*[[Mozilla 2/XPCOM and Binary Embedding]]
*[[Mozilla 2:Embedding APIs]]
*[[Mozilla 2:Obsolete APIs]]


* Get rid of remnants of old gfx
==== Rendering Performance  ====
** convert all paint methods to take gfxContext instead of nsIRenderingContext
** optimize API usage, e.g. take advantage of new clipping/transform capabilities
* Add optional acceleration using OpenGL (or Direct3D)
** Involves work to make widget layer 3D-aware
* Add video capabilities to platform, combined with hw accel and complex transform capability
* Make 3D a first-class citizen of platform
** any 2D element should render correctly under an arbitrary 2D transform
* Tighter integration between image decoding and rendering
** decode-on-render
** SVG as image


==== Security ====
==== Graphics/Advanced Rendering  ====


[[Category:Mozilla 2]]
*Get rid of remnants of old gfx
**convert all paint methods to take gfxContext instead of nsIRenderingContext
**optimize API usage, e.g. take advantage of new clipping/transform capabilities
*Add optional acceleration using OpenGL (or Direct3D)
**Involves work to make widget layer 3D-aware
*Add video capabilities to platform, combined with hw accel and complex transform capability
*Make 3D a first-class citizen of platform
**any 2D element should render correctly under an arbitrary 2D transform
*Tighter integration between image decoding and rendering
**decode-on-render
**SVG as image
 
==== Security  ====


Security Ideas and Wish List for Post Gecko 1.9  
Security Ideas and Wish List for Post Gecko 1.9  


* attack surface reduction
*attack surface reduction  
* content restrictions, <noscript>, jail
*content restrictions, &lt;noscript&gt;, jail  
* next level private browsing
*next level private browsing  
* low privilege/protected mode, cross platform
*low privilege/protected mode, cross platform  
* xbl2
*xbl2  
* security review for every feature lightweight process to make it manageable
*security review for every feature lightweight process to make it manageable  
* offline stuff
*offline stuff  
* profile encryption
*profile encryption  
* identity management
*identity management  
* platform native keychain
*platform native keychain  
* all critical – moderate resolved through every major release
*all critical – moderate resolved through every major release
 
*documenting and enforcing invariants
**what is allows to happen when
**assert if you do that
*clean up assertions
**ones remaining really mean something
*regression test suite for security, pages to assert, measure leaks
*better compartmentalization of javascript between chrome and content
*addons/plugins
*out of process plugins;&nbsp;


* documenting and enforcing invariants
[[Category:Mozilla_2]]
** what is allows to happen when
** assert if you do that
* clean up assertions
** ones remaining really mean something
* regression test suite for security, pages to assert, measure leaks
* better compartmentalization of javascript between chrome and content
* addons/plugins
* out of process plugins
3

edits