Commit fe9c69b1 authored by hyatt's avatar hyatt
Browse files

Fix for <rdar://problem/5222611> REGRESSION: Paint ordering problems at

        http://buymeasoda.com/dev/issues/image_onload/image_onload.html

        Clamp z-index so that values that exceed maxint (or that are below minint)
        are clamped to those values.

        Reviewed by darin

        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::applyProperty):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 27a28d44
2007-05-23 David Hyatt <hyatt@apple.com>
Fix for <rdar://problem/5222611> REGRESSION: Paint ordering problems at
http://buymeasoda.com/dev/issues/image_onload/image_onload.html
Clamp z-index so that values that exceed maxint (or that are below minint)
are clamped to those values.
Reviewed by darin
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
2007-05-23 Mitz Pettel <mitz@webkit.org> 2007-05-23 Mitz Pettel <mitz@webkit.org>
   
Reviewed by David Hyatt. Reviewed by David Hyatt.
...@@ -3105,7 +3105,11 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) ...@@ -3105,7 +3105,11 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
style->setHasAutoZIndex(); style->setHasAutoZIndex();
return; return;
} }
style->setZIndex((int)primitiveValue->getFloatValue());
// FIXME: Should clamp all sorts of other integer properties too.
const double minIntAsDouble = INT_MIN;
const double maxIntAsDouble = INT_MAX;
style->setZIndex(max(minIntAsDouble, min(primitiveValue->getFloatValue(), maxIntAsDouble)));
return; return;
} }
case CSS_PROP_WIDOWS: case CSS_PROP_WIDOWS:
...@@ -4026,7 +4030,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) ...@@ -4026,7 +4030,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
if (primitiveValue->getIdent() == CSS_VAL_INFINITE) if (primitiveValue->getIdent() == CSS_VAL_INFINITE)
style->setMarqueeLoopCount(-1); // -1 means repeat forever. style->setMarqueeLoopCount(-1); // -1 means repeat forever.
else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_NUMBER) else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_NUMBER)
style->setMarqueeLoopCount((int)(primitiveValue->getFloatValue())); style->setMarqueeLoopCount((int)primitiveValue->getFloatValue());
return; return;
} }
case CSS_PROP__WEBKIT_MARQUEE_SPEED: { case CSS_PROP__WEBKIT_MARQUEE_SPEED: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment