CSSFrameConstructor: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
m (Reverted edit of Biubpz, changed back to last version by RyanJones)
 
Line 1: Line 1:
<div id="ckdtjlqh" style="overflow:auto;height:1px;">[http://www.naacpncnetwork.org/nzrpe/ designer handbag kate replica spade] [http://www.naacpncnetwork.org/dqspqvz/ wholesale replica coach handbag] [http://www.naacpncnetwork.org/uicohwsh/ coach signature replica handbag wholesale] [http://www.naacpncnetwork.org/maxrfq/ aaa replica handbag] [http://www.naacpncnetwork.org/aeafvtw/ aaa chloe handbag replica] [http://www.naacpncnetwork.org/pfsvvrhya/ aaa grade handbag replica] [http://www.naacpncnetwork.org/iuksk/ handbag lv replica wholesale] [http://www.naacpncnetwork.org/mrisc/ hermes handbag replica] [http://www.naacpncnetwork.org/rkesflccj/ cheap replica handbag] [http://www.naacpncnetwork.org/cbmizf/ cheap replica chanel handbag] [http://www.naacpncnetwork.org/inmjs/ cheap replica coach handbag] [http://www.naacpncnetwork.org/xubcc/ cheap wholesale replica handbag] [http://www.naacpncnetwork.org/bbvfpatd/ cheap designer replica handbag wholesale] [http://www.naacpncnetwork.org/jrpbdgkls/ replica chloe handbag] [http://www.naacpncnetwork.org/bndxgv/ chloe handbag paddington replica] [http://www.naacpncnetwork.org/hurdmfzwa/ chloe designer handbag replica] [http://www.naacpncnetwork.org/lajyiwkvp/ fendi replica handbag] [http://www.naacpncnetwork.org/iyvxqw/ fendi and gucci replica handbag] [http://www.naacpncnetwork.org/enievg/ wholesale designer replica handbag] [http://www.naacpncnetwork.org/zydofdkd/ replica designer handbag at wholesale prices] [http://www.naacpncnetwork.org/giunev/ wholesale replica handbag] [http://www.naacpncnetwork.org/kgyuj/ handbag wholesale replica watch] [http://www.naacpncnetwork.org/jdilfpjqx/ wholesale replica lv handbag] [http://www.naacpncnetwork.org/fvkfvmvp/ replica handbag wholesale price] [http://www.naacpncnetwork.org/kouyrc/ replica chanel handbag] [http://www.naacpncnetwork.org/xrisqzjo/ replica designer handbag chanel] [http://www.naacpncnetwork.org/hkuzsz/ discount chanel handbag replica] [http://www.naacpncnetwork.org/rhyfld/ handbag louis replica theda vuitton] [http://www.naacpncnetwork.org/pfvwbjdyy/ handbag louis replica shopping vuitton] [http://www.naacpncnetwork.org/fwnriugs/ bag image louis mirror replica vuitton] [http://www.naacpncnetwork.org/kpcqja/ bag designer diaper replica] [http://www.naacpncnetwork.org/cwomynr/ bag dior replica] [http://www.naacpncnetwork.org/sbcjjxjum/ bag christian dior replica] [http://www.naacpncnetwork.org/coadxfajn/ bag hermes replica] [http://www.naacpncnetwork.org/atkwzq/ bag birkin hermes replica] [http://www.naacpncnetwork.org/dncljzexb/ bag burberry replica] </div>This is a page for documenting the [http://lxr.mozilla.org/mozilla/source/layout/base/nsCSSFrameConstructor.cpp nsCSSFrameConstructor] with the goal of simplifying, stabilizing and bugfixing it.== Documentation projects ==A major piece of information that we need to document is the constraints that various frames have on what child and parent frames it must or must not have. We should also document which transformations we perform between the content tree and the frame tree to enforce those constraints. This is tracked on the pages:* [[CSSFrameConstructor/Constraints]]* [[CSSFrameConstructor/Transformations]]== Ideas for design changes ===== Containing Blocks ===We need a better way of keeping track of containing frames forout-of-flow frames. Currently this logic is duplicated in both framesand the frame ctor. Additionally, the frameCtor spends time on keepingtrack of the current containers even though most of the time we don'tuse them.One way to fix this is move the logic of what is what type of containerinto the frame. This way the frame ctor can ask each frame as itsprocessing the frame children if the frame is a container. We can theneasily figure out which frames are current containers in ContentInsertedby walking the parent chain.Another solution is to make frames that need the information manuallywalk the parent chain until the desired block is found. This informationcould possibly be cached in the frame ctor.=== XBL ===XBL is currently too entangled in the frame ctor. XBL needs two things:# munge notifications so that ContentAppended/Inserted/Removed is done on the right frame, and at the right child index in that frame# Ability to create child lists that contains the mixture of anonymous and explicit children.1 could be done by the binding manager by letting all notifications gothrough the binding manager. It already is an nsIDocumentObserver so itshould have all neccesary information. Better apis into the bindingmanager is another solution.2 has to be fixed by creating a better api that the frame ctor can useto access the flattened tree. One possible solution for accessing theflattened tree is to use a treewalker. However this might be anunneccesarily big change.The ultimate goal is to move as much of the xbl logic as possible out ofthe frame constructor.=== Hash for creator functions ===Rather then the current neverending list of if-statements to figure outwhich frame to create we should have a hash table that maps tag+ns tocreator function. The hash table can also contain information aboutwhich type of frame will be constructed so that we can create, forexample, wrapping table frames beforehand.In some cases the type of frame created varies (for example for images)so we might need to call a function to get the type.These constructor functions should be able to create a whole tree offrames if neccesary. For example for list boxes or form controls.We should have a similar (or even identical) hash keyed on display typefor when the first hash doesn't produce a frame. Eventually we mightwant to move all frame types into this hash, but we need at least thecontent css property implemented for that.[https://bugzilla.mozilla.org/show_bug.cgi?id=323233 Bug 323233] filed.=== State management ===Until we have better transformation code in place we will probably needbetter state management code for the frame ctor. Logic should be movedinto the frames so that we can rebuild the right state in a morereliable manner.=== Frame teardown ===Frame teardown should be a lot simpler, (Do)DeletingFrameSubtree shoulddie and frames should be able to just clean themselfs up.[https://bugzilla.mozilla.org/show_bug.cgi?id=323105 Bug 323105] filed. === Frametree buildup ===Currently we link together the frametree from bottom up. We recursivly walk into each element for which to create frames. First we create the frame for the element itself, and then we create a framelist for all its children. Not until the childlist is fully created we insert anything into the parent. Then as we unwrap the callstack we insert the finished childlists into each element.The reason for this is that inserting a new childframe into a parent is slow (due to having to walk the linked-list of children) and forces reflow events to be created.This seems unneccesarily complicated. A better approach would probably be to insert frames as we go and let the caller worry about posting reflow events. The downside is that we'd have to keep a pointer to the last frame in the child-frame-list.
This is a page for documenting the [http://lxr.mozilla.org/mozilla/source/layout/base/nsCSSFrameConstructor.cpp nsCSSFrameConstructor] with the goal of simplifying, stabilizing and bugfixing it.
 
== Documentation projects ==
 
A major piece of information that we need to document is the constraints that various frames have on what child and parent frames it must or must not have. We should also document which transformations we perform between the content tree and the frame tree to enforce those constraints. This is tracked on the pages:
 
* [[CSSFrameConstructor/Constraints]]
* [[CSSFrameConstructor/Transformations]]
 
== Ideas for design changes ==
 
=== Containing Blocks ===
 
We need a better way of keeping track of containing frames for
out-of-flow frames. Currently this logic is duplicated in both frames
and the frame ctor. Additionally, the frameCtor spends time on keeping
track of the current containers even though most of the time we don't
use them.
 
One way to fix this is move the logic of what is what type of container
into the frame. This way the frame ctor can ask each frame as its
processing the frame children if the frame is a container. We can then
easily figure out which frames are current containers in ContentInserted
by walking the parent chain.
 
Another solution is to make frames that need the information manually
walk the parent chain until the desired block is found. This information
could possibly be cached in the frame ctor.
 
=== XBL ===
 
XBL is currently too entangled in the frame ctor. XBL needs two things:
 
# munge notifications so that ContentAppended/Inserted/Removed is done on the right frame, and at the right child index in that frame
# Ability to create child lists that contains the mixture of anonymous and explicit children.
 
1 could be done by the binding manager by letting all notifications go
through the binding manager. It already is an nsIDocumentObserver so it
should have all neccesary information. Better apis into the binding
manager is another solution.
 
2 has to be fixed by creating a better api that the frame ctor can use
to access the flattened tree. One possible solution for accessing the
flattened tree is to use a treewalker. However this might be an
unneccesarily big change.
 
The ultimate goal is to move as much of the xbl logic as possible out of
the frame constructor.
 
=== Hash for creator functions ===
 
Rather then the current neverending list of if-statements to figure out
which frame to create we should have a hash table that maps tag+ns to
creator function. The hash table can also contain information about
which type of frame will be constructed so that we can create, for
example, wrapping table frames beforehand.
 
In some cases the type of frame created varies (for example for images)
so we might need to call a function to get the type.
 
These constructor functions should be able to create a whole tree of
frames if neccesary. For example for list boxes or form controls.
 
We should have a similar (or even identical) hash keyed on display type
for when the first hash doesn't produce a frame. Eventually we might
want to move all frame types into this hash, but we need at least the
content css property implemented for that.
 
[https://bugzilla.mozilla.org/show_bug.cgi?id=323233 Bug 323233] filed.
 
=== State management ===
 
Until we have better transformation code in place we will probably need
better state management code for the frame ctor. Logic should be moved
into the frames so that we can rebuild the right state in a more
reliable manner.
 
=== Frame teardown ===
 
Frame teardown should be a lot simpler, (Do)DeletingFrameSubtree should
die and frames should be able to just clean themselfs up.
 
[https://bugzilla.mozilla.org/show_bug.cgi?id=323105 Bug 323105] filed.  
 
=== Frametree buildup ===
 
Currently we link together the frametree from bottom up. We recursivly walk into each element for which to create frames. First we create the frame for the element itself, and then we create a framelist for all its children. Not until the childlist is fully created we insert anything into the parent. Then as we unwrap the callstack we insert the finished childlists into each element.
 
The reason for this is that inserting a new childframe into a parent is slow (due to having to walk the linked-list of children) and forces reflow events to be created.
 
This seems unneccesarily complicated. A better approach would probably be to insert frames as we go and let the caller worry about posting reflow events. The downside is that we'd have to keep a pointer to the last frame in the child-frame-list.

Latest revision as of 09:44, 25 November 2006

This is a page for documenting the nsCSSFrameConstructor with the goal of simplifying, stabilizing and bugfixing it.

Documentation projects

A major piece of information that we need to document is the constraints that various frames have on what child and parent frames it must or must not have. We should also document which transformations we perform between the content tree and the frame tree to enforce those constraints. This is tracked on the pages:

Ideas for design changes

Containing Blocks

We need a better way of keeping track of containing frames for out-of-flow frames. Currently this logic is duplicated in both frames and the frame ctor. Additionally, the frameCtor spends time on keeping track of the current containers even though most of the time we don't use them.

One way to fix this is move the logic of what is what type of container into the frame. This way the frame ctor can ask each frame as its processing the frame children if the frame is a container. We can then easily figure out which frames are current containers in ContentInserted by walking the parent chain.

Another solution is to make frames that need the information manually walk the parent chain until the desired block is found. This information could possibly be cached in the frame ctor.

XBL

XBL is currently too entangled in the frame ctor. XBL needs two things:

  1. munge notifications so that ContentAppended/Inserted/Removed is done on the right frame, and at the right child index in that frame
  2. Ability to create child lists that contains the mixture of anonymous and explicit children.

1 could be done by the binding manager by letting all notifications go through the binding manager. It already is an nsIDocumentObserver so it should have all neccesary information. Better apis into the binding manager is another solution.

2 has to be fixed by creating a better api that the frame ctor can use to access the flattened tree. One possible solution for accessing the flattened tree is to use a treewalker. However this might be an unneccesarily big change.

The ultimate goal is to move as much of the xbl logic as possible out of the frame constructor.

Hash for creator functions

Rather then the current neverending list of if-statements to figure out which frame to create we should have a hash table that maps tag+ns to creator function. The hash table can also contain information about which type of frame will be constructed so that we can create, for example, wrapping table frames beforehand.

In some cases the type of frame created varies (for example for images) so we might need to call a function to get the type.

These constructor functions should be able to create a whole tree of frames if neccesary. For example for list boxes or form controls.

We should have a similar (or even identical) hash keyed on display type for when the first hash doesn't produce a frame. Eventually we might want to move all frame types into this hash, but we need at least the content css property implemented for that.

Bug 323233 filed.

State management

Until we have better transformation code in place we will probably need better state management code for the frame ctor. Logic should be moved into the frames so that we can rebuild the right state in a more reliable manner.

Frame teardown

Frame teardown should be a lot simpler, (Do)DeletingFrameSubtree should die and frames should be able to just clean themselfs up.

Bug 323105 filed.

Frametree buildup

Currently we link together the frametree from bottom up. We recursivly walk into each element for which to create frames. First we create the frame for the element itself, and then we create a framelist for all its children. Not until the childlist is fully created we insert anything into the parent. Then as we unwrap the callstack we insert the finished childlists into each element.

The reason for this is that inserting a new childframe into a parent is slow (due to having to walk the linked-list of children) and forces reflow events to be created.

This seems unneccesarily complicated. A better approach would probably be to insert frames as we go and let the caller worry about posting reflow events. The downside is that we'd have to keep a pointer to the last frame in the child-frame-list.