Commit fcacdb47 authored by hyatt@apple.com's avatar hyatt@apple.com

2008-05-14 David Hyatt <hyatt@apple.com>

        Fix for bug https://bugs.webkit.org/show_bug.cgi?id=16130.

        Opacity, transforms, reflections and masks should not honor z-index unless the element is also
        positioned.  Always reset to auto if the element is not positioned (and then the following code will
        adjust auto to 0 as needed).

        Reviewed by Dan Bernstein

        * css/CSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::adjustRenderStyle):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b9ad6c19
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
#stackA {
opacity: 0.66;
z-index: 2;
background: red;
width: 300px;
height: 300px;
}
#stackB {
opacity: 0.90;
background: blue;
margin-top: -150px;
width: 150px;
height: 300px;
}
</style>
</head>
<body>
<div id="stackA"></div>
<div id="stackB"></div>
</body>
</html>
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x466
RenderBlock {HTML} at (0,0) size 800x466
RenderBody {BODY} at (8,8) size 784x450
layer at (8,8) size 300x300
RenderBlock {DIV} at (0,0) size 300x300 [bgcolor=#FF0000]
layer at (8,158) size 150x300
RenderBlock {DIV} at (0,150) size 150x300 [bgcolor=#0000FF]
2008-05-14 David Hyatt <hyatt@apple.com>
Fix for bug https://bugs.webkit.org/show_bug.cgi?id=16130.
Opacity, transforms, reflections and masks should not honor z-index unless the element is also
positioned. Always reset to auto if the element is not positioned (and then the following code will
adjust auto to 0 as needed).
Reviewed by Dan Bernstein
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::adjustRenderStyle):
2008-05-14 Anders Carlsson <andersca@apple.com>
Reviewed by Brady.
......@@ -1181,9 +1181,8 @@ void CSSStyleSelector::adjustRenderStyle(RenderStyle* style, Element *e)
style->setPosition(StaticPosition);
}
// Make sure our z-index value is only applied if the object is positioned,
// relatively positioned, transparent, or has a transform/mask/reflection.
if (style->position() == StaticPosition && style->opacity() == 1.0f && !style->hasTransform() && !style->hasMask() && !style->boxReflect())
// Make sure our z-index value is only applied if the object is positioned.
if (style->position() == StaticPosition)
style->setHasAutoZIndex();
// Auto z-index becomes 0 for the root element and transparent objects. This prevents
......
Markdown is supported
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