Title: [107425] trunk/LayoutTests
- Revision
- 107425
- Author
- [email protected]
- Date
- 2012-02-10 12:07:54 -0800 (Fri, 10 Feb 2012)
Log Message
CSS3 calc: update font-size test to use pre/post js
https://bugs.webkit.org/show_bug.cgi?id=78325
Reviewed by Ojan Vafai.
* css3/calc/font-size-expected.txt:
* css3/calc/font-size.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (107424 => 107425)
--- trunk/LayoutTests/ChangeLog 2012-02-10 20:06:32 UTC (rev 107424)
+++ trunk/LayoutTests/ChangeLog 2012-02-10 20:07:54 UTC (rev 107425)
@@ -1,3 +1,13 @@
+2012-02-10 Mike Lawther <[email protected]>
+
+ CSS3 calc: update font-size test to use pre/post js
+ https://bugs.webkit.org/show_bug.cgi?id=78325
+
+ Reviewed by Ojan Vafai.
+
+ * css3/calc/font-size-expected.txt:
+ * css3/calc/font-size.html:
+
2012-02-10 Tony Chang <[email protected]>
[chromium] Unreviewed: The Leopard results were missed in r107140.
Modified: trunk/LayoutTests/css3/calc/font-size-expected.txt (107424 => 107425)
--- trunk/LayoutTests/css3/calc/font-size-expected.txt 2012-02-10 20:06:32 UTC (rev 107424)
+++ trunk/LayoutTests/css3/calc/font-size-expected.txt 2012-02-10 20:07:54 UTC (rev 107425)
@@ -1,5 +1,11 @@
-The font size of these lines should be identical
-The font size of these lines should be identical
-The font size of these lines should be identical
-FAIL
-Computed font sizes do not match
+Tests that CSS3 calc() can be used with the font-size property
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+FAIL getComputedStyle(document.getElementById("calc-percent"), null).fontSize should be 40px. Was 20px.
+FAIL getComputedStyle(document.getElementById("calc-percent-pixels"), null).fontSize should be 40px. Was 20px.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Modified: trunk/LayoutTests/css3/calc/font-size.html (107424 => 107425)
--- trunk/LayoutTests/css3/calc/font-size.html 2012-02-10 20:06:32 UTC (rev 107424)
+++ trunk/LayoutTests/css3/calc/font-size.html 2012-02-10 20:07:54 UTC (rev 107425)
@@ -1,3 +1,5 @@
+<!DOCTYPE HTML>
+<script src=""
<style>
#control {font-size: 200%;}
#calc-percent {font-size: -webkit-calc(200%);}
@@ -4,37 +6,23 @@
#calc-percent-pixels {font-size: -webkit-calc(150% + 10px);}
</style>
-<div style="font-size: 20px;">
+<div id="test-container" style="font-size: 20px;">
<span id="control">The font size of these lines should be identical</span>
<br/>
-<span id="calc-percent">The font size of these lines should be identical</span>
+<span class="fonttest" id="calc-percent">The font size of these lines should be identical</span>
<br/>
-<span id="calc-percent-pixels">The font size of these lines should be identical</span>
-<hr/>
+<span class="fonttest" id="calc-percent-pixels">The font size of these lines should be identical</span>
</div>
-<div id="results"></div>
<script>
-if (window.layoutTestController)
- layoutTestController.dumpAsText();
-var controlSize = getComputedStyle(document.getElementById("control"), null).fontSize
+description("Tests that CSS3 calc() can be used with the font-size property");
-var spans = document.getElementsByTagName("span");
-var sameSize = true;
+var spans = document.getElementsByClassName("fonttest");
for (var i = 0; i < spans.length; ++i) {
- var current = spans[i];
- if (sameSize)
- sameSize = getComputedStyle(current, null).fontSize == controlSize;
+ shouldBeEqualToString('getComputedStyle(document.getElementById("' + spans[i].id + '"), null).fontSize', getComputedStyle(document.getElementById("control"), null).fontSize);
}
-var results = document.getElementById("results");
-if (sameSize) {
- results.style.color = "green";
- results.innerHTML = "PASS";
-} else {
- results.style.color = "red";
- results.innerHTML = "FAIL";
- results.innerHTML += "<p>Computed font sizes do not match</p>";
-}
-
+if (window.layoutTestController)
+ document.body.removeChild(document.getElementById("test-container"));
</script>
+<script src=""
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes