Make -webkit-transition-* and -webkit-animation-* properties be pure aliases of the...
[WebKit-https.git] / LayoutTests / svg / css / rect-system-color.xhtml
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 <script src="../../resources/js-test-pre.js"/>
4 </head>
5 <body>
6 <svg display="none" xmlns="http://www.w3.org/2000/svg"/>
7 <p id="description"></p>
8 <div id="console"/>
9 <script><![CDATA[
10 SVG_NS = 'http://www.w3.org/2000/svg';
11 var color1, color2;
12 var systemColorRed, systemColorGreen, systemColorBlue;
13 function checkSystemColor(id1, id2, systemColor)
14 {
15     var textElement = document.getElementById(id1);
16     var computedStyleText = textElement.ownerDocument.defaultView.getComputedStyle(textElement);
17     var divElement = document.getElementById(id2);
18     var computedStyleDiv = divElement.ownerDocument.defaultView.getComputedStyle(divElement);
19
20     color1 = computedStyleText.getPropertyCSSValue('fill').rgbColor;
21     color2 = computedStyleDiv.getPropertyCSSValue('color').getRGBColorValue();
22
23     systemColorRed = color2.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
24     systemColorGreen = color2.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
25     systemColorBlue = color2.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
26
27     debug('Testing system color' + systemColor);
28
29     shouldBe("color1.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "systemColorRed");
30     shouldBe("color1.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "systemColorGreen");
31     shouldBe("color1.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "systemColorBlue");
32
33     color1 = computedStyleText.getPropertyCSSValue('stroke').rgbColor;
34
35     shouldBe("color1.red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "systemColorRed");
36     shouldBe("color1.green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "systemColorGreen");
37     shouldBe("color1.blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "systemColorBlue");
38 }
39
40 description('Test that fill and stroke properties accept system colors');
41 debug('');
42
43 var systemColors = new Array("ActiveBorder", "ActiveCaption", "AppWorkspace", "Background", "ButtonFace", "ButtonHighlight",
44                              "ButtonShadow", "ButtonText", "CaptionText", "GrayText", "Highlight", "HighlightText",
45                              "InactiveBorder", "InactiveCaption", "InactiveCaptionText", "InfoBackground", "InfoText",
46                              "Menu", "MenuText", "Scrollbar", "ThreeDDarkShadow", "ThreeDFace", "ThreeDHighlight",
47                              "ThreeDLightShadow", "ThreeDShadow", "Window", "WindowFrame", "WindowText");
48 var svgElement = document.getElementsByTagName("svg")[0];
49 for (i = 0; i < systemColors.length; ++i) {
50     var textElement = document.createElementNS(SVG_NS, "text");
51     textElement.setAttribute("id", "text" + i);
52     textElement.setAttribute("stroke", systemColors[i]);
53     textElement.setAttribute("style", "fill:" + systemColors[i]);
54     svgElement.appendChild(textElement);
55
56     var divElement = document.createElement("div");
57     divElement.setAttribute("id", "expected" + i);
58     divElement.setAttribute("style", "color:" + systemColors[i]);
59     document.body.appendChild(divElement);
60
61     checkSystemColor('text' + i, 'expected' + i, systemColors[i]);
62 }
63
64 ]]>
65 </script>
66 <script src="../../resources/js-test-post.js"></script>
67
68 </body>
69 </html>