Changeset 107425 in webkit


Ignore:
Timestamp:
Feb 10, 2012 12:07:54 PM (12 years ago)
Author:
mikelawther@chromium.org
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:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107423 r107425  
     12012-02-10  Mike Lawther  <mikelawther@chromium.org>
     2
     3        CSS3 calc: update font-size test to use pre/post js
     4        https://bugs.webkit.org/show_bug.cgi?id=78325
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/calc/font-size-expected.txt:
     9        * css3/calc/font-size.html:
     10
    1112012-02-10  Tony Chang  <tony@chromium.org>
    212
  • trunk/LayoutTests/css3/calc/font-size-expected.txt

    r104431 r107425  
    1 The font size of these lines should be identical
    2 The font size of these lines should be identical
    3 The font size of these lines should be identical
    4 FAIL
    5 Computed font sizes do not match
     1Tests that CSS3 calc() can be used with the font-size property
     2
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     4
     5
     6FAIL getComputedStyle(document.getElementById("calc-percent"), null).fontSize should be 40px. Was 20px.
     7FAIL getComputedStyle(document.getElementById("calc-percent-pixels"), null).fontSize should be 40px. Was 20px.
     8PASS successfullyParsed is true
     9
     10TEST COMPLETE
     11
  • trunk/LayoutTests/css3/calc/font-size.html

    r104431 r107425  
     1<!DOCTYPE HTML>
     2<script src="../../fast/js/resources/js-test-pre.js"></script>
    13<style>
    24#control {font-size: 200%;}
     
    57</style>
    68
    7 <div style="font-size: 20px;">
     9<div id="test-container" style="font-size: 20px;">
    810<span id="control">The font size of these lines should be identical</span>
    911<br/>
    10 <span id="calc-percent">The font size of these lines should be identical</span>
     12<span class="fonttest" id="calc-percent">The font size of these lines should be identical</span>
    1113<br/>
    12 <span id="calc-percent-pixels">The font size of these lines should be identical</span>
    13 <hr/>
     14<span class="fonttest" id="calc-percent-pixels">The font size of these lines should be identical</span>
    1415</div>
    15 <div id="results"></div>
    1616
    1717<script>
    18 if (window.layoutTestController)
    19     layoutTestController.dumpAsText();
    20 var controlSize =  getComputedStyle(document.getElementById("control"), null).fontSize
     18description("Tests that CSS3 calc() can be used with the font-size property");
    2119
    22 var spans = document.getElementsByTagName("span");
    23 var sameSize = true;
     20var spans = document.getElementsByClassName("fonttest");
    2421for (var i = 0; i < spans.length; ++i) {
    25     var current = spans[i];
    26     if (sameSize)
    27         sameSize = getComputedStyle(current, null).fontSize == controlSize;
     22    shouldBeEqualToString('getComputedStyle(document.getElementById("' + spans[i].id + '"), null).fontSize', getComputedStyle(document.getElementById("control"), null).fontSize);
    2823}
    2924
    30 var results = document.getElementById("results");
    31 if (sameSize) {
    32     results.style.color = "green";
    33     results.innerHTML = "PASS";
    34 } else {
    35     results.style.color = "red";
    36     results.innerHTML = "FAIL";   
    37     results.innerHTML += "<p>Computed font sizes do not match</p>";
    38 }
    39 
     25if (window.layoutTestController)
     26    document.body.removeChild(document.getElementById("test-container"));
    4027</script>
     28<script src="../../fast/js/resources/js-test-post.js"></script>
Note: See TracChangeset for help on using the changeset viewer.