RenderLayer code

Lars Knoll lars@trolltech.com
Thu, 30 Jan 2003 20:26:01 +0100


> That's a good idea.  Did you land that or can I see a diff with that
> change so I can make it in my tree?

It's all in render_style.h:

...
const int ZAUTO = 0xfeed4c4b;
...
    int zIndex() const { return (box->z_index == ZAUTO)? 0 : box->z_index; }
    void setZIndex(int v) { SET_VAR(box,z_index,v) }
    bool hasAutoZIndex() const { return box->z_index == ZAUTO; }
...

and in cssstyleselector.cpp:

...
           if (primitiveValue->getIdent() == CSS_VAL_AUTO) {
                z_index = ZAUTO;
            } else if (primitiveValue->primitiveType() != 
CSSPrimitiveValue::CSS_NUMBER)
                return; // Error case.

	    z_index = 
(int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
...

Talking about memory usage: There are a few other places I noticed you using 
too much memory. The booleans  quirksmarginTop/Bottom in RenderFlow should 
for example be added to the bitfield a few lines above. Saves 8 bytes for 
every renderflow.

Another issue I am currently wondering about is if we could avoid the 4 shorts 
used for margin calculations in renderflow. They are purely intermediate 
values, and could maybe get passed along in the layout() calls.

Lars