LayoutTests:
authorweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Jun 2007 20:53:07 +0000 (20:53 +0000)
committerweinig <weinig@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 24 Jun 2007 20:53:07 +0000 (20:53 +0000)
        Reviewed by Mitz.

        Tests for http://bugs.webkit.org/show_bug.cgi?id=14321
        getComputedStyle(...).zIndex returns string "normal"

        * fast/css/computed-style-expected.txt:
        * fast/css/getComputedStyle-zIndex-auto-expected.txt: Added.
        * fast/css/getComputedStyle-zIndex-auto.html: Added.

WebCore:

        Reviewed by Mitz.

        Patch for http://bugs.webkit.org/show_bug.cgi?id=14321
        getComputedStyle(...).zIndex returns string "normal"

        Test: fast/css/getComputedStyle-zIndex-auto.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Return 'auto' instead of 'normal'.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23754 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle-zIndex-auto-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/getComputedStyle-zIndex-auto.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebKit/WebKit.xcodeproj/project.pbxproj

index 344e74064443dffe2d64931c279fcf01ae147bb9..36a371b2945bb35342bb1f43ed524d0bc0a1bb07 100644 (file)
@@ -1,3 +1,14 @@
+2007-06-23  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Mitz.
+
+        Tests for http://bugs.webkit.org/show_bug.cgi?id=14321
+        getComputedStyle(...).zIndex returns string "normal"
+
+        * fast/css/computed-style-expected.txt:
+        * fast/css/getComputedStyle-zIndex-auto-expected.txt: Added.
+        * fast/css/getComputedStyle-zIndex-auto.html: Added.
+
 2007-06-23  Geoffrey Garen  <ggaren@apple.com>
 
         Uploading the correct expected results -- the ones checked in expected
index ca478118cacef28ef64c6fae614ea88dd85896d7..eb0bcd096e8cf7ed49d8218cd7873653a99d0415 100644 (file)
@@ -80,7 +80,7 @@ widows: 2;
 width: 784px;
 word-spacing: 0px;
 word-wrap: normal;
-z-index: normal;
+z-index: auto;
 -webkit-appearance: none;
 -webkit-background-clip: border;
 -webkit-background-composite: source-over;
diff --git a/LayoutTests/fast/css/getComputedStyle-zIndex-auto-expected.txt b/LayoutTests/fast/css/getComputedStyle-zIndex-auto-expected.txt
new file mode 100644 (file)
index 0000000..2a4e5a4
--- /dev/null
@@ -0,0 +1,8 @@
+Non-positioned Div:
+    Computed Style = auto (Should be auto)
+    element.style.zIndex = 20 (Should be 20)
+
+Positioned Div:
+    Computed Style = 20 (Should be 20)
+    element.style.zIndex = 20 (Should be 20)
+
diff --git a/LayoutTests/fast/css/getComputedStyle-zIndex-auto.html b/LayoutTests/fast/css/getComputedStyle-zIndex-auto.html
new file mode 100644 (file)
index 0000000..8b50d17
--- /dev/null
@@ -0,0 +1,35 @@
+<html>
+<head>
+    <script>
+        function log(msg)
+        {
+            var console = document.getElementById('console');
+            console.appendChild(document.createTextNode(msg + "\n"));
+        }
+
+        function test()
+        {
+            if (window.layoutTestController)
+                layoutTestController.dumpAsText();
+
+            var element = document.getElementById('nonPositionedDiv');
+            var compStyle = element.ownerDocument.defaultView.getComputedStyle(element, null);
+            log("Non-positioned Div:");
+            log("    Computed Style = " + compStyle.zIndex + " (Should be auto)");
+            log("    element.style.zIndex = " + element.style.zIndex + " (Should be 20)");
+            log("");
+
+            element = document.getElementById('positionedDiv');
+            compStyle = element.ownerDocument.defaultView.getComputedStyle(element, null);
+            log("Positioned Div:");
+            log("    Computed Style = " + compStyle.zIndex + " (Should be 20)");
+            log("    element.style.zIndex = " + element.style.zIndex + " (Should be 20)");
+        }
+    </script>
+</head>
+<body onload="test();">
+    <div style="z-index:20" id='nonPositionedDiv'></div>
+    <div style="z-index:20; position: absolute" id='positionedDiv'></div>
+    <pre id='console'></pre>
+</body>
+</html>
index 76f1991f3d4b3990a692541e64031532ffa8365c..fed881cb3a173d49d112bc29a15ec4a34eaf73f9 100644 (file)
@@ -1,3 +1,15 @@
+2007-06-23  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Mitz.
+
+        Patch for http://bugs.webkit.org/show_bug.cgi?id=14321
+        getComputedStyle(...).zIndex returns string "normal"
+
+        Test: fast/css/getComputedStyle-zIndex-auto.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Return 'auto' instead of 'normal'.
+
 2007-06-24  Matt Lilek  <pewtermoose@gmail.com>
 
         Reviewed by Tim Hatcher.
index 220880e1950f4b5a40a2a43dd00676c2c6ca6335..0adca558d4ede45d8f89759054d92d54bc5bea48 100644 (file)
@@ -1474,7 +1474,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             return 0;
         case CSS_PROP_Z_INDEX:
             if (style->hasAutoZIndex())
-                return new CSSPrimitiveValue(CSS_VAL_NORMAL);
+                return new CSSPrimitiveValue(CSS_VAL_AUTO);
             return new CSSPrimitiveValue(style->zIndex(), CSSPrimitiveValue::CSS_NUMBER);
         case CSS_PROP__WEBKIT_BOX_SIZING:
             if (style->boxSizing() == CONTENT_BOX)
index fa282e346e557520e9a3153ce34d58171083cda5..b79bc0b7540e4ef3b89b5faa9acc92e466c78cf0 100644 (file)
                0867D690FE84028FC02AAC07 /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
-                       compatibilityVersion = "Xcode 2.4";
                        hasScannedForEncodings = 1;
                        knownRegions = (
                                English,