RenderLayer code
David Hyatt
hyatt@apple.com
Thu, 30 Jan 2003 14:17:31 -0800
I found two bugs with this zauto change when making it in the Safari
tree.
(1) This may have just been left out, but you'll need to make sure you
initialize zindex to ZAUTO now instead of 0 in render_style.cpp.
StyleBoxData::StyleBoxData()
: z_index( ZAUTO )
(2) You need an extra else in cssstyleselector.cpp to avoid overwriting
the value of ZAUTO when auto is explicitly specified.
> if (primitiveValue->getIdent() == CSS_VAL_AUTO) {
> z_index = ZAUTO;
> } else if (primitiveValue->primitiveType() !=
> CSSPrimitiveValue::CSS_NUMBER)
> return; // Error case.
>
*else* goes here.
> z_index =
> (int)primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER);
With these changes, you should start passing the 4th test on that
dbaron page.
dave
(hyatt@apple.com)
On Thursday, January 30, 2003, at 11:26 AM, Lars Knoll wrote:
>
>> 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);
> ...