Commit 48a005cb authored by hyatt's avatar hyatt

LayoutTests:

        Add layout test for inheritance of auto z-index.

        Reviewed by eric

        * fast/layers/zindex-inherit-expected.checksum: Added.
        * fast/layers/zindex-inherit-expected.png: Added.
        * fast/layers/zindex-inherit-expected.txt: Added.
        * fast/layers/zindex-inherit.html: Added.

WebCore:

        Fix z-index:inherit so that it works properly when inheriting from z-index:auto.

        Reviewed by eric

        fast/layers/zindex-inherit.html

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



git-svn-id: svn://svn.chromium.org/blink/trunk@18661 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 7d3685d0
2007-01-08 David Hyatt <hyatt@apple.com>
Add layout test for inheritance of auto z-index.
Reviewed by eric
* fast/layers/zindex-inherit-expected.checksum: Added.
* fast/layers/zindex-inherit-expected.png: Added.
* fast/layers/zindex-inherit-expected.txt: Added.
* fast/layers/zindex-inherit.html: Added.
2007-01-07 Rob Buis <buis@kde.org> 2007-01-07 Rob Buis <buis@kde.org>
Reviewed by Eric. Reviewed by Eric.
df4f0bfd1a75d6a4aeed3751c4388a32
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x584
RenderBlock (anonymous) at (0,0) size 784x18
RenderText {#text} at (0,0) size 240x18
text run at (0,0) width 240: "You should see a green square below."
layer at (8,26) size 100x100
RenderBlock (relative positioned) {DIV} at (0,18) size 100x100 [bgcolor=#FF0000]
layer at (8,26) size 100x100
RenderBlock (positioned) {DIV} at (0,0) size 100x100
layer at (8,26) size 100x100
RenderBlock (positioned) {DIV} at (0,0) size 100x100
layer at (8,26) size 100x100
RenderBlock (positioned) zI: 100 {DIV} at (0,0) size 100x100
layer at (8,26) size 100x100
RenderBlock (positioned) zI: 1000 {DIV} at (0,0) size 100x100 [bgcolor=#008000]
<html>
<head>
<style>
div { width:100px; height:100px }
.green { background-color: green }
.red { background-color: red }
</style>
</head>
<body>
You should see a green square below.
<div class="red" style="position:relative; z-index:0">
<div class="red" style="position:absolute; z-index:auto">
<div class="red" style="position:absolute; z-index:inherit">
<div class="green" style="position:absolute; z-index:1000">
</div>
</div>
</div>
<div class="red" style="position:absolute; z-index:100">
</div>
</div>
</body>
</html>
2007-01-08 David Hyatt <hyatt@apple.com>
Fix z-index:inherit so that it works properly when inheriting from z-index:auto.
Reviewed by eric
fast/layers/zindex-inherit.html
* css/cssstyleselector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
2007-01-08 David Hyatt <hyatt@apple.com> 2007-01-08 David Hyatt <hyatt@apple.com>
Add support for all of the CSS3 multi-column properties in preparation for implementing the Add support for all of the CSS3 multi-column properties in preparation for implementing the
......
...@@ -3116,30 +3116,20 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) ...@@ -3116,30 +3116,20 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
return; return;
} }
break; break;
case CSS_PROP_Z_INDEX: case CSS_PROP_Z_INDEX: {
{ if (isInherit) {
HANDLE_INHERIT(zIndex, ZIndex) if (parentStyle->hasAutoZIndex())
else if (isInitial) { style->setHasAutoZIndex();
style->setHasAutoZIndex(); else
return; style->setZIndex(parentStyle->zIndex());
}
if (!primitiveValue)
return; return;
} else if (isInitial || primitiveValue->getIdent() == CSS_VAL_AUTO) {
if (primitiveValue->getIdent() == CSS_VAL_AUTO) {
style->setHasAutoZIndex(); style->setHasAutoZIndex();
return; return;
} }
if (primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
return; // Error case.
style->setZIndex((int)primitiveValue->getFloatValue()); style->setZIndex((int)primitiveValue->getFloatValue());
return; return;
} }
case CSS_PROP_WIDOWS: case CSS_PROP_WIDOWS:
{ {
HANDLE_INHERIT_AND_INITIAL(widows, Widows) HANDLE_INHERIT_AND_INITIAL(widows, Widows)
...@@ -3961,6 +3951,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) ...@@ -3961,6 +3951,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
style->setHasNormalColumnGap(); style->setHasNormalColumnGap();
else else
style->setColumnGap(parentStyle->columnGap()); style->setColumnGap(parentStyle->columnGap());
return;
} else if (isInitial || primitiveValue->getIdent() == CSS_VAL_NORMAL) { } else if (isInitial || primitiveValue->getIdent() == CSS_VAL_NORMAL) {
style->setHasNormalColumnGap(); style->setHasNormalColumnGap();
return; return;
...@@ -3974,6 +3965,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value) ...@@ -3974,6 +3965,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
style->setHasAutoColumnWidth(); style->setHasAutoColumnWidth();
else else
style->setColumnWidth(parentStyle->columnWidth()); style->setColumnWidth(parentStyle->columnWidth());
return;
} else if (isInitial || primitiveValue->getIdent() == CSS_VAL_AUTO) { } else if (isInitial || primitiveValue->getIdent() == CSS_VAL_AUTO) {
style->setHasAutoColumnWidth(); style->setHasAutoColumnWidth();
return; return;
......
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