Changeset 107464 in webkit


Ignore:
Timestamp:
Feb 10, 2012 5:37:23 PM (12 years ago)
Author:
mikelawther@chromium.org
Message:

CSS3 calc: convert font-size-fractional test to use pre/post js
https://bugs.webkit.org/show_bug.cgi?id=78347

Reviewed by Ojan Vafai.

  • css3/calc/font-size-fractional-expected.txt:
  • css3/calc/font-size-fractional.html:
Location:
trunk/LayoutTests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

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

    r104431 r107464  
    1 The font size and line height of these lines should be identical
    2 The font size and line height of these lines should be identical
    3 FAIL
    4 Line heights do not match
     1Tests that CSS3 calc() can be used with the font property using fractional sizes
    52
    6 Font sizes do not match
     3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
     4
     5
     6FAIL getComputedStyle(document.getElementById("calc-reduce"), null).lineHeight should be 24px. Was normal.
     7FAIL getComputedStyle(document.getElementById("calc-reduce"), null).fontSize should be 10px. Was 12px.
     8PASS successfullyParsed is true
     9
     10TEST COMPLETE
     11
  • trunk/LayoutTests/css3/calc/font-size-fractional.html

    r104431 r107464  
     1<!DOCTYPE HTML>
     2<script src="../../fast/js/resources/js-test-pre.js"></script>
    13<style>
    24body         {font-size: 12px;}
     
    57</style>
    68
    7 <div>
     9<div id="test-container">
    810<span id="control">The font size and line height of these lines should be identical</span>
    911<hr/>
    10 <span id="calc-reduce">The font size and line height of these lines should be identical</span>
     12<span class="fonttest" id="calc-reduce">The font size and line height of these lines should be identical</span>
    1113</div>
    1214<hr/>
    13 <div id="results"></div>
    1415
    1516<script>
    16 if (window.layoutTestController)
    17     layoutTestController.dumpAsText();
    18 var controlHeight = getComputedStyle(document.getElementById("control"), null).lineHeight;
    19 var controlSize = getComputedStyle(document.getElementById("control"), null).fontSize;
     17description("Tests that CSS3 calc() can be used with the font property using fractional sizes");
    2018
    21 var spans = document.getElementsByTagName("span");
    22 var sameHeight = true;
    23 var sameSize = true;
     19var spans = document.getElementsByClassName("fonttest");
    2420for (var i = 0; i < spans.length; ++i) {
    2521    var current = spans[i];
    26     if (sameHeight)
    27         sameHeight = getComputedStyle(current, null).lineHeight == controlHeight;
    28     if (sameSize)
    29         sameSize = getComputedStyle(current, null).fontSize == controlSize;
     22    shouldBeEqualToString('getComputedStyle(document.getElementById("' + current.id + '"), null).lineHeight', getComputedStyle(document.getElementById("control"), null).lineHeight);
     23    shouldBeEqualToString('getComputedStyle(document.getElementById("' + current.id + '"), null).fontSize', getComputedStyle(document.getElementById("control"), null).fontSize);
    3024}
    3125
    32 var results = document.getElementById("results");
    33 if (sameHeight && sameSize) {
    34     results.style.color = "green";
    35     results.innerHTML = "PASS";
    36 } else {
    37     results.style.color = "red";
    38     results.innerHTML = "FAIL";   
    39     if (!sameHeight)
    40         results.innerHTML += "<p>Line heights do not match</p>";
    41     if (!sameSize)
    42         results.innerHTML += "<p>Font sizes do not match</p>";
    43 }
    44 
     26if (window.layoutTestController)
     27    document.body.removeChild(document.getElementById("test-container"));
    4528</script>
     29<script src="../../fast/js/resources/js-test-post.js"></script>
Note: See TracChangeset for help on using the changeset viewer.